aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-18 01:38:11 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-18 01:38:11 +0100
commitdda7b002def51405bab82bd4a31fc3ad8c33c572 (patch)
treea549a0c10eaffd49491c7f68999fdaa7d6d698ca /app
parent41033768c3eacbd564c3ec15455587e4f725a055 (diff)
Corrections mode anonyme avec formulaire
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/361
Diffstat (limited to 'app')
-rwxr-xr-xapp/Controllers/indexController.php4
-rw-r--r--app/layout/header.phtml17
-rw-r--r--app/views/index/formLogin.phtml (renamed from app/views/helpers/view/login.phtml)0
-rw-r--r--app/views/index/index.phtml4
4 files changed, 16 insertions, 9 deletions
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index 772a08f30..d05a106bb 100755
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -296,7 +296,6 @@ class FreshRSS_index_Controller extends Minz_ActionController {
}
public function formLoginAction () {
- $this->view->_useLayout (false);
if (Minz_Request::isPost()) {
$ok = false;
$nonce = Minz_Session::param('nonce');
@@ -327,9 +326,10 @@ class FreshRSS_index_Controller extends Minz_ActionController {
);
Minz_Session::_param('notification', $notif);
}
+ $this->view->_useLayout(false);
+ Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true);
}
invalidateHttpCache();
- Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true);
}
public function formLogoutAction () {
diff --git a/app/layout/header.phtml b/app/layout/header.phtml
index e90da6196..d43f682b0 100644
--- a/app/layout/header.phtml
+++ b/app/layout/header.phtml
@@ -90,9 +90,16 @@ if (Minz_Configuration::canLogIn()) {
</ul>
</div>
</div>
- <?php }/* elseif (Minz_Configuration::authType() === 'persona') { ?>
- <div class="item configure">
- <?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a>
- </div>
- <?php }*/ ?>
+ <?php } elseif (Minz_Configuration::canLogIn()) {
+ ?><div class="item configure"><?php
+ switch (Minz_Configuration::authType()) {
+ case 'form':
+ echo FreshRSS_Themes::icon('login'); ?><a class="signin" href="<?php echo _url ('index', 'formLogin'); ?>"><?php echo Minz_Translate::t ('login'); ?></a></li><?php
+ break;
+ case 'persona':
+ echo FreshRSS_Themes::icon('login'); ?><a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a></li><?php
+ break;
+ }
+ ?></div><?php
+ } ?>
</div>
diff --git a/app/views/helpers/view/login.phtml b/app/views/index/formLogin.phtml
index e4a24f9ed..e4a24f9ed 100644
--- a/app/views/helpers/view/login.phtml
+++ b/app/views/index/formLogin.phtml
diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml
index 9b69233e9..9a7c9f3b9 100644
--- a/app/views/index/index.phtml
+++ b/app/views/index/index.phtml
@@ -21,8 +21,8 @@ if ($this->loginOk || Minz_Configuration::allowAnonymous()) {
if ($token_is_ok) {
$this->renderHelper ('view/rss_view');
} else {
- $this->renderHelper ('view/login');
+ Minz_Request::forward(array('c' => 'index', 'a' => 'formLogin'), true);
}
} else {
- $this->renderHelper ('view/login');
+ Minz_Request::forward(array('c' => 'index', 'a' => 'formLogin'), true);
}