Example #1
0
function wpsc_get_password_reminder_form_args()
{
    $args = array('class' => 'wpsc-form wpsc-form-vertical wpsc-password-reminder-form', 'action' => wpsc_get_password_reminder_url(), 'id' => "wpsc-password-reminder-form", 'fields' => array(array('id' => 'wpsc-password-reminder-username', 'name' => 'username', 'type' => 'textfield', 'title' => __('Username or E-mail', 'wpsc'), 'value' => wpsc_submitted_value('username'), 'rules' => 'trim|required|valid_username_or_email')), 'form_actions' => array(array('type' => 'submit', 'primary' => true, 'title' => apply_filters('wpsc_password_reminder_button_title', __('Get New Password', 'wpsc'))), array('type' => 'hidden', 'name' => 'action', 'value' => 'new_password'), array('type' => 'hidden', 'name' => '_wp_nonce', 'value' => wp_create_nonce("wpsc-password-reminder"))));
    return apply_filters('wpsc_get_password_reminder_form_args', $args);
}
Example #2
0
 public function reset($username = null, $key = null)
 {
     if (empty($username) || empty($key)) {
         wp_redirect(wpsc_get_password_reminder_url());
         exit;
     }
     $user = $this->check_password_reset_key($key, $username);
     if (is_wp_error($user)) {
         wpsc_set_validation_errors($user, 'check password reset key');
         return $user;
     }
     $this->view = 'password-reminder-reset';
     if (isset($_POST['action']) && $_POST['action'] == 'reset_password') {
         $this->callback_reset_password($user);
     }
     return $user;
 }
Example #3
0
function wpsc_get_password_reset_url($username, $key)
{
    return wpsc_get_password_reminder_url("reset/{$username}/{$key}");
}