mirror of
https://github.com/YunoHost-Apps/movim_ynh.git
synced 2024-09-03 19:46:19 +02:00
Upgrade to movim 20150810
This commit is contained in:
parent
b72c9e176c
commit
ca10b3e3df
42 changed files with 348 additions and 325 deletions
|
@ -8,4 +8,4 @@ DO NOT USE
|
|||
|
||||
**Changelog**
|
||||
|
||||
Current Movim version : 20150731.
|
||||
Current Movim version : 20150810.
|
||||
|
|
|
@ -49,10 +49,9 @@ sudo su -c "cd $final_path && php composer.phar install" -s /bin/sh www-data
|
|||
|
||||
# Movim configuration
|
||||
sudo cp $final_path/config/db.example.inc.php $final_path/config/db.inc.php
|
||||
sudo sed -i "s/yhuser/$db_user/g" $final_path/config/db.inc.php
|
||||
sudo sed -i "s/yhpwd/$db_pwd/g" $final_path/config/db.inc.php
|
||||
sudo sed -i "s/yhdb/$db_user/g" $final_path/config/db.inc.php
|
||||
sudo sed -i "s@PATHTOCHANGE@$path@g" $final_path/app/assets/js/movim_websocket.js
|
||||
sudo sed -i "s@username@$db_user@g" $final_path/config/db.inc.php
|
||||
sudo sed -i "s@password@$db_pwd@g" $final_path/config/db.inc.php
|
||||
sudo sed -i "s@/ws/@$path/ws/" $final_path/app/assets/js/movim_websocket.js
|
||||
sudo su -c "cd $final_path && php mud.php db set" -s /bin/sh www-data
|
||||
sudo su -c "cd $final_path && php mud.php config locale:$language"
|
||||
sudo su -c "cd $final_path && php mud.php config loglevel:1"
|
||||
|
|
14
sources/.bzrignore
Executable file
14
sources/.bzrignore
Executable file
|
@ -0,0 +1,14 @@
|
|||
*~
|
||||
*#*
|
||||
cache.tmp
|
||||
log/*
|
||||
locales/files.list
|
||||
*.pdf
|
||||
*.swp
|
||||
|
||||
./cache
|
||||
./config/*
|
||||
./lib/Modl
|
||||
./lib/Moxl
|
||||
./users/*
|
||||
./log
|
4
sources/.dir-locals.el
Executable file
4
sources/.dir-locals.el
Executable file
|
@ -0,0 +1,4 @@
|
|||
((nil . ((indent-tabs-mode . nil)
|
||||
(tab-width . 4)
|
||||
(fill-column . 80)))
|
||||
(c-mode . ((c-file-style . "stroustrup"))))
|
8
sources/.gitignore
vendored
Normal file
8
sources/.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/vendor
|
||||
/log
|
||||
/users
|
||||
/cache
|
||||
*~
|
||||
/config/db.inc.php
|
||||
/composer.lock
|
||||
/composer.phar
|
22
sources/.htaccess
Executable file
22
sources/.htaccess
Executable file
|
@ -0,0 +1,22 @@
|
|||
Options -Indexes
|
||||
AddType application/x-web-app-manifest+json .webapp
|
||||
<IfModule mod_rewrite.c>
|
||||
# Tell PHP that the mod_rewrite module is ENABLED.
|
||||
SetEnv HTTP_MOD_REWRITE 1
|
||||
|
||||
# If you have troubles or use VirtualDocumentRoot
|
||||
# uncomment this and set it to the path where your Movim installation is
|
||||
# i.e.:
|
||||
# Movim url: http://example.com
|
||||
# RewriteBase /
|
||||
# Movim url: http://some.example.com/movim
|
||||
# RewriteBase /movim/
|
||||
|
||||
RewriteBase /0.9/
|
||||
RewriteEngine On
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule (.*) index.php?query=$1 [L]
|
||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||
</IfModule>
|
|
@ -86,6 +86,13 @@ var MovimTpl = {
|
|||
return false;
|
||||
}
|
||||
},
|
||||
isPanelScrolled : function() {
|
||||
var selector = document.querySelector('main section > div:first-child:nth-last-child(2) ~ div div');
|
||||
|
||||
if(selector != null) {
|
||||
return (selector.scrollHeight - selector.scrollTop === selector.clientHeight);
|
||||
}
|
||||
},
|
||||
scrollPanel : function() {
|
||||
var selector = document.querySelector('main section > div:first-child:nth-last-child(2) ~ div div');
|
||||
|
||||
|
@ -119,6 +126,9 @@ var MovimTpl = {
|
|||
//if(!document.querySelector(element).contains(e.target))
|
||||
movim_remove_class(element, classname);
|
||||
},
|
||||
toggleActionButton : function() {
|
||||
movim_toggle_class('.button.action', 'active');
|
||||
},
|
||||
hideContextMenu : function() {
|
||||
movim_remove_class('ul.context_menu', 'shown');
|
||||
},
|
||||
|
|
|
@ -41,9 +41,9 @@ var MovimWebsocket = {
|
|||
|
||||
init : function() {
|
||||
if(SECURE_WEBSOCKET) {
|
||||
var uri = 'wss://' + BASE_HOST + 'PATHTOCHANGE/ws/';
|
||||
var uri = 'wss://' + BASE_HOST + '/ws/';
|
||||
} else {
|
||||
var uri = 'ws://' + BASE_HOST + 'PATHTOCHANGE/ws/';
|
||||
var uri = 'ws://' + BASE_HOST + '/ws/';
|
||||
}
|
||||
|
||||
this.connection = new WebSocket(uri);
|
||||
|
|
|
@ -309,7 +309,7 @@ function stringToColor($string) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the first letter of a string
|
||||
* Return the first two letters of a string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace Modl;
|
||||
|
||||
class Config extends Model {
|
||||
public $environment;
|
||||
public $description;
|
||||
public $theme;
|
||||
public $locale;
|
||||
|
@ -21,8 +20,6 @@ class Config extends Model {
|
|||
public function __construct() {
|
||||
$this->_struct = '
|
||||
{
|
||||
"environment" :
|
||||
{"type":"string", "size":64, "mandatory":true },
|
||||
"description" :
|
||||
{"type":"text" },
|
||||
"theme" :
|
||||
|
@ -53,7 +50,6 @@ class Config extends Model {
|
|||
|
||||
parent::__construct();
|
||||
|
||||
$this->environment = 'development';
|
||||
$this->description = __('global.description');
|
||||
$this->theme = 'material';
|
||||
$this->locale = 'en';
|
||||
|
|
|
@ -6,8 +6,7 @@ class ConfigDAO extends SQL {
|
|||
function set(Config $c) {
|
||||
$this->_sql = '
|
||||
update config
|
||||
set environment = :environment,
|
||||
description = :description,
|
||||
set description = :description,
|
||||
theme = :theme,
|
||||
locale = :locale,
|
||||
maxusers = :maxusers,
|
||||
|
@ -24,7 +23,6 @@ class ConfigDAO extends SQL {
|
|||
$this->prepare(
|
||||
'Config',
|
||||
array(
|
||||
'environment' => $c->environment,
|
||||
'description' => $c->description,
|
||||
'theme' => $c->theme,
|
||||
'locale' => $c->locale,
|
||||
|
@ -58,7 +56,6 @@ class ConfigDAO extends SQL {
|
|||
$this->_sql = '
|
||||
insert into config
|
||||
(
|
||||
environment,
|
||||
description,
|
||||
theme,
|
||||
locale,
|
||||
|
@ -75,7 +72,6 @@ class ConfigDAO extends SQL {
|
|||
)
|
||||
values
|
||||
(
|
||||
:environment,
|
||||
:description,
|
||||
:theme,
|
||||
:locale,
|
||||
|
@ -95,7 +91,6 @@ class ConfigDAO extends SQL {
|
|||
$this->prepare(
|
||||
'Config',
|
||||
array(
|
||||
'environment' => $c->environment,
|
||||
'description' => $c->description,
|
||||
'theme' => $c->theme,
|
||||
'locale' => $c->locale,
|
||||
|
|
|
@ -84,6 +84,24 @@ class Postn extends Model {
|
|||
parent::__construct();
|
||||
}
|
||||
|
||||
private function getContent($contents) {
|
||||
$content = '';
|
||||
foreach($contents as $c) {
|
||||
switch($c->attributes()->type) {
|
||||
case 'html':
|
||||
case 'xhtml':
|
||||
return (string)$c->asXML();
|
||||
break;
|
||||
case 'text':
|
||||
default :
|
||||
$content = (string)$c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function set($item, $from, $delay = false, $node = false) {
|
||||
if($item->item)
|
||||
$entry = $item->item;
|
||||
|
@ -125,16 +143,7 @@ class Postn extends Model {
|
|||
$summary = '';
|
||||
|
||||
if($entry->entry && $entry->entry->content) {
|
||||
if((string)$entry->entry->content->attributes()->type == 'text')
|
||||
$content = (string)$entry->entry->content;
|
||||
elseif(
|
||||
(string)$entry->entry->content->attributes()->type == ('html' || 'xhtml')
|
||||
//&& $entry->entry->content->html
|
||||
//&& $entry->entry->content->html->body
|
||||
) {
|
||||
$content = (string)$entry->entry->content/*->html->body*/->asXML();
|
||||
} else
|
||||
$content = (string)$entry->entry->content;
|
||||
$content = $this->getContent($entry->entry->content);
|
||||
} elseif($summary == '')
|
||||
$content = __('');
|
||||
else
|
||||
|
|
|
@ -79,11 +79,6 @@ class AdminMain extends WidgetBase
|
|||
1 => $this->__('log.syslog'),
|
||||
2 => $this->__('log.syslog_files'))
|
||||
);
|
||||
$this->view->assign('envs',
|
||||
array(
|
||||
'development' => 'Development',
|
||||
'production' => 'Production')
|
||||
);
|
||||
|
||||
$this->view->assign('bosh_info4',
|
||||
$this->__('bosh.info4', '<a href="http://wiki.movim.eu/en:install">', '</a>'));
|
||||
|
|
|
@ -19,22 +19,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="da">{$c->__('general.environment')}</label>
|
||||
<div class="select">
|
||||
<select id="environment" name="environment">';
|
||||
{loop="$envs"}
|
||||
<option value="{$key}"
|
||||
{if="$conf->environment == $key"}
|
||||
selected="selected"
|
||||
{/if}>
|
||||
{$value}
|
||||
</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div>
|
||||
<input type="text" name="sizelimit" id="sizelimit" value="{$conf->sizelimit}" />
|
||||
|
|
|
@ -4,7 +4,6 @@ general = General Settings
|
|||
[general]
|
||||
theme = Theme
|
||||
language = Default language
|
||||
environment = Environment
|
||||
log_verbosity = Log verbosity
|
||||
timezone = Server Timezone
|
||||
limit = User folder size limit (in bytes)
|
||||
|
|
|
@ -64,15 +64,6 @@
|
|||
</span>
|
||||
</li>
|
||||
|
||||
<!--<li id="xmpp_websocket_error">
|
||||
<span class="icon bubble color red">
|
||||
<i class="zmdi zmdi-code-setting"></i>
|
||||
</span>
|
||||
<span>
|
||||
{$c->__('compatibility.xmpp_websocket')} <code>{$websocketurl}</code>
|
||||
</span>
|
||||
</li>-->
|
||||
|
||||
{if="!$c->version()"}
|
||||
<li class="condensed">
|
||||
<span class="icon color bubble red">
|
||||
|
@ -121,11 +112,10 @@
|
|||
{if="!$_SERVER['HTTP_MOD_REWRITE']"}
|
||||
<li>
|
||||
<span class="icon bubble color orange">
|
||||
<i class="zmdi zmdi-mode-edit"></i>
|
||||
<i class="zmdi zmdi-edit"></i>
|
||||
</span>
|
||||
<span>{$c->__('compatibility.rewrite')}</span>
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
<!--<script type="text/javascript">AdminTest.testXMPPWebsocket('{$websocketurl}');</script>-->
|
||||
</div>
|
||||
|
|
|
@ -55,7 +55,12 @@ class Api extends WidgetBase {
|
|||
function ajaxRegister()
|
||||
{
|
||||
$rewrite = false;
|
||||
if(isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE']) {
|
||||
|
||||
$cd = new \Modl\ConfigDAO();
|
||||
$config = $cd->get();
|
||||
|
||||
if($config->rewrite/*isset($_SERVER['HTTP_MOD_REWRITE'])
|
||||
&& $_SERVER['HTTP_MOD_REWRITE']*/) {
|
||||
$rewrite = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class Chat extends WidgetBase
|
|||
Notification::append('chat|'.$from, $contact->getTrueName(), $message->body, $avatar, 4);
|
||||
}
|
||||
|
||||
RPC::call('movim_fill', $from.'_state', '');
|
||||
RPC::call('movim_fill', $from.'_state', $contact->jid);
|
||||
// If the message is from me
|
||||
} /*else {
|
||||
$from = $message->jidto;
|
||||
|
@ -90,7 +90,6 @@ class Chat extends WidgetBase
|
|||
if(!preg_match('#^\?OTR#', $message->body)) {
|
||||
RPC::call('Chat.appendMessage', $this->prepareMessage($message));
|
||||
}
|
||||
RPC::call('MovimTpl.scrollPanel');
|
||||
}
|
||||
|
||||
function onComposing($array)
|
||||
|
@ -154,7 +153,7 @@ class Chat extends WidgetBase
|
|||
$html = $view->draw('_chat_state', true);
|
||||
|
||||
RPC::call('movim_fill', $jid.'_state', $html);
|
||||
RPC::call('MovimTpl.scrollPanel');
|
||||
//RPC::call('MovimTpl.scrollPanel');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<section id="{$jid}_messages">
|
||||
<ul class="{if="$muc"}thin simple{else}middle{/if}" id="{$jid}_conversation"></ul>
|
||||
</section>
|
||||
<div id="{$jid}_state"></div>
|
||||
</div>
|
||||
<div class="chat_box">
|
||||
<ul class="thin">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="chat_header" class="return active r1" onclick="MovimTpl.hidePanel(); Chat_ajaxGet();">
|
||||
<div id="chat_header" class="return active r1 condensed" onclick="MovimTpl.hidePanel(); Chat_ajaxGet();">
|
||||
<span id="back" class="icon"><i class="zmdi zmdi-arrow-back"></i></span>
|
||||
<h2>
|
||||
{if="$contact != null"}
|
||||
|
@ -26,5 +26,6 @@
|
|||
{$jid|echapJS}
|
||||
{/if}
|
||||
</h2>
|
||||
<h4 id="{$jid}_state">{$contact->jid}</h4>
|
||||
</h2>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1 @@
|
|||
<ul class="simple thin">
|
||||
<li>
|
||||
<p>{$message}</p>
|
||||
</li>
|
||||
</ul>
|
||||
{$message}
|
||||
|
|
|
@ -54,6 +54,8 @@ var Chat = {
|
|||
var bubble = null;
|
||||
var id = null;
|
||||
|
||||
var scrolled = MovimTpl.isPanelScrolled();
|
||||
|
||||
if(message.type == 'groupchat') {
|
||||
bubble = Chat.room.cloneNode(true);
|
||||
|
||||
|
@ -115,7 +117,7 @@ var Chat = {
|
|||
}
|
||||
}
|
||||
|
||||
MovimTpl.scrollPanel();
|
||||
if(scrolled) MovimTpl.scrollPanel();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,15 @@
|
|||
<h1>{$c->__('chats.empty_title')}</h1>
|
||||
<h4>{$c->__('chats.empty')}</h4>
|
||||
</div>
|
||||
|
||||
<a onclick="Chats_ajaxAdd()" class="button action color">
|
||||
<a class="button action color" onclick="MovimTpl.toggleActionButton()">
|
||||
<i class="zmdi zmdi-plus"></i>
|
||||
|
||||
<ul class="actions">
|
||||
<li onclick="Chats_ajaxAdd()">
|
||||
<i class="zmdi zmdi-account-add"></i>
|
||||
</li>
|
||||
<li onclick="Rooms_ajaxAdd()">
|
||||
<i class="zmdi zmdi-accounts-add"></i>
|
||||
</li>
|
||||
</ul>
|
||||
</a>
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
</ul>
|
||||
</header>
|
||||
<section>
|
||||
{$value->contentcleaned}
|
||||
<content>
|
||||
{$value->contentcleaned}
|
||||
</content>
|
||||
</section>
|
||||
<footer>
|
||||
<ul class="thin">
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
<div>
|
||||
<ul class="active">
|
||||
<li onclick="Rooms_ajaxAdd()">
|
||||
<span class="icon">
|
||||
<i class="zmdi zmdi-accounts-add"></i>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<span id="menu" class="on_mobile icon active" onclick="MovimTpl.toggleMenu()"><i class="zmdi zmdi-menu"></i></span>
|
||||
<span class="on_desktop icon"><i class="zmdi zmdi-comments"></i></span>
|
||||
<h2 class="r1">{$c->__('page.chats')}</h2>
|
||||
<h2>{$c->__('page.chats')}</h2>
|
||||
</div>
|
||||
|
|
|
@ -77,14 +77,27 @@
|
|||
{else}
|
||||
<span>{$c->__('hello.contact_post')}</span>
|
||||
{/if}
|
||||
|
||||
<span class="info">{$value->published|strtotime|prepareDate}</span>
|
||||
|
||||
<p class="more">
|
||||
{if="current(explode('.', $value->origin)) != 'nsfw'"}
|
||||
{$value->contentcleaned|strip_tags:'<img><img/>'}
|
||||
<p>
|
||||
{if="$value->node == 'urn:xmpp:microblog:0'"}
|
||||
<a href="{$c->route('contact', $value->getContact()->jid)}">
|
||||
<i class="zmdi zmdi-account"></i> {$value->getContact()->getTrueName()}
|
||||
</a> –
|
||||
{else}
|
||||
{$value->origin} /
|
||||
<a href="{$c->route('group', array($value->origin, $value->node))}">
|
||||
<i class="zmdi zmdi-pages"></i> {$value->node}
|
||||
</a> –
|
||||
{/if}
|
||||
{$value->published|strtotime|prepareDate}
|
||||
</p>
|
||||
|
||||
{if="$value->privacy"}
|
||||
<span class="info" title="{$c->__('menu.public')}">
|
||||
<i class="zmdi zmdi-portable-wifi"></i>
|
||||
</span>
|
||||
{/if}
|
||||
<p>{$value->contentcleaned|strip_tags}</p>
|
||||
|
||||
</li>
|
||||
{/loop}
|
||||
<a href="{$c->route('news')}">
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
{else}
|
||||
<span class="icon thumb color {$value->node|stringToColor}">{$value->node|firstLetterCapitalize}</span>
|
||||
{/if}
|
||||
|
||||
{if="$value->title != null"}
|
||||
<span>{$value->title}</span>
|
||||
{else}
|
||||
|
@ -48,6 +49,7 @@
|
|||
<i class="zmdi zmdi-account"></i> {$value->getContact()->getTrueName()}
|
||||
</a> –
|
||||
{else}
|
||||
{$value->origin} /
|
||||
<a href="{$c->route('group', array($value->origin, $value->node))}">
|
||||
<i class="zmdi zmdi-pages"></i> {$value->node}
|
||||
</a> –
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
</a> –
|
||||
{/if}
|
||||
{if="$post->node != 'urn:xmpp:microblog:0'"}
|
||||
{$post->origin} /
|
||||
<a href="{$c->route('group', array($post->origin, $post->node))}">
|
||||
<i class="zmdi zmdi-pages"></i> {$post->node}
|
||||
</a> –
|
||||
|
@ -58,7 +59,9 @@
|
|||
</header>
|
||||
|
||||
<section>
|
||||
{$post->contentcleaned}
|
||||
<content>
|
||||
{$post->contentcleaned}
|
||||
</content>
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
|
@ -127,7 +130,7 @@
|
|||
</div>
|
||||
</form>
|
||||
<span class="icon gray">
|
||||
<i class="zmdi zmdi-public"></i>
|
||||
<i class="zmdi zmdi-portable-wifi"></i>
|
||||
</span>
|
||||
<span>
|
||||
<a target="_blank" href="{$c->route('blog', array($post->origin))}">
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
{/if}
|
||||
</span>
|
||||
<p>
|
||||
{$value->origin} /
|
||||
<a href="{$c->route('group', array($value->origin, $value->node))}">
|
||||
<i class="zmdi zmdi-pages"></i> {$value->node}
|
||||
</a> –
|
||||
|
|
|
@ -144,6 +144,7 @@ class Publish extends WidgetBase
|
|||
$p = new PostPublish;
|
||||
$p->setFrom($this->user->getLogin())
|
||||
->setTo($form->to->value)
|
||||
->setContent($form->content->value)
|
||||
->setNode($form->node->value);
|
||||
//->setLocation($geo)
|
||||
//->enableComments()
|
||||
|
|
|
@ -31,11 +31,6 @@ class System extends WidgetBase {
|
|||
else
|
||||
$this->view->assign('page_key_uri', '');
|
||||
|
||||
if(FAIL_SAFE != null)
|
||||
$this->view->assign('fail_safe', FAIL_SAFE);
|
||||
else
|
||||
$this->view->assign('fail_safe', '');
|
||||
|
||||
$this->view->assign('secure_websocket', file_get_contents(CACHE_PATH.'websocket'));
|
||||
|
||||
// And we load some public values of the system configuration
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
var BASE_HOST = '{$base_host}';
|
||||
var ERROR_URI = '{$error_uri}';
|
||||
var PAGE_KEY_URI = '{$page_key_uri}';
|
||||
var FAIL_SAFE = '{$fail_safe}';
|
||||
var CURRENT_PAGE = '{$current_page}';
|
||||
var SERVER_CONF = {$server_conf};
|
||||
var SECURE_WEBSOCKET= {$secure_websocket};
|
||||
|
|
|
@ -17,6 +17,29 @@ function systemErrorHandler($errno, $errstr, $errfile, $errline, $errcontext = n
|
|||
return false;
|
||||
}
|
||||
|
||||
function fatalErrorShutdownHandler()
|
||||
{
|
||||
$last_error = error_get_last();
|
||||
if($last_error['type'] === E_ERROR) {
|
||||
systemErrorHandler(
|
||||
E_ERROR,
|
||||
$last_error['message'],
|
||||
$last_error['file'],
|
||||
$last_error['line']);
|
||||
|
||||
if (ob_get_contents()) ob_clean();
|
||||
|
||||
?>
|
||||
<div style="font-family: Arial; text-align: center;">
|
||||
<h2>Oops... something went wrong.</h2>
|
||||
<p>But don't panic. The NSA is on the case.</p>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if (ob_get_contents()) ob_end_clean();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage boot order
|
||||
*/
|
||||
|
@ -186,7 +209,6 @@ class Bootstrap {
|
|||
require_once(SYSTEM_PATH . "UtilsPicture.php");
|
||||
require_once(SYSTEM_PATH . "Cache.php");
|
||||
require_once(SYSTEM_PATH . "Event.php");
|
||||
require_once(SYSTEM_PATH . "MovimException.php");
|
||||
require_once(SYSTEM_PATH . "RPC.php");
|
||||
require_once(SYSTEM_PATH . "User.php");
|
||||
require_once(SYSTEM_PATH . "Picture.php");
|
||||
|
@ -251,37 +273,11 @@ class Bootstrap {
|
|||
}
|
||||
|
||||
private function setLogs() {
|
||||
/*$cd = new \Modl\ConfigDAO();
|
||||
$config = $cd->get();
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('error_log', DOCUMENT_ROOT.'/log/php.log');
|
||||
|
||||
try {
|
||||
define('ENVIRONMENT', $config->environment);
|
||||
} catch (Exception $e) {
|
||||
define('ENVIRONMENT','development');//default environment is production
|
||||
}*/
|
||||
define('ENVIRONMENT','development');//default environment is production
|
||||
/**
|
||||
* LOG_MANAGEMENT: define where logs are saved, prefer error_log, or log_folder if you use mutual server.
|
||||
* 'error_log' : save in file defined on your file server
|
||||
* 'log_folder' : save in log folder, in DOCUMENT_ROOT.'/log'
|
||||
* 'syslog' : save in global system logs (not in file server logs)
|
||||
*/
|
||||
|
||||
define('LOG_MANAGEMENT','log_folder');
|
||||
if (ENVIRONMENT === 'development') {
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('error_reporting', E_ALL );
|
||||
|
||||
} else {
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('error_reporting', E_ALL ^ E_DEPRECATED ^ E_NOTICE);
|
||||
}
|
||||
if (LOG_MANAGEMENT === 'log_folder') {
|
||||
ini_set('error_log', DOCUMENT_ROOT.'/log/php.log');
|
||||
}
|
||||
set_error_handler('systemErrorHandler', E_ALL);
|
||||
register_shutdown_function('fatalErrorShutdownHandler');
|
||||
}
|
||||
|
||||
private function setTimezone() {
|
||||
|
@ -366,7 +362,7 @@ class Bootstrap {
|
|||
|
||||
switch($browser) {
|
||||
case 'Firefox':
|
||||
if($browser_version > 3.5)
|
||||
if($browser_version > 30.0)
|
||||
$compatible = true;
|
||||
break;
|
||||
case 'IE':
|
||||
|
|
|
@ -5,13 +5,13 @@ $conf = array(
|
|||
# The type can be 'pgsql' or 'mysql'
|
||||
'type' => 'mysql',
|
||||
# The database username
|
||||
'username' => 'yhuser',
|
||||
'username' => 'username',
|
||||
# The password
|
||||
'password' => 'yhpwd',
|
||||
'password' => 'password',
|
||||
# Where can we find the database ?
|
||||
'host' => 'localhost',
|
||||
# The port number, 3306 for MySQL and 5432 for PostGreSQL
|
||||
'port' => 3306,
|
||||
# The database name
|
||||
'database' => 'yhdb'
|
||||
'database' => 'movim'
|
||||
);
|
||||
|
|
|
@ -40,7 +40,7 @@ if($infos != null) {
|
|||
|
||||
echo colorize("\nTo update the database run\n", 'green');
|
||||
echo colorize("php mud.php db set\n", 'purple');
|
||||
|
||||
exit;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,52 +40,13 @@
|
|||
define('DOCUMENT_ROOT', dirname(__FILE__));
|
||||
require_once(DOCUMENT_ROOT.'/bootstrap.php');
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Handler\SyslogHandler;
|
||||
$bootstrap = new Bootstrap();
|
||||
|
||||
try {
|
||||
if((isset($_GET['q']) && $_GET['q'] == 'admin') ||
|
||||
(isset($_GET['query']) && $_GET['query'] == 'admin')
|
||||
)
|
||||
define('FAIL_SAFE', true);
|
||||
else
|
||||
define('FAIL_SAFE', false);
|
||||
$bootstrap->boot();
|
||||
|
||||
$bootstrap = new Bootstrap();
|
||||
$rqst = new FrontController();
|
||||
$rqst->handle();
|
||||
|
||||
$bootstrap->boot();
|
||||
|
||||
$rqst = new FrontController();
|
||||
$rqst->handle();
|
||||
|
||||
WidgetWrapper::getInstance(false);
|
||||
// Closing stuff
|
||||
WidgetWrapper::destroyInstance();
|
||||
|
||||
} catch (Exception $e) {
|
||||
$log = new Logger('movim');
|
||||
$log->pushHandler(new SyslogHandler('movim'));
|
||||
$log->addInfo($e->getMessage());
|
||||
|
||||
if (ENVIRONMENT === 'development' && !FAIL_SAFE) {
|
||||
?>
|
||||
<div id="final_exception" class="error debug">
|
||||
<h2>An error happened</h2>
|
||||
<p><?php print $e->getMessage();?></p>
|
||||
</div>
|
||||
<?php
|
||||
} elseif(!FAIL_SAFE) {
|
||||
?>
|
||||
<div class="carreful">
|
||||
<h2> Oops... something went wrong.</h2>
|
||||
<p>But don't panic. The NSA is on the case.</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if(FAIL_SAFE) {
|
||||
$r = new Route;
|
||||
$rqst = new FrontController();
|
||||
$rqst->handle();
|
||||
}
|
||||
}
|
||||
WidgetWrapper::getInstance(false);
|
||||
// Closing stuff
|
||||
WidgetWrapper::destroyInstance();
|
||||
|
|
|
@ -50,9 +50,13 @@ $stdin_behaviour = function ($data) use (&$conn, $loop, &$buffer, &$connector, &
|
|||
$cd = new \Modl\ConfigDAO();
|
||||
$config = $cd->get();
|
||||
|
||||
$domain = \Moxl\Utils::getDomain($msg->host);
|
||||
$port = 5222;
|
||||
|
||||
$dns = \Moxl\Utils::resolveHost($msg->host);
|
||||
if(isset($dns[0]['target']) && $dns[0]['target'] != null) $msg->host = $dns[0]['target'];
|
||||
if(isset($dns[0]['port']) && $dns[0]['port'] != null) $port = $dns[0]['port'];
|
||||
#fwrite(STDERR, colorize('open a socket to '.$domain, 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
|
||||
$connector->create($domain, 5222)->then($xmpp_behaviour);
|
||||
$connector->create($msg->host, $port)->then($xmpp_behaviour);
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* \brief Movim's custom exception class.
|
||||
*
|
||||
* Merely adds a line break to the messages so far. Is expected to become more
|
||||
* useful in the future.
|
||||
*/
|
||||
class MovimException extends Exception
|
||||
{
|
||||
/**
|
||||
* Forces to add a message.
|
||||
*/
|
||||
public function __construct($message, $code = 0) {
|
||||
parent::__construct('Error: ' . $message, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output proper html error reports.
|
||||
*/
|
||||
function __toString() {
|
||||
return $this->code . ' - ' . $this->message . '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -84,8 +84,8 @@ class Route extends \BaseController {
|
|||
$tab = '#'.$tab;
|
||||
// Here we got a beautiful rewriten URL !
|
||||
if($config->rewrite == true
|
||||
&& isset($_SERVER['HTTP_MOD_REWRITE'])
|
||||
&& $_SERVER['HTTP_MOD_REWRITE']) {
|
||||
/*&& isset($_SERVER['HTTP_MOD_REWRITE'])
|
||||
&& $_SERVER['HTTP_MOD_REWRITE']*/) {
|
||||
$uri = BASE_URI . $page;
|
||||
if($params != false && is_array($params))
|
||||
foreach($params as $value)
|
||||
|
|
|
@ -49,7 +49,7 @@ class Sessionx {
|
|||
self::$_sessionid = $_COOKIE['MOVIM_SESSION_ID'];
|
||||
} elseif(SESSION_ID) {
|
||||
self::$_sessionid = SESSION_ID;
|
||||
} else {
|
||||
} elseif(!headers_sent()) {
|
||||
$key = generateKey(32);
|
||||
setcookie("MOVIM_SESSION_ID", $key, time()+$this->_max_age, '/', false, APP_SECURED);
|
||||
self::$_sessionid = $key;
|
||||
|
|
|
@ -85,7 +85,7 @@ class WidgetWrapper
|
|||
$path = APP_PATH . "widgets/$name/$name.php";
|
||||
}
|
||||
else {
|
||||
throw new MovimException(
|
||||
throw new Exception(
|
||||
__('error.widget_load_error', $name));
|
||||
}
|
||||
|
||||
|
|
|
@ -290,7 +290,6 @@ input[type=button].flat:focus {
|
|||
position: fixed;
|
||||
bottom: 2rem;
|
||||
right: 2rem;
|
||||
border-radius: 10rem;
|
||||
min-height: 0rem;
|
||||
min-width: 0rem;
|
||||
line-height: 7rem;
|
||||
|
@ -298,19 +297,33 @@ input[type=button].flat:focus {
|
|||
width: 7rem;
|
||||
z-index: 1;
|
||||
font-size: 3.5rem;
|
||||
transition: all 0.15s ease 0s;
|
||||
}
|
||||
|
||||
.button.action,
|
||||
.button.action .actions li {
|
||||
border-radius: 10rem;
|
||||
box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.23), 0 0.5rem 1.25rem rgba(0, 0, 0, 0.16);
|
||||
}
|
||||
|
||||
.button.action:hover {
|
||||
transform: scale(1.1);
|
||||
/*transform: scale(1.1);*/
|
||||
background-image: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.1) 100%);
|
||||
}
|
||||
|
||||
/*
|
||||
.button.action:active {
|
||||
transform: scale(0.95);
|
||||
background-image: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%);
|
||||
}
|
||||
*/
|
||||
.button.action,
|
||||
.button.action .actions li,
|
||||
.button.action > i {
|
||||
transition: all 0.15s ease 0s;
|
||||
}
|
||||
|
||||
.button.action.active > i {
|
||||
transform: rotate(135deg);
|
||||
}
|
||||
|
||||
li.action div.action .button {
|
||||
margin: 0.5rem;
|
||||
|
@ -329,3 +342,34 @@ header.big ~ .button.action {
|
|||
right: calc(70% + 3rem);
|
||||
}
|
||||
}
|
||||
|
||||
.button.action .actions {
|
||||
position: absolute;
|
||||
bottom: 7rem;
|
||||
left: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.button.action .actions li {
|
||||
background-color: white;
|
||||
color: #888;
|
||||
font-size: 3rem;
|
||||
line-height: 6rem;
|
||||
margin: -4rem 0.5rem;
|
||||
width: 6rem;
|
||||
height: 6rem;
|
||||
padding: 0;
|
||||
opacity: 0;
|
||||
transition: all 0.15s ease 0s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.button.action.active .actions li {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
margin: 2rem 0.5rem;
|
||||
}
|
||||
|
||||
.button.action .actions li:hover {
|
||||
background-color: white;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue