This commit is contained in:
Olusesan Ameye
2021-02-20 20:41:42 -05:00
parent 7ab058c575
commit c9e4228bdd
+9
View File
@@ -266,6 +266,7 @@ long provider_createmember(CVars in, CVars &out) {
REQ_STRING(in, "password", 5, 49, "(.*)");
OPTIONAL(in, "phone") REQ_STRING(in, "loc", 5, 16, "(.*)");
OPTIONAL(in, "login") REQ_LONG(in, "login", 0, -1);
REQ_STRING(in, "gender", 1, 2, "(.*)");
long member_id = 0;
@@ -296,10 +297,18 @@ long provider_createmember(CVars in, CVars &out) {
x["email"].set_valid(true);
// x["password"] = in["email"];
// x["password"].set_valid(true);
x["gender"] = in["gender"];
x["gender"].set_valid(true);
out["member_id"] = insert_db_record(DBS_VALID, "members", "members_id_seq", x);
if (out["member_id"].Long() > 0) {
pgsql_query("UPDATE members SET password = md5('%s') WHERE id = %lu", in["password"].c_str(), out["member_id"].Long()); // setting the password MD5 now
if (in["dob"] !=""){ // if dob was sent
pgsql_query("UPDATE members SET dob = '%s' WHERE id = %lu", in["dob"].c_str(), out["member_id"].Long()); // setting dob now
}
// Now Send Email
ret = PHP_API_OK;
//make your patient