diff options
| author | 2013-12-28 00:04:34 +0100 | |
|---|---|---|
| committer | 2013-12-28 00:04:34 +0100 | |
| commit | 3273fee15e8d944debfaafd025c67c2ac514905d (patch) | |
| tree | 63dd4bf86fd1b0587cdfba279c1e98cbbd463937 | |
| parent | 48a1a36222ddcf1cb637302bdd09e2bcf9b15844 (diff) | |
Un peu de configuration utilisateur
Continue https://github.com/marienfressinaud/FreshRSS/issues/126
| -rw-r--r-- | app/i18n/en.php | 2 | ||||
| -rw-r--r-- | app/i18n/fr.php | 2 | ||||
| -rw-r--r-- | app/views/configure/users.phtml | 22 | ||||
| -rw-r--r-- | lib/Minz/Configuration.php | 3 |
4 files changed, 20 insertions, 9 deletions
diff --git a/app/i18n/en.php b/app/i18n/en.php index a1ab4a025..7c4f090ae 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -163,6 +163,8 @@ return array ( 'auth_token' => 'Authentication token', 'explain_token' => 'Allows to access RSS output without authentication.<br />%s?token=%s', 'login_configuration' => 'Login', + 'is_admin' => 'is administrator', + 'auth_type' => 'Authentication method', 'language' => 'Language', 'month' => 'months', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index f4e9d109c..9dff6dd33 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -163,6 +163,8 @@ return array ( 'auth_token' => 'Jeton d’identification', 'explain_token' => 'Permet d’accéder à la sortie RSS sans besoin de s’authentifier.<br />%s?output=rss&token=%s', 'login_configuration' => 'Identification', + 'is_admin' => 'est administrateur', + 'auth_type' => 'Méthode d’authentification', 'language' => 'Langue', 'month' => 'mois', diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml index a8e2deea1..81e551d95 100644 --- a/app/views/configure/users.phtml +++ b/app/views/configure/users.phtml @@ -7,14 +7,6 @@ <legend><?php echo Minz_Translate::t('users'); ?></legend> <div class="form-group"> - <label class="group-name" for="current_user">Current user</label> - <div class="group-controls"> - <input id="current_user" type="text" readonly="readonly" value="<?php echo Minz_Configuration::currentUser(); ?>" /> - <code>$_SERVER['REMOTE_USER'] = <?php echo isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : ''; ?></code> - </div> - </div> - - <div class="form-group"> <div class="group-controls"> <label class="checkbox" for="anon_access"> <input type="checkbox" name="anon_access" id="anon_access" value="yes"<?php echo $this->conf->anonAccess() == 'yes' ? ' checked="checked"' : ''; ?> /> @@ -24,7 +16,7 @@ </div> <div class="form-group"> - <label class="group-name" for="auth_type">Authentification method</label> + <label class="group-name" for="auth_type"><?php echo Minz_Translate::t('auth_type'); ?></label> <div class="group-controls"> <select id="auth_type" name="auth_type"> <option value="none">None (dangerous)</option> @@ -35,6 +27,18 @@ </div> </div> + <div class="form-group"> + <label class="group-name" for="current_user"><?php echo Minz_Translate::t('current_user'); ?></label> + <div class="group-controls"> + <input id="current_user" type="text" disabled="disabled" value="<?php echo Minz_Configuration::currentUser(); ?>" /> + <code>$_SERVER['REMOTE_USER'] = <?php echo isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : ''; ?></code> + <label class="checkbox" for="is_admin"> + <input type="checkbox" id="is_admin" disabled="disabled"<?php echo Minz_Configuration::isAdmin() ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t('is_admin'); ?> + </label> + </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> diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index 6c7206988..1e8058dc2 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -96,6 +96,9 @@ class Minz_Configuration { public static function currentUser () { return self::$current_user; } + public static function isAdmin () { + return self::$current_user === self::$default_user; + } /** * Initialise les variables de configuration |
