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


PHP UsersPeer::doSelectOne方法代码示例

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


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

示例1: executeIndex

 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $uid = $this->getRequestParameter('uid');
     $conf = $this->getRequestParameter('conf');
     $c = new Criteria();
     $c->add(UsersPeer::USER_ID, $uid);
     $user = UsersPeer::doSelectOne($c);
     if (sha1($user->getSalt() . $user->getUsername()) == $conf) {
         $this->goodConf = true;
         $user->setActive('Y');
         $user->save();
     } else {
         $this->goodConf = false;
     }
 }
开发者ID:broschb,项目名称:cyclebrain,代码行数:20,代码来源:actions.class.php

示例2: executeLogin

 public function executeLogin()
 {
     $c = new Criteria();
     $c->add(UsersPeer::USER_NAME, $this->getRequestParameter('login'));
     $c->add(UsersPeer::USER_PWD, $this->getRequestParameter('password'));
     $user_record = UsersPeer::doSelectOne($c);
     if ($user_record) {
         $this->getUser()->setAuthenticated(true);
         $c = new Criteria();
         $c->add(RolePeer::ID, $user_record->getRoleId());
         $user_role = RolePeer::doSelectOne($c);
         $this->getUser()->addCredential($user_role->getRoleName());
         return $this->redirect('users');
     } else {
         $this->getRequest()->setError('login', 'incorrect entry');
         return $this->forward('security', 'index');
     }
 }
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:18,代码来源:actions.class.php

示例3: getUsers

 /**
  * Get the associated Users object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     Users The associated Users object.
  * @throws     PropelException
  */
 public function getUsers(PropelPDO $con = null)
 {
     if ($this->aUsers === null && $this->user_id !== null) {
         $c = new Criteria(UsersPeer::DATABASE_NAME);
         $c->add(UsersPeer::USER_ID, $this->user_id);
         $this->aUsers = UsersPeer::doSelectOne($c, $con);
         // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.
         $this->aUsers->setUserInformation($this);
     }
     return $this->aUsers;
 }
开发者ID:broschb,项目名称:cyclebrain,代码行数:18,代码来源:BaseUserInformation.php

示例4: getUsers

 /**
  * Get the associated Users object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     Users The associated Users object.
  * @throws     PropelException
  */
 public function getUsers(PropelPDO $con = null)
 {
     if ($this->aUsers === null && $this->user_id !== null) {
         $c = new Criteria(UsersPeer::DATABASE_NAME);
         $c->add(UsersPeer::USER_ID, $this->user_id);
         $this->aUsers = UsersPeer::doSelectOne($c, $con);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->aUsers->addUserRidess($this);
         		 */
     }
     return $this->aUsers;
 }
开发者ID:broschb,项目名称:cyclebrain,代码行数:23,代码来源:BaseUserRides.php

示例5: executeForgot

 public function executeForgot()
 {
     if ($this->getRequest()->getMethod() != sfRequest::POST) {
         $this->emailSent = false;
         // display the form
         $this->getRequest()->setAttribute('referer', $this->getRequest()->getReferer());
     } else {
         // handle the form submission
         $nickname = $this->getRequestParameter('nickname');
         $c = new Criteria();
         $c->add(UsersPeer::USERNAME, $nickname);
         $user = UsersPeer::doSelectOne($c);
         // nickname exists?
         if ($user) {
             $password = substr(md5(rand(100000, 999999)), 0, 6);
             $user->saltPassword($password);
             $user->save();
             $this->emailSent = true;
             $this->sendPasswordMail($user->getUsername(), $user->getEmail(), $password);
         } else {
             $this->emailSent = false;
         }
         $this->getRequest()->setAttribute('referer', $this->getRequest()->getReferer());
     }
 }
开发者ID:broschb,项目名称:cyclebrain,代码行数:25,代码来源:actions.class.php


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