backend calls
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
long WrenchMarketImport(CVars in, CVars &out);
|
||||
long WrenchPromoLoad(CVars in, CVars &out);
|
||||
long WrenchPromoAdminLogin(CVars in, CVars &out);
|
||||
|
||||
long market_calls(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "market_calls()");
|
||||
@@ -35,7 +36,7 @@ long market_calls(CVars in, CVars &out) {
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_PROMOADMIN_LOGIN:
|
||||
|
||||
return WrenchPromoAdminLogin(in, out);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -46,6 +47,27 @@ long market_calls(CVars in, CVars &out) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
long WrenchPromoAdminLogin(CVars in, CVars &out){
|
||||
logfmt(logINFO, "WrenchPromoAdminLogin()");
|
||||
char vname[30];
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
|
||||
try {
|
||||
REQ_STRING (in, "username", 5, 49, "(.*)");
|
||||
REQ_STRING (in, "password", 5, 49, "(.*)");
|
||||
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
|
||||
ret = load_db_record( out, "SELECT *,id AS promo_admin_id, md5( now()::text )||''||md5( (now() + '1 hr')::text ) AS sessionid FROM promo_admin WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str() );
|
||||
if (ret) {
|
||||
ret = PHP_API_OK;
|
||||
out["status"] = "OK";
|
||||
}
|
||||
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long WrenchMarketImport(CVars in, CVars &out)");
|
||||
}
|
||||
logfmt(logINFO, "/WrenchPromoAdminLogin()");
|
||||
return ret;
|
||||
}
|
||||
|
||||
long WrenchMarketImport(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "WrenchMarketImport()");
|
||||
|
||||
Reference in New Issue
Block a user