data line
This commit is contained in:
@@ -19,6 +19,7 @@ long WrenchReturnMemberNotifications(CVars in, CVars &out);
|
||||
long WrenchReturnHelpItems(CVars in, CVars &out);
|
||||
long WrenchAccountSettings( CVars in, CVars &out );
|
||||
long WrenchAccountUsePrefrence(CVars in, CVars &out);
|
||||
long WrenchAccountSetPrefrence(CVars in, CVars &out);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -499,6 +499,7 @@ long account_calls(CVars in, CVars &out) {
|
||||
|
||||
case WRENCHBOARD_ACCOUNT_UPDATE_PREFS:
|
||||
logfmt(logINFO, "/account_calls() => WRENCHBOARD_ACCOUNT_UPDATE_PREFS");
|
||||
return WrenchAccountSetPrefrence(in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_ACCOUNT_MYPAGE:
|
||||
|
||||
@@ -15,6 +15,39 @@
|
||||
#include "account.h"
|
||||
|
||||
|
||||
|
||||
long WrenchAccountSetPrefrence(CVars in, CVars &out){
|
||||
logfmt(logINFO, "WrenchAccountSetPrefrence()");
|
||||
char vname[30];
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
|
||||
try {
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
out["total_record"] = "0";
|
||||
const PGresult *res;
|
||||
res = pgsql_query("SELECT * FROM members WHERE id = %lu", member_id );
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
out["total_record"] = pgsql_num_rows(res);
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||
if (f.empty()) continue;
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
ret = PHP_API_OK;
|
||||
out["status"] = "OK";
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long WrenchAccountSetPrefrence(CVars in, CVars &out)");
|
||||
}
|
||||
logfmt(logINFO, "/WrenchAccountSetPrefrence()");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
long WrenchAccountUsePrefrence(CVars in, CVars &out){
|
||||
logfmt(logINFO, "WrenchAccountUsePrefrence()");
|
||||
char vname[30];
|
||||
|
||||
Reference in New Issue
Block a user