aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-18 01:00:17 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-18 01:00:17 +0100
commit41033768c3eacbd564c3ec15455587e4f725a055 (patch)
tree461e38fa717d4ceec58e9caeab98e6f5ab5198ee /app
parentfb908d45577cd0f156104eb23b4b9859d40b6da2 (diff)
Mode anonyme pour connexion avec formulaire
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/361
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/usersController.php2
-rw-r--r--app/views/configure/users.phtml18
2 files changed, 5 insertions, 15 deletions
diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php
index 7e44b3d35..a044cd25b 100644
--- a/app/Controllers/usersController.php
+++ b/app/Controllers/usersController.php
@@ -57,8 +57,8 @@ class FreshRSS_users_Controller extends Minz_ActionController {
$auth_type = Minz_Request::param('auth_type', 'none');
if ($anon != Minz_Configuration::allowAnonymous() ||
$auth_type != Minz_Configuration::authType()) {
- Minz_Configuration::_allowAnonymous($anon);
Minz_Configuration::_authType($auth_type);
+ Minz_Configuration::_allowAnonymous($anon);
$ok &= Minz_Configuration::writeFile();
}
}
diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml
index 602dfaf62..3f352f9bf 100644
--- a/app/views/configure/users.phtml
+++ b/app/views/configure/users.phtml
@@ -58,20 +58,11 @@
</div>
</div>
- <div class="form-group form-actions">
- <div class="group-controls">
- <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button>
- <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button>
- </div>
- </div>
-
- <?php if (Minz_Configuration::authType() === 'persona') { ?>
-
- <legend>Mozilla Persona</legend>
<div class="form-group">
<div class="group-controls">
<label class="checkbox" for="anon_access">
- <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : ''; ?> />
+ <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : '',
+ Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> />
<?php echo Minz_Translate::t('allow_anonymous', Minz_Configuration::defaultUser()); ?>
</label>
</div>
@@ -81,7 +72,8 @@
<label class="group-name" for="token"><?php echo Minz_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 Minz_Translate::t('blank_to_disable'); ?>"/>
+ <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php
+ echo Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> />
<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
</div>
</div>
@@ -92,8 +84,6 @@
<button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button>
</div>
</div>
-
- <?php } ?>
</form>
<form method="post" action="<?php echo _url('users', 'delete'); ?>">