mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:30:12 +01:00
use email instead of username in the online table
This commit is contained in:
parent
1229e10bfc
commit
f3742a5a86
@ -18,6 +18,7 @@ class ControllerLoginLogin extends Controller {
|
|||||||
|
|
||||||
|
|
||||||
$request = Registry::get('request');
|
$request = Registry::get('request');
|
||||||
|
$session = Registry::get('session');
|
||||||
|
|
||||||
$db = Registry::get('db');
|
$db = Registry::get('db');
|
||||||
|
|
||||||
@ -42,10 +43,10 @@ class ControllerLoginLogin extends Controller {
|
|||||||
|
|
||||||
if($this->model_user_auth->checkLogin($this->request->post['username'], $_POST['password']) == 1) {
|
if($this->model_user_auth->checkLogin($this->request->post['username'], $_POST['password']) == 1) {
|
||||||
|
|
||||||
$this->model_user_prefs->get_user_preferences($_SESSION['username']);
|
$this->model_user_prefs->get_user_preferences($session->get('username'));
|
||||||
|
|
||||||
if(ENABLE_SAAS == 1) {
|
if(ENABLE_SAAS == 1) {
|
||||||
$this->model_saas_customer->online($_SESSION['username']);
|
$this->model_saas_customer->online($session->get('email'));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER('logged in');
|
LOGGER('logged in');
|
||||||
|
@ -11,6 +11,7 @@ class ControllerLoginLogout extends Controller {
|
|||||||
$this->layout = "common/layout-empty";
|
$this->layout = "common/layout-empty";
|
||||||
|
|
||||||
$request = Registry::get('request');
|
$request = Registry::get('request');
|
||||||
|
$session = Registry::get('session');
|
||||||
|
|
||||||
$db = Registry::get('db');
|
$db = Registry::get('db');
|
||||||
|
|
||||||
@ -21,7 +22,7 @@ class ControllerLoginLogout extends Controller {
|
|||||||
|
|
||||||
if(ENABLE_SAAS == 1) {
|
if(ENABLE_SAAS == 1) {
|
||||||
$this->load->model('saas/customer');
|
$this->load->model('saas/customer');
|
||||||
$this->model_saas_customer->offline(Registry::get('username'));
|
$this->model_saas_customer->offline($session->get('email'));
|
||||||
}
|
}
|
||||||
|
|
||||||
logout();
|
logout();
|
||||||
|
@ -80,10 +80,10 @@ if(Registry::get('username')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ENABLE_SAAS == 1) {
|
if(ENABLE_SAAS == 1) {
|
||||||
$query = $db->query("UPDATE " . TABLE_ONLINE . " SET last_activity=? WHERE username=? AND ipaddr=?", array(NOW, Registry::get('username'), $_SERVER['REMOTE_ADDR']));
|
$query = $db->query("UPDATE " . TABLE_ONLINE . " SET last_activity=? WHERE username=? AND ipaddr=?", array(NOW, $session->get('email'), $_SERVER['REMOTE_ADDR']));
|
||||||
|
|
||||||
if($db->countAffected() == 0) {
|
if($db->countAffected() == 0) {
|
||||||
$query = $db->query("INSERT INTO " . TABLE_ONLINE . " (username, ts, last_activity, ipaddr) VALUES(?,?,?,?)", array(Registry::get('username'), NOW, NOW, $_SERVER['REMOTE_ADDR']));
|
$query = $db->query("INSERT INTO " . TABLE_ONLINE . " (username, ts, last_activity, ipaddr) VALUES(?,?,?,?)", array($session->get('email'), NOW, NOW, $_SERVER['REMOTE_ADDR']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user