fixed change email on shard

This commit is contained in:
botanic 2014-09-03 00:23:47 -07:00
parent e2882d1b9f
commit 912a15c1bd
4 changed files with 6 additions and 4 deletions

View file

@ -466,12 +466,13 @@ class Users{
try { try {
//make connection with and put into shard db //make connection with and put into shard db
$dbs = new DBLayer("shard"); $dbs = new DBLayer("shard");
$dbs->update("user", $values, "Login = $user"); $dbs->update("user", $values, "Login = '$user'");
return "ok"; return "ok";
} }
catch (PDOException $e) { catch (PDOException $e) {
//oh noooz, the shard is offline! Put in query queue at ams_lib db! //oh noooz, the shard is offline! Put in query queue at ams_lib db!
try { try {
error_log($e);
$dbl = new DBLayer("lib"); $dbl = new DBLayer("lib");
$dbl->insert("ams_querycache", array("type" => "change_mail", $dbl->insert("ams_querycache", array("type" => "change_mail",
"query" => json_encode(array($user,$mail)), "db" => "shard")); "query" => json_encode(array($user,$mail)), "db" => "shard"));

View file

@ -260,7 +260,7 @@ class WebUsers extends Users{
try { try {
//make connection with and put into shard db //make connection with and put into shard db
$dbw = new DBLayer("web"); $dbw = new DBLayer("web");
$dbw->update("ams_user", $values, "Login = $user"); $dbw->update("ams_user", $values, "Login = '$user'");
} }
catch (PDOException $e) { catch (PDOException $e) {
//ERROR: the web DB is offline //ERROR: the web DB is offline

View file

@ -53,6 +53,7 @@ function add_user(){
$pageElements['prevConfirmPass'] = $_POST["ConfirmPass"]; $pageElements['prevConfirmPass'] = $_POST["ConfirmPass"];
$pageElements['prevEmail'] = $_POST["Email"]; $pageElements['prevEmail'] = $_POST["Email"];
$pageElements['permission'] = unserialize($_SESSION['ticket_user'])->getPermission(); $pageElements['permission'] = unserialize($_SESSION['ticket_user'])->getPermission();
$pageElements['do'] = "add_user";
helpers :: loadtemplate( 'settings', $pageElements); helpers :: loadtemplate( 'settings', $pageElements);
throw new SystemExit(); throw new SystemExit();
}else{ }else{

View file

@ -116,13 +116,13 @@
</div> </div>
</div> </div>
<div class="control-group {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE"}error{/if}"> <div class="control-group {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE" and isset($do)}error{/if}">
<label class="control-label">Email</label> <label class="control-label">Email</label>
<div class="controls"> <div class="controls">
<div class="input-prepend"> <div class="input-prepend">
<span style="margin-left:5px;" class="add-on"><i class="icon-envelope"></i></span> <span style="margin-left:5px;" class="add-on"><i class="icon-envelope"></i></span>
<input type="text" class="input-xlarge" id="Email" name="Email" placeholder="Email" {if isset($prevEmail)}value="{$prevEmail}"{/if}> <input type="text" class="input-xlarge" id="Email" name="Email" placeholder="Email" {if isset($prevEmail)}value="{$prevEmail}"{/if}>
{if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE"}<span class="help-inline">{$EMAIL}</span>{/if} {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE" and isset($do)}<span class="help-inline">{$EMAIL}</span>{/if}
</div> </div>
</div> </div>
</div> </div>