本文整理汇总了PHP中Contacts::validateUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Contacts::validateUser方法的具体用法?PHP Contacts::validateUser怎么用?PHP Contacts::validateUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contacts
的用法示例。
在下文中一共展示了Contacts::validateUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createUserFromContactForm
private function createUserFromContactForm ($user, $contactId, $email, $sendEmail = true) {
$createUser = false;
$createPass = false;
if ( array_var ($user, 'create-user')) {
$createUser = true;
if ( array_var ($user, 'create-password') || !$sendEmail) {
$createPass = true;
$password = array_var($user, 'password');
$password_a = array_var($user, 'password_a');
}
$type = array_var($user, 'type');
$username = array_var($user, 'username');
}
if ($createUser){
if ($createPass){
$userData = array(
'contact_id' => $contactId,
'username' => $username,
'email' => $email,
'password' => $password,
'password_a' => $password_a,
'type' => $type,
'password_generator' => 'specify',
'send_email_notification' => $sendEmail
);
}else{
$userData = array(
'contact_id' => $contactId,
'username' => $username,
'email' => $email,
'type' => $type,
'password_generator' => 'link',
'send_email_notification' => $sendEmail
);
}
$valid = Contacts::validateUser($contactId);
create_user($userData, '');
}
}
示例2: createUserFromContactForm
private function createUserFromContactForm($user, $contactId, $email, $sendEmail = true, $save_permissions = true)
{
$createUser = false;
$createPass = false;
if (array_var($user, 'create-user')) {
$createUser = true;
if (array_var($user, 'create-password') || !$sendEmail) {
$createPass = true;
$password = array_var($user, 'password');
$password_a = array_var($user, 'password_a');
}
$type = array_var($user, 'type');
$username = array_var($user, 'username');
}
if ($createUser) {
if ($createPass) {
$userData = array('contact_id' => $contactId, 'username' => $username, 'email' => $email, 'password' => $password, 'password_a' => $password_a, 'type' => $type, 'password_generator' => 'specify', 'send_email_notification' => $sendEmail);
} else {
$userData = array('contact_id' => $contactId, 'username' => $username, 'email' => $email, 'type' => $type, 'password_generator' => 'link', 'send_email_notification' => $sendEmail);
}
$valid = Contacts::validateUser($contactId);
// root permissions
if ($rp_genid = array_var($_POST, 'root_perm_genid')) {
$rp_permissions_data = array();
foreach ($_POST as $name => $value) {
if (str_starts_with($name, $rp_genid . 'rg_root_')) {
$rp_permissions_data[$name] = $value;
}
}
}
create_user($userData, array_var($_REQUEST, 'permissions', ''), $rp_permissions_data, $save_permissions);
}
return $userData;
}