本文整理汇总了PHP中CUser::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP CUser::exists方法的具体用法?PHP CUser::exists怎么用?PHP CUser::exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
public function check()
{
$errorArray = array();
$baseErrorMsg = get_class($this) . '::store-check failed - ';
if (!$this->user_id && '' == trim($this->user_password)) {
$errorArray['user_password'] = $baseErrorMsg . 'user password is not set';
}
if (!$this->user_id && CUser::exists($this->user_username)) {
$errorArray['user_exists'] = $baseErrorMsg . 'this user already exists';
}
$this->_error = $errorArray;
return $errorArray;
}
示例2: notifyNewUserCredentials
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('User');
// !User's contact information not deleted - left for history.
if ($del) {
if ($msg = $obj->delete()) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
$AppUI->redirect();
} else {
$AppUI->setMsg('deleted', UI_MSG_ALERT, true);
$AppUI->redirect();
}
return;
}
if ($isNewUser) {
// If userName already exists quit with error and do nothing
if (CUser::exists($obj->user_username) == true) {
$AppUI->setMsg('already exists. Try another username.', UI_MSG_ERROR, true);
$AppUI->redirect();
}
$contact->contact_owner = $AppUI->user_id;
}
if ($msg = $contact->store($AppUI)) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
} else {
$obj->user_contact = $contact->contact_id;
if ($msg = $obj->store()) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
} else {
if ($isNewUser && w2PgetParam($_REQUEST, 'send_user_mail', 0)) {
notifyNewUserCredentials($contact->contact_email, $contact->contact_first_name, $obj->user_username, $_POST['user_password']);
}