From 89bb22fcd6a81b744f32fa91516cc8d4b289453e Mon Sep 17 00:00:00 2001 From: Robert Anderson <randerson@lbsd.net> Date: Wed, 15 Jul 2009 14:24:02 +0000 Subject: [PATCH] Check if we have location if we editing a user --- webgui/include/ajax/functions/WiSPUsers.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/webgui/include/ajax/functions/WiSPUsers.php b/webgui/include/ajax/functions/WiSPUsers.php index 7eae446f..51d5bec8 100644 --- a/webgui/include/ajax/functions/WiSPUsers.php +++ b/webgui/include/ajax/functions/WiSPUsers.php @@ -521,18 +521,22 @@ function updateWiSPUser($params) { FirstName = ?, LastName = ?, Phone = ?, - Email = ?, - LocationID = ? + Email = ? WHERE UserID = ?", array($params[0]['Firstname'], $params[0]['Lastname'], $params[0]['Phone'], $params[0]['Email'], - $params[0]['LocationID'], $params[0]['ID']) ); } + # If successful, add location if any + if ($res !== FALSE && !empty($params[0]['LocationID'])) { + $res = DBDo("UPDATE wisp_userdata SET LocationID = ? WHERE UserID = ?", + array($params[0]['LocationID'],$params[0]['ID']) + ); + } # Commit changes if all was successful, else break if ($res !== FALSE) { -- GitLab