|
From: Benjamin C. <bc...@us...> - 2002-03-06 04:17:57
|
Update of /cvsroot/phpbt/phpbt/admin
In directory usw-pr-cvs1:/tmp/cvs-serv3983/admin
Modified Files:
user.php
Log Message:
Try to keep people from shooting themselves in the foot by removing the only admin from the system
Index: user.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/admin/user.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- user.php 1 Mar 2002 00:41:31 -0000 1.39
+++ user.php 6 Mar 2002 04:17:54 -0000 1.40
@@ -149,7 +149,10 @@
'femail' => $row['email'],
'fpassword' => $row['password'],
'factive' => $row['active'] ? 'checked' : '',
- 'fusergroup' => build_select('group', $user_groups)
+ 'fusergroup' => build_select('group', $user_groups),
+ // Whether or not this user has admin rights
+ 'hadadmin' => $q->grab_field('select count(*) from '.TBL_USER_GROUP.
+ " where user_id = {$row['user_id']} and group_id = 1")
));
} else {
$t->set_var(array(
@@ -167,9 +170,14 @@
'factive' => isset($_pv['factive']) ? ($_pv['factive'] ? 'checked' : '')
: 'checked',
'fusergroup' => build_select('group', (isset($_pv['fusergroup']) ?
- $_pv['fusergroup'] : array()))
+ $_pv['fusergroup'] : array())),
+ // Whether or not this user has admin rights
+ 'hadadmin' => 0
));
}
+ // The number of admins in the system
+ $t->set_var('numadmins', $q->grab_field('select count(*) from '.TBL_USER_GROUP.
+ ' where group_id = 1'));
// Show the login field only if login is not tied to email address
if (EMAIL_IS_LOGIN) {
|