当前位置: 首页>>代码示例>>PHP>>正文


PHP Default_Model_Users::getUserTimemanagementRole方法代码示例

本文整理汇总了PHP中Default_Model_Users::getUserTimemanagementRole方法的典型用法代码示例。如果您正苦于以下问题:PHP Default_Model_Users::getUserTimemanagementRole方法的具体用法?PHP Default_Model_Users::getUserTimemanagementRole怎么用?PHP Default_Model_Users::getUserTimemanagementRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Default_Model_Users的用法示例。


在下文中一共展示了Default_Model_Users::getUserTimemanagementRole方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loginpopupsaveAction

 /**
  * @name loginAction
  *
  * This method is used to display the login data errors
  *
  * @author Mainak
  * @version 1.0
  *
  * values used in this method
  * ==========================
  * @param username => Email given in Login Form
  * @param password => Password given in Login Form
  */
 public function loginpopupsaveAction()
 {
     $emailParam = $this->getRequest()->getParam('username');
     $opt = array('custom' => array('timeout' => $this->_options['auth']['timeout']));
     $options = array();
     $options['username'] = $this->getRequest()->getParam('username');
     $options['user_password'] = $this->getRequest()->getParam('password');
     $usersModel = new Default_Model_Users();
     $userData = $usersModel->isActiveUser($options['username']);
     $check = 0;
     foreach ($userData as $user) {
         $check = $user['count'] == 1 ? 1 : 0;
     }
     if (!$check) {
         $userStatusArr = $usersModel->getActiveStatus($options['username']);
         if (!empty($userStatusArr)) {
             $userStatus = $userStatusArr[0]['status'];
             $islockaccount = $userStatusArr[0]['isaccountlock'];
             if ($userStatus == 0) {
                 $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has been inactivated from the organization.");
             } else {
                 if ($userStatus == 2) {
                     $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has resigned from the organization.");
                 } else {
                     if ($userStatus == 3) {
                         $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has left the organization.");
                     } else {
                         if ($userStatus == 4) {
                             $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has been suspended from the organization.");
                         } else {
                             if ($userStatus == 5) {
                                 $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee deleted.");
                             } else {
                                 if ($islockaccount == 1) {
                                     $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Employee has been locked.");
                                 } else {
                                     $this->_helper->getHelper("FlashMessenger")->addMessage("Login failed. Not a valid employee.");
                                 }
                             }
                         }
                     }
                 }
             }
         } else {
             $this->_helper->getHelper("FlashMessenger")->addMessage("The username or password you entered is incorrect.");
         }
         $this->_redirect('index');
     }
     /**
      * 	Start - To check if employee date of joining is greater than current date.
      */
     $userDateOfJoining = $usersModel->getUserDateOfJoining($options['username']);
     if (!empty($userDateOfJoining)) {
         if (!$userDateOfJoining[0]['doj']) {
             $this->_helper->getHelper("FlashMessenger")->addMessage("You will be able to login on or after " . sapp_Global::change_date($userDateOfJoining[0]['date_of_joining'], 'view'));
             $this->_redirect('index');
         }
     }
     /**
      * End
      */
     $auth = Zend_Auth::getInstance();
     try {
         $db = $this->getInvokeArg('bootstrap')->getResource('db');
         $user = new Default_Model_Users($db);
         if ($user->isLdapUser(sapp_Global::escapeString($options['username']))) {
             $options['ldap'] = $this->_options['ldap'];
             $authAdapter = Login_Auth::_getAdapter('ldap', $options);
         } else {
             $options['db'] = $db;
             $options['salt'] = $this->_options['auth']['salt'];
             if ($isemail = filter_var($options['username'], FILTER_VALIDATE_EMAIL)) {
                 $authAdapter = Login_Auth::_getAdapter('email', $options);
             } else {
                 $authAdapter = Login_Auth::_getAdapter('db', $options);
             }
         }
         $result = $auth->authenticate($authAdapter);
         if ($result->isValid()) {
             $admin_data = $user->getUserObject($options['username']);
             $auth->getStorage()->write($admin_data);
             $storage = $auth->getStorage()->read();
             /***
             				Start - Session for time management role.
             			**/
             $tmRole = $usersModel->getUserTimemanagementRole($storage->id);
             $timeManagementRole = new Zend_Session_Namespace('tm_role');
//.........这里部分代码省略.........
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:101,代码来源:IndexController.php


注:本文中的Default_Model_Users::getUserTimemanagementRole方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。