diff options
| author | 2013-12-30 01:03:32 +0100 | |
|---|---|---|
| committer | 2013-12-30 01:03:32 +0100 | |
| commit | 92efd68a3a13e49fe7bbfb8441611c0dcd639415 (patch) | |
| tree | e6228848744b9369ad4e4e52c541075f5c723b6d /app/Controllers/feedController.php | |
| parent | 220341b40642771f9b5db97296edfb1913182464 (diff) | |
Début de mode multi-utilisateur avec http_auth
+ Légère optimisation de Minz_View.
+ Encore plus de tests de bibliothèques dans install.php
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126 et
https://github.com/marienfressinaud/FreshRSS/issues/303
Diffstat (limited to 'app/Controllers/feedController.php')
| -rwxr-xr-x | app/Controllers/feedController.php | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 42a0dcb11..2d7c0ab43 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -2,18 +2,17 @@ class FreshRSS_feed_Controller extends Minz_ActionController { public function firstAction () { - $token = $this->view->conf->token; - $token_param = Minz_Request::param ('token', ''); - $token_is_ok = ($token != '' && $token == $token_param); - $action = Minz_Request::actionName (); - - if (login_is_conf ($this->view->conf) && - !is_logged () && - !($token_is_ok && $action == 'actualize')) { - Minz_Error::error ( - 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) - ); + if (!$this->view->loginOk) { + $token = $this->view->conf->token; //TODO: check the token logic again, and if it is still needed + $token_param = Minz_Request::param ('token', ''); + $token_is_ok = ($token != '' && $token == $token_param); + $action = Minz_Request::actionName (); + if (!($token_is_ok && $action === 'actualize')) { + Minz_Error::error ( + 403, + array ('error' => array (Minz_Translate::t ('access_denied'))) + ); + } } $this->catDAO = new FreshRSS_CategoryDAO (); @@ -411,10 +410,8 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } private function addCategories ($categories) { - $catDAO = new FreshRSS_CategoryDAO (); - foreach ($categories as $cat) { - if (!$catDAO->searchByName ($cat->name ())) { + if (!$this->catDAO->searchByName ($cat->name ())) { $values = array ( 'id' => $cat->id (), 'name' => $cat->name (), |
