remove a warning when adding users when not logged in (could happen if OPT_AUTH isn't turned on yet

This commit is contained in:
Isaac Connor 2017-03-29 10:38:29 -04:00
parent a0c030413a
commit fe223e3b29
1 changed files with 3 additions and 2 deletions

View File

@ -835,12 +835,13 @@ if ( !empty($action) ) {
if ( count( $changes ) ) { if ( count( $changes ) ) {
if ( !empty($_REQUEST['uid']) ) { if ( !empty($_REQUEST['uid']) ) {
dbQuery( "update Users set ".implode( ", ", $changes )." where Id = ?", array($_REQUEST['uid']) ); dbQuery( "update Users set ".implode( ", ", $changes )." where Id = ?", array($_REQUEST['uid']) );
# If we are updating the logged in user, then update our session user data.
if ( $user and ( $dbUser['Username'] == $user['Username'] ) )
userLogin( $dbUser['Username'], $dbUser['Password'] );
} else { } else {
dbQuery( "insert into Users set ".implode( ", ", $changes ) ); dbQuery( "insert into Users set ".implode( ", ", $changes ) );
} }
$refreshParent = true; $refreshParent = true;
if ( $dbUser['Username'] == $user['Username'] )
userLogin( $dbUser['Username'], $dbUser['Password'] );
} }
$view = 'none'; $view = 'none';
} elseif ( $action == 'state' ) { } elseif ( $action == 'state' ) {