Browse Source

- Fix the RPC filter

pull/16/head
Jaussoin Timothée 13 years ago
parent
commit
4cd7d8b487
  1. 50
      app/controllers/ControllerMain.php
  2. 4
      app/widgets/ContactSummary/ContactSummary.php
  3. 15
      app/widgets/Login/Login.php
  4. 3
      app/widgets/Notifs/notifs.css
  5. 2
      app/widgets/Roster/Roster.php
  6. 8
      system/RPC.php
  7. 1
      system/Route.php
  8. 2
      themes/movim/main.tpl

50
app/controllers/ControllerMain.php

@ -277,6 +277,22 @@ class ControllerMain extends ControllerBase
}
}
function loading()
{
$user = new User();
if(!$user->isLogged()) {
$this->login();
} else {
$this->page->setTitle(t('%s - Loading', APP_TITLE));
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('loading.tpl'));
echo $this->page->build('page.tpl');
}
}
/**
* Show login interface
*/
@ -307,11 +323,11 @@ class ControllerMain extends ControllerBase
{
$user = new User();
$this->page->setTitle(t('%s - Explore', APP_TITLE));
if(!$user->isLogged()) {
if(!$user->isLogged())
$this->login();
} else {
else {
$this->page->setTitle(t('%s - Explore', APP_TITLE));
$this->page->menuAddLink(t('Home'), 'main');
$this->page->menuAddLink(t('Explore'), 'explore', true);
$this->page->menuAddLink(t('Profile'), 'profile');
@ -319,11 +335,11 @@ class ControllerMain extends ControllerBase
$this->page->menuAddLink(t('Configuration'), 'conf');
$this->page->menuAddLink(t('Help'), 'help');
$this->page->menuAddLink(t('Logout'), 'disconnect');
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('explore.tpl'));
echo $this->page->build('page.tpl');
}
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('explore.tpl'));
echo $this->page->build('page.tpl');
}
@ -334,12 +350,11 @@ class ControllerMain extends ControllerBase
{
$user = new User();
$this->page->setTitle(t('%s - Help Page', APP_TITLE));
if(!$user->isLogged()) {
if(!$user->isLogged())
$this->login();
} else {
else {
$this->page->setTitle(t('%s - Help Page', APP_TITLE));
$this->page->menuAddLink(t('Home'), 'main');
$this->page->menuAddLink(t('Explore'), 'explore');
$this->page->menuAddLink(t('Profile'), 'profile');
@ -347,12 +362,11 @@ class ControllerMain extends ControllerBase
$this->page->menuAddLink(t('Configuration'), 'conf');
$this->page->menuAddLink(t('Help'), 'help', true);
$this->page->menuAddLink(t('Logout'), 'disconnect');
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('help.tpl'));
echo $this->page->build('page.tpl');
}
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('help.tpl'));
echo $this->page->build('page.tpl');
}
/*

4
app/widgets/ContactSummary/ContactSummary.php

@ -95,7 +95,9 @@ class ContactSummary extends WidgetCommon
$contact = new modl\Contact();
echo $this->prepareContactSummary($contact);
?>
<script type="text/javascript">setTimeout("<?php $this->callAjax('ajaxRefreshVcard', "'".$_GET['f']."'");?>", 1000);</script>
<script type="text/javascript">
setTimeout("<?php $this->callAjax('ajaxRefreshVcard', "'".$_GET['f']."'");?>", 1000);
</script>
<?php } ?>
</div>
<?php

15
app/widgets/Login/Login.php

@ -227,8 +227,21 @@ class Login extends WidgetBase {
$pd = new modl\PresenceDAO();
$pd->clearPresence($element['login']);
/*global $session;
$session['login'] = true;
moxl\ping();
$cached = \Cache::c('moxlcache');
$session['login'] = false;
$sess = \Session::start(APP_NAME);
$sess->set('session', $session);
RPC::call('movim_redirect', Route::urlize('main'));
if(!empty($cached))
RPC::call('movim_redirect', Route::urlize('loading'));
else*/
RPC::call('movim_redirect', Route::urlize('main'));
RPC::commit();
}

3
app/widgets/Notifs/notifs.css

@ -6,7 +6,8 @@
transition: right 0.5s ease;
background-color: #242424;
margin: 0em -1em;
margin-top: 1em;
margin-top: 3em;
clear: both;
}
#notifslist li {

2
app/widgets/Roster/Roster.php

@ -47,8 +47,6 @@ class Roster extends WidgetBase
$group = t('Ungrouped');
else
$group = $c->group;
\movim_log('group'.$group.' '.$html);
RPC::call('movim_delete', 'roster'.$arr['jid']);
RPC::call('movim_append', 'group'.$group, $html);

8
system/RPC.php

@ -32,14 +32,16 @@ class RPC
$args = array_map('trim', $args);
//if(self::filter($funcname, $args)) {
if(self::filter($funcname, $args)) {
$funcall = array(
'func' => $funcname,
'params' => $args,
);
self::$funcalls[] = $funcall;
//}
} else {
Logger::log('RPC cleaning system : '.$funcname.', '.$args[0].' cleared');
}
}
/**
@ -51,7 +53,7 @@ class RPC
if(isset($f['func']) &&
isset($f['params']) &&
$f['func'] == $funcname &&
$f['params'][0] == $args[0])
$f['params'] === $args)
return false;
}

1
system/Route.php

@ -8,6 +8,7 @@ class Route extends ControllerBase {
'account' => array('err'),
'chatpop' => false,
'main' => false,
'loading' => false,
'admin' => false,
'explore' => false,
'profile' => false,

2
themes/movim/main.tpl

@ -9,8 +9,8 @@
<div id="main">
<div id="left">
<?php $this->widget('Profile');?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Bookmark');?>
<?php $this->widget('Notifs');?>
<?php $this->widget('ProfileData');?>
</div>

Loading…
Cancel
Save