/**
 * True if an the user can post a resume. By default, you must be logged in.
 *
 * @return bool
 */
function resume_manager_user_can_post_resume()
{
    $can_post = true;
    if (!is_user_logged_in()) {
        if (resume_manager_user_requires_account() && !resume_manager_enable_registration()) {
            $can_post = false;
        }
    }
    return apply_filters('resume_manager_user_can_post_resume', $can_post);
}
    printf(__('You are currently signed in as <strong>%s</strong>.', 'wp-job-manager-resumes'), $user->user_login);
    ?>

			<a class="button" href="<?php 
    echo apply_filters('submit_resume_form_logout_url', wp_logout_url(get_permalink()));
    ?>
"><?php 
    _e('Sign out', 'wp-job-manager-resumes');
    ?>
</a>
		</div>
	</fieldset>

<?php 
} else {
    $account_required = resume_manager_user_requires_account();
    $registration_enabled = resume_manager_enable_registration();
    $generate_username_from_email = resume_manager_generate_username_from_email();
    ?>
	<fieldset>
		<label><?php 
    _e('Have an account?', 'wp-job-manager-resumes');
    ?>
</label>
		<div class="field account-sign-in">
			<a class="button" href="<?php 
    echo apply_filters('submit_resume_form_login_url', wp_login_url(get_permalink()));
    ?>
"><?php 
    _e('Sign in', 'wp-job-manager-resumes');
    ?>
 /**
  * Submit Step is posted
  */
 public function submit_handler()
 {
     try {
         // Init fields
         $this->init_fields();
         // Get posted values
         $values = $this->get_posted_fields();
         if (empty($_POST['submit_resume']) || !wp_verify_nonce($_POST['_wpnonce'], 'submit_form_posted')) {
             return;
         }
         // Validate required
         if (is_wp_error($return = $this->validate_fields($values))) {
             throw new Exception($return->get_error_message());
         }
         // Account creation
         if (!is_user_logged_in()) {
             $create_account = false;
             if (resume_manager_enable_registration()) {
                 if (resume_manager_user_requires_account()) {
                     if (!resume_manager_generate_username_from_email() && empty($_POST['create_account_username'])) {
                         throw new Exception(__('Please enter a username.', 'wp-job-manager-resumes'));
                     }
                     if (empty($_POST['candidate_email'])) {
                         throw new Exception(__('Please enter your email address.', 'wp-job-manager-resumes'));
                     }
                 }
                 if (!empty($_POST['candidate_email'])) {
                     if (version_compare(JOB_MANAGER_VERSION, '1.20.0', '<')) {
                         $create_account = wp_job_manager_create_account($_POST['candidate_email'], get_option('resume_manager_registration_role', 'candidate'));
                     } else {
                         $create_account = wp_job_manager_create_account(array('username' => empty($_POST['create_account_username']) ? '' : $_POST['create_account_username'], 'email' => $_POST['candidate_email'], 'role' => get_option('resume_manager_registration_role', 'candidate')));
                     }
                 }
             }
             if (is_wp_error($create_account)) {
                 throw new Exception($create_account->get_error_message());
             }
         }
         if (resume_manager_user_requires_account() && !is_user_logged_in()) {
             throw new Exception(__('You must be signed in to post your resume.', 'wp-job-manager-resumes'));
         }
         // Update the job
         $this->save_resume($values['resume_fields']['candidate_name'], $values['resume_fields']['resume_content'], $this->resume_id ? '' : 'preview', $values);
         $this->update_resume_data($values);
         // Successful, show next step
         $this->step++;
     } catch (Exception $e) {
         $this->add_error($e->getMessage());
         return;
     }
 }