long WrenchMyPageIntro(CVars in, CVars &out)
This commit is contained in:
@@ -29,7 +29,7 @@ long LogManagerAction(CVars in, CVars &out);
|
||||
long WrenchUpdateProfile(CVars in, CVars &out);
|
||||
long WrenchUpdateAccountTerms(CVars in, CVars &out);
|
||||
long WrenchUpdateAccountDescription(CVars in, CVars &out);
|
||||
|
||||
long WrenchMyPageIntro(CVars in, CVars &out);
|
||||
|
||||
long LogWrenchBoardMember(CVars in, CVars &out);
|
||||
|
||||
|
||||
@@ -246,6 +246,9 @@ enum { PARTNER_STRIPE };
|
||||
#define WRENCHBOARD_ACCOUNT_REFFERHX 11064
|
||||
#define WRENCHBOARD_ACCOUNT_PREFERENCES 11065
|
||||
|
||||
#define WRENCHBOARD_ACCOUNT_MYPAGE 11070
|
||||
#define WRENCHBOARD_ACCOUNT_PAGEINTRO 11071
|
||||
|
||||
#define WRENCHBOARD_ACCOUNT_PRICE_COMBO 11171
|
||||
#define WRENCHBOARD_ACCOUNT_JOBPOST_DURATION 11173
|
||||
#define WRENCHBOARD_ACCOUNT_USER_RECIPEINT 11175
|
||||
|
||||
@@ -496,6 +496,14 @@ long account_calls(CVars in, CVars &out) {
|
||||
return WrenchAccountUsePrefrence(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_ACCOUNT_MYPAGE:
|
||||
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_ACCOUNT_PAGEINTRO:
|
||||
return WrenchMyPageIntro(in, out);
|
||||
break;
|
||||
|
||||
}
|
||||
logfmt(logINFO, "/account_calls()");
|
||||
return ret;
|
||||
@@ -503,6 +511,69 @@ long account_calls(CVars in, CVars &out) {
|
||||
|
||||
#define PHP_API_TRANSFER_COMPLETE 200
|
||||
|
||||
|
||||
long WrenchMyPageIntro(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "WrenchMyPageIntro()");
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
const PGresult *res;
|
||||
CVars cc;
|
||||
CVars x;
|
||||
|
||||
try {
|
||||
REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_STRING(in, "uid", 3, 150, "(.*)");
|
||||
REQ_STRING(in, "intro", 3, 150, "(.*)");
|
||||
REQ_STRING(in, "description", 3, 150, "(.*)");
|
||||
|
||||
x["intro"] = in["intro"];
|
||||
x["intro"].set_valid(true);
|
||||
x["description"] = in["description"];
|
||||
x["description"].set_valid(true);
|
||||
|
||||
if ( load_db_record(cc, "SELECT d.id AS detail_id FROM members_detail d "
|
||||
"LEFT JOIN members m ON m.id =d.member_id "
|
||||
"WHERE d.member_id=%lu AND m.uid='%s' AND active = 1 ", in["member_id"].Long(), in["uid"].c_str()) > 0){
|
||||
update_db_record(DBS_VALID, "members_detail", x, cc["detail_id"].Long());
|
||||
}
|
||||
else{
|
||||
x["member_id"] = in["member_id"];
|
||||
x["member_id"].set_valid(true);
|
||||
out["detail_id"] = insert_db_record(DBS_VALID, "members_detail", "members_detail_id_seq", x);
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
} catch (bad_parameter) {
|
||||
out["status"] = "ERROR";
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
/* THIS IS TO BE RETIRED */
|
||||
long WrenchUpdateAccountDescription(CVars in, CVars &out) {
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
logfmt(logINFO, "long WrenchUpdateAccountDescription(CVars in, CVars out)");
|
||||
REQ_STRING(in, "description", 0, 500, "(.*)");
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
CVars x;
|
||||
const PGresult *res = pgsql_query("SELECT id AS detail_id FROM members_detail WHERE member_id=%lu", member_id);
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
x["description"] = in["description"];
|
||||
x["description"].set_valid(true);
|
||||
update_db_record(DBS_VALID, "members_detail", x, rec["detail_id"].Long());
|
||||
ret = PHP_API_OK;
|
||||
} else {
|
||||
x["member_id"] = member_id;
|
||||
x["member_id"].set_valid(true);
|
||||
x["description"] = in["description"];
|
||||
x["description"].set_valid(true);
|
||||
long sid = insert_db_record(DBS_VALID, "members_detail", "members_detail_id_seq", x); //members_session_id_seq
|
||||
ret = PHP_API_OK;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/*
|
||||
|
||||
CREATE TABLE members_recentactivities (
|
||||
@@ -1743,34 +1814,6 @@ long WrenchResetPass(CVars in, CVars &out) {
|
||||
|
||||
}
|
||||
|
||||
long WrenchUpdateAccountDescription(CVars in, CVars &out) {
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
logfmt(logINFO, "long WrenchUpdateAccountDescription(CVars in, CVars out)");
|
||||
REQ_STRING(in, "description", 0, 500, "(.*)");
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
CVars x;
|
||||
const PGresult *res = pgsql_query("SELECT id AS detail_id FROM members_detail WHERE member_id=%lu", member_id);
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
x["description"] = in["description"];
|
||||
x["description"].set_valid(true);
|
||||
update_db_record(DBS_VALID, "members_detail", x, rec["detail_id"].Long());
|
||||
ret = PHP_API_OK;
|
||||
} else {
|
||||
x["member_id"] = member_id;
|
||||
x["member_id"].set_valid(true);
|
||||
x["description"] = in["description"];
|
||||
x["description"].set_valid(true);
|
||||
long sid = insert_db_record(DBS_VALID, "members_detail", "members_detail_id_seq", x); //members_session_id_seq
|
||||
ret = PHP_API_OK;
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
long WrenchUpdateAccountTerms(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "long WrenchUpdateAccountTerms(CVars in, CVars out)");
|
||||
|
||||
Reference in New Issue
Block a user