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 – 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'); }
nocache_headers(); jr_load_form_scripts(); global $post, $posted; $submitID = $post->ID; $posted = array(); $errors = new WP_Error(); if (!is_user_logged_in()) { $step = 1; } else { $step = 2; if (!current_user_can('can_submit_job')) { redirect_myjobs(); } } if (isset($_POST['register']) && $_POST['register']) { $result = jr_process_register_form(get_permalink($submitID)); $errors = $result['errors']; $posted = $result['posted']; } elseif (isset($_POST['login']) && $_POST['login']) { $errors = jr_process_login_form(); } elseif (isset($_POST['job_submit']) && $_POST['job_submit']) { $result = jr_process_submit_job_form(); $errors = $result['errors']; $posted = $result['posted']; if ($errors && sizeof($errors) > 0 && $errors->get_error_code()) { $step = 2; } else { $step = 3; } } elseif (isset($_POST['preview_submit']) && $_POST['preview_submit']) { $step = 4;