Example #1
0
/**
 * Function that creates a generate new password form
 *
 * @param array $post_data $_POST
 *
 */
function qum_create_recover_password_form($user, $post_data)
{
    ?>
	<form enctype="multipart/form-data" method="post" id="qum-recover-password" class="qum-user-forms" action="<?php 
    echo esc_url(add_query_arg('finalAction', 'yes', qum_curpageurl()));
    ?>
">
		<ul>
	<?php 
    if (!empty($post_data['passw1'])) {
        $passw_one = $post_data['passw1'];
    } else {
        $passw_one = '';
    }
    if (!empty($post_data['passw2'])) {
        $passw_two = $post_data['passw2'];
    } else {
        $passw_two = '';
    }
    $recover_inputPassword = '******' . __('Password', 'quickusermanager') . '</label>
				<input class="password" name="passw1" type="password" id="passw1" value="' . $passw_one . '" autocomplete="off" title="' . qum_password_length_text() . '"/>
			</li><!-- .passw1 -->
			<input type="hidden" name="userData" value="' . $user->ID . '"/>
			<li class="qum-form-field passw2">
				<label for="passw2">' . __('Repeat Password', 'quickusermanager') . '</label>
				<input class="password" name="passw2" type="password" id="passw2" value="' . $passw_two . '" autocomplete="off" />
			</li><!-- .passw2 -->';
    /* if we have active the password strength checker */
    $recover_inputPassword .= qum_password_strength_checker_html();
    echo apply_filters('qum_recover_password_form_input', $recover_inputPassword, $passw_one, $passw_two, $user->ID);
    ?>
		</ul>
		<p class="form-submit">
			<?php 
    $button_name = __('Reset Password', 'quickusermanager');
    ?>
			<input name="recover_password2" type="submit" id="qum-recover-password-button" class="submit button" value="<?php 
    echo apply_filters('qum_recover_password_button_name1', $button_name);
    ?>
" />
			<input name="action2" type="hidden" id="action2" value="recover_password2" />
		</p><!-- .form-submit -->
		<?php 
    wp_nonce_field('verify_true_password_recovery2_' . $user->ID, 'password_recovery_nonce_field2');
    ?>
	</form><!-- #recover_password -->
	<?php 
}
Example #2
0
function qum_password_handler($output, $form_location, $field, $user_id, $field_check_errors, $request_data)
{
    $item_title = apply_filters('qum_' . $form_location . '_password_item_title', qum_icl_t('plugin quick-user-manager-pro', 'default_field_' . $field['id'] . '_title_translation', $field['field-title']));
    $item_description = qum_icl_t('plugin quick-user-manager-pro', 'default_field_' . $field['id'] . '_description_translation', $field['description']);
    if ($form_location != 'back_end') {
        $error_mark = $field['required'] == 'Yes' ? '<span class="qum-required" title="' . qum_required_field_error($field["field-title"]) . '">*</span>' : '';
        if (array_key_exists($field['id'], $field_check_errors)) {
            $error_mark = '<img src="' . QUM_PLUGIN_URL . 'assets/images/pencil_delete.png" title="' . qum_required_field_error($field["field-title"]) . '"/>';
        }
        $output = '
			<label for="passw1">' . $item_title . $error_mark . '</label>
			<input class="text-input" name="passw1" maxlength="' . apply_filters('qum_maximum_character_length', 70) . '" type="password" id="passw1" value="" autocomplete="off" />';
        if (!empty($item_description)) {
            $output .= '<span class="qum-description-delimiter">' . $item_description . ' ' . qum_password_length_text() . '</span>';
        } else {
            $output .= '<span class="qum-description-delimiter">' . qum_password_length_text() . '</span>';
        }
        /* if we have active the password strength checker */
        $output .= qum_password_strength_checker_html();
    }
    return apply_filters('qum_' . $form_location . '_password', $output, $form_location, $field, $user_id, $field_check_errors, $request_data);
}