Browse Source

Update the dependencies

Start to implement XEP-0157, save the info in the DB and display the admin addresses in Help
Cleanup Help to remove old information
pull/531/merge
Jaussoin Timothée 8 years ago
parent
commit
8710b52599
  1. 50
      app/models/info/Info.php
  2. 6
      app/widgets/Help/Help.php
  3. 104
      app/widgets/Help/help.tpl
  4. 14
      app/widgets/Help/locales.ini
  5. 2
      composer.json
  6. 50
      composer.lock
  7. 1
      themes/material/css/style.css

50
app/models/info/Info.php

@ -26,11 +26,18 @@ class Info extends Model
public $mucmembersonly = false;
public $mucmoderated = false;
public $abuseaddresses = [];
public $adminaddresses = [];
public $feedbackaddresses = [];
public $salesaddresses = [];
public $securityaddresses = [];
public $supportaddresses = [];
public $_struct = [
'server' => ['type' => 'string','size' => 64,'key' => true],
'node' => ['type' => 'string','size' => 96,'key' => true],
'category' => ['type' => 'string','size' => 16],
'category' => ['type' => 'string','size' => 16, 'mandatory' => true],
'type' => ['type' => 'string','size' => 16],
'name' => ['type' => 'string','size' => 128],
@ -39,13 +46,21 @@ class Info extends Model
'occupants' => ['type' => 'int'],
'created' => ['type' => 'date'],
'updated' => ['type' => 'date','mandatory' => true],
'updated' => ['type' => 'date', 'mandatory' => true],
'mucpublic' => ['type' => 'bool'],
'mucpersistent' => ['type' => 'bool'],
'mucpasswordprotected' => ['type' => 'bool'],
'mucmembersonly' => ['type' => 'bool'],
'mucmoderated' => ['type' => 'bool'],
// XEP-0157: Contact Addresses for XMPP Services
'abuseaddresses' => ['type' => 'serialized','size' => 512],
'adminaddresses' => ['type' => 'serialized','size' => 512],
'feedbackaddresses' => ['type' => 'serialized','size' => 512],
'salesaddresses' => ['type' => 'serialized','size' => 512],
'securityaddresses' => ['type' => 'serialized','size' => 512],
'supportaddresses' => ['type' => 'serialized','size' => 512],
];
public function set($query)
@ -110,6 +125,37 @@ class Info extends Model
case 'muc#roominfo_occupants':
$this->occupants = (int)$field->value;
break;
case 'abuse-addresses':
foreach($field->children() as $value) {
$this->abuseaddresses[] = (string)$value;
}
break;
case 'admin-addresses':
foreach($field->children() as $value) {
$this->adminaddresses[] = (string)$value;
}
break;
case 'feedback-addresses':
foreach($field->children() as $value) {
$this->feedbackaddresses[] = (string)$value;
}
break;
case 'sales-addresses':
foreach($field->children() as $value) {
$this->salesaddresses[] = (string)$value;
}
break;
case 'security-addresses':
foreach($field->children() as $value) {
$this->securityaddresses[] = (string)$value;
}
break;
case 'support-addresses':
foreach($field->children() as $value) {
$this->supportaddresses[] = (string)$value;
}
break;
}
}
}

6
app/widgets/Help/Help.php

@ -13,5 +13,11 @@ class Help extends \Movim\Widget\Base
$this->route('chat', ['movim@conference.movim.eu', 'room'])
);
}
function display()
{
$id = new \Modl\InfoDAO;
$this->view->assign('info', $id->getJid($this->user->getServer()));
}
}

104
app/widgets/Help/help.tpl

@ -39,24 +39,47 @@
</a>
</p>
</li>
</ul>
{if="!empty($info->adminaddresses)"}
<hr />
<ul class="list thin flex">
<li class="subheader block large">
<p class="normal">{$c->__('adminaddresses.title')}</p>
</li>
<hr />
{loop="$info->adminaddresses"}
<li class="block">
{$parsed = parse_url($value)}
{if="$parsed['scheme'] == 'xmpp'"}
<span class="primary icon gray">
<i class="zmdi zmdi-comment"></i>
</span>
<p class="normal">
<a href="{$c->route('chat', $parsed['path'])}">
{$parsed['path']}
</a>
</p>
{else}
<span class="primary icon gray">
<i class="zmdi zmdi-email"></i>
</span>
<p class="normal">
<a href="{$value}" target="_blank" rel="noopener noreferrer">
{$parsed['path']}
</a>
</p>
{/if}
</li>
{/loop}
</ul>
{/if}
<hr />
<ul class="list divided middle">
<li class="subheader">
<p>{$c->__('page.help')}</p>
</li>
<li class="block">
<span class="primary icon bubble color orange">
<i class="zmdi zmdi-email"></i>
</span>
<p>
{$c->__('ml.question')}
</p>
<p>
<a href="https://github.com/edhelas/movim/wiki/Mailing-List" target="_blank">
{$c->__('ml.button')}
</a>
</p>
</li>
<li class="block">
<span class="primary icon bubble color teal">
<span class="primary icon gray">
<i class="zmdi zmdi-comment-text-alt"></i>
</span>
<p>{$c->__('chatroom.question')}</p>
@ -66,58 +89,5 @@
</a>
</p>
</li>
<li class="block">
<span class="primary icon bubble color blue">
<i class="zmdi zmdi-github-alt"></i>
</span>
<p>
{$c->__('wiki.question')}
</p>
<p>
<a href="https://github.com/edhelas/movim/wiki" target="_blank">
{$c->__('wiki.button')}
</a>
</p>
</li>
</ul>
<!--
<div class="clear spacetop"></div>
<h2 class="padded_top_bottom">{$c->__('help.faq')}</h2>
<div class="card">
<article>
<header>
<ul class="simple">
<li><h3>{$c->__('banner.title')}</h3></li>
</ul>
</header>
<section>
<p>{$c->__('banner.info1')}</p>
<ul class="thin">
<li>
<span class="color icon bubble gray small"></span>
<span>{$c->__('banner.white')}</span>
</li>
<li>
<span class="color icon bubble green small"></span>
<span>{$c->__('banner.green')}</span>
</li>
<li>
<span class="color icon bubble orange small"></span>
<span>{$c->__('banner.orange')}</span>
</li>
<li>
<span class="color icon bubble red small"></span>
<span>{$c->__('banner.red')}</span>
</li>
<li>
<span class="color icon bubble black small"></span>
<span>{$c->__('banner.black')}</span>
</li>
</ul>
</section>
</article>
</div>-->
</div>

14
app/widgets/Help/locales.ini

@ -2,7 +2,7 @@
faq = Frequently Asked Questions
[banner]
title = What do the little banners refer to ?
title = What do the little banners refer to
info1 = Thanks to these five little banners, you can quickly identitfy the level of confdentiality applied to the information you provide.
white = White, only you can see the information
green = Green, you have chosen some contacts who can see your information
@ -18,14 +18,12 @@ recommend = We also recommend
computer = Apps for your computer
computer_text = Our official apps are available on our website
[wiki]
question = Want to contribute to the project?
button = Read the Wiki
[adminaddresses]
title = Contact your server administrators
[ml]
question = Talk with us by email ?
button = Join the Mailing List
[securityaddresses]
title = Report a security issue
[chatroom]
question = Chat with the team ?
question = Chat with the Movim team?
button = Add the chatroom

2
composer.json

@ -16,7 +16,7 @@
"movim/modl": "dev-master#03c6f6e0c83b494ba33df318a724caf779cd37a8",
"movim/sasl2": "dev-master",
"movim/moxl": "dev-master#5b4fde5205f1fa4cf3afe482a197422a44211ebb",
"movim/moxl": "dev-master#595e7b3cc55fb4de2cd7202fe3998fb0b89e4655",
"embed/embed": "dev-master",
"heyupdate/emoji": "dev-twemoji2#99dda1bed08472046cac1498221f08684ad83d55",

50
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "362fec1aa6ec47cb436b6355a78f0d9d",
"content-hash": "adc6814820b8712e0130ce37eb5638ca",
"packages": [
{
"name": "cboden/ratchet",
@ -771,12 +771,12 @@
"source": {
"type": "git",
"url": "https://github.com/movim/moxl.git",
"reference": "5b4fde5205f1fa4cf3afe482a197422a44211ebb"
"reference": "595e7b3cc55fb4de2cd7202fe3998fb0b89e4655"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/movim/moxl/zipball/5b4fde5205f1fa4cf3afe482a197422a44211ebb",
"reference": "5b4fde5205f1fa4cf3afe482a197422a44211ebb",
"url": "https://api.github.com/repos/movim/moxl/zipball/595e7b3cc55fb4de2cd7202fe3998fb0b89e4655",
"reference": "595e7b3cc55fb4de2cd7202fe3998fb0b89e4655",
"shasum": ""
},
"require": {
@ -811,7 +811,7 @@
"php",
"xmpp"
],
"time": "2017-12-27T19:44:09+00:00"
"time": "2018-01-21T17:11:20+00:00"
},
{
"name": "movim/sasl2",
@ -1098,16 +1098,16 @@
},
{
"name": "ramsey/uuid",
"version": "3.7.2",
"version": "3.7.3",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
"reference": "bba83ad77bb9deb6d3c352a7361b818e415b221d"
"reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/bba83ad77bb9deb6d3c352a7361b818e415b221d",
"reference": "bba83ad77bb9deb6d3c352a7361b818e415b221d",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/44abcdad877d9a46685a3a4d221e3b2c4b87cb76",
"reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76",
"shasum": ""
},
"require": {
@ -1118,17 +1118,15 @@
"rhumsaa/uuid": "self.version"
},
"require-dev": {
"apigen/apigen": "^4.1",
"codeception/aspect-mock": "^1.0 | ~2.0.0",
"doctrine/annotations": "~1.2.0",
"goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1",
"ircmaxell/random-lib": "^1.1",
"jakub-onderka/php-parallel-lint": "^0.9.0",
"mockery/mockery": "^0.9.4",
"mockery/mockery": "^0.9.9",
"moontoast/math": "^1.1",
"php-mock/php-mock-phpunit": "^0.3|^1.1",
"phpunit/phpunit": "^4.7|^5.0",
"satooshi/php-coveralls": "^0.6.1",
"squizlabs/php_codesniffer": "^2.3"
},
"suggest": {
@ -1176,7 +1174,7 @@
"identifier",
"uuid"
],
"time": "2018-01-13T22:22:03+00:00"
"time": "2018-01-20T00:28:24+00:00"
},
{
"name": "ratchet/rfc6455",
@ -1420,11 +1418,6 @@
"react/stream": "^1.0 || ^0.7.1",
"ringcentral/psr7": "^1.2"
},
"require-dev": {
"clue/block-react": "^1.1",
"phpunit/phpunit": "^4.8.10||^5.0",
"react/socket": "^1.0 || ^0.8 || ^0.7"
},
"type": "library",
"autoload": {
"psr-4": {
@ -1435,14 +1428,9 @@
"license": [
"MIT"
],
"description": "Event-driven, streaming plaintext HTTP and secure HTTPS server for ReactPHP",
"description": "Library for building an evented http server.",
"keywords": [
"event-driven",
"http",
"https",
"reactphp",
"server",
"streaming"
"http"
],
"time": "2016-07-06T23:51:32+00:00"
},
@ -1692,22 +1680,22 @@
},
{
"name": "react/stream",
"version": "v0.7.6",
"version": "v0.7.7",
"source": {
"type": "git",
"url": "https://github.com/reactphp/stream.git",
"reference": "4e07a0014896cbbb73e2f2b2c28e86174b6e1d4d"
"reference": "10100896018fd847a257cd81143b8e1b7be08e40"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/reactphp/stream/zipball/4e07a0014896cbbb73e2f2b2c28e86174b6e1d4d",
"reference": "4e07a0014896cbbb73e2f2b2c28e86174b6e1d4d",
"url": "https://api.github.com/repos/reactphp/stream/zipball/10100896018fd847a257cd81143b8e1b7be08e40",
"reference": "10100896018fd847a257cd81143b8e1b7be08e40",
"shasum": ""
},
"require": {
"evenement/evenement": "^3.0 || ^2.0 || ^1.0",
"php": ">=5.3.8",
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3"
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5"
},
"require-dev": {
"clue/stream-filter": "~1.2",
@ -1734,7 +1722,7 @@
"stream",
"writable"
],
"time": "2017-12-21T14:12:01+00:00"
"time": "2018-01-19T15:04:38+00:00"
},
{
"name": "react/zmq",

1
themes/material/css/style.css

@ -362,6 +362,7 @@ main section > div:first-child:nth-last-child(2) ~ div .actions.fixed > div:last
hr:not(.clear) {
border-bottom: 1px solid;
width: 100%;
}
/* Spin */

Loading…
Cancel
Save