aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-07 16:37:10 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-07 16:37:10 +0200
commit1252b3dd867e59917cf303f0c39c7da938b8ce32 (patch)
tree4997fc8d5b6d5451d1869104546060b9eadb6fb1 /app/views
parent6009990935a2d06c252073f6b51ea5378536ef52 (diff)
Authentication system moved + Persona comes back!
AuthController is dedicated to auhentication. Persona is back, greater than ever! See https://github.com/marienfressinaud/FreshRSS/issues/655
Diffstat (limited to 'app/views')
-rw-r--r--app/views/auth/formLogin.phtml (renamed from app/views/index/formLogin.phtml)24
-rw-r--r--app/views/auth/logout.phtml0
-rw-r--r--app/views/auth/personaLogin.phtml24
-rw-r--r--app/views/helpers/javascript_vars.phtml13
4 files changed, 38 insertions, 23 deletions
diff --git a/app/views/index/formLogin.phtml b/app/views/auth/formLogin.phtml
index b05cdced4..0194a11a5 100644
--- a/app/views/index/formLogin.phtml
+++ b/app/views/auth/formLogin.phtml
@@ -1,9 +1,7 @@
<div class="prompt">
- <h1><?php echo _t('login'); ?></h1><?php
+ <h1><?php echo _t('login'); ?></h1>
- switch (Minz_Configuration::authType()) {
- case 'form':
- ?><form id="crypto-form" method="post" action="<?php echo _url('index', 'formLogin'); ?>">
+ <form id="crypto-form" method="post" action="<?php echo _url('auth', 'login'); ?>">
<div>
<label for="username"><?php echo _t('username'); ?></label>
<input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" />
@@ -24,23 +22,7 @@
<div>
<button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('login'); ?></button>
</div>
- </form><?php
- break;
-
- case 'persona':
- ?><p>
- <a class="signin btn btn-important" href="#">
- <?php echo _i('login'); ?>
- <?php echo _t('login_with_persona'); ?>
- </a><br /><br />
-
- <?php echo _i('help'); ?>
- <small>
- <a href="<?php echo _url('index', 'resetAuth'); ?>"><?php echo _t('login_persona_problem'); ?></a>
- </small>
- </p><?php
- break;
- } ?>
+ </form>
<p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a></p>
</div>
diff --git a/app/views/auth/logout.phtml b/app/views/auth/logout.phtml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/app/views/auth/logout.phtml
diff --git a/app/views/auth/personaLogin.phtml b/app/views/auth/personaLogin.phtml
new file mode 100644
index 000000000..d62fe5818
--- /dev/null
+++ b/app/views/auth/personaLogin.phtml
@@ -0,0 +1,24 @@
+<?php if ($this->res === false) { ?>
+<div class="prompt">
+ <h1><?php echo _t('login'); ?></h1>
+
+ <p>
+ <a class="signin btn btn-important" href="<?php echo _url('auth', 'login'); ?>">
+ <?php echo _i('login'); ?> <?php echo _t('login_with_persona'); ?>
+ </a>
+
+ <br /><br />
+
+ <?php echo _i('help'); ?>
+ <small>
+ <a href="<?php echo _url('auth', 'resetAuth'); ?>"><?php echo _t('login_persona_problem'); ?></a>
+ </small>
+ </p>
+
+ <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a></p>
+</div>
+<?php
+} else {
+ echo json_encode($this->res);
+}
+?>
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 8f615ed87..3bbcc3848 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -8,6 +8,15 @@ $hide_posts = ($this->conf->display_posts ||
Minz_Request::param('output') === 'reader');
$s = $this->conf->shortcuts;
+$url_login = Minz_Url::display(array(
+ 'c' => 'auth',
+ 'a' => 'login'
+), 'php');
+$url_logout = Minz_Url::display(array(
+ 'c' => 'auth',
+ 'a' => 'logout'
+), 'php');
+
echo 'var context={',
'hide_posts:', $hide_posts ? 'false' : 'true', ',',
'display_order:"', Minz_Request::param('order', $this->conf->sort_order), '",',
@@ -43,8 +52,8 @@ echo 'shortcuts={',
echo 'url={',
'index:"', _url('index', 'index'), '",',
- 'login:"', _url('index', 'login'), '",',
- 'logout:"', _url('index', 'logout'), '",',
+ 'login:"', $url_login, '",',
+ 'logout:"', $url_logout, '",',
'help:"', FRESHRSS_WIKI, '"',
"},\n";