diff --git a/coregrade/email/ACCOUNT/member_pending.mailfile b/coregrade/email/ACCOUNT/member_pending.mailfile index c1eb82d..64870c7 100644 --- a/coregrade/email/ACCOUNT/member_pending.mailfile +++ b/coregrade/email/ACCOUNT/member_pending.mailfile @@ -16,7 +16,8 @@ Welcome to {{site_name}}!. In order to complete your registration , click or cop Click Link : https://{{server_name}}/vemail?vlnk={{verify_link}}
-{{site_name}} gives empowers you to form, find and join one or more groups. As a group member you will receive the benefit of wholesale prices on leading brands from reputable sellers on the purchases you need for your home, your business or your life! +{{site_name}},your personalized learning in one place with tools to make it happen. {{site_name}} makes it easy to track due dates of goals set, focus plans with e-alerts in your workspace and dashboard. + diff --git a/coregrade/src/include/coregrade_api.h b/coregrade/src/include/coregrade_api.h index dd1caa1..af2d2a3 100644 --- a/coregrade/src/include/coregrade_api.h +++ b/coregrade/src/include/coregrade_api.h @@ -23,6 +23,9 @@ #define COREGRADE_ACCOUNT_TESTEMAIL 11001 #define COREGRADE_ACCOUNT_PENDING 11010 #define COREGRADE_VERIFY_PENDING_LINK 11015 + +#define COREGRADE_START_RESET_PASSWORD 11017 + #define COREGRADE_ACCOUNT_CREATEACC 11020 #define COREGRADE_ACCOUNT_LOGIN 11025 #define COREGRADE_ACCOUNT_ADDCARD 11027 @@ -41,7 +44,9 @@ //************************************************************** - +#define RESET_START 100 +#define RESET_CONFIRM 200 +#define RESET_COMPLETE 300 @@ -56,15 +61,15 @@ #define COREGRADE_INTERSW_DO_TRANSFER 560 #define COREGRADE_INTERSW_QUERY_TRANSACTION 561 -#define COREGRADE_ADD_MONEYRECIPIENT 600 +#define COREGRADE_ADD_MONEYRECIPIENT 600 #define COREGRADE_CREATE_USER_ACCOUNT 700 #define COREGRADE_USER_ACCOUNT_LOGIN 710 #define COREGRADE_START_PASSWORDRESET 720 #define COREGRADE_COMPLETE_PASSWORDRESET 730 -#define COREGRADE_START_ADDMONEY 770 -#define COREGRADE_COMPLETE_ADDMONEY 775 +#define COREGRADE_START_ADDMONEY 770 +#define COREGRADE_COMPLETE_ADDMONEY 775 #define COREGRADE_ADD_MOBILE_TOPUPNUM 900 #define COREGRADE_PROMO_CALL 990 @@ -78,27 +83,27 @@ #define COREGRADE_TOPUP_ORDER 900020 -#define COREGRADE_TOPUP_ORDER_PURCHASE 900030 +#define COREGRADE_TOPUP_ORDER_PURCHASE 900030 #define COREGRADE_PAYPAL_IPNMSG 900090 -#define COREGRADE_BULKTOPUP_ORDER 700010 -#define COREGRADE_BULKTOPUP_ITEM 700020 -#define COREGRADE_BULKTOPUP_ITEMUPDATE 700030 -#define COREGRADE_BULKTOPUP_DELIVER 700040 +#define COREGRADE_BULKTOPUP_ORDER 700010 +#define COREGRADE_BULKTOPUP_ITEM 700020 +#define COREGRADE_BULKTOPUP_ITEMUPDATE 700030 +#define COREGRADE_BULKTOPUP_DELIVER 700040 #define COREGRADE_BALANCE_TOPUP_ORDER 800020 -#define COREGRADE_BALANCE_TOPUP_PURCHASE 800030 -#define COREGRADE_BALANCE_TOPUP_PAYMENT 800040 +#define COREGRADE_BALANCE_TOPUP_PURCHASE 800030 +#define COREGRADE_BALANCE_TOPUP_PAYMENT 800040 -#define VIRTUAL_AIRTOPUP 70011 +#define VIRTUAL_AIRTOPUP 70011 #define PAY_MODE_BALANCE 0 #define PAY_MODE_CCARD 1 -#define PAY_MODE_BONUS 9 +#define PAY_MODE_BONUS 9 #define APPROVED_BALANCE 5 #define DISAPROVE_BALANCE 3 diff --git a/coregrade/src/include/email.h b/coregrade/src/include/email.h index 1144dcb..f5a3a44 100644 --- a/coregrade/src/include/email.h +++ b/coregrade/src/include/email.h @@ -8,6 +8,14 @@ long WelcomeAccountMail(CVars in); long GroupCreateMemberMail(CVars in); long CreateCoreGradeGroupMail(CVars in); +long member_email_calls(long action, CVars in, CVars &out); +/*long transporter_email_calls(long action, CVars in, CVars &out); +long agent_email_calls(long action, CVars in, CVars &out); +long cron_email_calls(long action, CVars in, CVars &out); +long alert_email_calls(long action, CVars in, CVars &out); +long email_test(CVars in, CVars &out); +long provider_email_calls(long action, CVars in, CVars &out); */ +long carpool_email_calls(long action, CVars in, CVars &out); long send_email(CVars in, CVars &out); diff --git a/coregrade/src/shared_tool/account.cc b/coregrade/src/shared_tool/account.cc index 75de1ef..4e43932 100644 --- a/coregrade/src/shared_tool/account.cc +++ b/coregrade/src/shared_tool/account.cc @@ -11,10 +11,15 @@ #include "pgsql_wrapper.h" #include "cfg.h" #include +#include "email.h" + #define CREATE_BY_EMAIL 1000 #define CREATE_BY_PHONE 2000 + + + long CreateDefaultPage(CVars in, CVars &out); long CreateUserPage(CVars in, CVars &out); long AddPageCard(CVars in, CVars &out); @@ -94,6 +99,8 @@ string base64_decode(string const& encoded_string) { return ret; } +long passwordReset(CVars in, CVars &out); + long account_calls(CVars in, CVars &out) { logfmt(logINFO, "account_calls()"); out["result"] = "YES I GET TO BACK END"; @@ -111,6 +118,10 @@ long account_calls(CVars in, CVars &out) { return CreateCoreGradeAccountPending(in, out); break; + case COREGRADE_START_RESET_PASSWORD: + return passwordReset(in, out); + break; + case COREGRADE_ACCOUNT_CREATEACC: return CreateCoreGradeAccount(in, out); break; @@ -122,11 +133,179 @@ long account_calls(CVars in, CVars &out) { case COREGRADE_ACCOUNT_ADDPAGECARD: return AddPageCard(in, out); break; + } logfmt(logINFO, "/account_calls()"); return 0; } + + + + + + + + + + + + + + +/*************************************************************************************************************************/ + +long startPassReset(CVars in, CVars &out); +long confirmPassReset(CVars in, CVars &out); +long completePassReset(CVars in, CVars &out); + +long passwordReset(CVars in, CVars &out) { + logfmt(logINFO, "passwordReset()"); + + long mode = REQ_LONG(in, "mode", 0, -1); + switch (mode) { + + case RESET_START: + return startPassReset(in, out); + break; + + case RESET_CONFIRM: + return confirmPassReset(in, out); + break; + + case RESET_COMPLETE: + return completePassReset(in, out); + break; + } +} + +/* + #define RESET_START 100 +#define RESET_CONFIRM 200 +#define RESET_COMPLETE 300 + */ + +long startPassReset(CVars in, CVars &out) { + logfmt(logINFO, "startPassReset()"); + long ret = PHP_API_BAD_PARAM; + CVars x, y; + try { + REQ_STRING(in, "username", 2, 49, "(.*)"); + const char *loc = getenv("REMOTE_ADDR"); + ret = load_db_record(out, "SELECT id AS member_id,now() AS reset_seed FROM members WHERE status=1 AND LOWER(username)=LOWER('%s') ", in["username"].c_str()); + if (ret && out["member_id"].Long() > 0) { + // remove all existing session + pgsql_exec("UPDATE resetpassword SET status=7 WHERE status NOT IN (3,5) AND member_id=%ld ", out["member_id"].Long()); + // Create New Session Now + + if (load_db_record(y, "SELECT floor( random()*100000) AS reset_pin ,md5('%s') AS reset_key", out["reset_seed"].c_str()) >= 0) { + x["username"] = in["username"]; + x["member_id"] = out["member_id"]; + x["loc"] = loc; + x["reset_key"] = y["reset_key"]; + x["reset_pin"] = y["reset_pin"]; + + x["username"].set_valid(true); + x["loc"].set_valid(true); + x["reset_key"].set_valid(true); + x["reset_pin"].set_valid(true); + x["member_id"].set_valid(true); + + out["reset_id"] = insert_db_record(DBS_VALID, "resetpassword", "resetpassword_id_seq", x); + if (out["reset_id"].Long() > 0) { + ret = PHP_API_OK; + out["reset_key"] = "YOU WILL GET THIS IF PIN IS CORRECT IN CONFIRM"; //x["reset_key"]; + out["mode"] = RESET_START; + member_email_calls(in["action"].Long(), out, x); // note the use of out to send in + } + } + } else { + x["username"] = in["username"]; + x["loc"] = loc; + x["status"] = 3; + + x["username"].set_valid(true); + x["loc"].set_valid(true); + x["status"].set_valid(true); + out["reset_id"] = insert_db_record(DBS_VALID, "resetpassword", "resetpassword_id_seq", x); + + out["status_message"] = "Invalid Username or disabled account"; + out["status_advice"] = "Check username or Contact support"; + } + out["reset_seed="] = "REMOVED"; + } catch (bad_parameter) { + out["status_message"] = "Reset Error A00"; + logfmt(logINFO, "ERROR CALL long startPassReset(CVars in, CVars &out)"); + } + + return ret; +} + +long confirmPassReset(CVars in, CVars &out) { + logfmt(logINFO, "confirmPassReset()"); + long ret = PHP_API_BAD_PARAM; + CVars x, y; + try { + REQ_STRING(in, "username", 2, 49, "(.*)"); + REQ_LONG(in, "reset_pin", 0, -1); + const char *loc = getenv("REMOTE_ADDR"); + + ret = load_db_record(out, "SELECT *, id AS reset_id FROM resetpassword WHERE status = 0 AND LOWER(username)=LOWER('%s') AND reset_pin='%lu' AND loc='%s'", in["username"].c_str(), in["reset_pin"].Long(), loc); + if (ret && out["id"].Long() > 0) { + pgsql_query("UPDATE resetpassword SET status = 1 WHERE id =%lu", out["reset_id"].Long()); + ret = PHP_API_OK; + } else { + out["status_message"] = "Invalid PIN or disabled account"; + out["status_advice"] = "Contact support or Start all over"; + } + // out["reset_seed="] = "REMOVED"; + } catch (bad_parameter) { + out["status_message"] = "Reset Error A02"; + logfmt(logINFO, "ERROR CALL long confirmPassReset(CVars in, CVars &out)"); + } + return ret; +} + +long completePassReset(CVars in, CVars &out) { + logfmt(logINFO, "completePassReset()"); + long ret = PHP_API_BAD_PARAM; + CVars x, y; + try { + REQ_STRING(in, "username", 2, 49, "(.*)"); + REQ_STRING(in, "newpass", 5, 15, "(.*)"); + REQ_LONG(in, "reset_pin", 0, -1); + REQ_STRING(in, "reset_key", 2, 49, "(.*)"); + + const char *loc = getenv("REMOTE_ADDR"); + + ret = load_db_record(out, "SELECT *,id AS reset_id FROM resetpassword WHERE status=1 AND LOWER(username)=LOWER('%s') AND reset_pin='%lu' AND loc='%s' AND reset_key='%s'", in["username"].c_str(), in["reset_pin"].Long(), loc, in["reset_key"].c_str()); + if (ret && out["reset_id"].Long() > 0) { + char mcf[128]; + int result = 0; //libscrypt_hash(mcf, in["password"].c_str(), SCRYPT_N, SCRYPT_r, SCRYPT_p); + if (result > 0) { + if (pgsql_query("UPDATE members SET password='%s' WHERE id =%lu", mcf, out["member_id"].Long()) >= 0) { + pgsql_query("UPDATE resetpassword SET status = 5,reset_key=NULL WHERE id =%lu", out["reset_id"].Long()); + ret = PHP_API_OK; + } + + out["reset_key"] = "YOU WILL GET THIS IF PIN IS CORRECT IN CONFIRM"; //x["reset_key"]; + out["mode"] = RESET_COMPLETE; + member_email_calls(in["action"].Long(), out, x); // note the use of out to send in + } else { + logfmt(logINFO, "ERROR create hash using SCRYPT"); + } + } else { + out["status_message"] = "Invalid call or disabled account"; + out["status_advice"] = "Contact Support"; + } + // out["reset_seed="] = "REMOVED"; + } catch (bad_parameter) { + out["status_message"] = "Reset Error A03"; + logfmt(logINFO, "ERROR CALL long confirmPassReset(CVars in, CVars &out)"); + } + return ret; +} + /*************************************************************************************************************************/ long AddPageCard(CVars in, CVars &out) { long ret = PHP_API_BAD_PARAM; @@ -155,16 +334,13 @@ long AddPageCard(CVars in, CVars &out) { x["member_id"] = in["member_id"]; x["member_id"].set_valid(true); x["item_type"] = in["item_type"]; - x["item_type"].set_valid( true ); + x["item_type"].set_valid(true); - ret = insert_db_record(DBS_VALID, "members_page_item", "members_page_item_id_seq", x); + out["page_item_id"] = insert_db_record(DBS_VALID, "members_page_item", "members_page_item_id_seq", x); - - - - // } else { - // out["status"] = "Error"; - // } + if (out["page_item_id"].Long()) { + ret = PHP_API_OK; + } } catch (bad_parameter) { out["status"] = "Invalid session ID"; @@ -271,6 +447,14 @@ long LoginCoreGradeAccount(CVars in, CVars &out) { out["status"] = "Invalid username and/or password"; } + // make sure we have folder for the user + if (out["folder"] == "") { + load_db_record(out, "SELECT upper(md5( now()::text )) AS folder"); + CVars x; + x["folder"] = out["folder"]; + x["folder"].set_valid(true); + update_db_record(DBS_VALID, "members", x, out["member_id"].Long()); + } logfmt(logINFO, "/LoginCoreGradeAccount()"); return ret; diff --git a/coregrade/src/shared_tool/email.cc b/coregrade/src/shared_tool/email.cc index a6973f2..c3a5884 100644 --- a/coregrade/src/shared_tool/email.cc +++ b/coregrade/src/shared_tool/email.cc @@ -12,7 +12,197 @@ void vars2form( CVars &v, C_CGI_Form &form ); extern int mailsend(CVars in,CVars &out); +long carpool_email_calls(long email_action, CVars in, CVars &out) { + logfmt(logINFO, "carpool_email_calls() action=%lu", email_action); + out["result"] = "ECHO BACKEND"; + + CVars x, y, z, x1, x2; + long ret = 0; + const char *loc = getenv("REMOTE_ADDR"); + C_CGI_Form form("", ""); + + char accept_link[150]; + char reject_link[150]; + + out["contactus"] = CfgReadChar("system.contactus"); + out["facebook"] = CfgReadChar("system.facebook"); + out["twitter"] = CfgReadChar("system.twitter"); + out["site_www"] = CfgReadChar("system.site_www"); + //https://www.float.sg/ + + try { + form.LetStr("site_name", "Float"); + form.LetStr("site_www", out["site_www"].c_str()); + form.LetStr("contactus", out["contactus"].c_str()); + form.LetStr("facebook", out["facebook"].c_str()); + form.LetStr("twitter", out["twitter"].c_str()); + // email_action = SAVVY_BKO_CARPOOL_FRIENDMESSAGE; + logfmt(logINFO, "carpool_email_calls() 11 - JOY email_action=%lu", email_action); + + switch (email_action) { + logfmt(logINFO, "carpool_email_calls() 00 - FAITH"); +/* + case SAVVY_BKO_CARPOOL_FRIENDMESSAGE: + logfmt(logINFO, "carpool_email_calls() 01"); + if (load_db_record(x, "SELECT cf.email AS friend_email, cf.*,cp.member_id,m.firstname AS invite_firstname FROM members_carpool_friends cf LEFT JOIN members_carpool cp ON cp.id =cf.carpool_id LEFT JOIN members m ON m.id =cp.member_id WHERE cf.id =%lu ", in["carpool_friend_id"].Long())) { + + snprintf(accept_link, sizeof (accept_link), "lmsg/carpool?pid=%s&ans=accept", x["link"].c_str()); + snprintf(reject_link, sizeof (reject_link), "lmsg/carpool?pid=%s&ans=reject", x["link"].c_str()); + + form.LetStr("reject_link", reject_link); + form.LetStr("accept_link", accept_link); + + logfmt(logINFO, "carpool_email_calls() 02"); + // form.LetStr("msgid", "ABCDEFGHIJKLMNOPQRST"); + logfmt(logINFO, "carpool_email_calls() 03"); + vars2form(x, form); + form.LetStr("subject", "Carpool Invitation"); + form.LetStr("email", x["friend_email"].c_str()); + form.Email("carpool/carpool_invite.mailfile"); + } + break; + + case SAVVY_BKO_CARPOOL_FRIENDACCEPT: + logfmt(logINFO, "carpool_email_calls() 01"); + if (load_db_record(x, "SELECT m.email AS sender_email, cf.*,cp.member_id,cf.firstname AS friend_firstname FROM members_carpool_friends cf LEFT JOIN members_carpool cp ON cp.id =cf.carpool_id LEFT JOIN members m ON m.id =cp.member_id WHERE cf.id =%lu ", in["carpool_friend_id"].Long())) { + + snprintf(accept_link, sizeof (accept_link), "lmsg/carpool?pid=%s&ans=accept", x["link"].c_str()); + snprintf(reject_link, sizeof (reject_link), "lmsg/carpool?pid=%s&ans=reject", x["link"].c_str()); + + form.LetStr("reject_link", reject_link); + form.LetStr("accept_link", accept_link); + + logfmt(logINFO, "carpool_email_calls() 02"); + // form.LetStr("msgid", "ABCDEFGHIJKLMNOPQRST"); + logfmt(logINFO, "carpool_email_calls() 03"); + vars2form(x, form); + form.LetStr("subject", "Carpool Accepted"); + form.LetStr("email", x["sender_email"].c_str()); + //form.LetStr("email", "olu@float.sg"); + form.Email("carpool/carpool_accepted.mailfile"); + } + break; + */ + } + } catch (bad_parameter) { + logfmt(logINFO, "ERROR CALL long member_email_calls(CVars in, CVars &out)"); + } + + logfmt(logINFO, "/carpool_email_calls()"); + return ret; +} + +long member_email_calls(long action, CVars in, CVars &out) { + logfmt(logINFO, "member_email_calls()"); + out["result"] = "ECHO BACKEND"; + + + CVars x, y, z, x1, x2; + long ret = 0; + long mode = 0; + const char *loc = getenv("REMOTE_ADDR"); + C_CGI_Form form("", ""); + // form.LetStr("subject", "KleenApp Email Test"); + out["contactus"] = CfgReadChar("system.contactus"); + out["facebook"] = CfgReadChar("system.facebook"); + out["twitter"] = CfgReadChar("system.twitter"); + + //https://www.float.sg/ + + form.LetStr("site_name", "Float"); + form.LetStr("contactus", out["contactus"].c_str()); + form.LetStr("facebook", out["facebook"].c_str()); + form.LetStr("twitter", out["twitter"].c_str()); + + CGIList *inv_list = new CGIList(&form, "inv_items"); + char listing_items[1024]; + //const PGresult *res; + + try { + + switch (action) { +/* + case SAVVY_USER_LOGINACCOUNT: + if (load_db_record(x, "SELECT *,email as email2,now() AS last_login2 FROM members WHERE id = %lu ", in["member_id"].Long())) { + vars2form(x, form); + form.LetStr("subject", "Float Account Access"); + form.LetStr("email", x["email2"].c_str()); + // form.Email("member/user_login.mailfile"); + } + break; + + case SAVVY_USER_CREATEACCOUNT: + + if (in["pending_id"].Long() > 0) { + if (load_db_record(x, " SELECT * FROM members_pending WHERE id=%lu", in["pending_id"].Long()) > 0) { + vars2form(x, form); + form.LetStr("subject", "Confirm your Float Account"); + form.LetStr("email", x["email"].c_str()); + form.Email("member/user_pending.mailfile"); + } + } else { + if (in["member_id"].Long() > 0) { + + if (load_db_record(x, "SELECT *,email as email2,now() AS last_login2 FROM members WHERE id = %lu ", in["member_id"].Long())) { + vars2form(x, form); + form.LetStr("subject", "Welcome to Float "); + form.LetStr("email", x["email2"].c_str()); + form.Email("member/user_welcome.mailfile"); + } + } // member created first time email only + } + break; + case FLOAT_SYSTEM_EMAIL_NOTIFICATION: + + if (load_db_record(x, "SELECT * FROM members_notification WHERE id =%lu ", in["notify_id"].Long())) { + vars2form(x, form); + form.LetStr("subject", "Float - Save Money and Time"); + form.LetStr("email", "olu@float.sg"); + form.LetStr("email", "ses66181@gmal.com"); + // form.LetStr("email", x["email2"].c_str()); + form.Email("member/user_notification.mailfile"); + } + + + break; + */ + case COREGRADE_START_RESET_PASSWORD: + mode = REQ_LONG(in, "mode", 0, -1); + if (load_db_record(x, "SELECT m.firstname,p.*,m.email AS member_email FROM resetpassword p LEFT JOIN members m ON m.id=p.member_id WHERE p.id=%lu ", in["reset_id"].Long())) { + vars2form(x, form); + form.LetStr("subject", "Reset Password"); + form.LetStr("email", x["member_email"].c_str()); + + switch (mode) { + case RESET_START: + form.Email("member/reset_password.mailfile"); + break; + + case RESET_CONFIRM: + + break; + + case RESET_COMPLETE: + + break; + } + } + break; + + + + + + } + } catch (bad_parameter) { + logfmt(logINFO, "ERROR CALL long member_email_calls(CVars in, CVars &out)"); + } + + logfmt(logINFO, "/member_email_calls()"); + return ret; +} +////TO_CHAR(r.service_date :: TIMESTAMP, 'Day Mon dd, yyyy HH:MI AM') AS long_date long AccountPendingMail(CVars in) { diff --git a/www/application/config/constants.php b/www/application/config/constants.php index 79fecd1..f4c76c2 100644 --- a/www/application/config/constants.php +++ b/www/application/config/constants.php @@ -89,7 +89,14 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto define('COREGRADE_ACCOUNT_TESTEMAIL',11001); define('COREGRADE_ACCOUNT_PENDING',11010); define('COREGRADE_VERIFY_PENDING_LINK',11015); + +define('COREGRADE_START_RESET_PASSWORD',11017); + define('COREGRADE_ACCOUNT_CREATEACC',11020); define('COREGRADE_ACCOUNT_LOGIN',11025); define('COREGRADE_ACCOUNT_ADDCARD', 11027); -define('COREGRADE_ACCOUNT_ADDPAGECARD', 11029); \ No newline at end of file +define('COREGRADE_ACCOUNT_ADDPAGECARD', 11029); + +define('RESET_START', 100); +define('RESET_CONFIRM', 200 ); +define('RESET_COMPLETE', 300 ); \ No newline at end of file diff --git a/www/application/controllers/Auth.php b/www/application/controllers/Auth.php index f4112d7..b944685 100644 --- a/www/application/controllers/Auth.php +++ b/www/application/controllers/Auth.php @@ -26,20 +26,20 @@ class Auth extends Start_Controller { $data["page_title"] = ""; $data["username"] = $username; //"auxsupport"; $data["password"] = $password; - $data["sessionid"] ="12345678901234567890"; + $data["sessionid"] = "12345678901234567890"; $out = []; $this->coregrade_webapi(COREGRADE_ACCOUNT_LOGIN, $data, $out); //print_r( $data ); //print_r( $out ); - if (count($out) > 0 && isset($out["sessionid"]) && isset($out["member_id"]) && $out["member_id"] > 0 ) { - // print_r($out); + if (count($out) > 0 && isset($out["sessionid"]) && isset($out["member_id"]) && $out["member_id"] > 0) { + // print_r($out); //$this->getSessionData($out[0], $session_data); // just for testing $this->buildUserSession(PHP_API_OK, $out); $valid_login = true; $this->session->set_flashdata('in', $out); - redirect("member/index"); - $login_done = true; + redirect("member/index"); + $login_done = true; } else { $error_message = "Invalid Username/Password"; } @@ -48,12 +48,11 @@ class Auth extends Start_Controller { - // $this->renderMemberPages('view_dash', $data); - // $login_done = true; - + // $this->renderMemberPages('view_dash', $data); + // $login_done = true; // exit(); } - // echo 'hhhh jjjj'; + // echo 'hhhh jjjj'; //$this->coregrade_webapi(100, $data, $out); // print_r($out); @@ -105,17 +104,28 @@ class Auth extends Start_Controller { } public function resetpass() { - //$this->load->view('home/home'); - //echo "START RESET 1"; + $data = array(); + $out = array(); + $data["next_page"] = 0; + $data["error_message"] = ""; + if ($_POST) { + $data['username'] = trim($this->input->post('username')); + $data["mode"] = RESET_START; + if ($data['username'] != '') { + $this->coregrade_webapi(COREGRADE_START_RESET_PASSWORD, $data, $out); + $data["next_page"] = 100; + } else { + $data["error_message"] = "Please enter a valis username to continue"; + } + } + $this->load->view('auth/view_head'); - $this->load->view('auth/view_reset_password'); + $this->load->view('auth/view_reset_password', $data); $this->load->view('auth/view_foot'); } public function logout() { $this->index(); } - - } diff --git a/www/application/views/auth/view_faq.php b/www/application/views/auth/view_faq.php index 0cfa73e..d820e31 100644 --- a/www/application/views/auth/view_faq.php +++ b/www/application/views/auth/view_faq.php @@ -34,7 +34,7 @@ $next_page = isset($next_page) ? $next_page : 0;
@@ -46,7 +46,7 @@ $next_page = isset($next_page) ? $next_page : 0;
@@ -70,7 +70,7 @@ $next_page = isset($next_page) ? $next_page : 0;
@@ -118,7 +118,7 @@ $next_page = isset($next_page) ? $next_page : 0;
diff --git a/www/application/views/auth/view_head.php b/www/application/views/auth/view_head.php index 2337e8c..74cb9d1 100644 --- a/www/application/views/auth/view_head.php +++ b/www/application/views/auth/view_head.php @@ -44,19 +44,18 @@
- -

Please enter your new password.

+
-
+

Please tell us your username.

+
- +
- + if the account is valid, you will receive instruction in your email to continue the reset process. +
- +
@@ -53,10 +55,33 @@ $next_page = isset($next_page) ? $next_page : 0;
+ +
+
+ Check your email for a link to continue this process. + +
+ +
+ The email will expire in a few minutes if you did not receive the password reset email, please contact us. +
+ +
+ +
+
+ +
+ +
+
+
+ -
diff --git a/www/application/views/home/home.php b/www/application/views/home/home.php index f4f5833..0117a00 100644 --- a/www/application/views/home/home.php +++ b/www/application/views/home/home.php @@ -40,7 +40,7 @@ - + @@ -81,7 +81,7 @@
  • PLANS
  • APP
  • CONTACT
  • -
  • ACCOUNT
  • +
  • START
  • @@ -200,7 +200,7 @@

    You Are

    • Individual
    • -
    • Groups
    • +
    • Need More
    • @@ -216,19 +216,20 @@ Free

      Empowering
      New Skills

        -
      • Step-by-step Learning Path

      • +
      • Creative Learning Path

      • Stay in the loop

      • Accessibility

      Get Started
    • -

      Groups

      +

      CoreGrade Plus

      Contact Us

      Quality support that
      drives success

        +
      • Everything Individual +

      • Integrations

      • -
      • Focus on laid-back acquirements

      • +
      • Flexible Learning

      • Personal Assistant

      Make me a Pro @@ -264,7 +265,6 @@
    -
    @@ -293,7 +293,7 @@
    - Mobile Slide +
    diff --git a/www/assets/css/style.css b/www/assets/css/style.css index 4f3e2fc..fee3529 100644 --- a/www/assets/css/style.css +++ b/www/assets/css/style.css @@ -438,7 +438,7 @@ Table of Contents .subscribe-area { width: 100%; height: auto; - background-image: url('../img/subscribe_bg.jpg'); + background-image: url('../img/coregrade_subscribe.jpg'); background-repeat: no-repeat; background-position: center; background-size: cover; @@ -489,6 +489,7 @@ Table of Contents width: 100%; height: auto; margin-top: 100px; + background-size: contain; } /* diff --git a/wwwadmin/index.php b/wwwadmin/index.php old mode 100644 new mode 100755