summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-06 23:29:20 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-06 23:29:20 +0200
commit79aa5beaf44af13a1828bfa5fc824a08c62054dc (patch)
tree53841c4ba4af03498c9005ced85cd1996cb9ca9b /app/views
parent530a1d4b6b043f6b6976bb7ad25b380c29d5b5a4 (diff)
Refactor authentication system.
Big work, not finished. A lot of features have been removed. See https://github.com/marienfressinaud/FreshRSS/issues/655
Diffstat (limited to 'app/views')
-rw-r--r--app/views/helpers/view/normal_view.phtml6
-rw-r--r--app/views/index/index.phtml2
-rw-r--r--app/views/index/login.phtml1
-rw-r--r--app/views/index/logout.phtml1
-rw-r--r--app/views/index/resetAuth.phtml33
5 files changed, 4 insertions, 39 deletions
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml
index 109fad0eb..db25714bb 100644
--- a/app/views/helpers/view/normal_view.phtml
+++ b/app/views/helpers/view/normal_view.phtml
@@ -7,7 +7,7 @@ if (!empty($this->entries)) {
$display_today = true;
$display_yesterday = true;
$display_others = true;
- if ($this->loginOk) {
+ if (FreshRSS_Auth::hasAccess()) {
$sharing = $this->conf->sharing;
} else {
$sharing = array();
@@ -58,7 +58,7 @@ if (!empty($this->entries)) {
}
?><div class="flux<?php echo !$item->isRead() ? ' not_read' : ''; ?><?php echo $item->isFavorite() ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id(); ?>">
<ul class="horizontal-list flux_header"><?php
- if ($this->loginOk) {
+ if (FreshRSS_Auth::hasAccess()) {
if ($topline_read) {
?><li class="item manage"><?php
$arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id()));
@@ -103,7 +103,7 @@ if (!empty($this->entries)) {
?>
</div>
<ul class="horizontal-list bottom"><?php
- if ($this->loginOk) {
+ if (FreshRSS_Auth::hasAccess()) {
if ($bottomline_read) {
?><li class="item manage"><?php
$arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id()));
diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml
index 584792e29..a59063557 100644
--- a/app/views/index/index.phtml
+++ b/app/views/index/index.phtml
@@ -2,7 +2,7 @@
$output = Minz_Request::param('output', 'normal');
-if ($this->loginOk || Minz_Configuration::allowAnonymous()) {
+if (FreshRSS_Auth::hasAccess() || Minz_Configuration::allowAnonymous()) {
if ($output === 'normal') {
$this->renderHelper('view/normal_view');
} elseif ($output === 'reader') {
diff --git a/app/views/index/login.phtml b/app/views/index/login.phtml
deleted file mode 100644
index 79fbe9d21..000000000
--- a/app/views/index/login.phtml
+++ /dev/null
@@ -1 +0,0 @@
-<?php print_r($this->res); ?>
diff --git a/app/views/index/logout.phtml b/app/views/index/logout.phtml
deleted file mode 100644
index a0aba9318..000000000
--- a/app/views/index/logout.phtml
+++ /dev/null
@@ -1 +0,0 @@
-OK \ No newline at end of file
diff --git a/app/views/index/resetAuth.phtml b/app/views/index/resetAuth.phtml
deleted file mode 100644
index 6d4282c14..000000000
--- a/app/views/index/resetAuth.phtml
+++ /dev/null
@@ -1,33 +0,0 @@
-<div class="prompt">
- <h1><?php echo _t('auth_reset'); ?></h1>
-
- <?php if (!empty($this->message)) { ?>
- <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>">
- <span class="alert-head"><?php echo $this->message['title']; ?></span><br />
- <?php echo $this->message['body']; ?>
- </p>
- <?php } ?>
-
- <?php if (!$this->no_form) { ?>
- <form id="crypto-form" method="post" action="<?php echo _url('index', 'resetAuth'); ?>">
- <p class="alert alert-warn">
- <span class="alert-head"><?php echo _t('attention'); ?></span><br />
- <?php echo _t('auth_will_reset'); ?>
- </p>
-
- <div>
- <label for="username"><?php echo _t('username_admin'); ?></label>
- <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" />
- </div>
- <div>
- <label for="passwordPlain"><?php echo _t('password'); ?></label>
- <input type="password" id="passwordPlain" required="required" />
- <input type="hidden" id="challenge" name="challenge" /><br />
- <noscript><strong><?php echo _t('javascript_should_be_activated'); ?></strong></noscript>
- </div>
- <div>
- <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('submit'); ?></button>
- </div>
- </form>
- <?php } ?>
-</div>