\BHB::$login->doLogin()
namespace adm\controller\opt; class opt { //***************************************************************** public function login() { //for the form $modelLogin = \BHB::$load->f("adm\\model\\opt", "modelLoginOtherWayToCallObj"); //$modelContent->showContent(); //this way is valid \BHB::obj("modelLoginOtherWayToCallObj")->login(); //this way is valid too. } //*************************************************************** public function dologin() { if(\BHB::$isPost === true) { //The Login Business-Logic is in ext/login/login.php $login = preg_replace("/[^\p{L}\p{N}]/u", "", $_POST["login"]); //$password = preg_replace("/[^\p{L}\p{N}]/u", "", $_POST["password"]); $password = $_POST["password"]; //may has strange chars. //the login type is determinated by the position of login form, ex. in admin_area or user_area. //or may use a radio button to determinate the type. //\BHB::$login->login(array("typeOfLogin(user,admin,etc)", $login, $password, $otp ); if(\BHB::$login->doLogin( "adm", $login, $password, $otp ) === false) { \BHB::$userData->oSet("ud,login,errorMsg", "Login or Password <b>NOT Correct</b>!"); } if(\BHB::$login->doLogin( "adm", $login, $password, $otp ) == "NotMoreLogged") { \BHB::$userData->oSet("ud,login,errorMsg", "NOT MORE THAN ".\BHB::$configArrayDB["login"]["adm"]["nrLoginsInSameTime"]." LOGIN IN THE SAME TIME<br />"); } //may be that the user_table and cookie_table are in diferent databases and connections. //\BHB::$login->logout(); } //die(\BHB::$url.\BHB::$c_."adm__opt__wt"); \BHB::goBack(\BHB::$url.\BHB::$c_."adm__opt__wt"); } //************************************************************* public function logout() { \BHB::$login->doLogout("adm"); \BHB::goBack(); } }