|
From: Bart v. B. <ba...@us...> - 2002-01-14 18:40:30
|
Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv1366
Modified Files:
admin_userauth.php
Log Message:
Sort of a fix for the user->admin bug (#502631) and prevent editing not-existing users
Index: admin_userauth.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_userauth.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** admin_userauth.php 2002/01/01 02:22:23 1.27
--- admin_userauth.php 2002/01/14 18:40:25 1.28
***************
*** 140,144 ****
AND g.group_id = ug.group_id
AND g.group_single_user = " . TRUE;
! if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't select info from user/user_group table", "", __LINE__, __FILE__, $sql);
--- 140,144 ----
AND g.group_id = ug.group_id
AND g.group_single_user = " . TRUE;
! if( !($result = $db->sql_query($sql)) || $db->sql_numrows($result) != 1)
{
message_die(GENERAL_ERROR, "Couldn't select info from user/user_group table", "", __LINE__, __FILE__, $sql);
***************
*** 197,201 ****
// Delete any entries in auth_access, they
! // are unrequired if user is becoming an
// admin
//
--- 197,201 ----
// Delete any entries in auth_access, they
! // are not required if user is becoming an
// admin
//
***************
*** 582,589 ****
else if( isset($HTTP_POST_VARS['username']) || $user_id)
{
-
if( isset($HTTP_POST_VARS['username']) )
{
$this_userdata = get_userdata($HTTP_POST_VARS['username']);
$user_id = $this_userdata['user_id'];
}
--- 582,592 ----
else if( isset($HTTP_POST_VARS['username']) || $user_id)
{
if( isset($HTTP_POST_VARS['username']) )
{
$this_userdata = get_userdata($HTTP_POST_VARS['username']);
+ if( !is_array($this_userdata) )
+ {
+ message_die(GENERAL_MESSAGE, $lang['No_such_user']);
+ }
$user_id = $this_userdata['user_id'];
}
***************
*** 983,985 ****
include('page_footer_admin.'.$phpEx);
! ?>
\ No newline at end of file
--- 986,988 ----
include('page_footer_admin.'.$phpEx);
! ?>
|