Example #1
0
 public function checkPurchaseForm()
 {
     $errors = new \WP_Error();
     $title = __('Check Purchase Key', 'marketcheck');
     $purchaseKey = $this->getPurchaseKey();
     $selectedMarket = $this->getSelectedMarket();
     $isSubmited = $this->getPostVar('marketcheck-submitted');
     if ($isSubmited) {
         if (!$selectedMarket) {
             $errors->add('invalid-market', __('<strong>Error</strong>: Invalid Market Selected.', 'marketcheck'));
         }
         if (!$purchaseKey) {
             $errors->add('empty_purchase', __('<strong>Error</strong>: Empty Purchase Code.', 'marketcheck'));
         }
     }
     if ($isSubmited && $selectedMarket && $purchaseKey) {
         $this->getCurrentMarket()->setPurchaseKey($purchaseKey);
         $isValidPurchase = $this->getCurrentMarket()->isValidPurchase();
         if (is_wp_error($isValidPurchase)) {
             $errors = $isValidPurchase;
         } else {
             return;
         }
     }
     login_header($title, '<p class="message register">' . $title, $errors);
     $this->showPreRegisterForm();
     login_footer('purchase-key');
     die;
 }
 public function Disallow_lost_password()
 {
     // The blogname option is escaped with esc_html on the way into the database in sanitize_option
     // we want to reverse this for the plain text arena of emails.
     $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
     login_header(__('Password reset disabled', c_bid_text_domain), '<p class="message">' . sprintf(__('%s uses Mozilla Persona to sign in and does not use passwords. Password reset is disabled.', c_bid_text_domain), $blogname) . "</p>");
     login_footer('user_login');
     exit;
 }
function wpcom_vip_login_limit_dont_show_login_form()
{
    if ('post' != strtolower($_SERVER['REQUEST_METHOD']) || !isset($_POST['log'])) {
        return;
    }
    $username = sanitize_user($_POST['log']);
    if ($error = wpcom_vip_login_is_limited($username)) {
        login_header(__('Error'), '', $error);
        login_footer();
        exit;
    }
}
    /**
     * disable_function()
     *
     * The main error function to be used when a user tries to
     * register or uses the forgotten password form
     *
     * @return void
     */
    function disable_function()
    {
        $errors = new WP_Error();
        $errors->add('registerdisabled', __('User registration is not available from this site, so you can\'t create an account or retrieve your password from here. See the message above.'));
        login_header(__('Log In'), '', $errors);
        ?>
			<p id="backtoblog"><a href="<?php 
        bloginfo('url');
        ?>
/" title="<?php 
        _e('Are you lost?');
        ?>
"><?php 
        printf(__('&larr; Back to %s'), get_bloginfo('title', 'display'));
        ?>
</a></p>
			<?php 
        exit;
    }
Example #5
0
        if ($_POST && empty($user_pass)) {
            $errors['user_pass'] = __('<strong>ERROR</strong>: The password field is empty.');
        }
        // Some parts of this script use the main login form to display a message
        if (TRUE == $_GET['loggedout']) {
            $errors['loggedout'] = __('Successfully logged you out.');
        } elseif ('disabled' == $_GET['registration']) {
            $errors['registerdiabled'] = __('User registration is currently not allowed.');
        } elseif ('confirm' == $_GET['checkemail']) {
            $errors['confirm'] = __('Check your e-mail for the confirmation link.');
        } elseif ('newpass' == $_GET['checkemail']) {
            $errors['newpass'] = __('Check your e-mail for your new password.');
        } elseif ('registered' == $_GET['checkemail']) {
            $errors['registered'] = __('Registration complete. Please check your e-mail.');
        }
        login_header(__('Login'));
        ?>

<form name="loginform" id="loginform" action="wp-login.php" method="post">
<?php 
        if (!in_array($_GET['checkemail'], array('confirm', 'newpass'))) {
            ?>
	<p>
		<label><?php 
            _e('Username:');
            ?>
<br />
		<input type="text" name="log" id="user_login" class="input" value="<?php 
            echo attribute_escape(stripslashes($user_login));
            ?>
" size="20" tabindex="10" /></label>
Example #6
0
File: app.php Project: avinaszh/CRM
echo base_url();
?>
",
			ci_base_url = "<?php 
echo base_url();
?>
",
			ci_index 	= "<?php 
echo base_url();
?>
index.php"; //append index.php if necessary
	</script>

	<!-- Application requirements -->
	<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading Application...';</script>
	<script type="text/javascript" src="<?php 
echo base_url();
?>
all-classes.js"></script>

</div>

<div id="login-header">
<?php 
echo login_header();
?>
</div>

</body>
</html>
        function show_reset_password_form($user, $oncerkey, $redirect_to = false, $errors = false)
        {
            if (!is_a($user, 'WP_User')) {
                // Ooops we don't have a user to use :( return to the login form as this shouldn't happen except in hack attempts
                wp_safe_redirect(wp_login_url());
                exit;
            }
            wp_enqueue_script('utils');
            wp_enqueue_script('user-profile');
            // We are going to save our key to a oncer for later checking - but set it to expire in 5 minutes
            shrkey_set_usermeta_timed_oncer($user->ID, '_shrkey_password_expired_key', $oncerkey, '+5 minutes');
            login_header(__('Expired Password', 'expirepassword'), '<p class="message reset-pass">' . __('Your password has <strong>expired</strong>. Enter a new password below.', 'expirepassword') . '</p>', $errors);
            ?>
			<form name="expiredpasswordform" id="expiredpasswordform" method="post" action="<?php 
            echo esc_url(site_url('wp-login.php?action=expiredpassword', 'login_post'));
            ?>
">
				<input type="hidden" name="user_login" id="user_login" value="<?php 
            echo esc_attr($user->user_login);
            ?>
" autocomplete="off" />
				<input type="hidden" name="key" id="key" value="<?php 
            echo esc_attr($oncerkey);
            ?>
" autocomplete="off" />
				<input type="hidden" name="redirect_to" id="redirect_to" value="<?php 
            echo esc_attr($redirect_to);
            ?>
" autocomplete="off" />

					<label for="pass1"><?php 
            _e('New password');
            ?>
</label><br />
					<div class="wp-pwd">
						<span class="password-input-wrapper">
							<input type="password" data-reveal="1" data-pw="<?php 
            echo esc_attr(wp_generate_password(16));
            ?>
" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result" />
						</span>
						<div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php 
            _e('Strength indicator');
            ?>
</div>
					</div>
				</p>
				<p class="user-pass2-wrap">
					<label for="pass2"><?php 
            _e('Confirm new password');
            ?>
</label><br />
					<input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" />
				</p>

				<p class="description indicator-hint"><?php 
            _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).', 'expirepassword');
            ?>
</p>

				<br class="clear" />
				<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php 
            esc_attr_e('Reset Password', 'expirepassword');
            ?>
" /></p>
			</form>
			<?php 
            // Show the standard footer
            login_footer('pass1');
        }
Example #8
0
<?php

// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
?>

<?php 
login_header($title, '<p class="message">' . $message . '</p>');
?>

    <form id="associateform" action="<?php 
echo esc_url(site_url('wp-login.php?xfac=associate', 'login_post'));
?>
"
          method="post">
        <p>
            <label for="user_login">
                <?php 
_e('Username', 'xenforo-api-consumer');
?>
<br/>
                <input type="text" name="user_login" id="user_login" class="input"
                       value="<?php 
echo esc_attr($wpUser->user_login);
?>
" size="20"/>
            </label>
        </p>
Example #9
0
	   <tr><td><img src="images/bottom.gif" style="margin-top:100px;"></td></tr>	   
      </table>
	 </td>
	 <td width="4%"></td>
	</tr>
   </table>  
  </td>
 </tr>
</table>
<!-- End Save for Web Slices -->
</body>
</html>

<?php 
}
?>

<?php 
/**
 * WordPress User Page
 *
 * Handles authentication, registering, resetting passwords, forgot password,
 * and other user handling.
 *
 * @package WordPress
 */
/** Make sure that the WordPress bootstrap has run before continuing. */
require dirname(__FILE__) . '/wp-load.php';
//注意,这里已经获取了session,到 $current_user 变量中,通过 $current_user->ID等方式,取值。
login_header('', __('Log_In'), '', $errors);
Example #10
0
<?php

/**
 * Request additional info to login with provider
 *
 * @package YITH WooCommerce Social Login
 * @since   1.0.0
 * @author  Yithemes
 */
login_header(__('Login', 'yith-woocommerce-social-login'));
?>
    <div id="welcome">

        <p>
            <?php 
_e("Please, enter your information in the form below to continue", 'yith-woocommerce-social-login');
?>
.
        </p>
        <?php 
if (!empty($errors)) {
    foreach ($errors as $error) {
        echo "<p>{$error}</p>";
    }
}
?>
    </div>

    <form name="loginform" id="loginform" action="#" method="post">
        <?php 
if ($show_user) {
    /**
     * Generates the html form for the second step of the authentication process.
     *
     * @since 0.1-dev
     *
     * @param WP_User       $user WP_User object of the logged-in user.
     * @param string        $login_nonce A string nonce stored in usermeta.
     * @param string        $redirect_to The URL to which the user would like to be redirected.
     * @param string        $error_msg Optional. Login error message.
     * @param string|object $provider An override to the provider.
     */
    public static function login_html($user, $login_nonce, $redirect_to, $error_msg = '', $provider = null)
    {
        if (empty($provider)) {
            $provider = self::get_primary_provider_for_user($user->ID);
        } elseif (is_string($provider) && method_exists($provider, 'get_instance')) {
            $provider = call_user_func(array($provider, 'get_instance'));
        }
        $provider_class = get_class($provider);
        $available_providers = self::get_available_providers_for_user($user);
        $backup_providers = array_diff_key($available_providers, array($provider_class => null));
        $rememberme = 0;
        if (isset($_REQUEST['rememberme']) && $_REQUEST['rememberme']) {
            $rememberme = 1;
        }
        login_header();
        if (!empty($error_msg)) {
            echo '<div id="login_error"><strong>' . esc_html($error_msg) . '</strong><br /></div>';
        }
        ?>

		<form name="validate_2fa_form" id="loginform" action="<?php 
        echo esc_url(site_url('wp-login.php?action=validate_2fa', 'login_post'));
        ?>
" method="post" autocomplete="off">
				<input type="hidden" name="provider" id="provider" value="<?php 
        echo esc_attr($provider_class);
        ?>
" />
				<input type="hidden" name="wp-auth-id" id="wp-auth-id" value="<?php 
        echo esc_attr($user->ID);
        ?>
" />
				<input type="hidden" name="wp-auth-nonce" id="wp-auth-nonce" value="<?php 
        echo esc_attr($login_nonce);
        ?>
" />
				<input type="hidden" name="redirect_to" id="redirect_to" value="<?php 
        echo esc_attr($redirect_to);
        ?>
" />
				<input type="hidden" name="rememberme" id="rememberme" value="<?php 
        echo esc_attr($rememberme);
        ?>
" />

				<?php 
        $provider->authentication_page($user);
        ?>

		</form>

		<?php 
        if ($backup_providers) {
            ?>
		<p><a href="#"><?php 
            esc_html_e('Or, use a backup method:', 'two-factor');
            ?>
</a></p>
		<ul class="backup-methods">
			<?php 
            foreach ($backup_providers as $backup_classname => $backup_provider) {
                ?>
				<li><a href="<?php 
                echo esc_url(add_query_arg(urlencode_deep(array('action' => 'backup_2fa', 'provider' => $backup_classname, 'wp-auth-id' => $user->ID, 'wp-auth-nonce' => $login_nonce, 'redirect_to' => $redirect_to, 'rememberme' => $rememberme))));
                ?>
"><?php 
                $backup_provider->print_label();
                ?>
</a></li>
			<?php 
            }
            ?>
		</ul>
		<?php 
        }
        ?>

		<p id="backtoblog">
			<a href="<?php 
        echo esc_url(home_url('/'));
        ?>
" title="<?php 
        esc_attr_e('Are you lost?');
        ?>
"><?php 
        echo esc_html(sprintf(__('&larr; Back to %s'), get_bloginfo('title', 'display')));
        ?>
</a>
		</p>

		</body>
		</html>
		<?php 
    }
Example #12
0
 public function rpr_login_form_adminverify()
 {
     global $register_plus_redux;
     global $errors;
     if (is_array($errors->errors) && isset($errors->errors['registered'])) {
         $temp = $errors->errors;
         unset($temp['registered']);
         $errors->errors = $temp;
     }
     if (is_array($errors->error_data) && isset($errors->error_data['registered'])) {
         $temp = $errors->error_data;
         unset($temp['registered']);
         $errors->error_data = $temp;
     }
     if (!is_wp_error($errors)) {
         $errors = new WP_Error();
     }
     $errors->add('verify_user_admin', nl2br($register_plus_redux->rpr_get_option('message_verify_user_admin')), 'message');
     login_header(__('Admin Verification', 'register-plus-redux'), '', $errors);
     login_footer();
     exit;
 }
	/**
	 * Login form validation.
	 */
	public function login_form_validate_2fa() {
		if ( ! isset( $_POST['wp-auth-id'], $_POST['wp-auth-nonce'] ) ) {
			return;
		}

		$user = get_userdata( $_POST['wp-auth-id'] );
		if ( ! $user ) {
			return;
		}

		$nonce = $_POST['wp-auth-nonce'];
		if ( true !== $this->verify_login_nonce( $user->ID, $nonce ) ) {
			wp_safe_redirect( get_bloginfo( 'url' ) );
			exit;
		}

		global $interim_login;

		$interim_login = isset($_REQUEST['interim-login']);

		/**
		 * iThemes Sync override
		 */
		$sync_override    = intval( get_user_option( 'itsec_two_factor_override', $user->ID ) ) === 1 ? true : false;
		$override_expires = intval( get_user_option( 'itsec_two_factor_override_expires', $user->ID ) );

		if ( ! $sync_override || current_time( 'timestamp' ) > $override_expires ) {
			if ( isset( $_POST['provider'] ) ) {
				$providers = $this->get_available_providers_for_user( $user );
				if ( isset( $providers[ $_POST['provider'] ] ) ) {
					$provider = $providers[ $_POST['provider'] ];
				} else {
					wp_die( esc_html__( 'Cheatin&#8217; uh?', 'it-l10n-ithemes-security-pro' ), 403 );
				}
			} else {
				$provider = $this->get_primary_provider_for_user( $user->ID );
			}

			if ( true !== $provider->validate_authentication( $user ) ) {
				do_action( 'wp_login_failed', $user->user_login );

				$login_nonce = $this->create_login_nonce( $user->ID );
				if ( ! $login_nonce ) {
					return;
				}

				if ( empty( $_REQUEST['redirect_to'] ) ) {
					$_REQUEST['redirect_to'] = '';
				}
				$this->login_html( $user, $login_nonce['key'], $_REQUEST['redirect_to'], esc_html__( 'ERROR: Invalid verification code.', 'it-l10n-ithemes-security-pro' ) );
				exit;
			}
		}

		$this->delete_login_nonce( $user->ID );

		$rememberme = false;
		if ( isset( $_REQUEST['rememberme'] ) && $_REQUEST['rememberme'] ) {
			$rememberme = true;
		}

		wp_set_auth_cookie( $user->ID, $rememberme );

		if ( $interim_login ) {
			$customize_login = isset( $_REQUEST['customize-login'] );
			if ( $customize_login ) {
				wp_enqueue_script( 'customize-base' );
			}
			$message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
			$interim_login = '******';
			login_header( '', $message ); ?>
			</div>
			<?php
			/** This action is documented in wp-login.php */
			do_action( 'login_footer' ); ?>
			<?php if ( $customize_login ) : ?>
				<script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>
			<?php endif; ?>
			</body></html>
<?php		exit;
		}

		$redirect_to = apply_filters( 'login_redirect', $_REQUEST['redirect_to'], $_REQUEST['redirect_to'], $user );
		wp_safe_redirect( $redirect_to );

		exit;
	}
    function login_html($user, $login_nonce, $redirect_to, $error_msg = '', $login_type = 'standard')
    {
        $provider = $this->get_provider_for_user($user->ID);
        $rememberme = 0;
        if (isset($_REQUEST['rememberme']) && $_REQUEST['rememberme']) {
            $rememberme = 1;
        }
        login_header();
        if (!empty($error_msg)) {
            echo '<div id="login_error"><strong>' . esc_html($error_msg) . '</strong><br /></div>';
        }
        ?>

		<form name="twostepform" id="loginform" action="<?php 
        echo esc_url(site_url('wp-login.php?action=twostep', 'login_post'));
        ?>
" method="post" autocomplete="off">
				<input type="hidden" name="wp-auth-id" id="wp-auth-id" value="<?php 
        echo esc_attr($user->ID);
        ?>
" />
				<input type="hidden" name="wp-auth-nonce" id="wp-auth-nonce" value="<?php 
        echo esc_attr($login_nonce['key']);
        ?>
"/>
				<input type="hidden" name="redirect_to" id="redirect_to" value="<?php 
        echo esc_attr($redirect_to);
        ?>
"/>
				<input type="hidden" name="rememberme" id="rememberme" value="<?php 
        echo esc_attr($rememberme);
        ?>
"/>

				<?php 
        $provider->authentication_page($user);
        ?>

		</form>

		<p id="backtoblog"><a href="<?php 
        echo esc_url(home_url('/'));
        ?>
" title="<?php 
        esc_attr_e('Are you lost?');
        ?>
"><?php 
        printf(__('&larr; Back to %s'), get_bloginfo('title', 'display'));
        ?>
</a></p>

		</body>
		</html>
		<?php 
    }
function new_twitter_request_email()
{
    $user_email = '';
    $errors = new WP_Error();
    if (isset($_POST['user_email'])) {
        $user_email = $_POST['user_email'];
        if ($user_email == '') {
            $errors->add('empty_email', __('<strong>ERROR</strong>: Please type your e-mail address.'));
        } elseif (!is_email($user_email)) {
            $errors->add('invalid_email', __('<strong>ERROR</strong>: The email address isn&#8217;t correct.'));
            $user_email = '';
        } elseif (email_exists($user_email)) {
            $errors->add('email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.'));
        }
        if (isset($_POST['user_email']) && $errors->get_error_code() == '') {
            return $user_email;
        }
    }
    login_header(__('Registration Form'), '<p class="message register">' . __('Please enter your email address to register!') . '</p>', $errors);
    ?>
  <form name="registerform" id="registerform" action="<?php 
    echo esc_url(site_url('wp-login.php?loginTwitter=1', 'login_post'));
    ?>
" method="post">
          <p>
                  <label for="user_email"><?php 
    _e('E-mail');
    ?>
<br />
                  <input type="email" name="user_email" id="user_email" class="input" value="<?php 
    echo esc_attr(stripslashes($user_email));
    ?>
" size="25" tabindex="20" /></label>
          </p>
          <p id="reg_passmail"><?php 
    _e('A password will be e-mailed to you.');
    ?>
</p>
          <br class="clear" />
          <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php 
    esc_attr_e('Register');
    ?>
" tabindex="100" /></p>
  </form>
  <?php 
    login_footer('user_login');
    exit;
}
Example #16
0
/**
 * Generates the html form for the second step of the authentication process.
 *
 * @codeCoverageIgnore
 *
 * @param \WP_User      $user WP_User object of the logged-in user.
 * @param string        $login_nonce A string nonce stored in usermeta.
 * @param string        $redirect_to The URL to which the user would like to be redirected.
 * @param string        $error_msg Optional. Login error message.
 */
function login_html($user, $login_nonce, $redirect_to, $error_msg = '')
{
    $rememberme = 0;
    if (isset($_REQUEST['rememberme']) && $_REQUEST['rememberme']) {
        $rememberme = 1;
    }
    login_header();
    if (!empty($error_msg)) {
        echo '<div id="login_error"><strong>' . esc_html($error_msg) . '</strong><br /></div>';
    }
    ?>

	<form name="validate_totp" id="loginform" action="<?php 
    echo esc_url(site_url('wp-login.php?action=validate_totp', 'login_post'));
    ?>
" method="post" autocomplete="off">
		<input type="hidden" name="wp-auth-id"    id="wp-auth-id"    value="<?php 
    echo esc_attr($user->ID);
    ?>
" />
		<input type="hidden" name="wp-auth-nonce" id="wp-auth-nonce" value="<?php 
    echo esc_attr($login_nonce);
    ?>
" />
		<input type="hidden" name="redirect_to" value="<?php 
    echo esc_attr($redirect_to);
    ?>
" />
		<input type="hidden" name="rememberme"    id="rememberme"    value="<?php 
    echo esc_attr($rememberme);
    ?>
" />

		<?php 
    authentication_page($user);
    ?>
	</form>

	<p id="backtoblog">
		<a href="<?php 
    echo esc_url(home_url('/'));
    ?>
" title="<?php 
    esc_attr_e('Are you lost?', 'dovedi');
    ?>
"><?php 
    echo esc_html(sprintf(__('&larr; Back to %s', 'dovedi'), get_bloginfo('title', 'display')));
    ?>
</a>
	</p>

	<?php 
    /** This action is documented in wp-login.php */
    do_action('login_footer');
    ?>
	<div class="clear"></div>
	</body>
	</html>
	<?php 
}
Example #17
0
    if (isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2']) {
        $errors->add('password_reset_mismatch', __('The passwords do not match.'));
    }
    /**
     * Fires before the password reset procedure is validated.
     *
     * @since 3.5.0
     *
     * @param object           $errors WP Error object.
     * @param WP_User|WP_Error $user   WP_User object if the login and reset key match. WP_Error object otherwise.
     */
    do_action('validate_password_reset', $errors, $user);
    if (!$errors->get_error_code() && isset($_POST['pass1']) && !empty($_POST['pass1'])) {
        reset_password($user, $_POST['pass1']);
        setcookie($rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true);
        login_header(__('Password Reset'), '<p class="message reset-pass">' . __('Your password has been reset.') . ' <a href="' . esc_url(wp_login_url()) . '">' . __('Log in') . '</a></p>');
        login_footer();
        exit;
    }
    echo '<div id="login-error-box" class="alert alert-success alert-dismissable" role="alert">';
    echo __('Enter your password below!', 'jobboard');
    echo '</div>';
    /** Validation user ends **/
}
?>


				<div id="login-form-wrapper" class="<?php 
echo $login_class;
?>
">
Example #18
0
 function ll_login_header($title = 'Log In', $message = '', $wp_error = '')
 {
     global $error, $is_iphone, $interim_login, $current_site;
     if (!function_exists('login_header')) {
         ob_start();
         require_once ABSPATH . '/wp-login.php';
         ob_end_clean();
     }
     login_header($title, $message, $wp_error);
     /*
     	add_filter( 'pre_option_blog_public', '__return_zero' );
     	add_action( 'login_head', 'noindex' );
     
     	if ( empty($wp_error) )
     		$wp_error = new WP_Error();
     
     
     	$shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );
     	$shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );
     
     	if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) )
     		add_action( 'login_head', 'wp_shake_js', 12 );
     
     	?>
     
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
     <head>
     <title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title>
     <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
     <?php
     wp_admin_css( 'login', true );
     wp_admin_css( 'colors-fresh', true );
     
     if ( $is_iphone ) { ?>
     <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" />
     <style type="text/css" media="screen">
     form { margin-left: 0px; }
     #login { margin-top: 20px; }
     </style>
     <?php
     } elseif ( isset($interim_login) && $interim_login ) { ?>
     <style type="text/css" media="all">
     .login #login { margin: 20px auto; }
     </style>
     <?php
     }
     
     do_action( 'login_enqueue_scripts' );
     do_action( 'login_head' ); ?>
     </head>
     <body class="login">
     <?php   if ( !is_multisite() ) { ?>
     <div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_head
     ertitle', esc_attr__('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1>
     <?php   } else { ?>
     <div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', network_home_url() ); ?>" title="<?php echo apply_filters('login_headertitle', esc_attr($current_site->site_name) ); ?>"><span class="hide"><?php bloginfo('name'); ?></span></a></h1>
     <?php   }
     
     	$message = apply_filters('login_message', $message);
     	if ( !empty( $message ) ) echo $message . "\n";
     
     	// Incase a plugin uses $error rather than the $errors object
     	if ( !empty( $error ) ) {
     		$wp_error->add('error', $error);
     		unset($error);
     	}
     
     	if ( $wp_error->get_error_code() ) {
     		$errors = '';
     		$messages = '';
     		foreach ( $wp_error->get_error_codes() as $code ) {
     			$severity = $wp_error->get_error_data($code);
     			foreach ( $wp_error->get_error_messages($code) as $error ) {
     				if ( 'message' == $severity )
     					$messages .= '  ' . $error . "<br />\n";
     				else
     					$errors .= '    ' . $error . "<br />\n";
     			}
     		}
     		if ( !empty($errors) )
     			echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n";
     		if ( !empty($messages) )
     			echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
     	}
     */
 }
    /**
     * Login form validation.
     *
     * @since 0.1-dev
     */
    public static function login_form_validate_2fa()
    {
        if (!isset($_POST['wp-auth-id'], $_POST['wp-auth-nonce'])) {
            return;
        }
        $user = get_userdata($_POST['wp-auth-id']);
        if (!$user) {
            return;
        }
        $nonce = $_POST['wp-auth-nonce'];
        if (true !== self::verify_login_nonce($user->ID, $nonce)) {
            wp_safe_redirect(get_bloginfo('url'));
            exit;
        }
        if (isset($_POST['provider'])) {
            $providers = self::get_available_providers_for_user($user);
            if (isset($providers[$_POST['provider']])) {
                $provider = $providers[$_POST['provider']];
            } else {
                wp_die(esc_html__('Cheatin&#8217; uh?'), 403);
            }
        } else {
            $provider = self::get_primary_provider_for_user($user->ID);
        }
        if (true !== $provider->validate_authentication($user)) {
            do_action('wp_login_failed', $user->user_login);
            $login_nonce = self::create_login_nonce($user->ID);
            if (!$login_nonce) {
                return;
            }
            self::login_html($user, $login_nonce['key'], $_REQUEST['redirect_to'], esc_html__('ERROR: Invalid verification code.'), $provider);
            exit;
        }
        self::delete_login_nonce($user->ID);
        $rememberme = false;
        if (isset($_REQUEST['rememberme']) && $_REQUEST['rememberme']) {
            $rememberme = true;
        }
        wp_set_auth_cookie($user->ID, $rememberme);
        // Must be global because that's how login_header() uses it.
        global $interim_login;
        $interim_login = isset($_REQUEST['interim-login']);
        // WPCS: override ok.
        if ($interim_login) {
            $customize_login = isset($_REQUEST['customize-login']);
            if ($customize_login) {
                wp_enqueue_script('customize-base');
            }
            $message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
            $interim_login = '******';
            // WPCS: override ok.
            login_header('', $message);
            ?>
			</div>
			<?php 
            /** This action is documented in wp-login.php */
            do_action('login_footer');
            ?>
			<?php 
            if ($customize_login) {
                ?>
				<script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php 
                echo wp_customize_url();
                /* WPCS: XSS OK. */
                ?>
', channel: 'login' }).send('login') }, 1000 );</script>
			<?php 
            }
            ?>
			</body></html>
			<?php 
            exit;
        }
        $redirect_to = apply_filters('login_redirect', $_REQUEST['redirect_to'], $_REQUEST['redirect_to'], $user);
        wp_safe_redirect($redirect_to);
        exit;
    }
function cimy_confirmation_form()
{
    if (empty($_POST['register_confirmation'])) {
        return;
    }
    $confirmation = false;
    $http_post = 'POST' == $_SERVER['REQUEST_METHOD'];
    $user_login = '';
    $user_email = '';
    if ($http_post) {
        $user_login = $_POST['user_login'];
        $user_email = $_POST['user_email'];
        if (function_exists("register_new_user")) {
            // fake registration to check if no errors then we'll proceed to confirmation phase
            $fake_errors = register_new_user($user_login, $user_email);
            // ok we can remove registration checks
            // 			remove_action('register_post', 'cimy_registration_check', 10);
            // 			remove_action('register_post', 'cimy_registration_captcha_check', 9);
        } else {
            return;
        }
        if (!is_wp_error($fake_errors)) {
            $redirect_to = !empty($_POST['redirect_to']) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
            wp_safe_redirect($redirect_to);
            exit;
        } else {
            if (count($fake_errors->errors) == 1 && isset($fake_errors->errors["register_confirmation"])) {
                $confirmation = true;
            }
        }
    }
    if ($confirmation) {
        global $cimy_uef_domain;
        $redirect_to = apply_filters('registration_redirect', !empty($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '');
        $message = new WP_Error();
        $message->add('confirmation', __('Confirm your registration', $cimy_uef_domain), 'message');
        login_header(__("Confirm your registration", $cimy_uef_domain), "", $message);
        ?>
		<form name="registerform" id="registerform" action="<?php 
        echo site_url('wp-login.php?action=register', 'login_post');
        ?>
" method="post">
<?php 
        cimy_registration_form(null, 2);
        ?>
		<p id="reg_passmail"><?php 
        _e('A password will be e-mailed to you.');
        ?>
</p>
		<br class="clear" />
		<input type="hidden" name="redirect_to" value="<?php 
        echo esc_attr($redirect_to);
        ?>
" />
		<?php 
        wp_nonce_field('confirm_form', 'confirm_form_nonce');
        ?>
		<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php 
        esc_attr_e('Register');
        ?>
" tabindex="100" /></p>
		</form>

		<p id="nav">
		<a href="javascript: history.go(-1)"><?php 
        _e('&larr; Back', $cimy_uef_domain);
        ?>
</a>
		</p>
<?php 
        login_footer("");
        exit(0);
    }
}
    /**
     * Load Login Page For Social
     * 
     * Handles to load login page for social
     * when no email address found
     * 
     * @package Easy Digital Downloads - Social Login
     * @since 1.0.0
     */
    public function edd_slg_social_login_redirect()
    {
        global $edd_options;
        $socialtype = isset($_GET['eddslgnetwork']) ? $_GET['eddslgnetwork'] : '';
        //get all social networks
        $allsocialtypes = edd_slg_social_networks();
        if (!is_user_logged_in() && isset($_GET['edd_slg_social_login']) && !empty($socialtype) && array_key_exists($socialtype, $allsocialtypes)) {
            // get redirect url from shortcode
            $stcd_redirect_url = EDD()->session->get('edd_slg_stcd_redirect_url');
            //check button clicked from widget then redirect to widget page url
            if (isset($_GET['container']) && $_GET['container'] == 'widget') {
                // get redirect url from widget
                $stcd_redirect_url = EDD()->session->get('edd_slg_stcd_redirect_url_widget');
            }
            $redirect_url = !empty($stcd_redirect_url) ? $stcd_redirect_url : edd_slg_get_current_page_url();
            $data = array();
            //wordpress error class
            $errors = new WP_Error();
            switch ($socialtype) {
                case 'twitter':
                    //get twitter user data
                    $tw_userdata = $this->socialtwitter->edd_slg_get_twitter_user_data();
                    //check user id is set or not for twitter
                    if (!empty($tw_userdata) && isset($tw_userdata->id) && !empty($tw_userdata->id)) {
                        $data['first_name'] = $tw_userdata->name;
                        $data['last_name'] = '';
                        $data['name'] = $tw_userdata->screen_name;
                        //display name of user
                        $data['type'] = 'twitter';
                        $data['all'] = $tw_userdata;
                        $data['link'] = 'https://twitter.com/' . $tw_userdata->screen_name;
                        $data['id'] = $tw_userdata->id;
                    }
                    break;
            }
            //if cart is empty or user is not logged in social media
            //and accessing the url then send back user to checkout page
            if (!isset($data['id']) || empty($data['id'])) {
                /*if( isset( $_GET['page_id'] ) && !empty( $_GET['page_id'] ) ) {
                			$redirect_url = get_permalink( $_GET['page_id'] );
                		} else {
                			$redirect_url = home_url();
                		}*/
                if (isset($_SESSION['edd']['edd_slg_stcd_redirect_url_widget'])) {
                    unset($_SESSION['edd']['edd_slg_stcd_redirect_url_widget']);
                }
                if (isset($_SESSION['edd']['edd_slg_stcd_redirect_url'])) {
                    unset($_SESSION['edd']['edd_slg_stcd_redirect_url']);
                }
                wp_redirect($redirect_url);
                exit;
                //send user to checkout page
                //edd_slg_send_on_checkout_page();
            }
            //when user will click submit button of custom login
            //check user clicks submit button of registration page and get parameter should be valid param
            if (isset($_POST['edd-slg-submit']) && !empty($_POST['edd-slg-submit']) && $_POST['edd-slg-submit'] == __('Register', 'eddslg')) {
                $loginurl = wp_login_url();
                if (isset($_POST['edd_slg_social_email'])) {
                    //check email is set or not
                    $socialemail = $_POST['edd_slg_social_email'];
                    if (empty($socialemail)) {
                        //if email is empty
                        $errors->add('empty_email', '<strong>' . __('ERROR', 'eddslg') . ' :</strong> ' . __('Enter your email address.', 'eddslg'));
                    } elseif (!is_email($socialemail)) {
                        //if email is not valid
                        $errors->add('invalid_email', '<strong>' . __('ERROR', 'eddslg') . ' :</strong> ' . __('The email address did not validate.', 'eddslg'));
                        $socialemail = '';
                    } elseif (email_exists($socialemail)) {
                        //if email is exist or not
                        $errors->add('email_exists', '<strong>' . __('ERROR', 'eddslg') . ' :</strong> ' . __('Email already exists, If you have an account login first.', 'eddslg'));
                    }
                    if ($errors->get_error_code() == '') {
                        //
                        if (!empty($data)) {
                            //check user data is not empty
                            $data['email'] = $socialemail;
                            //create user
                            $usercreated = $this->edd_slg_add_user($data);
                            if (isset($_SESSION['edd']['edd_slg_stcd_redirect_url_widget'])) {
                                unset($_SESSION['edd']['edd_slg_stcd_redirect_url_widget']);
                            }
                            if (isset($_SESSION['edd']['edd_slg_stcd_redirect_url'])) {
                                unset($_SESSION['edd']['edd_slg_stcd_redirect_url']);
                            }
                            wp_redirect($redirect_url);
                            exit;
                            //send user to checkout page
                            //edd_slg_send_on_checkout_page();
                        }
                    }
                }
            }
            //redirect user to custom registration form
            if (isset($_GET['edd_slg_social_login']) && !empty($_GET['edd_slg_social_login'])) {
                //login call back url after registration
                /*$callbackurl = wp_login_url();
                		$callbackurl = add_query_arg('edd_slg_social_login_done', 1, $callbackurl);*/
                $socialemail = isset($_POST['edd_slg_social_email']) ? $_POST['edd_slg_social_email'] : '';
                //check the user who is going to connect with site
                //it is alreay exist with same data or not
                //if user is exist then simply make that user logged in
                $metaquery = array(array('key' => 'edd_slg_social_user_connect_via', 'value' => $data['type']), array('key' => 'edd_slg_social_identifier', 'value' => $data['id']));
                $getusers = get_users(array('meta_query' => $metaquery));
                $wpuser = array_shift($getusers);
                //getting users
                //check user is exist or not conected with same metabox
                if (!empty($wpuser)) {
                    //make user logged in
                    wp_set_auth_cookie($wpuser->ID, false);
                    if (isset($_SESSION['edd']['edd_slg_stcd_redirect_url_widget'])) {
                        unset($_SESSION['edd']['edd_slg_stcd_redirect_url_widget']);
                    }
                    if (isset($_SESSION['edd']['edd_slg_stcd_redirect_url'])) {
                        unset($_SESSION['edd']['edd_slg_stcd_redirect_url']);
                    }
                    wp_redirect($redirect_url);
                    exit;
                } else {
                    //if user is not exist then show register user form
                    login_header(__('Registration Form', 'eddslg'), '<p class="message register">' . __('Please enter your email address to complete registration.', 'eddslg') . '</p>', $errors);
                    ?>
						<form name="registerform" id="registerform" action="" method="post">
							  <p>
								  <label for="wcsl_email"><?php 
                    _e('E-mail', 'eddslg');
                    ?>
<br />
								  <input type="text" name="edd_slg_social_email" id="edd_slg_social_email" class="input" value="<?php 
                    echo $socialemail;
                    ?>
" size="25" tabindex="20" /></label>
							  </p>
							  <p id="reg_passmail">
							  	<?php 
                    _e('Username and Password will be sent to your email.', 'eddslg');
                    ?>
							  </p>
							  <br class="clear" />
							  <p class="submit"><input type="submit" name="edd-slg-submit" id="edd-slg-submit" class="button-primary" value="<?php 
                    _e('Register', 'eddslg');
                    ?>
" tabindex="100" /></p>
						</form>
					<?php 
                    login_footer('user_login');
                    exit;
                }
            }
        }
    }
 /**
  * Display an error using login page wrapper
  *
  * @param WP_Error $error Error object
  */
 public function display_error(WP_Error $error)
 {
     login_header(__('Error'), '', $error);
     login_footer();
 }
Example #23
0
<?php

login_header(__('Authorize', 'oauth'), '', $errors);
$current_user = wp_get_current_user();
$url = site_url('wp-login.php?action=oauth1_authorize', 'login_post');
?>

<style>

	.login-title {
		margin-bottom: 15px;
	}

	.login-info .avatar {
		margin-right: 15px;
		margin-bottom: 15px;
		float: left;
	}

	#login form .login-info p {
		margin-bottom: 15px;
	}

	/** Note - login scope has not yet been implemented. **/
	.login-scope {
		clear: both;
		margin-bottom: 15px;
	}

	.login-scope h4 {
		margin-bottom: 10px;
function ym_register_sidebar_widget($args = false, $pack_id = false, $hide_custom_fields = false, $hide_further_pages = false, $autologin = false)
{
    global $wpdb, $user_ID, $current_user;
    $html = '';
    if (!function_exists('register_sidebar_widget')) {
        return;
    }
    if ($args) {
        extract($args);
        $options = get_option('ym_register_sidebar_widget');
    } else {
        $args = array();
    }
    $title = isset($options['ym_register_sidebar_widget_title']) ? $options['ym_register_sidebar_widget_title'] : __('Your Members - Register', 'ym');
    $intro = isset($options['ym_register_sidebar_widget_intro']) ? $options['ym_register_sidebar_widget_intro'] : '';
    $custom_fields = isset($options['ym_register_sidebar_widget_use_custom_fields']) ? $options['ym_register_sidebar_widget_use_custom_fields'] : true;
    if (!$user_ID) {
        if ($args) {
            $html .= $before_widget;
        } else {
            $html .= '<div id="ym_page_register_form">';
        }
        if (trim($title) && $args) {
            $html .= $before_title . $title . $after_title;
        }
        if ($intro) {
            $html .= $intro;
        }
        $user_email = ym_request('user_email');
        //register_new_user($userlogin, useremail);
        global $errors;
        if (is_wp_error($errors)) {
            login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
        }
        $html .= '<form ' . (!$args ? 'class="ym_register_form"' : '') . ' name="registerform" id="registerform" action="' . site_url('wp-login.php?action=register', 'login_post') . '" method="post" enctype="multipart/form-data">';
        //		$html .= '<form ' . (!$args ? 'class="ym_register_form"':'') . ' name="registerform" id="registerform" action="" method="post">
        //		<input type="hidden" name="ym_register_form_posting" value="1" />';
        if (!ym_post('user_login')) {
            $html .= '<div class="ym_register_form_row">
				<label class="ym_label">' . __('Username') . '</label>
				<p>
					<input type="text" name="user_login" id="user_login" class="ym_reg_input input" value="" size="20" />
				</p>
				<div class="ym_clear">&nbsp;</div>
			</div>';
        } else {
            $html .= '<input type="hidden" name="user_login" value="' . esc_attr(stripslashes($user_login)) . '" />';
        }
        if (!ym_post('user_email')) {
            $html .= '<div class="ym_register_form_row">
				<label class="ym_label">' . __('Email') . '</label>
				<p>				
					<input type="text" name="user_email" id="user_email" class="ym_reg_input input" value="' . esc_attr(stripslashes($user_email)) . '" size="25" />
				</p>
				<div class="ym_clear">&nbsp;</div>
			</div>';
        } else {
            $html .= '<input type="hidden" name="user_email" value="' . esc_attr(stripslashes($user_email)) . '" />';
        }
        if ($custom_fields) {
            ob_start();
            $html .= do_action('register_form', false, 1, $pack_id, $hide_custom_fields, $hide_further_pages, $autologin);
            $html .= ob_get_clean();
        }
        $html .= '<p id="reg_passmail">' . __('A password will be e-mailed to you.') . '</p>
			<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" value="' . __('Register') . '" /></p>
		</form>';
        if ($args) {
            $html .= $after_widget;
        } else {
            $html .= '</div>';
        }
    } else {
        $html .= '<div class="ym_message" id="ym_page_register_form_already_registered"><div class="ym_message_liner">' . __('You are already registered for the site and can\'t do so again.', 'ym') . '</div></div>';
    }
    if ($args) {
        echo $html;
    } else {
        return $html;
    }
}
Example #25
0
<header>
<title> PROJECT LTW 2015/2016 </title>
<meta charset = "utf-8">
<link rel="stylesheet" href="./css/myStyle.css">
<?php 
meta_includes();
?>
<script type="text/javascript" src="main.js"></script>
</header>

<body>

    <header> 
	<?php 
login_header();
?>
	<h1>Le EventBook</h1> 
	</header>
	
    <br>
		<?php 
/*main_display()*/
print_events(popular_events(), true, "Popular Events");
?>
    <br>
    <br>
    <a href="list_events.php">Check all public events</a>
	<br>
	
	<footer>
    /**
     * Generates the html form for the second step of the authentication process.
     *
     * @since 0.1-dev
     *
     * @param WP_User       $user WP_User object of the logged-in user.
     * @param string        $login_nonce A string nonce stored in usermeta.
     * @param string        $redirect_to The URL to which the user would like to be redirected.
     * @param string        $error_msg Optional. Login error message.
     * @param string|object $provider An override to the provider.
     */
    public static function login_html($user, $login_nonce, $redirect_to, $error_msg = '', $provider = null)
    {
        if (empty($provider)) {
            $provider = self::get_primary_provider_for_user($user->ID);
        } elseif (is_string($provider) && method_exists($provider, 'get_instance')) {
            $provider = call_user_func(array($provider, 'get_instance'));
        }
        $provider_class = get_class($provider);
        $available_providers = self::get_available_providers_for_user($user);
        $backup_providers = array_diff_key($available_providers, array($provider_class => null));
        $rememberme = 0;
        if (isset($_REQUEST['rememberme']) && $_REQUEST['rememberme']) {
            $rememberme = 1;
        }
        login_header();
        if (!empty($error_msg)) {
            echo '<div id="login_error"><strong>' . esc_html($error_msg) . '</strong><br /></div>';
        }
        ?>

		<form name="validate_2fa_form" id="loginform" action="<?php 
        echo esc_url(site_url('wp-login.php?action=validate_2fa', 'login_post'));
        ?>
" method="post" autocomplete="off">
				<input type="hidden" name="provider"      id="provider"      value="<?php 
        echo esc_attr($provider_class);
        ?>
" />
				<input type="hidden" name="wp-auth-id"    id="wp-auth-id"    value="<?php 
        echo esc_attr($user->ID);
        ?>
" />
				<input type="hidden" name="wp-auth-nonce" id="wp-auth-nonce" value="<?php 
        echo esc_attr($login_nonce);
        ?>
" />
				<input type="hidden" name="redirect_to"   id="redirect_to"   value="<?php 
        echo esc_attr($redirect_to);
        ?>
" />
				<input type="hidden" name="rememberme"    id="rememberme"    value="<?php 
        echo esc_attr($rememberme);
        ?>
" />

				<?php 
        $provider->authentication_page($user);
        ?>
		</form>

		<?php 
        if (1 === count($backup_providers)) {
            $backup_classname = key($backup_providers);
            $backup_provider = $backup_providers[$backup_classname];
            ?>
			<div class="backup-methods-wrap">
				<p class="backup-methods"><a href="<?php 
            echo esc_url(add_query_arg(urlencode_deep(array('action' => 'backup_2fa', 'provider' => $backup_classname, 'wp-auth-id' => $user->ID, 'wp-auth-nonce' => $login_nonce, 'redirect_to' => $redirect_to, 'rememberme' => $rememberme))));
            ?>
"><?php 
            echo esc_html(sprintf(__('Or, use your backup method: %s &rarr;', 'two-factor'), $backup_provider->get_label()));
            ?>
</a></p>
			</div>
		<?php 
        } elseif (1 < count($backup_providers)) {
            ?>
			<div class="backup-methods-wrap">
				<p class="backup-methods"><a href="javascript:;" onclick="document.querySelector('ul.backup-methods').style.display = 'block';"><?php 
            esc_html_e('Or, use a backup method…', 'two-factor');
            ?>
</a></p>
				<ul class="backup-methods">
					<?php 
            foreach ($backup_providers as $backup_classname => $backup_provider) {
                ?>
						<li><a href="<?php 
                echo esc_url(add_query_arg(urlencode_deep(array('action' => 'backup_2fa', 'provider' => $backup_classname, 'wp-auth-id' => $user->ID, 'wp-auth-nonce' => $login_nonce, 'redirect_to' => $redirect_to, 'rememberme' => $rememberme))));
                ?>
"><?php 
                $backup_provider->print_label();
                ?>
</a></li>
					<?php 
            }
            ?>
				</ul>
			</div>
		<?php 
        }
        ?>

		<p id="backtoblog">
			<a href="<?php 
        echo esc_url(home_url('/'));
        ?>
" title="<?php 
        esc_attr_e('Are you lost?');
        ?>
"><?php 
        echo esc_html(sprintf(__('&larr; Back to %s'), get_bloginfo('title', 'display')));
        ?>
</a>
		</p>

		<style>
		/* @todo: migrate to an external stylesheet. */
		.backup-methods-wrap {
			margin-top: 16px;
			padding: 0 24px;
		}
		.backup-methods-wrap a {
			color: #999;
			text-decoration: none;
		}
		ul.backup-methods {
			display: none;
			padding-left: 1.5em;
		}
		</style>

		<?php 
        /** This action is documented in wp-login.php */
        do_action('login_footer');
        ?>
		<div class="clear"></div>
		</body>
		</html>
		<?php 
    }
Example #27
0
function px_verify_view_registration_form($errors = '', $verified = array())
{
    login_header(__('Registration Form'), '<p class="message register">' . __('Register An Account') . '</p>', $errors);
    if ($verified) {
        ?>
		<div class="message success">
			<h3>Purchase Information</h3><br/>
			<p><strong>Buyer: </strong><?php 
        echo $verified['px_envato_username'];
        ?>
</p>
			<p><strong>Item: </strong><?php 
        echo $verified['px_envato_item'];
        ?>
</p>
			<p><strong>License: </strong><?php 
        echo $verified['px_envato_license'];
        ?>
</p>
			<p><strong>Purchase Code: </strong><?php 
        echo $verified['px_envato_purchase_code'];
        ?>
</p>
		</div>
		<?php 
    }
    ?>

	<form name="registerform" id="registerform" action="<?php 
    echo esc_url(site_url('wp-login.php?action=register', 'login_post'));
    ?>
" method="post">
		<input type="hidden" name="purchase_code" value="<?php 
    echo $verified['px_envato_purchase_code'];
    ?>
" />

		<p>
			<label for="user_login"><?php 
    _e('Username');
    ?>
<br />
			<input type="text" name="user_login" id="user_login" class="input" value="<?php 
    echo $verified['px_envato_username'];
    ?>
" size="20" tabindex="10" /></label>
		</p>
		<p>
			<label for="user_email"><?php 
    _e('E-mail');
    ?>
<br />
			<input type="email" name="user_email" id="user_email" class="input" value="" size="25" tabindex="20" /></label>
		</p>

		<p id="reg_passmail"><?php 
    _e('A password will be e-mailed to you.');
    ?>
</p>
		<br class="clear" />
		<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php 
    esc_attr_e('Register');
    ?>
" tabindex="100" /></p>
	</form>

	<p id="nav">
	<a href="<?php 
    echo esc_url(wp_login_url());
    ?>
"><?php 
    _e('Log in');
    ?>
</a> |
	<a href="<?php 
    echo esc_url(wp_lostpassword_url());
    ?>
" title="<?php 
    esc_attr_e('Password Lost and Found');
    ?>
"><?php 
    _e('Lost your password?');
    ?>
</a>
	</p>

	<?php 
    login_footer('user_login');
}
function simplr_login_switch()
{
    $options = get_option('simplr_reg_options');
    if (!isset($_GET['action'])) {
        $_GET['action'] = 'login';
    }
    $action = $_GET['action'];
    global $errors;
    switch ($action) {
        case 'logout':
            check_admin_referer('log-out');
            wp_logout();
            $redirect_to = !empty($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : 'wp-login.php?loggedout=true';
            wp_safe_redirect($redirect_to);
            exit;
            break;
        case 'lostpassword':
        case 'retrievepassword':
            ?>

		<form name="lostpasswordform" id="lostpasswordform" action="<?php 
            echo get_permalink($options->login_redirect);
            ?>
?action=lostpassword" method="post">
		<p>
			<label><?php 
            _e('Username or E-mail:', 'simplr-registration-form');
            ?>
<br />
			<input type="text" name="user_login" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
		</p>
		<?php 
            do_action('lostpassword_form');
            ?>
		<input type="hidden" name="redirect_to" value="<?php 
            echo esc_attr(@$redirect_to);
            ?>
" />
		<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php 
            esc_attr_e('Get New Password', 'simplr-registration-form');
            ?>
" tabindex="100" /></p>
		</form>

		<p id="nav">
		<a href="<?php 
            echo site_url('wp-login.php', 'login');
            ?>
"><?php 
            _e('Log in', 'simplr-registration-form');
            ?>
</a>
		<?php 
            if (get_option('users_can_register')) {
                ?>
			| <a href="<?php 
                echo site_url('wp-login.php?action=register', 'login');
                ?>
"><?php 
                _e('Register', 'simplr-registration-form');
                ?>
</a>
		<?php 
            }
            ?>
		</p>

		<?php 
            login_footer('user_login');
            break;
        case 'resetpass':
        case 'rp':
            $user = check_password_reset_key($_GET['key'], $_GET['login']);
            if (is_wp_error($user)) {
                wp_redirect(site_url('wp-login.php?action=lostpassword&error=invalidkey'));
                exit;
            }
            $errors = '';
            if (isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2']) {
                $errors = new WP_Error('password_reset_mismatch', __('The passwords do not match.', 'simplr-registration-form'));
            } elseif (isset($_POST['pass1']) && !empty($_POST['pass1'])) {
                reset_password($user, $_POST['pass1']);
                login_header(__('Password Reset', 'simplr-registration-form'), '<p class="message reset-pass">' . __('Your password has been reset.', 'simplr-registration-form') . ' <a href="' . site_url('wp-login.php', 'login') . '">' . __('Log in', 'simplr-registration-form') . '</a></p>');
                login_footer();
                exit;
            }
            wp_enqueue_script('utils');
            wp_enqueue_script('user-profile');
            login_header(__('Reset Password', 'simplr-registration-form'), '<p class="message reset-pass">' . __('Enter your new password below.', 'simplr-registration-form') . '</p>', $errors);
            ?>
		<form name="resetpassform" id="resetpassform" action="<?php 
            echo get_permalink($options->login_redirect) . '?action=resetpass&key=' . urlencode($_GET['key']) . '&login='******'login']);
            ?>
" method="post">
		<input type="hidden" id="user_login" value="<?php 
            echo esc_attr($_GET['login']);
            ?>
" autocomplete="off" />

		<p>
			<label><?php 
            _e('New password', 'simplr-registration-form');
            ?>
<br />
			<input type="password" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" /></label>
		</p>
		<p>
			<label><?php 
            _e('Confirm new password', 'simplr-registration-form');
            ?>
<br />
			<input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" /></label>
		</p>

		<div id="pass-strength-result" class="hide-if-no-js"><?php 
            _e('Strength indicator', 'simplr-registration-form');
            ?>
</div>
		<p class="description indicator-hint"><?php 
            _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).', 'simplr-registration-form');
            ?>
</p>

		<br class="clear" />
		<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php 
            esc_attr_e('Reset Password', 'simplr-registration-form');
            ?>
" tabindex="100" /></p>
		</form>

		<p id="nav">
		<a href="<?php 
            echo site_url('wp-login.php', 'login');
            ?>
"><?php 
            _e('Log in', 'simplr-registration-form');
            ?>
</a>
		<?php 
            if (get_option('users_can_register')) {
                ?>
			| <a href="<?php 
                echo site_url('wp-login.php?action=register', 'login');
                ?>
"><?php 
                _e('Register', 'simplr-registration-form');
                ?>
</a>
		<?php 
            }
            ?>
		</p>

		<?php 
            login_footer('user_pass');
            break;
        case 'login':
        default:
            $redirect_to = !isset($redirect_to) ? apply_filters('simplr_login_redirect', home_url(), $action) : $redirect_to;
            if (isset($_POST['log'])) {
                $user_login = '******' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ? esc_attr(stripslashes($_POST['log'])) : '';
            }
            $rememberme = !empty($_POST['rememberme']);
            ?>

		<form name="loginform" id="loginform" action="<?php 
            echo get_permalink($options->login_redirect);
            ?>
?action=<?php 
            echo $action;
            ?>
" method="post">
		<p>
			<label><?php 
            _e('Username', 'simplr-registration-form');
            ?>
<br />
			<input type="text" name="log" id="user_login" class="input" value="<?php 
            echo esc_attr(@$user_login);
            ?>
" size="20" tabindex="10" /></label>
		</p>
		<p>
			<label><?php 
            _e('Password', 'simplr-registration-form');
            ?>
<br />
			<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
		</p>
		<?php 
            do_action('login_form');
            ?>
		<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90"<?php 
            checked($rememberme);
            ?>
 /> <?php 
            esc_attr_e('Remember Me', 'simplr-registration-form');
            ?>
</label></p>
		<p class="submit">
			<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php 
            esc_attr_e('Log In', 'simplr-registration-form');
            ?>
" tabindex="100" />
		<?php 
            if (isset($interim_login)) {
                ?>
			<input type="hidden" name="interim-login" value="1" />
		<?php 
            } else {
                ?>
			<input type="hidden" name="redirect_to" value="<?php 
                echo esc_attr($redirect_to);
                ?>
" />
		<?php 
            }
            ?>
			<input type="hidden" name="testcookie" value="1" />
		</p>
		</form>

		<?php 
            if (!isset($interim_login)) {
                ?>
			<p id="nav">
			<?php 
                if (isset($_GET['checkemail']) && in_array($_GET['checkemail'], array('confirm', 'newpass'))) {
                    ?>
			<?php 
                } elseif (get_option('users_can_register')) {
                    ?>
				<a href="<?php 
                    echo site_url('wp-login.php?action=register', 'login');
                    ?>
"><?php 
                    _e('Register', 'simplr-registration-form');
                    ?>
</a> |
				<a href="<?php 
                    echo site_url('wp-login.php?action=lostpassword', 'login');
                    ?>
" title="<?php 
                    _e('Password Lost and Found', 'simplr-registration-form');
                    ?>
"><?php 
                    _e('Lost your password?', 'simplr-registration-form');
                    ?>
</a>
			<?php 
                } else {
                    ?>
				<a href="<?php 
                    echo site_url('wp-login.php?action=lostpassword', 'login');
                    ?>
" title="<?php 
                    _e('Password Lost and Found', 'simplr-registration-form');
                    ?>
"><?php 
                    _e('Lost your password?', 'simplr-registration-form');
                    ?>
</a>
			<?php 
                }
                ?>
			</p>
		<?php 
            }
            ?>

		<script type="text/javascript">
		function wp_attempt_focus(){
			setTimeout( function(){ try{
				<?php 
            if (isset($user_login) || isset($interim_login)) {
                ?>
					d = document.getElementById('user_pass');
					d.value = '';
				<?php 
            } else {
                ?>
					d = document.getElementById('user_login');
					<?php 
                if ('invalid_username' == @$errors->get_error_code()) {
                    ?>
						if( d.value != '' )
							d.value = '';
						<?php 
                }
            }
            ?>
				d.focus();
				d.select();
			} catch(e){}
			}, 200);
		}

		<?php 
            if (!$error) {
                ?>
			wp_attempt_focus();
		<?php 
            }
            ?>
		if(typeof wpOnload=='function') wpOnload();
		</script>

		<?php 
            login_footer();
            break;
    }
    // end action switch
}
Example #29
0
            }
        }
        /**
         * Filter the login page errors.
         *
         * @since 3.6.0
         *
         * @param object $errors      WP Error object.
         * @param string $redirect_to Redirect destination URL.
         */
        $errors = apply_filters('wp_login_errors', $errors, $redirect_to);
        // Clear any stale cookies.
        if ($reauth) {
            wp_clear_auth_cookie();
        }
        login_header(__('Log In'), '', $errors);
        if (isset($_POST['log'])) {
            $user_login = '******' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ? esc_attr(wp_unslash($_POST['log'])) : '';
        }
        $rememberme = !empty($_POST['rememberme']);
        if (!empty($errors->errors)) {
            $aria_describedby_error = ' aria-describedby="login_error"';
        } else {
            $aria_describedby_error = '';
        }
        ?>

<form name="loginform" id="loginform" action="<?php 
        echo esc_url(wp_login_url());
        ?>
" method="post">
Example #30
0
 /**
  * Display a message to the user after they have registered
  *
  * @uses registration_errors
  */
 public function show_user_pending_message($errors)
 {
     if (!empty($_POST['redirect_to'])) {
         // if a redirect_to is set, honor it
         wp_safe_redirect($_POST['redirect_to']);
         exit;
     }
     // if there is an error already, let it do it's thing
     if ($errors->get_error_code()) {
         return $errors;
     }
     $message = nua_default_registration_complete_message();
     $message = nua_do_email_tags($message, array('context' => 'pending_message'));
     $message = apply_filters('new_user_approve_pending_message', $message);
     $errors->add('registration_required', $message, 'message');
     $success_message = __('Registration successful.', 'new-user-approve');
     $success_message = apply_filters('new_user_approve_registration_message', $success_message);
     login_header(__('Pending Approval', 'new-user-approve'), '<p class="message register">' . $success_message . '</p>', $errors);
     login_footer();
     // an exit is necessary here so the normal process for user registration doesn't happen
     exit;
 }