PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.2
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.2
1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.23 All 172 releases
userswp / widgets / reset.php

reset.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.2.2, at widgets/reset.php

153 lines 4.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 /**
7 * UsersWP reset password widget.
8 *
9 * @since 1.0.22
10 */
11 class UWP_Reset_Widget extends WP_Super_Duper {
12
13 /**
14 * Register the reset password widget with WordPress.
15 *
16 */
17 public function __construct() {
18
19
20 $options = array(
21 'textdomain' => 'userswp',
22 'block-icon' => 'admin-site',
23 'block-category'=> 'widgets',
24 'block-keywords'=> "['userswp','reset']",
25 'class_name' => __CLASS__,
26 'base_id' => 'uwp_reset',
27 'name' => __('UWP > Reset','userswp'),
28 'widget_ops' => array(
29 'classname' => 'uwp-reset-class bsui',
30 'description' => esc_html__('Displays reset password form.','userswp'),
31 ),
32 'arguments' => array(
33 'title' => array(
34 'title' => __( 'Widget title', 'userswp' ),
35 'desc' => __( 'Enter widget title.', 'userswp' ),
36 'type' => 'text',
37 'desc_tip' => true,
38 'default' => '',
39 'advanced' => false
40 ),
41 'form_title' => array(
42 'title' => __( 'Form title', 'userswp' ),
43 'desc' => __( 'Enter the form title (or "0" for no title)', 'userswp' ),
44 'type' => 'text',
45 'desc_tip' => true,
46 'default' => '',
47 'placeholder' => __('Reset Password','userswp'),
48 'advanced' => true
49 ),
50 'design_style' => array(
51 'title' => __('Design Style', 'userswp'),
52 'desc' => __('The design style to use.', 'userswp'),
53 'type' => 'select',
54 'options' => array(
55 "" => __('default', 'userswp'),
56 "bs1" => __('Style 1', 'userswp'),
57 ),
58 'default' => '',
59 'desc_tip' => true,
60 'advanced' => true
61 ),
62 'css_class' => array(
63 'type' => 'text',
64 'title' => __('Extra class:', 'userswp'),
65 'desc' => __('Give the wrapper an extra class so you can style things as you want.', 'userswp'),
66 'placeholder' => '',
67 'default' => '',
68 'desc_tip' => true,
69 'advanced' => true,
70 ),
71 )
72
73 );
74
75
76 parent::__construct( $options );
77 }
78
79 /**
80 * The Super block output function.
81 *
82 * @param array $args
83 * @param array $widget_args
84 * @param string $content
85 *
86 * @return mixed|string|bool
87 */
88 public function output( $args = array(), $widget_args = array(), $content = '' ) {
89
90 if (is_user_logged_in() && !is_admin()) {
91 return false;
92 }
93
94 $defaults = array(
95 'form_title' => __('Reset Password','userswp'),
96 'css_class' => ''
97 );
98
99 /**
100 * Parse incoming $args into an array and merge it with $defaults
101 */
102 $args = wp_parse_args( $args, $defaults );
103
104 global $uwp_widget_args;
105 $uwp_widget_args = $args;
106
107 ob_start();
108
109 echo '<div class="uwp_widgets uwp_widget_reset">';
110
111 $design_style = !empty($args['design_style']) ? esc_attr($args['design_style']) : uwp_get_option("design_style",'bootstrap');
112 $template = $design_style ? $design_style."/reset.php" : "reset.php";
113
114 echo '<div class="uwp_page">';
115
116 uwp_get_template($template, $args);
117
118 echo '</div>';
119
120 echo '</div>';
121
122 // scripts
123 wp_enqueue_script( 'password-strength-meter' ); // add scripts
124
125 ?>
126 <script>
127 jQuery( document ).ready( function( $ ) {
128 // Binding to trigger uwp_checkPasswordStrength
129 $( 'body' ).on( 'keyup', 'input[name=password], input[name=confirm_password]',
130 function( event ) {
131 uwp_checkPasswordStrength(
132 $('input[name=password]'), // First password field
133 $('input[name=confirm_password]'), // Second password field
134 $('#uwp-password-strength'), // Strength meter
135 $('input[type=submit]'), // Submit button
136 ['black', 'listed', 'word'] // Blacklisted words
137 );
138 }
139 );
140 });
141 </script>
142
143 <?php
144
145 $output = ob_get_contents();
146
147 ob_end_clean();
148
149 return trim($output);
150
151 }
152
153 }