aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-08-21 16:04:18 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-08-21 16:04:18 +0200
commit54541608ac979dfc6044c89cb30493704dcc94c8 (patch)
tree68c73aebd62f59e0d86c04526732a37bfaf7db07 /app/views
parent456c95d2dbb40d358d79f426f68eb03f5f447945 (diff)
Fix issue #127 : ajout système de token
Ajout du système de token pour accéder aux flux RSS même quand la connexion a été paramétrée. Pour l'utiliser, il faut simplement ajouter le paramètre ?token=<votre_token> à l'url
Diffstat (limited to 'app/views')
-rw-r--r--app/views/configure/display.phtml9
-rw-r--r--app/views/index/index.phtml6
2 files changed, 14 insertions, 1 deletions
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml
index 1fdcdee41..3989ff06f 100644
--- a/app/views/configure/display.phtml
+++ b/app/views/configure/display.phtml
@@ -50,6 +50,15 @@
</label>
</div>
</div>
+
+ <div class="form-group">
+ <label class="group-name" for="token"><?php echo Translate::t ('auth_token'); ?></label>
+ <?php $token = $this->conf->token (); ?>
+ <div class="group-controls">
+ <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>"/>
+ <i class="icon i_help"></i> <?php echo Translate::t('explain_token', Url::display()); ?>
+ </div>
+ </div>
<legend><?php echo Translate::t ('reading_configuration'); ?></legend>
diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml
index 4bf82f9b4..73e5fcc4d 100644
--- a/app/views/index/index.phtml
+++ b/app/views/index/index.phtml
@@ -1,10 +1,14 @@
<?php
$output = Request::param ('output', 'normal');
+$token = $this->conf->token();
+$token_param = Request::param ('token', '');
+$token_is_ok = ($token != '' && $token == $token_param);
if(!login_is_conf ($this->conf) ||
is_logged() ||
- $this->conf->anonAccess() == 'yes') {
+ $this->conf->anonAccess() == 'yes' ||
+ ($output == 'rss' && $token_is_ok)) {
if($output == 'rss') {
$this->renderHelper ('view/rss_view');
} elseif($output == 'reader') {