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


PHP User::getLogin方法代码示例

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


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

示例1: persist

 function persist(User $user)
 {
     $requete = "INSERT INTO user(id, login, password) value(:id, :login,:password)";
     $param = array('id' => $user->getId(), 'login' => $user->getLogin(), 'password' => $user->getPassword());
     $this->conn->prepareAndExecuteQuery($requete, $param);
 }
开发者ID:jbrat,项目名称:uFrameworkPHP,代码行数:6,代码来源:UserMapper.php

示例2: sendRecoveryCode

 /**
  * Send user account recovery code.
  *
  * @access   public
  * @param    User $oUser
  * @since    1.0.0, 2015-02-17
  * @version  2.1.0-dev
  * @return   bool
  */
 private function sendRecoveryCode(User $oUser)
 {
     $sUserAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT');
     $sCodeToEncode = mb_strlen(uniqid()) * time() . $sUserAgent . $oUser->getLogin();
     $sCode2 = sha1($sCodeToEncode);
     $sRecoveryCode = base64_encode($sCode2);
     DB::query('DELETE FROM \\Model\\User\\RecoveryCode r WHERE r.user = :user')->param('user', $oUser->getId())->execute(TRUE);
     $oRecoveryCode = new User\RecoveryCode();
     $oRecoveryCode->setUser($oUser);
     $oRecoveryCode->setCode($sRecoveryCode);
     DB::persist($oRecoveryCode);
     DB::flush();
     $sSubject = __('Account activation on :app', ['app' => Core::getAppName()]);
     $mailContent = View::factory("user/frontend/recovery/message")->render(['sLogin' => $oUser->getLogin(), 'sRecoveryCode' => $sRecoveryCode]);
     $mailView = View::factory('base/email');
     $mailView->bind('sContent', $mailContent);
     $mailView->set('sTitle', $sSubject);
     return $oUser->sendEmail($sSubject, $mailView->render());
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:28,代码来源:PasswordRecovery.php

示例3: sendActivationCode

 /**
  * Send user account activation code.
  *
  * @access     public
  * @param      string    $sPassword
  * @param      UserModel $oUser
  * @return     bool
  * @throws     \Plethora\Exception
  * @throws     \Plethora\Exception\Fatal
  * @since      1.0.0
  * @version    2.1.0-dev
  */
 private function sendActivationCode($sPassword, UserModel $oUser)
 {
     $sUserAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT');
     $sActivationCode1 = mb_strlen($sPassword) * time() . $sUserAgent . $oUser->getLogin();
     $sActivationCode2 = sha1($sActivationCode1);
     $sActivationCode = base64_encode($sActivationCode2);
     $oActivationCode = new ActivationCodeModel();
     $oActivationCode->setUser($oUser);
     $oActivationCode->setCode($sActivationCode);
     DB::persist($oActivationCode);
     DB::flush();
     $sSubject = __(':appname - Activation link', ['appname' => Plethora\Core::getAppName()]);
     $mailContent = View::factory("user/frontend/register/message")->render(['sLogin' => $oUser->getLogin(), 'sActivationCode' => $sActivationCode]);
     $mailView = View::factory('base/email');
     $mailView->bind('sContent', $mailContent);
     $mailView->set('sTitle', $sSubject);
     $mail = $mailView->render();
     $oMessage = new Mail();
     $oMessage->setSubject($sSubject);
     $oMessage->setFrom(Config::get('base.email'));
     $oMessage->setTo($oUser->getEmail());
     $oMessage->setBody($mail, 'text/html');
     return Mailer::factory()->send($oMessage);
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:36,代码来源:Registration.php


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