2013-09-17 00:03:26 +02:00
{include="header"}
{if condition="$view == 'list_users'"}
< h2 > List des utilisateurs< / h2 >
< p class = "center" > Vous pouvez également < a href = "?do=add_user" > ajouter un utilisateur< / a > .< / p >
< table id = "edit_users" >
< tr >
< th > Id< / th >
< th > Identifiant< / th >
< th > Nom affiché< / th >
2013-09-28 19:31:27 +02:00
< th > Adresse e-mail< / th >
2013-09-17 00:03:26 +02:00
< th > Administrateur ?< / th >
< th > Modifier< / th >
< th > Supprimer< / th >
< / tr >
{loop="users"}
< tr >
< td > {$value->getId()}< / td >
< td > {$value->getLogin()}< / td >
< td > {$value->getDisplayName()}< / td >
2013-09-28 19:31:27 +02:00
< td > {$value->getEmail()}< / td >
2013-09-27 17:33:04 +02:00
< td > {$value->getAdmin() ? "Oui" : "Non"}< / td >
2013-09-17 00:03:26 +02:00
< td > < a href = "index.php?do=edit_users&user_id={$value->getId()}" > Modifier< / a > < / td >
2013-09-25 22:09:25 +02:00
< td > {if condition="$value->getId() != $current_user->getId()"}< a href = "index.php?do=delete_user&user_id={$value->getId()}&token={$token}" > Supprimer< / a > {/if}< / td >
2013-09-17 00:03:26 +02:00
< / tr >
{/loop}
< / table >
{elseif condition="$view == 'edit_user'"}
< h2 > {$user_id != -1 ? 'Modifier' : 'Ajouter'} un utilisateur< / h2 >
< form method = "post" action = "index.php?do={$user_id != -1 ? 'edit_users' : 'add_user'}" id = "edit_user_form" >
< p >
< label for = "login" class = "label-block" > Identifiant : < / label > < input type = "text" name = "login" id = "login" { if condition = "$login_post != ''" } value = "{$login_post}" { else } { $ user_id ! = -1 ? ' value = "'.$user_data->getLogin().'" ' : ' ' } { / if } / >
< / p >
< p >
< label for = "display_name" class = "label-block" > Nom affiché : < / label > < input type = "text" name = "display_name" id = "display_name" { if condition = "$display_name_post != ''" } value = "{$display_name_post}" { else } { $ user_id ! = -1 ? ' value = "'.$user_data->getDisplayName().'" ' : ' ' } { / if } / >
< / p >
2013-09-28 19:31:27 +02:00
< p >
< label for = "email" class = "label-block" > Adresse e-mail : < / label > < input type = "text" name = "email" id = "email" { if condition = "$email_post != ''" } value = "{$email_post}" { else } { $ user_id ! = -1 ? ' value = "'.$user_data->getEmail().'" ' : ' ' } { / if } / >
< / p >
< p >
< label for = "notifications" class = "label-block" > Notifications pour < / label >
< select name = "notifications" id = "notifications" >
< option value = "1" { if condition = "$user_data->getNotifications() == 1" } selected = "selected" { / if } > rien.< / option >
< option value = "2" { if condition = "$user_data->getNotifications() == 2" } selected = "selected" { / if } > les remboursements globaux uniquement.< / option >
< option value = "3" { if condition = "$user_data->getNotifications() == 3" } selected = "selected" { / if } > tout ce qui concerne cet utilisateur.< / option >
< / select >
< / p >
2013-09-17 00:03:26 +02:00
< p >
< label for = "password" class = "label-block" > Mot de passe : < / label > < input type = "password" name = "password" id = "password" / > < a href = "" onclick = "toggle_password('password'); return false;" > < img src = "img/toggleVisible.png" alt = "Afficher / Masquer" / > < / a >
{if condition="$user_id != -1"}
< br / > < em > Note :< / em > Laissez ce champ vide pour ne pas modifier le mot de passe.
{/if}
< / p >
< p id = "edit_user_admin_rights" >
Donner des droits administateurs à cet utilisateur ?< br / >
< input type = "radio" id = "admin_yes" value = "1" name = "admin" { if condition = "$admin_post == 1 || ($admin_post == -1 && $user_id != -1 && $user_data->getAdmin())" } checked { / if } / > < label for = "admin_yes" > Oui< / label > < br / >
< input type = "radio" id = "admin_no" value = "0" name = "admin" { if condition = "$admin_post == 0 || ($admin_post == -1 && ($user_id == -1 || !$user_data->getAdmin()))" } checked { / if } / > < label for = "admin_no" > Non< / label >
< / p >
< p class = "center" >
< input type = "submit" value = "{$user_id != -1 ? 'Modifier' : 'Ajouter'}" / >
{if condition="$user_id != -1"}< input type = "hidden" name = "user_id" value = "{$user_id}" / > {/if}
< input type = "hidden" name = "token" value = "{$token}" / >
< / p >
< / form >
{if condition="$user_id != -1"}
< h2 > Jeton d'identification pour l'utilisateur< / h2 >
2013-09-26 18:34:29 +02:00
< p > Le jeton personnel d'identification à utiliser pour la connection à l'API est : {$user_data->getJsonToken()}.< br / > Si vous pensez qu'il a pu être compromis, vous pouvez < a href = "index.php?do=new_token&user_id={$user_data->getId()}&token={$token}" > en générer un nouveau< / a > .< / p >
2013-09-17 00:03:26 +02:00
{/if}
{elseif condition="$view == 'password'"}
< h2 > Modifier votre mot de passe< / h2 >
< form method = "post" action = "index.php?do=password" id = "edit_password_form" >
< p > < label for = "password" class = "label-block" > Nouveau mot de passe : < / label > < input type = "password" id = "password" name = "password" / > < a href = "" onclick = "toggle_password('password'); return false;" > < img src = "img/toggleVisible.png" alt = "Afficher / Masquer" / > < / a > < / p >
< p > < label for = "password_confirm" class = "label-block" > Confirmation : < / label > < input type = "password" id = "password_confirm" name = "password_confirm" / > < a href = "" onclick = "toggle_password('password_confirm'); return false;" > < img src = "img/toggleVisible.png" alt = "Afficher / Masquer" / > < / a > < / p >
2013-09-28 19:31:27 +02:00
< p >
< label for = "email" class = "label-block" > Adresse e-mail : < / label > < input type = "text" name = "email" id = "email" value = "{$current_user->getEmail()}" / >
< / p >
< p >
< label for = "notifications" class = "label-block" > Notifications pour < / label >
< select name = "notifications" id = "notifications" >
< option value = "1" { if condition = "$current_user->getNotifications() == 1" } selected = "selected" { / if } > rien.< / option >
< option value = "2" { if condition = "$current_user->getNotifications() == 2" } selected = "selected" { / if } > les remboursements globaux uniquement.< / option >
< option value = "3" { if condition = "$current_user->getNotifications() == 3" } selected = "selected" { / if } > tout ce qui vous concerne.< / option >
< / select >
< / p >
< p > < em > Note :< / em > Laissez les champs mot de passe vides pour ne pas modifier le mot de passe.< / p >
2013-09-27 17:33:04 +02:00
< p class = "center" > < input type = "submit" value = "Enregistrer" / > < input type = "hidden" name = "token" value = "{$token}" < / p >
2013-09-17 00:03:26 +02:00
< / form >
< h2 > Votre jeton de connexion à l'API< / h2 >
2013-09-25 22:09:25 +02:00
< p > Votre jeton personnel de connexion à l'API est : {$json_token}.< br / > Si vous pensez qu'il a pu être compromis, vous pouvez < a href = "index.php?do=new_token&token={$token}" > en générer un nouveau< / a > .< / p >
2013-09-17 00:03:26 +02:00
{/if}
{include="footer"}