summaryrefslogtreecommitdiff
path: root/app/views/index/index.phtml
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-30 01:03:32 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-30 01:03:32 +0100
commit92efd68a3a13e49fe7bbfb8441611c0dcd639415 (patch)
treee6228848744b9369ad4e4e52c541075f5c723b6d /app/views/index/index.phtml
parent220341b40642771f9b5db97296edfb1913182464 (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/views/index/index.phtml')
-rw-r--r--app/views/index/index.phtml45
1 files changed, 27 insertions, 18 deletions
diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml
index 4db53e2a5..549d0b61e 100644
--- a/app/views/index/index.phtml
+++ b/app/views/index/index.phtml
@@ -1,29 +1,38 @@
<?php
+function showForbidden() {
+?><div class="post content">
+ <h1><?php echo Minz_Translate::t ('forbidden_access'); ?></h1>
+ <p><?php echo Minz_Configuration::canLogIn() ?
+ Minz_Translate::t ('forbidden_access_description') :
+ Minz_Translate::t ('forbidden_access') . ' (' . Minz_Configuration::authType() . ')'; ?></p>
+ <p><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></p>
+</div><?php
+}
+
$output = Minz_Request::param ('output', 'normal');
-$token = $this->conf->token;
-$token_param = Minz_Request::param ('token', '');
-$token_is_ok = ($token != '' && $token == $token_param);
-if(!login_is_conf ($this->conf) ||
- is_logged() ||
- Minz_Configuration::allowAnonymous() ||
- ($output == 'rss' && $token_is_ok)) {
- if($output == 'rss') {
+if ($this->loginOk || Minz_Configuration::allowAnonymous()) {
+ if ($output === 'normal') {
+ $this->renderHelper ('view/normal_view');
+ } elseif ($output === 'rss') {
$this->renderHelper ('view/rss_view');
- } elseif($output == 'reader') {
+ } elseif ($output === 'reader') {
$this->renderHelper ('view/reader_view');
- } elseif($output == 'global') {
+ } elseif ($output === 'global') {
$this->renderHelper ('view/global_view');
} else {
$this->renderHelper ('view/normal_view');
}
+} elseif ($output === 'rss') {
+ $token = $this->conf->token;
+ $token_param = Minz_Request::param ('token', '');
+ $token_is_ok = ($token != '' && $token == $token_param);
+ if ($token_is_ok) {
+ $this->renderHelper ('view/rss_view');
+ } else {
+ showForbidden();
+ }
} else {
-?>
-<div class="post content">
- <h1><?php echo Minz_Translate::t ('forbidden_access'); ?></h1>
- <p><?php echo Minz_Translate::t ('forbidden_access_description'); ?></p>
- <p><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></p>
-</div>
-<?php
-} \ No newline at end of file
+ showForbidden();
+}