Пример #1
0
 /**
  * Login service.
  */
 public function doLogin($user, $passwd)
 {
     $securityBo = CalemFactory::getSecurityBo();
     list($succ, $userDbo) = $securityBo->verifyLogin($user, $passwd);
     if ($succ) {
         //Login is successful.
         //Creating a session
         $ses = new CalemSession();
         //configure session settings
         $ses->set('setting', array('lang' => $this->lang, 'theme' => $this->theme, 'loadmode' => $this->loadmode, 'login_time' => mktime()));
         $ses->set('user', $userDbo->getRow());
         //Store off the user.
         $ses->save();
     }
     return array($succ, $ses);
 }