<%!
from kaithem.src.util import url
%>

<%include file="/pageheader.html"/>
<h2> Users and Groups <sup><a href="/docs#auth">[help]</a></sup></h2>
<details class="help"><summary><i class="mdi mdi-help-circle-outline"></i></summary>Note: Your changes are saved temporarily to RAM until either a configured autosave(Off by default), or a manual save of the server state.</details>
<title>Manage Authorization</title>
<h3>Users</h3>

<div class="window paper">
<p class="menubar">
<a class="button createbutton" href="/auth/newuser">Add New User</a>  <a class="button deletebutton" href="/auth/deleteuser">Delete User</a></p>
<details class="help"><summary><i class="mdi mdi-help-circle-outline"></i></summary>
The following users are registered with the server. <br>To allow unregistered users access to certain permissions, create a user named '__guest__' with password '__none__'<br>All usernames surrounded by double underscores are reserved.</details>
<hr>
<ul>
%for i in sorted(auth.Users.keys()):
   <li
%if i.startswith('__'):
class="specialentry"\
%endif
   > <a href="/auth/user/${url(i)}">${i}</a></li>
%endfor
</ul>
</div>

<h3>Groups</h3>
<div class="window paper">
<p class="menubar">
<a class="button createbutton" href="/auth/newgroup">Add New Group</a>  <a class="button deletebutton" href="/auth/deletegroup">Delete Group</a></p>
<details class="help"><summary><i class="mdi mdi-help-circle-outline"></i></summary>
The following groups are registered with the server.</details>
<hr>
<ul>
%for i in sorted(auth.Groups.keys()):
   <li> <a href="/auth/group/${url(i)}">${i}</a></li>
%endfor
</ul>
</div>
<%include file="/pagefooter.html"/>
