public function registration($params)
 {
     // Loading scripts and styles only when required
     /* Password Stregth Checker Script */
     if (!wp_script_is('form-validate')) {
         wp_register_script('form-validate', upme_url . 'js/form-validate.js', array('jquery'));
         wp_enqueue_script('form-validate');
         $validate_strings = upme_form_validate_setting();
         wp_localize_script('form-validate', 'Validate', $validate_strings);
     }
     // Include password strength meter from WordPress core
     wp_enqueue_script('password-strength-meter');
     if (!wp_style_is('upme_password_meter')) {
         wp_register_style('upme_password_meter', upme_url . 'css/password-meter.css');
         wp_enqueue_style('upme_password_meter');
     }
     if (!wp_style_is('upme_date_picker')) {
         wp_register_style('upme_date_picker', upme_url . 'css/upme-datepicker.css');
         wp_enqueue_style('upme_date_picker');
     }
     if (!wp_script_is('upme_date_picker_js')) {
         wp_register_script('upme_date_picker_js', upme_url . 'js/upme-datepicker.js', array('jquery'));
         wp_enqueue_script('upme_date_picker_js');
         // Set date picker default settings
         $date_picker_array = upme_date_picker_setting();
         wp_localize_script('upme_date_picker_js', 'UPMEDatePicker', $date_picker_array);
     }
     do_action('upme_add_registration_scripts');
 }
Пример #2
0
 function show_reset_password_form()
 {
     global $upme_reset_password;
     $this->login_code_count++;
     // Check whether action parameter is available to show password reset form
     // or forget password form
     $action = isset($_GET['action']) ? $_GET['action'] : '';
     $login = isset($_GET['login']) ? $_GET['login'] : '';
     $upme_reset_status = isset($_GET['upme_reset_status']) ? $_GET['upme_reset_status'] : '';
     // Loading scripts and styles only when required
     /* Password Stregth Checker Script */
     if (!wp_script_is('form-validate')) {
         wp_register_script('form-validate', upme_url . 'js/form-validate.js', array('jquery'));
         wp_enqueue_script('form-validate');
         $validate_strings = upme_form_validate_setting();
         wp_localize_script('form-validate', 'Validate', $validate_strings);
     }
     if (!wp_style_is('upme_password_meter')) {
         wp_register_style('upme_password_meter', upme_url . 'css/password-meter.css');
         wp_enqueue_style('upme_password_meter');
     }
     // Include password strength meter from WordPress core
     wp_enqueue_script('password-strength-meter');
     $display = null;
     if (('upme_reset_pass' == $action || 'expired' == $upme_reset_status) && '' != $action) {
         $display .= '<div id="upme-reset-form-err-holder" style="display: none;" class="upme-errors"></div>';
         $display .= '<form action="" method="post" id="upme-reset-password-form">';
         $display .= '<div class="upme-field upme-edit upme-edit-show upme-user_pass ">';
         $display .= '<label class="upme-field-type" for="' . __('New Password', 'upme') . '">';
         $display .= '<i class="upme-icon upme-icon-lock"></i>';
         $display .= '<span>' . __('New Password', 'upme') . '</span></label>';
         $display .= '<div class="upme-field-value">';
         $display .= '<input type="password" class="upme-input" name="upme_new_password" id="upme_new_password" value=""  />';
         $display .= '<div class="upme-help-text upme-help">' . apply_filters('upme_password_help_text', __('Password must be at least 7 characters long. To make it stronger, use upper and lower case letters, numbers and symbols.', 'upme')) . '</div>';
         $display .= '</div>';
         $display .= '</div><div class="upme-clear"></div>';
         $display .= '<div class="upme-field upme-edit upme-edit-show upme-user_pass_confirm">';
         $display .= '<label class="upme-field-type" for="' . __('Confirm', 'upme') . '">';
         $display .= '<i class="upme-icon upme-icon-lock"></i>';
         $display .= '<span>' . __('Confirm', 'upme') . '</span></label>';
         $display .= '<div class="upme-field-value">';
         $display .= '<input type="password" class="upme-input" name="upme_confirm_new_password" id="upme_confirm_new_password" value=""  />';
         $display .= '<div class="password-meter"><div id="password-meter-message" class="password-meter-message">' . __('Strength Indicator', 'upme') . '</div></div>';
         $display .= '</div>';
         $display .= '</div><div class="upme-clear"></div>';
         $display .= '<div class="upme-field upme-edit upme-edit-show">
                     <input type="hidden" id="upme-reset-pass-login" value="' . $login . '" />';
         $display .= UPME_Html::button('submit', array('class' => 'upme-button upme-reset-password', 'name' => 'upme-reset-password', 'value' => __('Reset Password', 'upme')));
         $display .= ' </div><div class="upme-clear"></div>';
         $display .= '</form>';
     } else {
         $display .= '<form action="" method="post" id="upme-forgot-password-form">';
         $display .= '<div class="upme-field upme-edit upme-edit-show upme-user_name_email">';
         $display .= '<label class="upme-field-type" for="user_name_email">
         <i class="upme-icon upme-icon-user"></i><span>' . __('Username or Email', 'upme') . '</span></label>';
         $display .= '<div class="upme-field-value">';
         $display .= UPME_Html::text_box(array('class' => 'upme-input', 'id' => 'user_name_email-' . $this->login_code_count, 'name' => 'user_name_email'));
         $display .= '</div>';
         $display .= '</div>';
         $display .= '<div class="upme-field upme-edit upme-edit-show">';
         $display .= UPME_Html::button('button', array('class' => 'upme-button upme-login', 'id' => 'upme-forgot-pass-btn-' . $this->login_code_count, 'name' => 'upme-forgot-pass-btn', 'value' => __('Forgot Password', 'upme')));
         $display .= ' </div><div class="upme-clear"></div>';
         $display .= '</form>';
     }
     return $display;
 }