|
From: Benjamin C. <bc...@us...> - 2002-03-06 04:17:57
|
Update of /cvsroot/phpbt/phpbt/templates/default/admin
In directory usw-pr-cvs1:/tmp/cvs-serv3983/templates/default/admin
Modified Files:
userlist.html
Log Message:
Try to keep people from shooting themselves in the foot by removing the only admin from the system
Index: userlist.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/userlist.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- userlist.html 1 Mar 2002 00:41:31 -0000 1.3
+++ userlist.html 6 Mar 2002 04:17:54 -0000 1.4
@@ -1,4 +1,24 @@
<!--<a href="{me}?op=add">Add a new user</a>-->
+<script language="JavaScript">
+<!--
+ function checkAdmin(slct) {
+ var hadAdmin = {hadadmin};
+ var numAdmins = {numadmins};
+ var adminSelected = false;
+
+ if (hadAdmin && numAdmins == 1) {
+ for (current = 0; current < slct.options.length; current++ ) {
+ if (slct.options[current].selected && slct.options[current].value == 1) {
+ adminSelected = true;
+ }
+ }
+ if (!adminSelected) {
+ alert('This is the only admin user for the system. Removing this user from the Admin group would be unwise.');
+ }
+ }
+ }
+// -->
+</script>
<br>
<table border="0">
<tr>
@@ -73,7 +93,7 @@
<tr>
<td align="right" valign="top">User Group:</td>
<td>
- <select name="fusergroup[]" size="3" multiple>
+ <select name="fusergroup[]" size="3" multiple onClick="checkAdmin(this)">
{fusergroup}
</select>
</td>
|