Esempio n. 1
0
}
# Check to see if signup is allowed
if (OFF == config_get_global('allow_signup')) {
    print_header_redirect('login_page.php');
    exit;
}
if (ON == config_get('signup_use_captcha') && get_gd_version() > 0 && helper_call_custom_function('auth_can_change_password', array())) {
    # captcha image requires GD library and related option to ON
    $t_key = utf8_strtolower(utf8_substr(md5(config_get('password_confirm_hash_magic_string') . $t_form_key), 1, 5));
    if ($t_key != $f_captcha) {
        trigger_error(ERROR_SIGNUP_NOT_MATCHING_CAPTCHA, ERROR);
    }
    # Clear captcha cache
    session_delete(CAPTCHA_IMG);
}
email_ensure_not_disposable($f_email);
# notify the selected group a new user has signed-up
if (user_signup($f_username, $f_email)) {
    email_notify_new_account($f_username, $f_email);
}
form_security_purge('signup');
html_page_top1();
html_page_top2a();
?>

<br />
<div align="center">
<table class="width50" cellspacing="1">
<tr>
	<td class="center">
		<b><?php 
Esempio n. 2
0
/**
 * Set the user's email to the given string after checking that it is a valid email
 * @param integer $p_user_id A valid user identifier.
 * @param string  $p_email   An email address to set.
 * @return boolean
 */
function user_set_email($p_user_id, $p_email)
{
    $p_email = trim($p_email);
    email_ensure_valid($p_email);
    email_ensure_not_disposable($p_email);
    $t_old_email = user_get_email($p_user_id);
    if (strcasecmp($t_old_email, $p_email) != 0) {
        user_ensure_email_unique($p_email);
    }
    return user_set_field($p_user_id, 'email', $p_email);
}