Преглед на файлове

Liste d'utilisateurs

Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
Alexandre Alapetite преди 12 години
родител
ревизия
8ffa896e68
променени са 4 файла, в които са добавени 36 реда и са изтрити 6 реда
  1. 4 3
      app/i18n/en.php
  2. 4 3
      app/i18n/fr.php
  3. 16 0
      app/views/configure/users.phtml
  4. 12 0
      lib/lib_rss.php

+ 4 - 3
app/i18n/en.php

@@ -162,9 +162,10 @@ return array (
 	'allow_anonymous'		=> 'Allow anonymous reading',
 	'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',
+	'login_configuration'		=> 'Login',
+	'is_admin'			=> 'is administrator',
+	'auth_type'			=> 'Authentication method',
+	'users_list'			=> 'List of users',
 
 	'language'			=> 'Language',
 	'month'				=> 'months',

+ 4 - 3
app/i18n/fr.php

@@ -162,9 +162,10 @@ return array (
 	'allow_anonymous'		=> 'Autoriser la lecture anonyme',
 	'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',
+	'login_configuration'		=> 'Identification',
+	'is_admin'			=> 'est administrateur',
+	'auth_type'			=> 'Méthode d’authentification',
+	'users_list'			=> 'Liste des utilisateurs',
 
 	'language'			=> 'Langue',
 	'month'				=> 'mois',

+ 16 - 0
app/views/configure/users.phtml

@@ -39,6 +39,22 @@
 			</div>
 		</div>
 
+		<?php if (Minz_Configuration::isAdmin()) { ?>
+
+		<div class="form-group">
+			<label class="group-name" for="users_list"><?php echo Minz_Translate::t('users_list'); ?></label>
+			<div class="group-controls">
+				<select id="users_list" name="users_list"><?php
+					foreach (listUsers() as $user) {
+						echo '<option>', $user, '</option>';
+					}
+				?></select>
+				(not implemented yet)
+			</div>
+		</div>
+
+		<?php } ?>
+
 		<div class="form-group form-actions">
 			<div class="group-controls">
 				<button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button>

+ 12 - 0
lib/lib_rss.php

@@ -176,3 +176,15 @@ function uSecString() {
 function invalidateHttpCache() {
 	file_put_contents(DATA_PATH . '/touch.txt', uTimeString());
 }
+
+function usernameFromPath($userPath) {
+	if (preg_match('%/([a-z0-9]{1,16})_user\.php$%', $userPath, $matches)) {
+		return $matches[1];
+	} else {
+		return '';
+	}
+}
+
+function listUsers() {
+	return array_map('usernameFromPath', glob(DATA_PATH . '/*_user.php'));
+}