diff options
| author | 2013-12-28 01:01:31 +0100 | |
|---|---|---|
| committer | 2013-12-28 01:01:31 +0100 | |
| commit | 8ffa896e68d05403cd65bd7b1ca3d4657347c10a (patch) | |
| tree | 56d1543df5d25b11669c29aabdb7be11206084f1 | |
| parent | 2063f967c63cab8bed30c8db44490a6531d4cb5d (diff) | |
Liste d'utilisateurs
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
| -rw-r--r-- | app/i18n/en.php | 7 | ||||
| -rw-r--r-- | app/i18n/fr.php | 7 | ||||
| -rw-r--r-- | app/views/configure/users.phtml | 16 | ||||
| -rw-r--r-- | lib/lib_rss.php | 12 |
4 files changed, 36 insertions, 6 deletions
diff --git a/app/i18n/en.php b/app/i18n/en.php index 7c4f090ae..c7ac16ae0 100644 --- a/app/i18n/en.php +++ b/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', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 9dff6dd33..e8da1c603 100644 --- a/app/i18n/fr.php +++ b/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', diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml index 81e551d95..e6bebc77c 100644 --- a/app/views/configure/users.phtml +++ b/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> diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 160a65bbf..c7698b5c5 100644 --- a/lib/lib_rss.php +++ b/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')); +} |
