本文整理汇总了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);
}
示例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());
}
示例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);
}