back office login
This commit is contained in:
@@ -303,9 +303,12 @@ long LoginBkoAdmin(CVars in, CVars &out)
|
||||
in["sessionid"] = out["sessionid"]; in["sessionid"].set_valid( true );
|
||||
|
||||
|
||||
ret = load_db_record( out, "SELECT *,id AS backoffice_id FROM backoffice WHERE status=1 AND LOWER(username)=LOWER('%s') AND pass= md5('%s')", in["username"].c_str(), in["password"].c_str() );
|
||||
ret = load_db_record( out, "SELECT *,id AS backoffice_id "
|
||||
" FROM backoffice WHERE status=1 "
|
||||
" AND LOWER(username)=LOWER('%s') AND pass= md5('%s')", in["username"].c_str(), in["password"].c_str() );
|
||||
if (ret>0) {
|
||||
if (BkoCommonSessionCheck(out["id"].Long(),0,0, in["sessionid"].c_str(), 1)>0) {
|
||||
pgsql_exec("UPDATE backoffice SET last_login=NOW() WHERE id=%ld AND uid='%s'", out["backoffice_id"].Long(), out["uid"].c_str())
|
||||
out["stauts"] = "OK";
|
||||
ret = PHP_API_OK;
|
||||
} else {
|
||||
|
||||
@@ -135,7 +135,7 @@ class ResultFormatter extends Model
|
||||
"pref" => $out["pref_${key}"],
|
||||
"lang" => $out["lang_${key}"],
|
||||
"added" => $out["added_${key}"],
|
||||
|
||||
"currval" => 0,
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user