Пример #1
0
    //force use of SSL for login
    header('Location: https://' . getStringFromServer('HTTP_HOST') . getStringFromServer('REQUEST_URI'));
}
if (!$theme_id || !is_numeric($theme_id)) {
    $theme_id = $HTML->getThemeIdFromName($sys_theme);
}
if (getStringFromRequest('submit')) {
    /*
    	Adding call to library rather than
    	logic that used to be coded in this page
    */
    if (!form_key_is_valid(getStringFromRequest('form_key'))) {
        exit_form_double_submit();
    }
    $new_user = new GFUser();
    $register = $new_user->create($unix_name, $firstname, $lastname, $password1, $password2, $email, $mail_site, $mail_va, $language_id, $timezone, $jabber_address, $jabber_only, $theme_id, '', $address, $address2, $phone, $fax, $title, $ccode);
    if ($register) {
        echo $HTML->header(array('title' => 'Register Confirmation'));
        printf(_('<p>Congratulations. You have registered on %1$s.  <p> You are now being sent a confirmation email to verify your email address. Visiting the link sent to you in this email will activate your account.'), $sys_name);
        echo $HTML->footer(array());
        exit;
    } else {
        $feedback = $new_user->getErrorMessage();
    }
}
$HTML->header(array('title' => 'User Account Registration'));
if (isset($feedback)) {
    print "<p><span class=\"error\">{$feedback} {$register_error}</span>";
}
if (!isset($timezone) || empty($timezone) || !eregi('^[-a-z0-9_/]*?$', $timezone)) {
    $timezone = isset($sys_default_timezone) ? $sys_default_timezone : 'GMT';