1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00

update to movim upstream

This commit is contained in:
src386 2016-04-15 10:05:14 +02:00
parent fa04195341
commit dae5ad547e
17 changed files with 150 additions and 23 deletions

View file

@ -1,7 +1,7 @@
**Changelog**
1.8 2016?
- Update to movim 0.9 git2016-04-14
- Update to movim 0.9 git2016-04-15
- Removed "environment" variable
1.7.1 2016-30-30

View file

@ -5,7 +5,7 @@ Movim is a decentralized social network, written in PHP and HTML5 and based on t
It is recommended to use a "valid" certificate to use Movim, auto-signed is sometimes problematic. You might want to take a look a StartSSL or Let's Encrypt.
Provided Movim version : 0.9 git2016-04-14
Provided Movim version : 0.9 git2016-04-15
Please read CHANGELOG.

View file

@ -3,6 +3,8 @@ Movim Changelog
v0.9.1 (trunk)
---------------------------
* Put your own XMPP server as default in the configuration (movim.eu in fallback)
* Close the Dialog box when pressing ESC
* Moving values from Sessionx to Session
* Using chart.js for the statistics
* Refactor the "public" system for the Posts

View file

@ -182,4 +182,10 @@ var MovimTpl = {
movim_add_onload(function() {
MovimTpl.init();
document.body.addEventListener('click', MovimTpl.toggleContextMenu, false);
document.onkeydown = function(evt) {
evt = evt || window.event;
if (evt.keyCode == 27 && Dialog.filled()) {
Dialog.clear();
}
};
});

View file

@ -9,13 +9,17 @@ class Config extends Model {
public $maxusers;
public $loglevel;
public $timezone;
public $xmppwhitelist;
public $info;
public $unregister;
public $username;
public $password;
public $sizelimit;
public $xmppdomain;
public $xmppdescription;
public $xmppcountry;
public $xmppwhitelist;
public function __construct() {
$this->_struct = '
{
@ -31,8 +35,6 @@ class Config extends Model {
{"type":"string", "size":16, "mandatory":true },
"timezone" :
{"type":"string", "size":32, "mandatory":true },
"xmppwhitelist" :
{"type":"text" },
"info" :
{"type":"text" },
"unregister" :
@ -42,7 +44,15 @@ class Config extends Model {
"password" :
{"type":"string", "size":64, "mandatory":true },
"sizelimit" :
{"type":"int", "size":16 }
{"type":"int", "size":16 },
"xmppdomain" :
{"type":"string", "size":32 },
"xmppdescription" :
{"type":"text" },
"xmppcountry" :
{"type":"string", "size":4 },
"xmppwhitelist" :
{"type":"text" }
}';
parent::__construct();

View file

@ -12,6 +12,9 @@ class ConfigDAO extends SQL {
maxusers = :maxusers,
loglevel = :loglevel,
timezone = :timezone,
xmppdomain = :xmppdomain,
xmppdescription = :xmppdescription,
xmppcountry = :xmppcountry,
xmppwhitelist = :xmppwhitelist,
info = :info,
unregister = :unregister,
@ -28,6 +31,9 @@ class ConfigDAO extends SQL {
'maxusers' => $c->maxusers,
'loglevel' => $c->loglevel,
'timezone' => $c->timezone,
'xmppdomain' => $c->xmppdomain,
'xmppdescription' => $c->xmppdescription,
'xmppcountry' => $c->xmppcountry,
'xmppwhitelist'=> $c->xmppwhitelist,
'info' => $c->info,
'unregister' => $c->unregister,
@ -60,6 +66,9 @@ class ConfigDAO extends SQL {
maxusers,
loglevel,
timezone,
xmppdomain,
xmppdescription,
xmppcountry,
xmppwhitelist,
info,
unregister,
@ -75,6 +84,9 @@ class ConfigDAO extends SQL {
:maxusers,
:loglevel,
:timezone,
:xmppdomain,
:xmppdescription,
:xmppcountry,
:xmppwhitelist,
:info,
:unregister,
@ -93,6 +105,9 @@ class ConfigDAO extends SQL {
'maxusers' => $c->maxusers,
'loglevel' => $c->loglevel,
'timezone' => $c->timezone,
'xmppdomain' => $c->xmppdomain,
'xmppdescription' => $c->xmppdescription,
'xmppcountry' => $c->xmppcountry,
'xmppwhitelist'=> $c->xmppwhitelist,
'info' => $c->info,
'unregister' => $c->unregister,

View file

@ -5,7 +5,6 @@ namespace modl;
class Sessionx extends Model {
public $session;
public $username;
public $password;
public $hash;
public $resource;
public $rid;
@ -27,8 +26,6 @@ class Sessionx extends Model {
{"type":"string", "size":32, "key":true },
"username" :
{"type":"string", "size":64 },
"password" :
{"type":"string", "size":64 },
"hash" :
{"type":"string", "size":64 },
"resource" :
@ -36,7 +33,7 @@ class Sessionx extends Model {
"rid" :
{"type":"int", "size":8, "mandatory":true },
"sid" :
{"type":"string", "size":64 },
{"type":"string", "size":64 },
"id" :
{"type":"int", "size":8, "mandatory":true },
"port" :

View file

@ -88,5 +88,6 @@ class AdminMain extends \Movim\Widget\Base
$this->view->assign('timezones', getTimezoneList());
$this->view->assign('langs', $l->getList());
$this->view->assign('countries', getCountries());
}
}

View file

@ -6,7 +6,7 @@
<label for="da">{$c->__('general.language')}</label>
<div class="select">
<select id="locale" name="locale">
<option value="en">English (default)</option>';
<option value="en">English (default)</option>
{loop="$langs"}
<option value="{$key}"
{if="$conf->locale == $key"}
@ -61,6 +61,37 @@
<br />
<h3>{$c->__('xmpp.title')}</h3>
<div>
<input type="text" name="xmppdomain" id="xmppdomain" placeholder="server.tld" value="{$conf->xmppdomain}" />
<label for="xmppdomain">{$c->__('xmpp.domain')}</label>
</div>
<div>
<textarea type="text" name="xmppdescription" id="xmppdescription" placeholder="{$c->__('xmpp.description')}" />{$conf->xmppdescription}</textarea>
<label for="xmppdescription">{$c->__('xmpp.description')}</label>
</div>
<div>
<div class="select">
<select id="xmppcountry" name="xmppcountry">
<option value=""></option>
{loop="$countries"}
<option value="{$key}"
{if="$conf->xmppcountry == $key"}
selected="selected"
{/if}>
{$value}
</option>
{/loop}
</select>
</div>
<label for="xmppcountry">{$c->__('xmpp.country')}</label>
</div>
<br />
<h3>{$c->__('whitelist.title')}</h3>
<div>

View file

@ -23,7 +23,7 @@ password = Password
re_password = Retype password
[whitelist]
title = Whitelist - XMPP Server
title = Whitelisted XMPP Servers
info1 = If you want to specify a list of authorized XMPP servers on your Movim pod and forbid the connection on all the others please put their domain name here, with comma (ex: movim.eu,jabber.fr)
info2 = Leave this field blank if you allow the access to all the XMPP accounts.
label = List of whitelisted XMPP servers
@ -35,6 +35,12 @@ info1 = This message will be displayed on the login page
info2 = "Leave this field blank if you dont want to show any message."
label = Information Message
[xmpp]
title = Default XMPP server
domain = Main XMPP server domain
description = Main XMPP server description
country = Main XMPP server country
[log]
empty = Empty
syslog = Syslog

View file

@ -76,6 +76,13 @@ class Login extends \Movim\Widget\Base
$this->view->assign('info', $config->info);
$this->view->assign('whitelist',$config->xmppwhitelist);
if(isset($config->xmppdomain)
&& !empty($config->xmppdomain)) {
$this->view->assign('domain', $config->xmppdomain);
} else {
$this->view->assign('domain', 'movim.eu');
}
$pop = 0;
foreach(scandir(USERS_PATH) as $f)

View file

@ -1,4 +1,5 @@
var Login = {
domain : '@movim.eu',
submitted : false,
fillExample : function(login, pass) {
document.querySelector('#login').value = login;
@ -134,7 +135,7 @@ var Login = {
*/
setCookie : function(value) {
document.cookie = 'MOVIM_SESSION_ID='+value;
}
},
}
MovimWebsocket.attach(function()
@ -176,7 +177,7 @@ movim_add_onload(function() {
login.addEventListener('input', function() {
if(this.value.indexOf('@') == -1) {
// TODO allow another server here
document.querySelector('input#complete').value = this.value + '@movim.eu';
document.querySelector('input#complete').value = this.value + '@' + Login.domain;
} else {
document.querySelector('input#complete').value = this.value;
}

View file

@ -1,8 +1,9 @@
<div id="login_widget">
<div id="sessions" class="dialog actions"></div>
<script type="text/javascript">
Login.domain = '{$domain}';
{if="isset($httpAuthUser)"}
<script type="text/javascript">
localStorage.username = '{$httpAuthUser}';
MovimWebsocket.attach(function() {
MovimWebsocket.connection.register('{$httpAuthHost}');
@ -10,8 +11,8 @@
MovimWebsocket.register(function() {
Login_ajaxHTTPLogin('{$httpAuthUser}', '{$httpAuthPassword}');
});
</script>
{/if}
</script>
<div id="form" class="dialog">
<section>

View file

@ -38,6 +38,9 @@ class Subscribe extends \Movim\Widget\Base {
$json = requestURL(MOVIM_API.'servers', 1);
$json = json_decode($json);
$cd = new \Modl\ConfigDAO;
$this->view->assign('config', $cd->get());
if(is_object($json) && $json->status == 200) {
$this->view->assign('servers', $json->servers);
}

View file

@ -7,6 +7,32 @@
</ul>
<ul class="list card shadow active flex">
{if="!empty($config->xmppdomain)"}
<li
class="block large"
onclick="movim_redirect('{$c->route('accountnext', array($config->xmppdomain, false))}')">
<span class="primary icon bubble color {$config->xmppdomain|stringToColor}">
{$config->xmppdomain|firstLetterCapitalize}
</span>
<p>
{if="!empty($config->xmppcountry)"}
<span class="info">
<img
class="flag"
title="{$config->xmppcountry}"
alt="{$config->xmppc}"
src="{$c->flagPath($config->xmppcountry)}"/>
</span>
{/if}
{$config->xmppdomain}
</p>
{if="!empty($config->xmppdescription)"}
<p>
{$config->xmppdescription}<br />
</p>
{/if}
</li>
{/if}
{loop="$servers"}
<li
class="block"
@ -30,9 +56,6 @@
</p>
<p>
{$value->description}<br />
<!--<a target="_blank" href="{$value->url}">
{$value->url}
</a>-->
</p>
</li>
{/loop}

View file

@ -50,6 +50,30 @@ class ConfigCommand extends Command
InputOption::VALUE_REQUIRED,
'The server main locale'
)
->addOption(
'xmppdomain',
null,
InputOption::VALUE_REQUIRED,
'The default XMPP server domain'
)
->addOption(
'xmppdescription',
null,
InputOption::VALUE_REQUIRED,
'The default XMPP server description'
)
->addOption(
'xmppcountry',
null,
InputOption::VALUE_REQUIRED,
'The default XMPP server country'
)
->addOption(
'xmppwhitelist',
null,
InputOption::VALUE_REQUIRED,
'The whitelisted XMPP servers'
)
;
}

View file

@ -66,7 +66,7 @@ class Builder
{
$this->_view = $view;
$template = $this->_view.'.tpl';
//if (ENVIRONMENT === 'production') ob_clean();
ob_start();
require($this->viewsPath($template));