2013-08-09 23:35:20 +02:00
{include="header"}
2013-08-09 23:43:56 +02:00
{if condition="$error != ''"}
< p class = "error" > {$error}< / p >
{/if}
2013-08-10 23:58:40 +02:00
{if condition="$view == 'list_users'"}
< h2 > List of users< / h2 >
2013-08-30 20:07:52 +02:00
< p class = "center" > You can also < a href = "?do=add_user" > add a user< / a > .< / p >
< table id = "edit_users" >
2013-08-10 23:58:40 +02:00
< tr >
< th > Id< / th >
< th > Login< / th >
2013-08-13 17:58:14 +02:00
< th > Display Name< / th >
2013-08-10 23:58:40 +02:00
< th > Is admin ?< / th >
< th > Edit< / th >
< th > Delete< / th >
< / tr >
{loop="users"}
< tr >
< td > {$value->getId()}< / td >
< td > {$value->getLogin()}< / td >
2013-08-13 17:58:14 +02:00
< td > {$value->getDisplayName()}< / td >
2013-08-10 23:58:40 +02:00
< td > {$value->getAdmin() ? "Yes" : "No"}< / td >
< td > < a href = "index.php?do=edit_users&user_id={$value->getId()}" > Edit< / a > < / td >
2013-08-11 22:25:25 +02:00
< td > {if condition="$value->getId() != $current_user->getId()"}< a href = "index.php?do=delete_user&user_id={$value->getId()}" > Delete< / a > {/if}< / td >
2013-08-10 23:58:40 +02:00
< / tr >
{/loop}
< / table >
{elseif condition="$view == 'edit_user'"}
2013-08-25 23:06:47 +02:00
< h2 > {$user_id != -1 ? 'Edit' : 'Add'} a user< / h2 >
< form method = "post" action = "index.php?do={$user_id != -1 ? 'edit_users' : 'add_user'}" id = "edit_user_form" >
2013-08-10 23:58:40 +02:00
< p >
2013-08-13 17:58:14 +02:00
< label for = "login" class = "label-block" > Login : < / 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 >
2013-08-25 23:06:47 +02:00
< label for = "display_name" class = "label-block" > Displayed name : < / 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 } / >
2013-08-10 23:58:40 +02:00
< / p >
< p >
< label for = "password" class = "label-block" > Password : < / label > < input type = "password" name = "password" id = "password" / >
{if condition="$user_id != -1"}
< br / > < em > Note :< / em > Leave blank this field if you don't want to edit password.
{/if}
< / p >
< p id = "edit_user_admin_rights" >
Give admin rights to this user ?< br / >
2013-08-11 22:25:25 +02:00
< 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" > Yes< / 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" > No< / label >
2013-08-10 23:58:40 +02:00
< / p >
< p class = "center" >
< input type = "submit" value = "{$user_id != -1 ? 'Edit' : 'Add'}" / >
2013-08-11 22:25:25 +02:00
{if condition="$user_id != -1"}< input type = "hidden" name = "user_id" value = "{$user_id}" / > {/if}
2013-08-24 23:53:52 +02:00
< input type = "hidden" name = "token" value = "{$token}" / >
2013-08-10 23:58:40 +02:00
< / p >
< / form >
{elseif condition="$view == 'password'"}
2013-08-09 23:35:20 +02:00
< h2 > Edit your password< / h2 >
< form method = "post" action = "index.php?do=password" id = "edit_password_form" >
< p > < label for = "password" class = "label-block" > New password : < / label > < input type = "password" id = "password" name = "password" / > < / p >
< p > < label for = "password_confirm" class = "label-block" > Confirm new password : < / label > < input type = "password" id = "password_confirm" name = "password_confirm" / > < / p >
2013-08-24 23:53:52 +02:00
< p class = "center" > < input type = "submit" value = "Update" / > < input type = "hidden" name = "token" value = "{$token}" < / p >
2013-08-09 23:35:20 +02:00
< / form >
2013-08-10 23:58:40 +02:00
{/if}