diff --git a/wrenchboard/src/include/account.h b/wrenchboard/src/include/account.h index d01bc0f7..235af04c 100644 --- a/wrenchboard/src/include/account.h +++ b/wrenchboard/src/include/account.h @@ -30,6 +30,7 @@ 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 WrenchMyPage(CVars in, CVars &out); long LogWrenchBoardMember(CVars in, CVars &out); diff --git a/wrenchboard/src/shared_tool/account.cc b/wrenchboard/src/shared_tool/account.cc index b8f1f5ec..5c567bea 100644 --- a/wrenchboard/src/shared_tool/account.cc +++ b/wrenchboard/src/shared_tool/account.cc @@ -497,7 +497,7 @@ long account_calls(CVars in, CVars &out) { break; case WRENCHBOARD_ACCOUNT_MYPAGE: - + return WrenchMyPage(in, out); break; case WRENCHBOARD_ACCOUNT_PAGEINTRO: @@ -511,6 +511,37 @@ long account_calls(CVars in, CVars &out) { #define PHP_API_TRANSFER_COMPLETE 200 +long WrenchMyPage(CVars in, CVars &out) { + logfmt(logINFO, "WrenchMyPageIntro()"); + long ret = PHP_API_BAD_PARAM; + const PGresult *res; + 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(out, "SELECT d.id AS detail_id,d.* 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){ + + } + else{ + ret = PHP_API_OK; + } + + } catch (bad_parameter) { + out["status"] = "ERROR"; + } + return ret; +} long WrenchMyPageIntro(CVars in, CVars &out) { logfmt(logINFO, "WrenchMyPageIntro()");