Example #1
0
 function registration_validation()
 {
     $errors = new WP_error();
     if (isset($_REQUEST['ag_type']) && $_REQUEST['ag_type'] == 'register' && $this->options['register'] == 1) {
         if (isset($_REQUEST['ag_login_accept']) && $_REQUEST['ag_login_accept'] == 1) {
             return $errors;
         } else {
             $errors->add('ag_login_accept', $this->options['fail_text']);
             return $errors;
         }
     } else {
         return $errors;
     }
 }
Example #2
0
function cyc_show_registerform()
{
    global $cyc_pluginpath, $cyc_options;
    if (!get_option('users_can_register')) {
        wp_redirect(get_bloginfo('wpurl') . '/wp-login.php?registration=disabled');
        exit;
    }
    $user_login = '';
    $user_email = '';
    if (isset($_POST['user_login'])) {
        if (!$cyc_options['captcha'] || $cyc_options['captcha'] && $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'])) {
            unset($_SESSION['security_code']);
            require_once ABSPATH . WPINC . '/registration.php';
            $user_login = $_POST['user_login'];
            $user_email = $_POST['user_email'];
            $errors = custom_register_new_user($user_login, $user_email, @$_POST['password']);
            if (!is_wp_error($errors)) {
                wp_redirect('wp-login.php?checkemail=registered');
                exit;
            }
        } else {
            $user_login = $_POST['user_login'];
            $user_email = $_POST['user_email'];
            $errors = new WP_error();
            $errors->add('captcha', __("<strong>ERROR</strong>: You didn't correctly enter the captcha, please try again."));
        }
    }
    cyc_head("Register");
    cyc_show_errors($errors);
    get_template_part('_user', 'register');
    cyc_footer();
}
Example #3
0
function cyc_show_registerform()
{
    global $cyc_pluginpath, $cyc_options;
    if (!get_option('users_can_register')) {
        wp_redirect(get_bloginfo('wpurl') . '/wp-login.php?registration=disabled');
        exit;
    }
    $user_login = '';
    $user_email = '';
    if (isset($_POST['user_login'])) {
        if (!$cyc_options['captcha'] || $cyc_options['captcha'] && $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'])) {
            unset($_SESSION['security_code']);
            require_once ABSPATH . WPINC . '/registration.php';
            $user_login = $_POST['user_login'];
            $user_email = $_POST['user_email'];
            $errors = register_new_user($user_login, $user_email);
            if (!is_wp_error($errors)) {
                wp_redirect('wp-login.php?checkemail=registered');
                exit;
            }
        } else {
            $user_login = $_POST['user_login'];
            $user_email = $_POST['user_email'];
            $errors = new WP_error();
            $errors->add('captcha', __("<strong>ERROR</strong>: You didn't correctly enter the captcha, please try again."));
        }
    }
    cyc_head("Register");
    cyc_show_errors($errors);
    ?>
	<form class="loginform" name="registerform" id="registerform" action="<?php 
    echo site_url('wp-login.php?action=register', 'login_post');
    ?>
" method="post">
		<p>
			<label><?php 
    _e('Username');
    ?>
:</label>
			<input tabindex="1" type="text" name="user_login" id="user_login" class="input" value="<?php 
    echo attribute_escape(stripslashes($user_login));
    ?>
" size="20" tabindex="10" />
			<label><?php 
    _e('E-mail');
    ?>
:</label>
			<input tabindex="2" type="text" name="user_email" id="user_email" class="input" value="<?php 
    echo attribute_escape(stripslashes($user_email));
    ?>
" size="25" tabindex="20" />
<?php 
    if ($cyc_options['captcha']) {
        ?>
			<label>&nbsp;</label>
			<img alt="captcha" width="155" height="30" src="<?php 
        echo $cyc_pluginpath;
        ?>
captcha.php?width=155&amp;height=30&amp;characters=5" /><br/>
			<label for="security_code">Type the code above:</label>
			<input tabindex="3" id="security_code" name="security_code" class="input" type="text" />
<?php 
    }
    ?>
		</p>
		<?php 
    do_action('register_form');
    ?>
		<p id="reg_passmail"><?php 
    _e('A password will be e-mailed to you.');
    ?>
</p>
		<p class="submit"><input tabindex="4" type="submit" name="wp-submit" id="wp-submit" value="<?php 
    _e('Register');
    ?>
" tabindex="100" /></p>
	</form>
<?php 
    cyc_footer();
}