summaryrefslogtreecommitdiff
path: root/app/views/index
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/views/index
parent41033768c3eacbd564c3ec15455587e4f725a055 (diff)
Corrections mode anonyme avec formulaire
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/361
Diffstat (limited to 'app/views/index')
-rw-r--r--app/views/index/formLogin.phtml43
-rw-r--r--app/views/index/index.phtml4
2 files changed, 45 insertions, 2 deletions
diff --git a/app/views/index/formLogin.phtml b/app/views/index/formLogin.phtml
new file mode 100644
index 000000000..e4a24f9ed
--- /dev/null
+++ b/app/views/index/formLogin.phtml
@@ -0,0 +1,43 @@
+<div class="post content">
+
+<?php
+if (Minz_Configuration::canLogIn()) {
+ ?><h1><?php echo Minz_Translate::t('login'); ?></h1><?php
+ switch (Minz_Configuration::authType()) {
+
+ case 'form':
+ ?><form id="loginForm" method="post" action="<?php echo _url('index', 'formLogin'); ?>">
+ <div class="form-group">
+ <label class="group-name" for="username"><?php echo Minz_Translate::t('username'); ?></label>
+ <div class="group-controls">
+ <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" />
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password'); ?></label>
+ <div class="group-controls">
+ <input type="password" id="passwordPlain" required="required" />
+ <input type="hidden" id="challenge" name="challenge" />
+ <noscript><strong><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></strong></noscript>
+ </div>
+ </div>
+ <div class="form-group form-actions">
+ <div class="group-controls">
+ <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button>
+ </div>
+ </div>
+ </form><?php
+ break;
+
+ case 'persona':
+ ?><p><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="#"><?php echo Minz_Translate::t('login'); ?></a></p><?php
+ break;
+ }
+} else {
+ ?><h1>FreshRSS</h1>
+ <p><?php echo Minz_Translate::t('forbidden_access', Minz_Configuration::authType()); ?></p><?php
+}
+?>
+
+ <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo Minz_Translate::t('about_freshrss'); ?></a></p>
+</div>
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);
}