family action
This commit is contained in:
@@ -2425,7 +2425,9 @@ long LoginWrenchBoardAccount(CVars in, CVars &out) {
|
||||
in["loc"].set_valid(true);
|
||||
|
||||
load_db_record(in, "SELECT upper(md5(now()::text))||''|| upper(md5(now()::date::text)) AS sessionid");
|
||||
ret = load_db_record(out, "SELECT *,id AS member_id , to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2,country FROM members WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str());
|
||||
ret = load_db_record(out, "SELECT *,id AS member_id , to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2,country "
|
||||
" FROM members WHERE status=1 AND "
|
||||
" LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str());
|
||||
if (ret > 0) {
|
||||
|
||||
if ( out["country"] !=""){
|
||||
@@ -2450,6 +2452,8 @@ long LoginWrenchBoardAccount(CVars in, CVars &out) {
|
||||
pgsql_query("UPDATE members SET last_login = now() , loc='%s' WHERE id = %lu",loc, out["member_id"].Long());
|
||||
account_email(ACCOUNT_LOGIN_ALERT, out, out); // ALERT CUSTOMER OF LOGIN
|
||||
ret = PHP_LOGIN_OK;
|
||||
in["member_id"] = out["member_id"];
|
||||
in["member_id"].set_valid(true);
|
||||
LoginWrenchBoardSetDashType(in, out);
|
||||
out["profile_pic_url"] = "https://www.wrenchboard.com/assets/images/profile.jpg";
|
||||
out["password"] = "";
|
||||
@@ -2476,6 +2480,8 @@ long LoginWrenchBoardAccount(CVars in, CVars &out) {
|
||||
long LoginWrenchBoardSetDashType(CVars in, CVars &out){
|
||||
|
||||
out["home_dash_type"] = "DEFAULT_HOME_DASH";
|
||||
out["family_action"] = "FAMILY_ACTION_NO_KIDS";
|
||||
|
||||
/*
|
||||
DEFAULT_HOME_DASH
|
||||
FAMILY_PARENT_DASH
|
||||
@@ -2483,7 +2489,7 @@ long LoginWrenchBoardSetDashType(CVars in, CVars &out){
|
||||
JOBOWNER_HOME_DASH
|
||||
*/
|
||||
|
||||
out["family_action"] = "FAMILY_ACTION_NO_KIDS";
|
||||
|
||||
/*
|
||||
FAMILY_ACTION_NO_KIDS
|
||||
FAMILY_ACTION_SEND_REWARD
|
||||
@@ -2495,6 +2501,24 @@ FAMILY_ACTION_SEND_REWARD
|
||||
<app-familiy-allowancen *ngIf="family_action=='FAMILY_ACTION_SETUP_ALLOWANCE';"></app-familiy-allowancen>
|
||||
*/
|
||||
|
||||
logfmt(logINFO, "LoginWrenchBoardSetDashType()");
|
||||
try {
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
if ( load_db_record(out, "SELECT last_login, country, uid FROM members WHERE id = %lu", out["member_id"].Long() ) > 0 ){
|
||||
if ( out["country"] == "US" ){
|
||||
out["home_dash_type"] = "FAMILY_PARENT_DASH";
|
||||
out["family_action"] = "FAMILY_ACTION_NO_KIDS";
|
||||
if ( load_db_record(out, "SELECT count(id) AS family_count FROM members_family WHERE member_id = %lu", out["member_id"].Long() ) > 0 ){
|
||||
if (out["family_count"].Long() > 0 ){
|
||||
out["family_action"] = "FAMILY_ACTION_SEND_REWARD";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (bad_parameter) {
|
||||
out["log_status"] = "Something went wrong with dash";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user