diff options
| author | 2013-12-31 02:59:07 +0100 | |
|---|---|---|
| committer | 2013-12-31 02:59:07 +0100 | |
| commit | 1ac09e7fe4a5408290d06116c6fb8152e018fe26 (patch) | |
| tree | e5f4b3eb7654e0364670a4f180fc5d92f51b0309 /app/views | |
| parent | 84be5ff618a59c510db7627c9b6447835f4364c7 (diff) | |
Multi-utilisateur fonctionnel en HTTP Auth
+ Possibilité d'ajout / suppression d'utilisateur (seulement par
l'administrateur)
+ Divers changements pour le mode multi-utilisateur
https://github.com/marienfressinaud/FreshRSS/issues/126
+ Minz : Renomme "sel_application" en "salt'
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/configure/archiving.phtml | 23 | ||||
| -rw-r--r-- | app/views/configure/users.phtml | 91 |
2 files changed, 91 insertions, 23 deletions
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 0a68eb76c..cbe3b086c 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -6,7 +6,7 @@ <form method="post" action="<?php echo _url('configure', 'archiving'); ?>"> <legend><?php echo Minz_Translate::t('archiving_configuration'); ?></legend> <p><?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('archiving_configuration_help'); ?></p> - + <div class="form-group"> <label class="group-name" for="old_entries"><?php echo Minz_Translate::t('delete_articles_every'); ?></label> <div class="group-controls"> @@ -31,17 +31,28 @@ <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> </div> </div> + </form> + <form method="post" action="<?php echo _url('entry', 'optimize'); ?>"> <legend><?php echo Minz_Translate::t ('advanced'); ?></legend> + <div class="form-group"> - <label class="group-name"></label> + <p class="group-name"><?php echo Minz_Translate::t('current_user'); ?></p> <div class="group-controls"> - <p><?php echo $this->nb_total; ?> <?php echo Minz_Translate::t('articles') ?>, <?php echo formatBytes($this->size_total); ?>.</p> - <p><a class="btn" href="<?php echo _url('entry', 'optimize'); ?>"> - <?php echo Minz_Translate::t('optimize_bdd'); ?> - </a></p> + <p><?php echo $this->nb_total, ' ', Minz_Translate::t('articles'), ', ', formatBytes($this->size_user); ?></p> + <input type="hidden" name="optimiseDatabase" value="1" /> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('optimize_bdd'); ?></button> <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('optimize_todo_sometimes'); ?> </div> </div> + + <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> + <div class="form-group"> + <p class="group-name"><?php echo Minz_Translate::t('users'); ?></p> + <div class="group-controls"> + <p><?php echo formatBytes($this->size_total); ?></p> + </div> + </div> + <?php } ?> </form> </div> diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml index cb6579a6b..223f81e8d 100644 --- a/app/views/configure/users.phtml +++ b/app/views/configure/users.phtml @@ -3,16 +3,15 @@ <div class="post"> <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a> - <form method="post" action="<?php echo _url('configure', 'users'); ?>"> + <form method="post" action="<?php echo _url('users', 'id'); ?>"> <legend><?php echo Minz_Translate::t('login_configuration'); ?></legend> <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_Session::param('currentUser', '_'); ?>" /> - <code>$_SERVER['REMOTE_USER'] = <?php echo httpAuthUser(); ?></code> <label class="checkbox" for="is_admin"> - <input type="checkbox" id="is_admin" disabled="disabled"<?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? ' checked="checked"' : ''; ?> /> + <input type="checkbox" id="is_admin" disabled="disabled" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? 'checked="checked" ' : ''; ?>/> <?php echo Minz_Translate::t('is_admin'); ?> </label> </div> @@ -22,21 +21,25 @@ <label class="group-name" for="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> <?php $mail = $this->conf->mail_login; ?> <div class="group-controls"> - <input type="email" id="mail_login" name="mail_login" value="<?php echo $mail ? $mail : ''; ?>" placeholder="alice@example.net" /> + <input type="email" id="mail_login" name="mail_login" value="<?php echo $mail; ?>" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" /> <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> </div> </div> + <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> <div class="form-group form-actions"> <div class="group-controls"> <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> </div> </div> + <?php } ?> + </form> - <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> + <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> - <legend><?php echo Minz_Translate::t('users'); ?></legend> + <form method="post" action="<?php echo _url('users', 'auth'); ?>"> + <legend><?php echo Minz_Translate::t('auth_type'); ?></legend> <div class="form-group"> <label class="group-name" for="auth_type"><?php echo Minz_Translate::t('auth_type'); ?></label> @@ -46,17 +49,7 @@ <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>>HTTP Auth</option> <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : ''; ?>>Mozilla Persona</option> </select> - </div> - </div> - - <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> + <code>$_SERVER['REMOTE_USER'] = `<?php echo httpAuthUser(); ?>`</code> </div> </div> @@ -67,6 +60,8 @@ </div> </div> + <?php if (Minz_Configuration::authType() === 'persona') { ?> + <legend>Mozilla Persona</legend> <div class="form-group"> <div class="group-controls"> @@ -95,4 +90,66 @@ <?php } ?> </form> + + <form method="post" action="<?php echo _url('users', 'delete'); ?>"> + <legend><?php echo Minz_Translate::t('users'); ?></legend> + + <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="username"><?php + foreach (listUsers() as $user) { + echo '<option>', $user, '</option>'; + } + ?></select> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-attention confirm"><?php echo Minz_Translate::t('delete'); ?></button> + </div> + </div> + </form> + + <form method="post" action="<?php echo _url('users', 'create'); ?>"> + <legend><?php echo Minz_Translate::t('create_user'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="new_user_language"><?php echo Minz_Translate::t ('language'); ?></label> + <div class="group-controls"> + <select name="new_user_language" id="new_user_language"> + <?php $languages = $this->conf->availableLanguages (); ?> + <?php foreach ($languages as $short => $lib) { ?> + <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_name"><?php echo Minz_Translate::t('username'); ?></label> + <div class="group-controls"> + <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" placeholder="demo" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_email"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> + <?php $mail = $this->conf->mail_login; ?> + <div class="group-controls"> + <input type="email" id="new_user_email" name="new_user_email" placeholder="alice@example.net" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('create'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> + </div> + </div> + + </form> + + <?php } ?> </div> |
