Beispiel #1
0
 public function authentication($username, $password)
 {
     $session = $this->getSession();
     $user = new Ecm_Model_Customer();
     $select = $user->select()->where('username = ?', $username)->where('password = ?', $password)->where("status = 'Yes'");
     //echo $select;
     $userLogon = $user->fetchRow($select);
     if ($userLogon == null) {
         return self::FAILURE;
     } else {
         App_Env::setSession('userFullname', $userLogon->firstname);
         //$_SESSION['SES_USER_FULLNAME'] = $userLogon->getFullname();
         App_Env::setSession('userEmail', $userLogon->mail);
         //$_SESSION['SES_USER_EMAIL'] = $userLogon->getEmail();
         App_Env::setSession('userId', $userLogon->id);
         App_Env::setSession('userGroupId', 'customer');
         App_Env::setSession("userType", 'customer');
         $this->setIdentity($userLogon->id);
         $session->isLoginSuccess = true;
         //self::getInstance ()->setUser ( $userLogon );
         //$userLogon->setLastlogin ( new DateTime () );
         $userLogon->save();
         return self::SUCCESS;
     }
 }
Beispiel #2
0
 public function toReceiverName($eceiverId, $row)
 {
     $name = '';
     if ($row->receiverType == 'customer') {
         $user = new Ecm_Model_Customer();
         $user->find($eceiverId);
         $name = $user->firstname . " " . $user->lastname . "(" . $user->mail . ")";
     } else {
         $user = new Cms_Model_User();
         $user->find($eceiverId);
         $name = $user->firstname . " " . $user->lastname . "(" . $user->email . ")";
     }
     return $name;
 }