Example #1
0
 public function checkAdminLogin()
 {
     $adminUserInfo = '';
     $sessionUser = utils::getSessionVal('user');
     if ($sessionUser) {
         $adminUserObj = new adminUserModel();
         $adminUserInfo = $adminUserObj->find($sessionUser);
     }
     return $adminUserInfo;
 }
Example #2
0
 public function loginIn()
 {
     $user = request::postParam('user', '');
     $password = request::postParam('password', '');
     $adminUserModel = new adminUserModel();
     $encryptPassword = $adminUserModel->createPassword($user, $password);
     $paramWhere = array('field' => array('id', 'username', 'paddtime', 'pstatus', 'pupdatetime', 'groupid'), 'where' => 'username =? and password=? and pstatus=?', 'param' => array($user, $encryptPassword, 1), 'isRow' => true);
     $userInfo = $adminUserModel->select($paramWhere);
     if ($userInfo) {
         utils::setSessionVal('user', $userInfo['id']);
         $this->tip('登录成功,即将进入ERP后台系统', utils::getUrl('admin'));
     } else {
         $this->tip('登录失败,请确认用户名和密码是否正确', utils::getUrl('admin'));
     }
 }