/** * check ssid in get return and after check set login data for user * check user permissions and validate session for disallow unwanted attack * @param [type] $_type [description] * @return [type] [description] */ public function checkMainAccount($_type = null) { $_type = $_type !== null ? $_type : $this->put_ssidStatus(); switch ($_type) { // user want to attack to our system! logout from system and show message case 'attack': $this->put_logout(); \lib\error::bad(T_("you want hijack us!!?")); break; // only log out user from system // only log out user from system case 'logout': $this->put_logout('redirect'); break; // if user_id set in options table login user to system // if user_id set in options table login user to system case is_numeric($_type): $mydatarow = $this->sql()->tableUsers()->whereId($_type)->select()->assoc(); $myfields = array('id', 'user_mobile', 'user_email', 'user_displayname', 'user_meta', 'user_status', 'user_permission'); $this->setLoginSession($mydatarow, $myfields); break; // ssid does not available on this sub domain // ssid does not available on this sub domain case 'notlogin': $this->put_logout('redirect'); break; default: break; } }