diff --git a/jubabox/src/shared_tool/function_members.cc b/jubabox/src/shared_tool/function_members.cc
index 575d4bd..ad603e4 100644
--- a/jubabox/src/shared_tool/function_members.cc
+++ b/jubabox/src/shared_tool/function_members.cc
@@ -23,6 +23,50 @@
#include "function_members.h"
#include "jubabox_session.h"
+long medTMemberLogin(CVars in, CVars &out) {
+ long ret = PHP_API_BAD_PARAM;
+
+ try {
+ REQ_STRING(in, "username", 2, 49, "(.*)");
+ REQ_STRING(in, "password", 2, 49, "(.*)");
+ const char * loc = getenv("REMOTE_ADDR");
+ ret = load_db_record(out, "SELECT UPPER( md5( now()::text) ) AS sessionid,m.*,mp.*,m.id AS member_id,mp.id AS member_profile_id FROM members m \
+ LEFT JOIN members_profile mp ON mp.member_id = m.id \
+ WHERE m.status=1 AND LOWER(m.username)=LOWER('%s') AND m.password= md5('%s')", in["username"].c_str(), in["password"].c_str());
+ if (ret && out["member_id"].Long() > 0) {
+ // remove all existing session
+ pgsql_exec("DELETE FROM members_session WHERE member_id=%ld ", out["member_id"].Long());
+ // Create New Session Now
+ if (out["member_id"].Long() > 0) {
+ if (SessionCheck(out["member_id"].Long(), out["sessionid"].c_str(), 1) > 0) {
+
+ out["stauts"] = "OK";
+ /*LOAD THE SESSION INTO OUT now */
+ load_db_record(out, "SELECT session FROM members_session WHERE member_id=%lu ORDER BY id DESC LIMIT 1", out["member_id"].Long());
+ member_email_calls(in["action"].Long(), in, out);
+ //===============================================================================================================================
+ pgsql_query("UPDATE members SET last_login = now() WHERE id = %lu", out["member_id"].Long());
+ // account_email(ACCOUNT_LOGIN_ALERT,out,out); // ALERT CUSTOMER OF LOGIN
+ ret = PHP_LOGIN_OK;
+ }
+ } else {
+ out["status"] = "Session check failed";
+ }
+
+
+ } else {
+ out["status_message"] = "Invalid Username/Password";
+ }
+
+
+ } catch (bad_parameter) {
+ logfmt(logINFO, "ERROR CALL long medTMemberLogin(CVars in, CVars &out)");
+ }
+
+ return ret;
+}
+
+
long serviceCost(long service_id, long discount_rate);
long medTrMemberTransportById(CVars in, CVars &out) {
@@ -277,48 +321,7 @@ long getServiceDetail(long service_id, CVars &out) {
-long medTMemberLogin(CVars in, CVars &out) {
- long ret = PHP_API_BAD_PARAM;
- try {
- REQ_STRING(in, "username", 2, 49, "(.*)");
- REQ_STRING(in, "password", 2, 49, "(.*)");
- const char * loc = getenv("REMOTE_ADDR");
- ret = load_db_record(out, "SELECT UPPER( md5( now()::text) ) AS sessionid,m.*,mp.*,m.id AS member_id,mp.id AS member_profile_id FROM members m \
- LEFT JOIN members_profile mp ON mp.member_id = m.id \
- WHERE m.status=1 AND LOWER(m.username)=LOWER('%s') AND m.password= md5('%s')", in["username"].c_str(), in["password"].c_str());
- if (ret && out["member_id"].Long() > 0) {
- // remove all existing session
- pgsql_exec("DELETE FROM members_session WHERE member_id=%ld ", out["member_id"].Long());
- // Create New Session Now
- if (false) {
- //if (SessionCheck(out["member_id"].Long(), out["sessionid"].c_str(), 1) > 0) {
-
-
- out["stauts"] = "OK";
- /*LOAD THE SESSION INTO OUT now */
- load_db_record(out, "SELECT session FROM members_session WHERE member_id=%lu ORDER BY id DESC LIMIT 1", out["member_id"].Long());
- member_email_calls(in["action"].Long(), in, out);
- //===============================================================================================================================
- pgsql_query("UPDATE members SET last_login = now() WHERE id = %lu", out["member_id"].Long());
- // account_email(ACCOUNT_LOGIN_ALERT,out,out); // ALERT CUSTOMER OF LOGIN
- ret = PHP_LOGIN_OK;
- } else {
- out["status"] = "Session check failed";
- }
-
-
- } else {
- out["status_message"] = "Invalid Username/Password";
- }
-
-
- } catch (bad_parameter) {
- logfmt(logINFO, "ERROR CALL long medTMemberLogin(CVars in, CVars &out)");
- }
-
- return ret;
-}
diff --git a/wwwjuba/app-assets/js/scripts/pages/dashboard-analytics.js b/wwwjuba/app-assets/js/scripts/pages/dashboard-analytics.js
index a5164c3..16f2b15 100644
--- a/wwwjuba/app-assets/js/scripts/pages/dashboard-analytics.js
+++ b/wwwjuba/app-assets/js/scripts/pages/dashboard-analytics.js
@@ -546,7 +546,7 @@ $(window).on("load", function () {
});
if ($(window).width() > 1200 && !$("body").hasClass("menu-collapsed")) {
- tour.start()
+ //tour.start()
}
else {
tour.cancel()
diff --git a/wwwjuba/application/controllers/Auth.php b/wwwjuba/application/controllers/Auth.php
index 9c58b9c..6ef74ec 100644
--- a/wwwjuba/application/controllers/Auth.php
+++ b/wwwjuba/application/controllers/Auth.php
@@ -22,15 +22,19 @@ class Auth extends Start_Controller {
$data["page_title"] = "";
$data["username"] = $username; //"auxsupport";
- $data["password"] = "may12002";
+ $data["password"] = $password;
+ $out = [];
$this->jubabox_webapi(USER_LOGIN, $data, $out);
//print_r( $data );
//print_r( $out );
- if ( count($out) > 0 && isset($out[0]) ){
- $this->getSessionData($out[0], $session_data); // just for testing
+ if ( count($out) > 0 && isset($out["session"]) ){
+ print_r( $out );
+ //$this->getSessionData($out[0], $session_data); // just for testing
- $this->buildUserSession(PHP_API_OK,$session_data);
+ $this->buildUserSession(PHP_API_OK,$out);
$valid_login = true;
+ $this->session->set_flashdata('in',$out);
+ redirect("page/index");
}
else
{
@@ -45,6 +49,34 @@ class Auth extends Start_Controller {
$this->load->view('home/view_login');
}
+ /*
+.916 SQL [12418]: Found rows: 0
+- 18:20:16.916 SQL [12418]: Found rows: 0
+- 18:20:16.916 INFO [12418]: RET: added=2019-10-10 10:43:55.26967
+- 18:20:16.916 INFO [12418]: RET: created=
+- 18:20:16.916 INFO [12418]: RET: email=ameye@chiefsoft.com
+- 18:20:16.916 INFO [12418]: RET: firstname=Olu
+- 18:20:16.916 INFO [12418]: RET: id=
+- 18:20:16.916 INFO [12418]: RET: last_login=2019-10-10 17:55:23.835444
+- 18:20:16.916 INFO [12418]: RET: lastname=Amey
+- 18:20:16.916 INFO [12418]: RET: loc=
+- 18:20:16.916 INFO [12418]: RET: member_id=1
+- 18:20:16.916 INFO [12418]: RET: member_profile_id=
+- 18:20:16.916 INFO [12418]: RET: mypage=oluamey
+- 18:20:16.916 INFO [12418]: RET: password=8ef852e9c900de50c6e9d004f3463686
+- 18:20:16.916 INFO [12418]: RET: phone=
+- 18:20:16.916 INFO [12418]: RET: result=ECHO BACKEND
+- 18:20:16.916 INFO [12418]: RET: session=2AB29AC8698D9F9F7EBCB28A1FE41568
+- 18:20:16.916 INFO [12418]: RET: sessionid=2AB29AC8698D9F9F7EBCB28A1FE41568
+- 18:20:16.916 INFO [12418]: RET: status=1
+- 18:20:16.916 INFO [12418]: RET: stauts=OK
+- 18:20:16.916 INFO [12418]: RET: updated=
+- 18:20:16.916 INFO [12418]: RET: username=ameye@chiefsoft.com
+- 18:20:16.918 INFO [12418]: JUBABOX is stopping...
+- 18:20:16.918 DEBUG [12418]: Closing database connection
+- 18:20:16.918 SQL [12418]: pgsql_close()
+*/
+
public function forgotpass() {
$this->index();
}
diff --git a/wwwjuba/application/controllers/Page.php b/wwwjuba/application/controllers/Page.php
index 535623d..f31f57a 100644
--- a/wwwjuba/application/controllers/Page.php
+++ b/wwwjuba/application/controllers/Page.php
@@ -6,14 +6,21 @@ class Page extends Member_Controller {
public function index()
{
- $this->load->view('members/view_page');
+ $this->load->view('members/view_page');
}
-
- public function forgotpass(){
- $this->index();
+
+ public function email(){
+ $this->index();
}
- public function register(){
- $this->index();
+ public function chat(){
+ $this->index();
+ }
+
+ public function todo(){
+ $this->index();
+ }
+ public function calendar(){
+ $this->index();
}
}
diff --git a/wwwjuba/application/core/JUB_Controller.php b/wwwjuba/application/core/JUB_Controller.php
index b0afb1f..9b5aea4 100644
--- a/wwwjuba/application/core/JUB_Controller.php
+++ b/wwwjuba/application/core/JUB_Controller.php
@@ -51,9 +51,11 @@ class JUB_Controller extends CI_Controller {
protected function jubabox_webapi($action, $in, &$out) {
$this->load->model('backend_model');
- $in["action"] = $action;
- $in["pid"] = 100;
- return $this->backend_model->jubabox_api($in, $out);
+ $in["action"] = $action;
+ $in["pid"] = 100;
+ $ret = $this->backend_model->jubabox_api($in, $out);
+ //echo $ret;
+ return $ret;
}
function formatedMesage($msgType, $theMessage) {
diff --git a/wwwjuba/application/libraries/Start_Controller.php b/wwwjuba/application/libraries/Start_Controller.php
index 230f10b..3c15d07 100644
--- a/wwwjuba/application/libraries/Start_Controller.php
+++ b/wwwjuba/application/libraries/Start_Controller.php
@@ -16,6 +16,7 @@ class Start_Controller extends JUB_Controller {
}
}
+
protected function buildUserSession($ret, $out) {
//session_destroy();
@@ -29,12 +30,10 @@ class Start_Controller extends JUB_Controller {
$_SESSION['firstname'] = $out["firstname"]; // $ret->firstname;
$_SESSION['lastname'] = $out["lastname"]; // $ret->lastname;
$_SESSION['email'] = $out["email"]; // $ret->email;
- $_SESSION['user_id'] = $out["user_id"]; // $ret->id;
- $_SESSION['pid'] = $out["pid"]; // $ret->id;
+ $_SESSION['user_id'] = $out["member_id"]; // $ret->id;
$_SESSION['loc'] = $out["loc"];
- $_SESSION['practice'] = $out["practice"];
- $_SESSION['PracticeID'] = $out["PracticeID"];
- $_SESSION['UserId'] = $out["UserId"];
+ $_SESSION['mypage'] = $out["mypage"];
+
}
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
diff --git a/wwwjuba/application/models/Backend_model.php b/wwwjuba/application/models/Backend_model.php
index bfecb0b..7ba3ce3 100644
--- a/wwwjuba/application/models/Backend_model.php
+++ b/wwwjuba/application/models/Backend_model.php
@@ -17,9 +17,16 @@ class Backend_model extends CI_Model {
$this->thisUser = $this->USER;
}
- public function jubabox_api($in, $out = array()) {
+ public function jubabox_api($in, &$out) {
+ if (!is_array($out)) return -1;
$this->jubabox_load();
- $ret = $this->jubabox->jubabox_api($in, $out);
+ $rrr = array();
+ $jubabox = $this->jubabox;
+ $ret = $jubabox->jubabox_api($in, $rrr);
+ //print_r( $in );
+ //echo "-----\n";
+ //print_r( $rrr );
+ $out = $rrr;
return $ret;
}
diff --git a/wwwjuba/application/views/members/view_page.php b/wwwjuba/application/views/members/view_page.php
index 113556e..4cd6be6 100644
--- a/wwwjuba/application/views/members/view_page.php
+++ b/wwwjuba/application/views/members/view_page.php
@@ -38,6 +38,7 @@
+
@@ -63,11 +64,11 @@
- - 2
+
-
@@ -111,16 +112,16 @@
-
-
-
-
+
+
+
+
-
@@ -139,7 +140,7 @@
-
@@ -148,7 +149,7 @@