A free, self-hostable news aggregator…
Un peu de configuration utilisateur
Alexandre Alapetite3273fee15e8d
diff --git a/app/i18n/en.php b/app/i18n/en.phpindex 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.phpindex 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.phtmlindex a8e2deea1..81e551d95 100644--- a/app/views/configure/users.phtml+++ b/app/views/configure/users.phtml@@ -6,14 +6,6 @@<form method="post" action="<?php echo _url('configure', 'users'); ?>"><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">@@ -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.phpindex 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