Esempio n. 1
0
function jr_show_login()
{
    global $posted;
    if (isset($_POST['register']) && $_POST['register']) {
        $result = jr_process_register_form();
        $errors = $result['errors'];
        $posted = $result['posted'];
    } elseif (isset($_POST['login']) && $_POST['login']) {
        $errors = jr_process_login_form();
    }
    // Clear errors if loggedout is set.
    if (!empty($_GET['loggedout'])) {
        $errors = new WP_Error();
    }
    // If cookies are disabled we can't log in even with a valid user+pass
    if (isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE])) {
        $errors->add('test_cookie', __('Cookies are blocked or not supported by your browser. You must enable cookies to continue.', 'appthemes'));
    }
    if (isset($_GET['loggedout']) && TRUE == $_GET['loggedout']) {
        $message = __('You are now logged out.', 'appthemes');
    } elseif (isset($_GET['registration']) && 'disabled' == $_GET['registration']) {
        $errors->add('registerdisabled', __('User registration is currently not allowed.', 'appthemes'));
    } elseif (isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail']) {
        $message = __('Check your email for the confirmation link.', 'appthemes');
    } elseif (isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail']) {
        $message = __('Check your email for your new password.', 'appthemes');
    } elseif (isset($_GET['checkemail']) && 'registered' == $_GET['checkemail']) {
        $message = __('Registration complete. Please check your e-mail.', 'appthemes');
    }
    get_template_part('header');
    ?>
	<div class="section">

    	<div class="section_content">

			<h1><?php 
    _e('Login/Register', 'appthemes');
    ?>
</h1>
			
			<?php 
    if (isset($message) && !empty($message)) {
        echo '<p class="success">' . $message . '</p>';
    }
    ?>
			<?php 
    if (isset($errors) && sizeof($errors) > 0 && $errors->get_error_code()) {
        echo '<ul class="errors">';
        foreach ($errors->errors as $error) {
            echo '<li>' . $error[0] . '</li>';
        }
        echo '</ul>';
    }
    ?>
			
			<?php 
    if (get_option('jr_allow_job_seekers') == 'yes') {
        ?>
		    	
		    	<p><?php 
        _e('You must login or create an account in order to post a job or submit your resume.', 'appthemes');
        ?>
</p>
		    	
		    	<ul>
		    	<li><?php 
        _e('As a <strong>Job Seeker</strong> you\'ll be able to submit your profile, post your resume, and be found by employers.', 'appthemes');
        ?>
</li>
		    	
		    	<li><?php 
        _e('As an <strong>employer</strong> you will be able to submit, relist, view and remove your job listings.', 'appthemes');
        ?>
</li>
		    	</ul>
		    	
			<?php 
    } else {
        ?>
				<p><?php 
        _e('You must login or create an account in order to post a job &ndash; this will enable you to view, remove, or relist your listing in the future.', 'appthemes');
        ?>
</p>
			<?php 
    }
    ?>
			
		    <div class="col-1">
				
		        <?php 
    jr_register_form('', '');
    ?>

		    </div>

		    <div class="col-2">

		        <?php 
    jr_login_form();
    ?>

		    </div>

			<div class="clear"></div>

    	</div><!-- end section_content -->
	
		<div class="clear"></div>
	
	</div><!-- end section -->

        <div class="clear"></div>

</div><!-- end main content -->
			

	<?php 
    if (get_option('jr_show_sidebar') !== 'no') {
        get_sidebar('page');
    }
    ?>

			


<?php 
    get_template_part('footer');
}
Esempio n. 2
0
        jr_before_step_one();
        // do_action hook
        ?>
						<p><?php 
        _e('You must login or create an account in order to post a job &mdash; this will enable you to view, remove, or relist your listing in the future.', 'appthemes');
        ?>
</p>
				
						<div class="col-1">
							<?php 
        jr_register_form(get_permalink($submitID), 'job_lister');
        ?>
						</div>
						<div class="col-2">			
							<?php 
        jr_login_form(get_permalink($submitID), get_permalink($submitID));
        ?>
						</div>
						<div class="clear"></div>
						<?php 
        jr_after_step_one();
        // do_action hook
        break;
    case 2:
        jr_before_step_two();
        // do_action hook
        jr_submit_job_form();
        jr_after_step_two();
        // do_action hook
        break;
    case 3: