|
|
|
@ -365,25 +365,27 @@ class Users{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function setPassword($user, $pass){
|
|
|
|
|
protected function setAmsPassword($user, $pass){
|
|
|
|
|
|
|
|
|
|
global $cfg;
|
|
|
|
|
$values = Array('user' => $user, 'pass' => $pass);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
//make connection with and put into shard db
|
|
|
|
|
global $cfg;
|
|
|
|
|
$dbs = new DBLayer($cfg['db']['shard']);
|
|
|
|
|
$dbs->execute("UPDATE user SET Password = :pass WHERE Login = :user ",$values);
|
|
|
|
|
return "ok";
|
|
|
|
|
}
|
|
|
|
|
catch (PDOException $e) {
|
|
|
|
|
//oh noooz, the shard is offline! Put in query queue at ams_lib db!
|
|
|
|
|
/*try {
|
|
|
|
|
$dbl = new DBLayer($cfg['db']['lib']);
|
|
|
|
|
$dbl->execute("INSERT INTO ams_querycache (type, query) VALUES (:type, :query)",array("type" => "createUser",
|
|
|
|
|
"query" => json_encode(array($values["name"],$values["pass"],$values["mail"]))));
|
|
|
|
|
try {
|
|
|
|
|
$dbl = new DBLayer($cfg['db']['lib']);
|
|
|
|
|
$dbl->execute("INSERT INTO ams_querycache (type, query) VALUES (:type, :query)",array("type" => "changepass",
|
|
|
|
|
"query" => json_encode(array($values["name"],$values["pass"]))));
|
|
|
|
|
return "shardoffline";
|
|
|
|
|
}catch (PDOException $e) {
|
|
|
|
|
print_r($e);
|
|
|
|
|
return "liboffline";
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|