本文整理匯總了PHP中AuthManager::createUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP AuthManager::createUser方法的具體用法?PHP AuthManager::createUser怎麽用?PHP AuthManager::createUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AuthManager
的用法示例。
在下文中一共展示了AuthManager::createUser方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processImpl
protected function processImpl(PostArrayAdapter $adapter, $button)
{
$data = new RegFormData();
/*
* Имя пользователя
*/
$name = $adapter->str(FORM_PARAM_REG_NAME);
$error = UserInputValidator::validateShortText($name);
if ($error) {
return array(FORM_PARAM_REG_NAME => $error);
}
$name = UserInputTools::safeShortText($name);
$data->setUserName($name);
/*
* e-mail
*/
$mail = $adapter->str(FORM_PARAM_REG_MAIL);
$error = UserInputValidator::validateEmail($mail);
if ($error) {
return array(FORM_PARAM_REG_MAIL => $error);
}
$data->setUserMail($mail);
/*
* Пол
*/
$sex = $adapter->int(FORM_PARAM_REG_SEX);
$error = UserInputValidator::validateSex($sex);
if ($error) {
return array(FORM_PARAM_REG_SEX => $error);
}
$data->setSex($sex);
/*
* Пароль
*/
$pass = $adapter->str(FORM_PARAM_REG_PASS);
$passConfirm = $adapter->str(FORM_PARAM_REG_PASS_CONF);
$error = UserInputValidator::validatePass($pass, $passConfirm);
if ($error) {
return array(FORM_PARAM_REG_PASS => $error);
}
$error = UserInputValidator::validatePassConfirm($pass, $passConfirm);
if ($error) {
return array(FORM_PARAM_REG_PASS_CONF => $error);
}
$data->setPassword($pass);
AuthManager::createUser($data);
return new AjaxSuccess();
}