예제 #1
0
    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 
echo lang_get('signup_done_title');
?>
</b><br />
예제 #2
0
 private function get_user($p_parsed_from)
 {
     if ($this->_mail_use_reporter) {
         // Always report as mail_reporter
         $t_reporter_id = $this->_mail_reporter_id;
     } else {
         // Try to get the reporting users id
         $t_reporter_id = $this->get_userid_from_email($p_parsed_from['email']);
         if (!$t_reporter_id) {
             if ($this->_mail_auto_signup) {
                 // So, we have to sign up a new user...
                 $t_new_reporter_name = $this->prepare_username($p_parsed_from);
                 if ($t_new_reporter_name !== FALSE && $this->validate_email_address($p_parsed_from['email'])) {
                     if (user_signup($t_new_reporter_name, $p_parsed_from['email'])) {
                         # notify the selected group a new user has signed-up
                         email_notify_new_account($t_new_reporter_name, $p_parsed_from['email']);
                         $t_reporter_id = user_get_id_by_email($p_parsed_from['email']);
                         $t_reporter_name = $t_new_reporter_name;
                         $t_realname = $this->prepare_realname($p_parsed_from, $t_reporter_name);
                         if ($t_realname !== FALSE) {
                             user_set_realname($t_reporter_id, $t_realname);
                         }
                     }
                 }
                 if (!$t_reporter_id) {
                     $this->custom_error('Failed to create user based on: ' . $p_parsed_from['From']);
                 }
             }
         }
         if ((!$t_reporter_id || !user_is_enabled($t_reporter_id)) && $this->_mail_fallback_mail_reporter) {
             // Fall back to the default mail_reporter
             $t_reporter_id = $this->_mail_reporter_id;
         }
     }
     if ($t_reporter_id && user_is_enabled($t_reporter_id)) {
         if (!isset($t_reporter_name)) {
             $t_reporter_name = user_get_field($t_reporter_id, 'username');
         }
         $t_authattemptresult = auth_attempt_script_login($t_reporter_name);
         # last attempt for fallback
         if ($t_authattemptresult === FALSE && $this->_mail_fallback_mail_reporter && $t_reporter_id != $this->_mail_reporter_id && user_is_enabled($this->_mail_reporter_id)) {
             $t_reporter_id = $this->_mail_reporter_id;
             $t_reporter_name = user_get_field($t_reporter_id, 'username');
             $t_authattemptresult = auth_attempt_script_login($t_reporter_name);
         }
         if ($t_authattemptresult === TRUE) {
             user_update_last_visit($t_reporter_id);
             return (int) $t_reporter_id;
         }
     }
     // Normally this function does not get here unless all else failed
     $this->custom_error('Could not get a valid reporter. Email will be ignored');
     return FALSE;
 }