diff options
| author | 2013-04-13 15:58:18 +0200 | |
|---|---|---|
| committer | 2013-04-13 15:58:18 +0200 | |
| commit | 650a04458a8733fb776f39bc7016444725b04dff (patch) | |
| tree | ed0e1e51af94d3e7936c058cfd2892b7d7fa7d52 | |
| parent | 9b9543109e36a5409fe71eb084cfac680dfc7cbd (diff) | |
On ne récupère plus le script persona si le login n'est pas configuré
| -rw-r--r-- | app/App_FrontController.php | 29 | ||||
| -rwxr-xr-x | app/controllers/feedController.php | 5 |
2 files changed, 21 insertions, 13 deletions
diff --git a/app/App_FrontController.php b/app/App_FrontController.php index b7b060418..5a66ae1dd 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -9,20 +9,20 @@ class App_FrontController extends FrontController { public function init () { $this->loadLibs (); $this->loadModels (); - + Session::init (); // lancement de la session doit se faire après chargement des modèles sinon bug (pourquoi ?) $this->loadParamsView (); $this->loadStylesAndScripts (); $this->loadNotifications (); } - + private function loadLibs () { require (LIB_PATH . '/lib_phpQuery.php'); require (LIB_PATH . '/lib_rss.php'); require (LIB_PATH . '/SimplePie_autoloader.php'); require (LIB_PATH . '/lib_text.php'); } - + private function loadModels () { include (APP_PATH . '/models/Exception/FeedException.php'); include (APP_PATH . '/models/RSSConfiguration.php'); @@ -31,22 +31,25 @@ class App_FrontController extends FrontController { include (APP_PATH . '/models/Feed.php'); include (APP_PATH . '/models/Entry.php'); } - + + private function loadParamsView () { + $this->conf = Session::param ('conf', new RSSConfiguration ()); + View::_param ('conf', $this->conf); + + $entryDAO = new EntryDAO (); + View::_param ('nb_not_read', $entryDAO->countNotRead ()); + } + private function loadStylesAndScripts () { View::appendStyle (Url::display ('/theme/global.css')); View::appendStyle (Url::display ('/theme/freshrss.css')); - View::appendScript ('https://login.persona.org/include.js'); + if (login_is_conf ($this->conf)) { + View::appendScript ('https://login.persona.org/include.js'); + } View::appendScript (Url::display ('/scripts/jquery.js')); View::appendScript (Url::display ('/scripts/notification.js')); } - - private function loadParamsView () { - View::_param ('conf', Session::param ('conf', new RSSConfiguration ())); - - $entryDAO = new EntryDAO (); - View::_param ('nb_not_read', $entryDAO->countNotRead ()); - } - + private function loadNotifications () { $notif = Session::param ('notification'); if ($notif) { diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 83fc19e20..73921e215 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -161,6 +161,11 @@ class feedController extends ActionController { Session::_param ('notification', $notif); Request::forward (array (), true); } else { + $notif = array ( + 'type' => 'good', + 'content' => 'Les flux ont été mis à jour' + ); + Session::_param ('notification', $notif); $this->view->_useLayout (false); } } |
