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


PHP Model_Users::fetchWithEmail方法代码示例

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


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

示例1: fetchWithEmail

 /**
  * fetch user by email
  * 
  * @param string $email
  */
 public function fetchWithEmail($email)
 {
     $user = parent::fetchWithEmail($email);
     if (!$user instanceof Model_User) {
         return false;
     }
     $user = self::makePublic($user);
     return $user;
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:14,代码来源:Users.php

示例2: isValid

 public function isValid($value)
 {
     $modelUsers = new Model_Users();
     $user = $modelUsers->fetchWithEmail($value);
     if (!$user) {
         $this->_error(self::INVALID_USER_EMAIL);
         return false;
     }
     return true;
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:10,代码来源:User.php

示例3: isValid

 public function isValid($value)
 {
     if ($value == $this->excludeAddress) {
         return true;
     }
     $modelUsers = new Model_Users();
     $user = $modelUsers->fetchWithEmail($value);
     if ($user) {
         $this->_error('Email already registered');
         return false;
     }
     return true;
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:13,代码来源:NotUser.php

示例4: fetchWithEmail

 /**
  * fetch admin user by email
  * 
  * @param string $email
  */
 public function fetchWithEmail($email)
 {
     $user = parent::fetchWithEmail($email);
     if (!$user instanceof Model_User) {
         return false;
     }
     $adminInfo = $user->findDependentRowset('Admin_Model_Users_Admins', 'Admin');
     if (count($adminInfo) > 0) {
         $row = $adminInfo->current();
         $user->type = 'ADMIN';
         $user->level = $row->level;
     } else {
         $user = false;
     }
     return $user;
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:21,代码来源:Users.php

示例5: resetpasswordAction

 public function resetpasswordAction()
 {
     if (vkNgine_Auth::isAuthenticated()) {
         $this->_redirect('/admin');
         exit;
     }
     $modelUsers = new Model_Users();
     $modelUsersTokens = new Model_Users_Tokens();
     $token = $this->_getParam('token');
     if (!$token) {
         $this->_redirect('/admin/auth/login');
     }
     $form = self::getResetPasswordForm();
     $request = $this->getRequest();
     if ($request->isPost()) {
         $post = $request->getPost();
         if ($form->isValid($post)) {
             $values = $form->getValues();
             $user = $modelUsers->fetchWithEmail($values['email']);
             $token = $modelUsersTokens->fetch($user, $values['token']);
             if ($token) {
                 $data = array('password' => $values['password']);
                 $modelUsers->update($user->getId(), $data);
                 $modelUsersTokens->delete($token['tokenId']);
                 echo Zend_Json::encode(array('success' => 1, 'title' => $this->t->_('Success Message'), 'message' => $this->t->_('Password was changed successfully'), 'icon' => 'success', 'href' => '/admin/auth/login'));
                 exit;
             } else {
                 echo Zend_Json::encode(array('title' => $this->t->_('Error Message'), 'message' => $this->t->_('Given token was not valid'), 'icon' => 'error'));
                 exit;
             }
         } else {
             echo Zend_Json::encode(array('title' => $this->t->_('Error Message'), 'message' => $this->t->_('Given token/email or password was not valid'), 'icon' => 'error'));
             exit;
         }
     }
     $this->view->form = $form->setTokenValue($token);
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:37,代码来源:AuthController.php


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