Răsfoiți Sursa

Un peu de configuration utilisateur

Continue https://github.com/marienfressinaud/FreshRSS/issues/126
Alexandre Alapetite 12 ani în urmă
părinte
comite
3273fee15e
4 a modificat fișierele cu 20 adăugiri și 9 ștergeri
  1. 2 0
      app/i18n/en.php
  2. 2 0
      app/i18n/fr.php
  3. 13 9
      app/views/configure/users.phtml
  4. 3 0
      lib/Minz/Configuration.php

+ 2 - 0
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',

+ 2 - 0
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',

+ 13 - 9
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>

+ 3 - 0
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