public function __construct() { parent::__construct(); if (!is_user_logged_in()) { wp_redirect(wpsc_get_login_url()); exit; } $this->title = wpsc_get_customer_account_title(); }
private function send_registration_notification($user_id, $username, $email, $password) { wp_new_user_notification($user_id); $username = stripslashes($username); $password = stripslashes($password); $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); $title = apply_filters('wpsc_registration_notification_title', __('[%s] Thank you for registering', 'wpsc')); $title = sprintf($title, $blogname); $message = sprintf(__('Welcome, %s.', 'wpsc'), $username) . "\r\n\r\n"; $message .= __("Thank you for registering with us. Your account has been created:", 'wpsc') . "\r\n\r\n"; $message .= sprintf(__('Username: %s', 'wpsc'), $username) . "\r\n\r\n"; $message .= sprintf(__('Password: %s', 'wpsc'), $password) . "\r\n\r\n"; $message .= __("Here's a list of things you can do to get started:", 'wpsc') . "\r\n\r\n"; $message .= sprintf(__('1. Log in with your new account details <%s>', 'wpsc'), wpsc_get_login_url()) . "\r\n\r\n"; $message .= sprintf(__('2. Build your customer profile, and probably change your password to something easier to remember <%s>', 'wpsc'), wpsc_get_customer_account_url()) . "\r\n\r\n"; $message .= sprintf(__('3. Explore our shop! <%s>', 'wpsc'), wpsc_get_store_url()) . "\r\n\r\n"; $message = apply_filters('wpsc_registration_notification_body', $message); wp_mail($email, $title, $message); }
private function callback_reset_password($user) { $form = wpsc_get_password_reset_form_args(); add_filter('wpsc_validation_rule_fields_dont_match_message', array($this, 'filter_fields_dont_match_message')); $validation = wpsc_validate_form($form); remove_filter('wpsc_validation_rule_fields_dont_match_message', array($this, 'filter_fields_dont_match_message')); if (is_wp_error($validation)) { wpsc_set_validation_errors($validation); return; } $this->reset_password($user, $_POST['pass1']); $message = apply_filters('wpsc_reset_password_success_message', __('Your password has been reset successfully. Please log in with the new password.', 'wp-e-commerce'), $user); $this->message_collection->add($message, 'success', 'main', 'flash'); wp_redirect(wpsc_get_login_url()); exit; }
function wpsc_get_login_form_args() { $args = array('class' => 'wpsc-form wpsc-form-vertical wpsc-login-form', 'action' => wpsc_get_login_url(), 'id' => "wpsc-login-form", 'fields' => array(array('id' => 'wpsc-login-username', 'name' => 'username', 'type' => 'textfield', 'title' => __('Username', 'wpsc'), 'value' => wpsc_submitted_value('username'), 'rules' => 'required'), array('id' => 'wpsc-login-password', 'name' => 'password', 'type' => 'password', 'title' => __('Password', 'wpsc'), 'value' => '', 'rules' => 'required', 'description' => sprintf('<a class="wpsc-lost-password-link" href="%1$s">%2$s</a>', esc_url(wpsc_get_password_reminder_url()), __('Lost your password?', 'wpsc'))), array('id' => 'wpsc-login-remember', 'name' => 'remember', 'type' => 'checkbox', 'title' => __('Remember Me', 'wpsc'))), 'form_actions' => array(array('type' => 'submit', 'primary' => true, 'title' => apply_filters('wpsc_login_button_title', __('Log in', 'wpsc'))), array('type' => 'hidden', 'name' => 'action', 'value' => 'login'), array('type' => 'hidden', 'name' => '_wp_nonce', 'value' => wp_create_nonce("wpsc-log-in")))); $args = apply_filters('wpsc_get_login_form_args', $args); return $args; }
function wpsc_login_url($slug = '') { echo esc_url(wpsc_get_login_url($slug)); }