From f29aa60fc7db6490d2600d39b33dcc144271664b Mon Sep 17 00:00:00 2001 From: botanic Date: Wed, 3 Sep 2014 00:23:47 -0700 Subject: [PATCH] fixed change email on shard --- code/web/private_php/ams/autoload/users.php | 3 ++- code/web/public_php/ams/autoload/webusers.php | 2 +- code/web/public_php/ams/func/add_user.php | 1 + code/web/public_php/ams/templates/settings.tpl | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/code/web/private_php/ams/autoload/users.php b/code/web/private_php/ams/autoload/users.php index aabdbe98e..d1d11f51f 100644 --- a/code/web/private_php/ams/autoload/users.php +++ b/code/web/private_php/ams/autoload/users.php @@ -466,12 +466,13 @@ class Users{ try { //make connection with and put into shard db $dbs = new DBLayer("shard"); - $dbs->update("user", $values, "Login = $user"); + $dbs->update("user", $values, "Login = '$user'"); return "ok"; } catch (PDOException $e) { //oh noooz, the shard is offline! Put in query queue at ams_lib db! try { + error_log($e); $dbl = new DBLayer("lib"); $dbl->insert("ams_querycache", array("type" => "change_mail", "query" => json_encode(array($user,$mail)), "db" => "shard")); diff --git a/code/web/public_php/ams/autoload/webusers.php b/code/web/public_php/ams/autoload/webusers.php index c739274c4..b674f63dd 100644 --- a/code/web/public_php/ams/autoload/webusers.php +++ b/code/web/public_php/ams/autoload/webusers.php @@ -260,7 +260,7 @@ class WebUsers extends Users{ try { //make connection with and put into shard db $dbw = new DBLayer("web"); - $dbw->update("ams_user", $values, "Login = $user"); + $dbw->update("ams_user", $values, "Login = '$user'"); } catch (PDOException $e) { //ERROR: the web DB is offline diff --git a/code/web/public_php/ams/func/add_user.php b/code/web/public_php/ams/func/add_user.php index f827a08b5..f2425ae71 100644 --- a/code/web/public_php/ams/func/add_user.php +++ b/code/web/public_php/ams/func/add_user.php @@ -53,6 +53,7 @@ function add_user(){ $pageElements['prevConfirmPass'] = $_POST["ConfirmPass"]; $pageElements['prevEmail'] = $_POST["Email"]; $pageElements['permission'] = unserialize($_SESSION['ticket_user'])->getPermission(); + $pageElements['do'] = "add_user"; helpers :: loadtemplate( 'settings', $pageElements); throw new SystemExit(); }else{ diff --git a/code/web/public_php/ams/templates/settings.tpl b/code/web/public_php/ams/templates/settings.tpl index ea0f32e34..5cc0b0672 100644 --- a/code/web/public_php/ams/templates/settings.tpl +++ b/code/web/public_php/ams/templates/settings.tpl @@ -116,13 +116,13 @@ -
+
- {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE"}{$EMAIL}{/if} + {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE" and isset($do)}{$EMAIL}{/if}