Version Description
- email/message tags
- refactor messages
- send admin approval email after the user has been created
- tested for WordPress 4.0
- finish updates in preparation of option addon plugin
Download this release
Release Info
Developer | picklewagon |
Plugin | New User Approve |
Version | 1.7 |
Comparing to | |
See all releases |
Code changes from version 1.6 to 1.7
- includes/admin-approve.php +0 -4
- includes/email-tags.php +394 -0
- includes/messages.php +88 -0
- localization/new-user-approve-fr_FR.mo +0 -0
- localization/new-user-approve-fr_FR.po +286 -0
- localization/new-user-approve.pot +149 -102
- new-user-approve.php +99 -120
- readme.txt +19 -7
- tests/bootstrap.php +18 -7
includes/admin-approve.php
CHANGED
@@ -57,10 +57,6 @@ class pw_new_user_approve_admin_approve {
|
|
57 |
* Create the view for the admin interface
|
58 |
*/
|
59 |
public function approve_admin() {
|
60 |
-
if ( !current_user_can( 'manage_options' ) ) {
|
61 |
-
wp_die( __('You do not have sufficient permissions to access this page.') );
|
62 |
-
}
|
63 |
-
|
64 |
require_once( pw_new_user_approve()->get_plugin_dir() . '/admin/templates/approve.php' );
|
65 |
}
|
66 |
|
57 |
* Create the view for the admin interface
|
58 |
*/
|
59 |
public function approve_admin() {
|
|
|
|
|
|
|
|
|
60 |
require_once( pw_new_user_approve()->get_plugin_dir() . '/admin/templates/approve.php' );
|
61 |
}
|
62 |
|
includes/email-tags.php
ADDED
@@ -0,0 +1,394 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Email Tags API for creating Email template tags
|
4 |
+
*
|
5 |
+
* Email tags are wrapped in { }
|
6 |
+
*
|
7 |
+
* A few examples:
|
8 |
+
*
|
9 |
+
* {name}
|
10 |
+
* {sitename}
|
11 |
+
*
|
12 |
+
* To replace tags in content, use: nua_do_email_tags( $content, $name );
|
13 |
+
*
|
14 |
+
* To add tags, use: nua_add_email_tag( $tag, $description, $func ). Be sure to wrap nua_add_email_tag()
|
15 |
+
* in a function hooked to the 'nua_email_tags' action
|
16 |
+
*
|
17 |
+
* @package New User Approve
|
18 |
+
* @subpackage Emails
|
19 |
+
* @copyright Copyright (c) 2014, Pippin Williamson
|
20 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
21 |
+
* @author Barry Kooij
|
22 |
+
*/
|
23 |
+
|
24 |
+
// Exit if accessed directly
|
25 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
26 |
+
|
27 |
+
class NUA_Email_Template_Tags {
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Container for storing all tags
|
31 |
+
*/
|
32 |
+
private $tags;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Attributes
|
36 |
+
*/
|
37 |
+
private $attributes;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Add an email tag
|
41 |
+
*
|
42 |
+
* @param string $tag Email tag to be replace in email
|
43 |
+
* @param callable $func Hook to run when email tag is found
|
44 |
+
*/
|
45 |
+
public function add( $tag, $description, $func, $context ) {
|
46 |
+
if ( is_callable( $func ) ) {
|
47 |
+
$this->tags[$tag] = array(
|
48 |
+
'tag' => $tag,
|
49 |
+
'description' => $description,
|
50 |
+
'func' => $func,
|
51 |
+
'context' => $context,
|
52 |
+
);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Remove an email tag
|
58 |
+
*
|
59 |
+
* @param string $tag Email tag to remove hook from
|
60 |
+
*/
|
61 |
+
public function remove( $tag ) {
|
62 |
+
unset( $this->tags[$tag] );
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Check if $tag is a registered email tag
|
67 |
+
*
|
68 |
+
* @param string $tag Email tag that will be searched
|
69 |
+
*
|
70 |
+
* @return bool
|
71 |
+
*/
|
72 |
+
public function email_tag_exists( $tag ) {
|
73 |
+
return array_key_exists( $tag, $this->tags );
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Returns a list of all email tags
|
78 |
+
*
|
79 |
+
* @return array
|
80 |
+
*/
|
81 |
+
public function get_tags() {
|
82 |
+
return $this->tags;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Search content for email tags and filter email tags through their hooks
|
87 |
+
*
|
88 |
+
* @param string $content Content to search for email tags
|
89 |
+
* @param array $attributes Attributes for email customization
|
90 |
+
*
|
91 |
+
* @return string Content with email tags filtered out.
|
92 |
+
*/
|
93 |
+
public function do_tags( $content, $attributes ) {
|
94 |
+
|
95 |
+
// Check if there is atleast one tag added
|
96 |
+
if ( empty( $this->tags ) || ! is_array( $this->tags ) ) {
|
97 |
+
return $content;
|
98 |
+
}
|
99 |
+
|
100 |
+
$this->attributes = $attributes;
|
101 |
+
|
102 |
+
$new_content = preg_replace_callback( "/{([A-z0-9\-\_]+)}/s", array( $this, 'do_tag' ), $content );
|
103 |
+
|
104 |
+
$this->user_id = null;
|
105 |
+
|
106 |
+
return $new_content;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Do a specific tag, this function should not be used. Please use edd_do_email_tags instead.
|
111 |
+
*
|
112 |
+
* @param $m message
|
113 |
+
*
|
114 |
+
* @return mixed
|
115 |
+
*/
|
116 |
+
public function do_tag( $m ) {
|
117 |
+
|
118 |
+
// Get tag
|
119 |
+
$tag = $m[1];
|
120 |
+
|
121 |
+
// Return tag if tag not set
|
122 |
+
if ( ! $this->email_tag_exists( $tag ) ) {
|
123 |
+
return $m[0];
|
124 |
+
}
|
125 |
+
|
126 |
+
return call_user_func( $this->tags[$tag]['func'], $this->attributes, $tag );
|
127 |
+
}
|
128 |
+
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Add an email tag
|
133 |
+
*
|
134 |
+
* @param string $tag Email tag to be replace in email
|
135 |
+
* @param callable $func Hook to run when email tag is found
|
136 |
+
*/
|
137 |
+
function nua_add_email_tag( $tag, $description, $func, $context ) {
|
138 |
+
pw_new_user_approve()->email_tags->add( $tag, $description, $func, $context );
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Remove an email tag
|
143 |
+
*
|
144 |
+
* @param string $tag Email tag to remove hook from
|
145 |
+
*/
|
146 |
+
function nua_remove_email_tag( $tag ) {
|
147 |
+
pw_new_user_approve()->email_tags->remove( $tag );
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Check if $tag is a registered email tag
|
152 |
+
*
|
153 |
+
* @param string $tag Email tag that will be searched
|
154 |
+
*
|
155 |
+
* @return bool
|
156 |
+
*/
|
157 |
+
function nua_email_tag_exists( $tag ) {
|
158 |
+
return pw_new_user_approve()->email_tags->email_tag_exists( $tag );
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Get all email tags
|
163 |
+
*
|
164 |
+
* @return array
|
165 |
+
*/
|
166 |
+
function nua_get_email_tags() {
|
167 |
+
return pw_new_user_approve()->email_tags->get_tags();
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Get a formatted HTML list of all available email tags
|
172 |
+
*
|
173 |
+
* @return string
|
174 |
+
*/
|
175 |
+
function nua_get_emails_tags_list( $context = 'email' ) {
|
176 |
+
// The list
|
177 |
+
$list = '';
|
178 |
+
|
179 |
+
// Get all tags
|
180 |
+
$email_tags = nua_get_email_tags();
|
181 |
+
|
182 |
+
// Check
|
183 |
+
if ( count( $email_tags ) > 0 ) {
|
184 |
+
|
185 |
+
// Loop
|
186 |
+
foreach ( $email_tags as $email_tag ) {
|
187 |
+
if ( in_array( $context, $email_tag['context'] ) ) {
|
188 |
+
// Add email tag to list
|
189 |
+
$list .= '{' . $email_tag['tag'] . '} - ' . $email_tag['description'] . '<br/>';
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
}
|
194 |
+
|
195 |
+
// Return the list
|
196 |
+
return $list;
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Search content for email tags and filter email tags through their hooks
|
201 |
+
*
|
202 |
+
* @param string $content Content to search for email tags
|
203 |
+
* @param int $attributes Attributes to customize email messages
|
204 |
+
*
|
205 |
+
* @return string Content with email tags filtered out.
|
206 |
+
*/
|
207 |
+
function nua_do_email_tags( $content, $attributes ) {
|
208 |
+
|
209 |
+
$attributes = apply_filters( 'nua_email_tags_attributes', $attributes );
|
210 |
+
|
211 |
+
// Replace all tags
|
212 |
+
$content = pw_new_user_approve()->email_tags->do_tags( $content, $attributes );
|
213 |
+
|
214 |
+
// Return content
|
215 |
+
return $content;
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Load email tags
|
220 |
+
*/
|
221 |
+
function nua_load_email_tags() {
|
222 |
+
do_action( 'nua_add_email_tags' );
|
223 |
+
}
|
224 |
+
add_action( 'init', 'nua_load_email_tags', -999 );
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Add default NUA email template tags
|
228 |
+
*/
|
229 |
+
function nua_setup_email_tags() {
|
230 |
+
|
231 |
+
// Setup default tags array
|
232 |
+
$email_tags = array(
|
233 |
+
array(
|
234 |
+
'tag' => 'username',
|
235 |
+
'description' => __( "The user's username on the site as well as the Username label", 'new-user-approve' ),
|
236 |
+
'function' => 'nua_email_tag_username',
|
237 |
+
'context' => array( 'email' ),
|
238 |
+
),
|
239 |
+
array(
|
240 |
+
'tag' => 'user_email',
|
241 |
+
'description' => __( "The user's email address", 'new-user-approve' ),
|
242 |
+
'function' => 'nua_email_tag_user_email',
|
243 |
+
'context' => array( 'email' ),
|
244 |
+
),
|
245 |
+
array(
|
246 |
+
'tag' => 'sitename',
|
247 |
+
'description' => __( 'Your site name', 'new-user-approve' ),
|
248 |
+
'function' => 'nua_email_tag_sitename',
|
249 |
+
'context' => array( 'email', 'login' ),
|
250 |
+
),
|
251 |
+
array(
|
252 |
+
'tag' => 'site_url',
|
253 |
+
'description' => __( 'Your site URL', 'new-user-approve' ),
|
254 |
+
'function' => 'nua_email_tag_siteurl',
|
255 |
+
'context' => array( 'email' ),
|
256 |
+
),
|
257 |
+
array(
|
258 |
+
'tag' => 'admin_approve_url',
|
259 |
+
'description' => __( 'The URL to approve/deny users', 'new-user-approve' ),
|
260 |
+
'function' => 'nua_email_tag_adminurl',
|
261 |
+
'context' => array( 'email' ),
|
262 |
+
),
|
263 |
+
array(
|
264 |
+
'tag' => 'login_url',
|
265 |
+
'description' => __( 'The URL to login to the site', 'new-user-approve' ),
|
266 |
+
'function' => 'nua_email_tag_loginurl',
|
267 |
+
'context' => array( 'email' ),
|
268 |
+
),
|
269 |
+
array(
|
270 |
+
'tag' => 'password',
|
271 |
+
'description' => __( 'Generates the password for the user to add to the email', 'new-user-approve' ),
|
272 |
+
'function' => 'nua_email_tag_password',
|
273 |
+
'context' => array( 'email' ),
|
274 |
+
),
|
275 |
+
);
|
276 |
+
|
277 |
+
// Apply nua_email_tags filter
|
278 |
+
$email_tags = apply_filters( 'nua_email_tags', $email_tags );
|
279 |
+
|
280 |
+
// Add email tags
|
281 |
+
foreach ( $email_tags as $email_tag ) {
|
282 |
+
nua_add_email_tag( $email_tag['tag'], $email_tag['description'], $email_tag['function'], $email_tag['context'] );
|
283 |
+
}
|
284 |
+
|
285 |
+
}
|
286 |
+
add_action( 'nua_add_email_tags', 'nua_setup_email_tags' );
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Email template tag: username
|
290 |
+
* The user's user name on the site
|
291 |
+
*
|
292 |
+
* @param array $attributes
|
293 |
+
*
|
294 |
+
* @return string username
|
295 |
+
*/
|
296 |
+
function nua_email_tag_username( $attributes ) {
|
297 |
+
$username = $attributes['user_login'];
|
298 |
+
|
299 |
+
return sprintf( __( 'Username: %s', 'new-user-approve' ), $username );
|
300 |
+
}
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Email template tag: user_email
|
304 |
+
* The user's email address
|
305 |
+
*
|
306 |
+
* @param array $attributes
|
307 |
+
*
|
308 |
+
* @return string user_email
|
309 |
+
*/
|
310 |
+
function nua_email_tag_user_email( $attributes ) {
|
311 |
+
return $attributes['user_email'];
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Email template tag: sitename
|
316 |
+
* Your site name
|
317 |
+
*
|
318 |
+
* @param array $attributes
|
319 |
+
*
|
320 |
+
* @return string sitename
|
321 |
+
*/
|
322 |
+
function nua_email_tag_sitename( $attributes ) {
|
323 |
+
return get_bloginfo( 'name' );
|
324 |
+
}
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Email template tag: site_url
|
328 |
+
* Your site URL
|
329 |
+
*
|
330 |
+
* @param array $attributes
|
331 |
+
*
|
332 |
+
* @return string site URL
|
333 |
+
*/
|
334 |
+
function nua_email_tag_siteurl( $attributes ) {
|
335 |
+
return home_url();
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Email template tag: admin_approve_url
|
340 |
+
* Your site URL
|
341 |
+
*
|
342 |
+
* @param array $attributes
|
343 |
+
*
|
344 |
+
* @return string admin approval URL
|
345 |
+
*/
|
346 |
+
function nua_email_tag_adminurl( $attributes ) {
|
347 |
+
return $attributes['admin_url'];
|
348 |
+
}
|
349 |
+
|
350 |
+
/**
|
351 |
+
* Email template tag: login_url
|
352 |
+
* Your site URL
|
353 |
+
*
|
354 |
+
* @param array $attributes
|
355 |
+
*
|
356 |
+
* @return string admin approval URL
|
357 |
+
*/
|
358 |
+
function nua_email_tag_loginurl( $attributes ) {
|
359 |
+
return wp_login_url();
|
360 |
+
}
|
361 |
+
|
362 |
+
/**
|
363 |
+
* Email template tag: password
|
364 |
+
* Generates the password for the user to add to the email
|
365 |
+
*
|
366 |
+
* @param array $attributes
|
367 |
+
*
|
368 |
+
* @return string password label and password
|
369 |
+
*/
|
370 |
+
function nua_email_tag_password( $attributes ) {
|
371 |
+
$user = $attributes['user'];
|
372 |
+
|
373 |
+
if ( pw_new_user_approve()->do_password_reset( $user->ID ) ) {
|
374 |
+
// reset password to know what to send the user
|
375 |
+
$new_pass = wp_generate_password( 12, false );
|
376 |
+
|
377 |
+
// store the password
|
378 |
+
global $wpdb;
|
379 |
+
$data = array( 'user_pass' => md5( $new_pass ), 'user_activation_key' => '', );
|
380 |
+
$where = array( 'ID' => $user->ID, );
|
381 |
+
$wpdb->update( $wpdb->users, $data, $where, array( '%s', '%s' ), array( '%d' ) );
|
382 |
+
|
383 |
+
// Set up the Password change nag.
|
384 |
+
update_user_option( $user->ID, 'default_password_nag', true, true );
|
385 |
+
|
386 |
+
// Set this meta field to track that the password has been reset by
|
387 |
+
// the plugin. Don't reset it again unless doing a password reset.
|
388 |
+
update_user_meta( $user->ID, 'pw_user_approve_password_reset', time() );
|
389 |
+
|
390 |
+
return sprintf( __( 'Password: %s', 'new-user-approve' ), $new_pass );
|
391 |
+
} else {
|
392 |
+
return '';
|
393 |
+
}
|
394 |
+
}
|
includes/messages.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* The default email message that will be sent to users as they are approved.
|
5 |
+
*
|
6 |
+
* @return string
|
7 |
+
*/
|
8 |
+
function nua_default_approve_user_message() {
|
9 |
+
$message = __( 'You have been approved to access {sitename}', 'new-user-approve' ) . "\r\n\r\n";
|
10 |
+
$message .= "{username}\r\n";
|
11 |
+
$message .= "{password}\r\n\r\n";
|
12 |
+
$message .= "{login_url}";
|
13 |
+
|
14 |
+
$message = apply_filters( 'new_user_approve_approve_user_message_default', $message );
|
15 |
+
|
16 |
+
return $message;
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* The default email message that will be sent to users as they are denied.
|
21 |
+
*
|
22 |
+
* @return string
|
23 |
+
*/
|
24 |
+
function nua_default_deny_user_message() {
|
25 |
+
$message = __( 'You have been denied access to {sitename}.', 'new-user-approve' );
|
26 |
+
|
27 |
+
$message = apply_filters( 'new_user_approve_deny_user_message_default', $message );
|
28 |
+
|
29 |
+
return $message;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* The default message that will be shown to the user after registration has completed.
|
34 |
+
*
|
35 |
+
* @return string
|
36 |
+
*/
|
37 |
+
function nua_default_registration_complete_message() {
|
38 |
+
$message = sprintf( __( 'An email has been sent to the site administrator. The administrator will review the information that has been submitted and either approve or deny your request.', 'new-user-approve' ) );
|
39 |
+
$message .= ' ';
|
40 |
+
$message .= sprintf( __( 'You will receive an email with instructions on what you will need to do next. Thanks for your patience.', 'new-user-approve' ) );
|
41 |
+
|
42 |
+
$message = apply_filters( 'new_user_approve_pending_message_default', $message );
|
43 |
+
|
44 |
+
return $message;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* The default welcome message that is shown to all users on the login page.
|
49 |
+
*
|
50 |
+
* @return string
|
51 |
+
*/
|
52 |
+
function nua_default_welcome_message() {
|
53 |
+
$welcome = sprintf( __( 'Welcome to {sitename}. This site is accessible to approved users only. To be approved, you must first register.', 'new-user-approve' ), get_option( 'blogname' ) );
|
54 |
+
|
55 |
+
$welcome = apply_filters( 'new_user_approve_welcome_message_default', $welcome );
|
56 |
+
|
57 |
+
return $welcome;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* The default notification message that is sent to site admin when requesting approval.
|
62 |
+
*
|
63 |
+
* @return string
|
64 |
+
*/
|
65 |
+
function nua_default_notification_message() {
|
66 |
+
$message = __( '{username} ({user_email}) has requested a username at {sitename}', 'new-user-approve' ) . "\n\n";
|
67 |
+
$message .= "{site_url}\n\n";
|
68 |
+
$message .= __( 'To approve or deny this user access to {sitename} go to', 'new-user-approve' ) . "\n\n";
|
69 |
+
$message .= "{admin_approve_url}\n\n";
|
70 |
+
|
71 |
+
$message = apply_filters( 'new_user_approve_notification_message_default', $message );
|
72 |
+
|
73 |
+
return $message;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* The default message that is shown to the user on the registration page before any action
|
78 |
+
* has been taken.
|
79 |
+
*
|
80 |
+
* @return string
|
81 |
+
*/
|
82 |
+
function nua_default_registration_message() {
|
83 |
+
$message = __( 'After you register, your request will be sent to the site administrator for approval. You will then receive an email with further instructions.', 'new-user-approve' );
|
84 |
+
|
85 |
+
$message = apply_filters( 'new_user_approve_registration_message_default', $message );
|
86 |
+
|
87 |
+
return $message;
|
88 |
+
}
|
localization/new-user-approve-fr_FR.mo
ADDED
Binary file
|
localization/new-user-approve-fr_FR.po
ADDED
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: New User Approve 1.0\n"
|
4 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
|
5 |
+
"POT-Creation-Date: 2013-08-20 21:48-0700\n"
|
6 |
+
"PO-Revision-Date: 2014-03-02 21:08+0100\n"
|
7 |
+
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
|
8 |
+
"Language-Team: Philippe Scoffoni <philippe@scoffoni.net>\n"
|
9 |
+
"Language: fr\n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
+
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Generator: Poedit 1.6.4\n"
|
14 |
+
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
15 |
+
|
16 |
+
#: ../new-user-approve.php:79
|
17 |
+
#, php-format
|
18 |
+
msgid "New User Approve requires WordPress %s or newer."
|
19 |
+
msgstr "New User Approve nécessite WordPress en version %s ou supérieure."
|
20 |
+
|
21 |
+
#: ../new-user-approve.php:204
|
22 |
+
msgid "<strong>ERROR</strong>: Your account is still pending approval."
|
23 |
+
msgstr ""
|
24 |
+
"<strong>ERREUR</strong> : Votre compte est toujours en attente "
|
25 |
+
"d'approbation."
|
26 |
+
|
27 |
+
#: ../new-user-approve.php:210
|
28 |
+
msgid ""
|
29 |
+
"<strong>ERROR</strong>: Your account has been denied access to this site."
|
30 |
+
msgstr ""
|
31 |
+
"<strong>ERREUR</strong> : Votre compte n'a pas été autorisé à accéder à "
|
32 |
+
"ce site."
|
33 |
+
|
34 |
+
#: ../new-user-approve.php:297
|
35 |
+
msgid "Users"
|
36 |
+
msgstr "Utilisateurs"
|
37 |
+
|
38 |
+
#: ../new-user-approve.php:325
|
39 |
+
#, php-format
|
40 |
+
msgid "%1$s (%2$s) has requested a username at %3$s"
|
41 |
+
msgstr "%1$s (%2$s) a demandé l'approbation d'un compte sur %3$s"
|
42 |
+
|
43 |
+
#: ../new-user-approve.php:327
|
44 |
+
#, php-format
|
45 |
+
msgid "To approve or deny this user access to %s go to"
|
46 |
+
msgstr "Pour approuver ou refuser cet utilisateur, aller sur le site %s"
|
47 |
+
|
48 |
+
#: ../new-user-approve.php:332
|
49 |
+
#, php-format
|
50 |
+
msgid "[%s] User Approval"
|
51 |
+
msgstr "[%s] Demande d'approbation pour un utilisateur"
|
52 |
+
|
53 |
+
#: ../new-user-approve.php:359
|
54 |
+
#, php-format
|
55 |
+
msgid ""
|
56 |
+
"<strong>ERROR</strong>: Couldn’t register you... please contact the <a "
|
57 |
+
"href=\"mailto:%s\">webmaster</a> !"
|
58 |
+
msgstr ""
|
59 |
+
"<strong>ERREUR</strong> : Il n'a pas été possible de vous enregistrer. "
|
60 |
+
"Veuillez contacter le <a href=\"mailto:%s\">webmestre</a>du site !"
|
61 |
+
|
62 |
+
#: ../new-user-approve.php:429
|
63 |
+
#, php-format
|
64 |
+
msgid "You have been approved to access %s"
|
65 |
+
msgstr "Votre inscription a été acceptée pour accéder au site %s"
|
66 |
+
|
67 |
+
#: ../new-user-approve.php:430
|
68 |
+
#, php-format
|
69 |
+
msgid "Username: %s"
|
70 |
+
msgstr "Nom de compte : %s"
|
71 |
+
|
72 |
+
#: ../new-user-approve.php:432
|
73 |
+
#, php-format
|
74 |
+
msgid "Password: %s"
|
75 |
+
msgstr "Mot de passe : %s"
|
76 |
+
|
77 |
+
#: ../new-user-approve.php:438
|
78 |
+
#, php-format
|
79 |
+
msgid "[%s] Registration Approved"
|
80 |
+
msgstr "[%s] Inscription approuvée"
|
81 |
+
|
82 |
+
#: ../new-user-approve.php:462
|
83 |
+
#, php-format
|
84 |
+
msgid "You have been denied access to %s"
|
85 |
+
msgstr "Désolé, votre inscription pour accéder au site « %s » a été refusée."
|
86 |
+
|
87 |
+
#: ../new-user-approve.php:465
|
88 |
+
#, php-format
|
89 |
+
msgid "[%s] Registration Denied"
|
90 |
+
msgstr "[%s] Inscription refusée"
|
91 |
+
|
92 |
+
#: ../new-user-approve.php:511
|
93 |
+
msgid ""
|
94 |
+
"An email has been sent to the site administrator. The administrator will "
|
95 |
+
"review the information that has been submitted and either approve or deny "
|
96 |
+
"your request."
|
97 |
+
msgstr ""
|
98 |
+
"Un courriel a été envoyé à l'administrateur du site. Il va vérifier les "
|
99 |
+
"informations que vous avez transmises et approuver ou refuser votre demande "
|
100 |
+
"d'inscription. "
|
101 |
+
|
102 |
+
#: ../new-user-approve.php:513
|
103 |
+
msgid ""
|
104 |
+
"You will receive an email with instructions on what you will need to do "
|
105 |
+
"next. Thanks for your patience."
|
106 |
+
msgstr ""
|
107 |
+
"Vous allez recevoir un courriel avec les instructions sur ce que vous devrez "
|
108 |
+
"faire ensuite. Merci de votre patience."
|
109 |
+
|
110 |
+
#: ../new-user-approve.php:518
|
111 |
+
msgid "Registration successful."
|
112 |
+
msgstr "Inscription réussie."
|
113 |
+
|
114 |
+
#: ../new-user-approve.php:521
|
115 |
+
msgid "Pending Approval"
|
116 |
+
msgstr "Approbation en attente"
|
117 |
+
|
118 |
+
#: ../new-user-approve.php:558
|
119 |
+
#, php-format
|
120 |
+
msgid ""
|
121 |
+
"Welcome to %s. This site is accessible to approved users only. To be "
|
122 |
+
"approved, you must first register."
|
123 |
+
msgstr ""
|
124 |
+
"Bienvenue sur le site %s. Ce site est accessible aux utilisateurs approuvés. "
|
125 |
+
"Pour être approuvé, vous devez d'abord vous inscrire."
|
126 |
+
|
127 |
+
#: ../new-user-approve.php:567
|
128 |
+
msgid ""
|
129 |
+
"After you register, your request will be sent to the site administrator for "
|
130 |
+
"approval. You will then receive an email with further instructions."
|
131 |
+
msgstr ""
|
132 |
+
"Après l'inscription, votre demande sera envoyée à l'administrateur pour "
|
133 |
+
"approbation. Vous recevrez alors un courriel avec les informations "
|
134 |
+
"supplémentaires."
|
135 |
+
|
136 |
+
#: ../includes/admin-approve.php:49
|
137 |
+
msgid "Approve New Users"
|
138 |
+
msgstr "Approuver les nouveaux utilisateurs"
|
139 |
+
|
140 |
+
#: ../includes/admin-approve.php:58
|
141 |
+
msgid "User successfully updated."
|
142 |
+
msgstr "Utilisateur correctement mis à jour."
|
143 |
+
|
144 |
+
#: ../includes/admin-approve.php:64
|
145 |
+
msgid "User Registration Approval"
|
146 |
+
msgstr "Validation des utilisateurs enregistrés"
|
147 |
+
|
148 |
+
#: ../includes/admin-approve.php:67
|
149 |
+
msgid "Users Pending Approval"
|
150 |
+
msgstr "Utilisateurs en attente d'approbation"
|
151 |
+
|
152 |
+
#: ../includes/admin-approve.php:68
|
153 |
+
msgid "Approved Users"
|
154 |
+
msgstr "Utilisateurs approuvés"
|
155 |
+
|
156 |
+
#: ../includes/admin-approve.php:69
|
157 |
+
msgid "Denied Users"
|
158 |
+
msgstr "Utilisateurs refusés"
|
159 |
+
|
160 |
+
#: ../includes/admin-approve.php:108
|
161 |
+
msgid "Username"
|
162 |
+
msgstr "Nom de compte"
|
163 |
+
|
164 |
+
#: ../includes/admin-approve.php:109
|
165 |
+
msgid "Name"
|
166 |
+
msgstr "Nom"
|
167 |
+
|
168 |
+
#: ../includes/admin-approve.php:110
|
169 |
+
msgid "E-mail"
|
170 |
+
msgstr "Courriel"
|
171 |
+
|
172 |
+
#: ../includes/admin-approve.php:112 ../includes/admin-approve.php:114
|
173 |
+
msgid "Actions"
|
174 |
+
msgstr "Actions"
|
175 |
+
|
176 |
+
#: ../includes/admin-approve.php:149
|
177 |
+
msgid "email:"
|
178 |
+
msgstr "courriel :"
|
179 |
+
|
180 |
+
#: ../includes/admin-approve.php:151 ../includes/user-list.php:95
|
181 |
+
#: ../includes/user-list.php:217 ../includes/user-list.php:218
|
182 |
+
msgid "Approve"
|
183 |
+
msgstr "Approuver"
|
184 |
+
|
185 |
+
#: ../includes/admin-approve.php:154 ../includes/user-list.php:96
|
186 |
+
#: ../includes/user-list.php:220 ../includes/user-list.php:221
|
187 |
+
msgid "Deny"
|
188 |
+
msgstr "Refuser"
|
189 |
+
|
190 |
+
#: ../includes/admin-approve.php:169
|
191 |
+
msgid "approved"
|
192 |
+
msgstr "approuvé"
|
193 |
+
|
194 |
+
#: ../includes/admin-approve.php:171
|
195 |
+
msgid "denied"
|
196 |
+
msgstr "refusé"
|
197 |
+
|
198 |
+
#: ../includes/admin-approve.php:173
|
199 |
+
msgid "pending"
|
200 |
+
msgstr "en attente"
|
201 |
+
|
202 |
+
#: ../includes/admin-approve.php:176
|
203 |
+
#, php-format
|
204 |
+
msgid "There are no users with a status of %s"
|
205 |
+
msgstr "Il n'y a aucun utilisateur avec le status %s"
|
206 |
+
|
207 |
+
#: ../includes/admin-approve.php:212
|
208 |
+
#, php-format
|
209 |
+
msgid ""
|
210 |
+
"You can now update user status on the <a href=\"%1$s\">users admin page</a>. "
|
211 |
+
"| <a href=\"%2$s\">Hide Notice</a>"
|
212 |
+
msgstr ""
|
213 |
+
"Vous pouvez désormais mettre à jour le statut des utilisateurs depuis la <a "
|
214 |
+
"href=\"%1$s\">page de gestion des utilisateurs</a>. | <a href=\"%2$s"
|
215 |
+
"\">Masquer cette note</a>"
|
216 |
+
|
217 |
+
#: ../includes/user-list.php:118
|
218 |
+
msgid "Status"
|
219 |
+
msgstr "Statut"
|
220 |
+
|
221 |
+
#: ../includes/user-list.php:154
|
222 |
+
msgid "Filter"
|
223 |
+
msgstr "Filtrer"
|
224 |
+
|
225 |
+
#: ../includes/user-list.php:158 ../includes/user-list.php:160
|
226 |
+
msgid "View all users"
|
227 |
+
msgstr "Voir tous les utilisateurs"
|
228 |
+
|
229 |
+
#: ../includes/user-list.php:308
|
230 |
+
#, php-format
|
231 |
+
msgid "User denied."
|
232 |
+
msgid_plural "%s users denied."
|
233 |
+
msgstr[0] "Utilisateur refusé."
|
234 |
+
msgstr[1] "%s utilisateurs refusés."
|
235 |
+
|
236 |
+
#: ../includes/user-list.php:312
|
237 |
+
#, php-format
|
238 |
+
msgid "User approved."
|
239 |
+
msgid_plural "%s users approved."
|
240 |
+
msgstr[0] "Utilisateur approuvé."
|
241 |
+
msgstr[1] "%s utilisateurs approuvés."
|
242 |
+
|
243 |
+
#: ../includes/user-list.php:335
|
244 |
+
msgid "Access Status"
|
245 |
+
msgstr "Statut d'accès"
|
246 |
+
|
247 |
+
#: ../includes/user-list.php:339
|
248 |
+
msgid "-- Status --"
|
249 |
+
msgstr "-- Statut --"
|
250 |
+
|
251 |
+
#: ../includes/user-list.php:345
|
252 |
+
msgid "If user has access to sign in or not."
|
253 |
+
msgstr "Indique si l'utilisateur est autorisé à se connecter ou non."
|
254 |
+
|
255 |
+
#: ../includes/user-list.php:347
|
256 |
+
msgid "Current user status is <strong>pending</strong>."
|
257 |
+
msgstr "Le statut de l'utilisateur actuel est <strong>en attente</strong>."
|
258 |
+
|
259 |
+
#~ msgid "Settings"
|
260 |
+
#~ msgstr "Paramètres"
|
261 |
+
|
262 |
+
#~ msgid "User Management"
|
263 |
+
#~ msgstr "Gestion des utilisateurs"
|
264 |
+
|
265 |
+
#~ msgid "ID"
|
266 |
+
#~ msgstr "ID"
|
267 |
+
|
268 |
+
#~ msgid "User name already exists"
|
269 |
+
#~ msgstr "Nom d'utilisateur déjà existant"
|
270 |
+
|
271 |
+
#~ msgid "http://www.picklewagon.com/wordpress/new-user-approve"
|
272 |
+
#~ msgstr "http://www.picklewagon.com/wordpress/new-user-approve"
|
273 |
+
|
274 |
+
#~ msgid ""
|
275 |
+
#~ "This plugin allows administrators to approve users once they register. "
|
276 |
+
#~ "Only approved users will be allowed to access the blog."
|
277 |
+
#~ msgstr ""
|
278 |
+
#~ "Cette extension permet aux administrateurs d'approuver les utilisateurs "
|
279 |
+
#~ "après leur inscription. Seuls les utilisateurs approuvés seront autorisés "
|
280 |
+
#~ "à accéder au blog."
|
281 |
+
|
282 |
+
#~ msgid "Josh Harrison"
|
283 |
+
#~ msgstr "Josh Harrison"
|
284 |
+
|
285 |
+
#~ msgid "http://www.picklewagon.com/"
|
286 |
+
#~ msgstr "http://www.picklewagon.com/"
|
localization/new-user-approve.pot
CHANGED
@@ -7,9 +7,9 @@ msgid ""
|
|
7 |
msgstr ""
|
8 |
"Project-Id-Version: New User Approve\n"
|
9 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
|
10 |
-
"POT-Creation-Date:
|
11 |
-
"PO-Revision-Date:
|
12 |
-
"Last-Translator:
|
13 |
"Language-Team: Picklewagon <josh@picklewagon.com>\n"
|
14 |
"Language: English\n"
|
15 |
"MIME-Version: 1.0\n"
|
@@ -23,226 +23,273 @@ msgstr ""
|
|
23 |
"X-Poedit-SearchPath-0: ..\n"
|
24 |
"X-Poedit-SearchPath-1: ../includes\n"
|
25 |
|
26 |
-
#: ../new-user-approve.php:
|
27 |
#, php-format
|
28 |
msgid "New User Approve requires WordPress %s or newer."
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: ../new-user-approve.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
msgid "<strong>ERROR</strong>: Your account is still pending approval."
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: ../new-user-approve.php:
|
36 |
msgid ""
|
37 |
"<strong>ERROR</strong>: Your account has been denied access to this site."
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: ../new-user-approve.php:
|
41 |
msgid "Users"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: ../new-user-approve.php:
|
45 |
-
#, php-format
|
46 |
-
msgid "%1$s (%2$s) has requested a username at %3$s"
|
47 |
-
msgstr ""
|
48 |
-
|
49 |
-
#: ../new-user-approve.php:327
|
50 |
-
#, php-format
|
51 |
-
msgid "To approve or deny this user access to %s go to"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: ../new-user-approve.php:332
|
55 |
#, php-format
|
56 |
msgid "[%s] User Approval"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: ../new-user-approve.php:
|
60 |
#, php-format
|
61 |
msgid ""
|
62 |
"<strong>ERROR</strong>: Couldn’t register you... please contact the <a "
|
63 |
"href=\"mailto:%s\">webmaster</a> !"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: ../new-user-approve.php:
|
67 |
#, php-format
|
68 |
-
msgid "
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: ../new-user-approve.php:
|
72 |
#, php-format
|
73 |
-
msgid "
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: ../new-user-approve.php:
|
77 |
-
|
78 |
-
msgid "Password: %s"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: ../new-user-approve.php:
|
82 |
-
|
83 |
-
msgid "[%s] Registration Approved"
|
84 |
msgstr ""
|
85 |
|
86 |
-
#: ../
|
87 |
-
|
88 |
-
msgid "You have been denied access to %s"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: ../
|
92 |
-
|
93 |
-
msgid "[%s] Registration Denied"
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: ../
|
97 |
-
msgid ""
|
98 |
-
"An email has been sent to the site administrator. The administrator will "
|
99 |
-
"review the information that has been submitted and either approve or deny "
|
100 |
-
"your request."
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: ../
|
104 |
-
msgid ""
|
105 |
-
"You will receive an email with instructions on what you will need to do "
|
106 |
-
"next. Thanks for your patience."
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: ../
|
110 |
-
msgid "
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: ../
|
114 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: ../
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
#, php-format
|
119 |
-
msgid ""
|
120 |
-
"Welcome to %s. This site is accessible to approved users only. To be "
|
121 |
-
"approved, you must first register."
|
122 |
msgstr ""
|
123 |
|
124 |
-
#: ../
|
|
|
125 |
msgid ""
|
126 |
-
"
|
127 |
-
"
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: ../includes/admin-approve.php:
|
131 |
-
msgid "Approve
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: ../includes/admin-approve.php:
|
135 |
-
msgid "
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: ../includes/admin-approve.php:
|
139 |
-
msgid "
|
|
|
|
|
|
|
|
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: ../includes/admin-approve.php:
|
143 |
msgid "Users Pending Approval"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: ../includes/admin-approve.php:
|
147 |
msgid "Approved Users"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: ../includes/admin-approve.php:
|
151 |
msgid "Denied Users"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: ../includes/
|
155 |
-
msgid "Username"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: ../includes/
|
159 |
-
msgid "
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: ../includes/
|
163 |
-
msgid "
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: ../includes/
|
167 |
-
msgid "
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: ../includes/
|
171 |
-
msgid "
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: ../includes/
|
175 |
-
|
176 |
-
msgid "Approve"
|
177 |
msgstr ""
|
178 |
|
179 |
-
#: ../includes/
|
180 |
-
|
181 |
-
msgid "Deny"
|
182 |
msgstr ""
|
183 |
|
184 |
-
#: ../includes/
|
185 |
-
|
|
|
186 |
msgstr ""
|
187 |
|
188 |
-
#: ../includes/
|
189 |
-
|
|
|
190 |
msgstr ""
|
191 |
|
192 |
-
#: ../includes/
|
193 |
-
msgid "
|
194 |
msgstr ""
|
195 |
|
196 |
-
#: ../includes/
|
197 |
-
|
198 |
-
msgid "There are no users with a status of %s"
|
199 |
msgstr ""
|
200 |
|
201 |
-
#: ../includes/
|
202 |
-
#, php-format
|
203 |
msgid ""
|
204 |
-
"
|
205 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: ../includes/user-list.php:
|
209 |
msgid "Status"
|
210 |
msgstr ""
|
211 |
|
212 |
-
#: ../includes/user-list.php:
|
213 |
msgid "Filter"
|
214 |
msgstr ""
|
215 |
|
216 |
-
#: ../includes/user-list.php:
|
217 |
msgid "View all users"
|
218 |
msgstr ""
|
219 |
|
220 |
-
#: ../includes/user-list.php:
|
221 |
#, php-format
|
222 |
msgid "User denied."
|
223 |
msgid_plural "%s users denied."
|
224 |
msgstr[0] ""
|
225 |
msgstr[1] ""
|
226 |
|
227 |
-
#: ../includes/user-list.php:
|
228 |
#, php-format
|
229 |
msgid "User approved."
|
230 |
msgid_plural "%s users approved."
|
231 |
msgstr[0] ""
|
232 |
msgstr[1] ""
|
233 |
|
234 |
-
#: ../includes/user-list.php:
|
235 |
msgid "Access Status"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: ../includes/user-list.php:
|
239 |
msgid "-- Status --"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: ../includes/user-list.php:
|
243 |
msgid "If user has access to sign in or not."
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: ../includes/user-list.php:
|
247 |
msgid "Current user status is <strong>pending</strong>."
|
248 |
msgstr ""
|
7 |
msgstr ""
|
8 |
"Project-Id-Version: New User Approve\n"
|
9 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
|
10 |
+
"POT-Creation-Date: 2014-09-26 02:55-0700\n"
|
11 |
+
"PO-Revision-Date: 2014-09-26 02:56-0700\n"
|
12 |
+
"Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
|
13 |
"Language-Team: Picklewagon <josh@picklewagon.com>\n"
|
14 |
"Language: English\n"
|
15 |
"MIME-Version: 1.0\n"
|
23 |
"X-Poedit-SearchPath-0: ..\n"
|
24 |
"X-Poedit-SearchPath-1: ../includes\n"
|
25 |
|
26 |
+
#: ../new-user-approve.php:97
|
27 |
#, php-format
|
28 |
msgid "New User Approve requires WordPress %s or newer."
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: ../new-user-approve.php:139
|
32 |
+
#, php-format
|
33 |
+
msgid ""
|
34 |
+
"The Membership setting must be turned on in order for the New User Approve "
|
35 |
+
"to work correctly. <a href=\"%1$s\">Update in settings</a>. | <a href=\"%2$s"
|
36 |
+
"\">Hide Notice</a>"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: ../new-user-approve.php:251
|
40 |
msgid "<strong>ERROR</strong>: Your account is still pending approval."
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: ../new-user-approve.php:254
|
44 |
msgid ""
|
45 |
"<strong>ERROR</strong>: Your account has been denied access to this site."
|
46 |
msgstr ""
|
47 |
|
48 |
+
#: ../new-user-approve.php:356
|
49 |
msgid "Users"
|
50 |
msgstr ""
|
51 |
|
52 |
+
#: ../new-user-approve.php:386
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
#, php-format
|
54 |
msgid "[%s] User Approval"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: ../new-user-approve.php:441
|
58 |
#, php-format
|
59 |
msgid ""
|
60 |
"<strong>ERROR</strong>: Couldn’t register you... please contact the <a "
|
61 |
"href=\"mailto:%s\">webmaster</a> !"
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: ../new-user-approve.php:510
|
65 |
#, php-format
|
66 |
+
msgid "[%s] Registration Approved"
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: ../new-user-approve.php:540
|
70 |
#, php-format
|
71 |
+
msgid "[%s] Registration Denied"
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: ../new-user-approve.php:604
|
75 |
+
msgid "Registration successful."
|
|
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: ../new-user-approve.php:607
|
79 |
+
msgid "Pending Approval"
|
|
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: ../admin/templates/approve.php:6
|
83 |
+
msgid "User successfully updated."
|
|
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: ../admin/templates/approve.php:11
|
87 |
+
msgid "User Registration Approval"
|
|
|
88 |
msgstr ""
|
89 |
|
90 |
+
#: ../includes/admin-approve.php:50
|
91 |
+
msgid "Approve New Users"
|
|
|
|
|
|
|
92 |
msgstr ""
|
93 |
|
94 |
+
#: ../includes/admin-approve.php:82
|
95 |
+
msgid "Username"
|
|
|
|
|
96 |
msgstr ""
|
97 |
|
98 |
+
#: ../includes/admin-approve.php:83
|
99 |
+
msgid "Name"
|
100 |
msgstr ""
|
101 |
|
102 |
+
#: ../includes/admin-approve.php:84
|
103 |
+
msgid "E-mail"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: ../includes/admin-approve.php:86 ../includes/admin-approve.php:88
|
107 |
+
msgid "Actions"
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: ../includes/admin-approve.php:129
|
111 |
+
msgid "email:"
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: ../includes/admin-approve.php:133 ../includes/user-list.php:97
|
115 |
+
#: ../includes/user-list.php:223 ../includes/user-list.php:224
|
116 |
+
msgid "Approve"
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: ../includes/admin-approve.php:138 ../includes/user-list.php:98
|
120 |
+
#: ../includes/user-list.php:226 ../includes/user-list.php:227
|
121 |
+
msgid "Deny"
|
122 |
msgstr ""
|
123 |
|
124 |
+
#: ../includes/admin-approve.php:154
|
125 |
+
msgid "approved"
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: ../includes/admin-approve.php:156
|
129 |
+
msgid "denied"
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
+
#: ../includes/admin-approve.php:158
|
133 |
+
msgid "pending"
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
#: ../includes/admin-approve.php:161
|
137 |
#, php-format
|
138 |
+
msgid "There are no users with a status of %s"
|
|
|
|
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: ../includes/admin-approve.php:197
|
142 |
+
#, php-format
|
143 |
msgid ""
|
144 |
+
"You can now update user status on the <a href=\"%1$s\">users admin page</a>. "
|
145 |
+
"| <a href=\"%2$s\">Hide Notice</a>"
|
146 |
msgstr ""
|
147 |
|
148 |
+
#: ../includes/admin-approve.php:220
|
149 |
+
msgid "Approve Users"
|
150 |
msgstr ""
|
151 |
|
152 |
+
#: ../includes/admin-approve.php:221
|
153 |
+
msgid "Updates"
|
154 |
msgstr ""
|
155 |
|
156 |
+
#: ../includes/admin-approve.php:222
|
157 |
+
msgid "Support"
|
158 |
+
msgstr ""
|
159 |
+
|
160 |
+
#: ../includes/admin-approve.php:223
|
161 |
+
msgid "Feedback"
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: ../includes/admin-approve.php:231
|
165 |
msgid "Users Pending Approval"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: ../includes/admin-approve.php:233
|
169 |
msgid "Approved Users"
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: ../includes/admin-approve.php:235
|
173 |
msgid "Denied Users"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: ../includes/email-tags.php:235
|
177 |
+
msgid "The user's username on the site as well as the Username label"
|
178 |
msgstr ""
|
179 |
|
180 |
+
#: ../includes/email-tags.php:241
|
181 |
+
msgid "The user's email address"
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: ../includes/email-tags.php:247
|
185 |
+
msgid "Your site name"
|
186 |
msgstr ""
|
187 |
|
188 |
+
#: ../includes/email-tags.php:253
|
189 |
+
msgid "Your site URL"
|
190 |
msgstr ""
|
191 |
|
192 |
+
#: ../includes/email-tags.php:259
|
193 |
+
msgid "The URL to approve/deny users"
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: ../includes/email-tags.php:265
|
197 |
+
msgid "The URL to login to the site"
|
|
|
198 |
msgstr ""
|
199 |
|
200 |
+
#: ../includes/email-tags.php:271
|
201 |
+
msgid "Generates the password for the user to add to the email"
|
|
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: ../includes/email-tags.php:299
|
205 |
+
#, php-format
|
206 |
+
msgid "Username: %s"
|
207 |
msgstr ""
|
208 |
|
209 |
+
#: ../includes/email-tags.php:390
|
210 |
+
#, php-format
|
211 |
+
msgid "Password: %s"
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: ../includes/messages.php:9
|
215 |
+
msgid "You have been approved to access {sitename}"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: ../includes/messages.php:25
|
219 |
+
msgid "You have been denied access to {sitename}."
|
|
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: ../includes/messages.php:38
|
|
|
223 |
msgid ""
|
224 |
+
"An email has been sent to the site administrator. The administrator will "
|
225 |
+
"review the information that has been submitted and either approve or deny "
|
226 |
+
"your request."
|
227 |
+
msgstr ""
|
228 |
+
|
229 |
+
#: ../includes/messages.php:40
|
230 |
+
msgid ""
|
231 |
+
"You will receive an email with instructions on what you will need to do "
|
232 |
+
"next. Thanks for your patience."
|
233 |
+
msgstr ""
|
234 |
+
|
235 |
+
#: ../includes/messages.php:53
|
236 |
+
msgid ""
|
237 |
+
"Welcome to {sitename}. This site is accessible to approved users only. To be "
|
238 |
+
"approved, you must first register."
|
239 |
+
msgstr ""
|
240 |
+
|
241 |
+
#: ../includes/messages.php:66
|
242 |
+
msgid "{username} ({user_email}) has requested a username at {sitename}"
|
243 |
+
msgstr ""
|
244 |
+
|
245 |
+
#: ../includes/messages.php:68
|
246 |
+
msgid "To approve or deny this user access to {sitename} go to"
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
#: ../includes/messages.php:83
|
250 |
+
msgid ""
|
251 |
+
"After you register, your request will be sent to the site administrator for "
|
252 |
+
"approval. You will then receive an email with further instructions."
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: ../includes/user-list.php:120
|
256 |
msgid "Status"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: ../includes/user-list.php:156
|
260 |
msgid "Filter"
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: ../includes/user-list.php:161 ../includes/user-list.php:163
|
264 |
msgid "View all users"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: ../includes/user-list.php:320
|
268 |
#, php-format
|
269 |
msgid "User denied."
|
270 |
msgid_plural "%s users denied."
|
271 |
msgstr[0] ""
|
272 |
msgstr[1] ""
|
273 |
|
274 |
+
#: ../includes/user-list.php:325
|
275 |
#, php-format
|
276 |
msgid "User approved."
|
277 |
msgid_plural "%s users approved."
|
278 |
msgstr[0] ""
|
279 |
msgstr[1] ""
|
280 |
|
281 |
+
#: ../includes/user-list.php:349
|
282 |
msgid "Access Status"
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: ../includes/user-list.php:354
|
286 |
msgid "-- Status --"
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: ../includes/user-list.php:362
|
290 |
msgid "If user has access to sign in or not."
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: ../includes/user-list.php:365
|
294 |
msgid "Current user status is <strong>pending</strong>."
|
295 |
msgstr ""
|
new-user-approve.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin URI: http://www.picklewagon.com/wordpress/new-user-approve/
|
5 |
Description: Allow administrators to approve users once they register. Only approved users will be allowed to access the blog. For support, please go to the <a href="http://wordpress.org/support/plugin/new-user-approve">support forums</a> on wordpress.org.
|
6 |
Author: Josh Harrison
|
7 |
-
Version: 1.
|
8 |
Author URI: http://picklewagon.com/
|
9 |
*/
|
10 |
|
@@ -25,6 +25,9 @@ class pw_new_user_approve {
|
|
25 |
public static function instance() {
|
26 |
if ( !isset( self::$instance ) ) {
|
27 |
self::$instance = new pw_new_user_approve();
|
|
|
|
|
|
|
28 |
}
|
29 |
return self::$instance;
|
30 |
}
|
@@ -44,10 +47,11 @@ class pw_new_user_approve {
|
|
44 |
add_action( 'new_user_approve_approve_user', array( $this, 'delete_new_user_approve_transient' ), 11 );
|
45 |
add_action( 'new_user_approve_deny_user', array( $this, 'delete_new_user_approve_transient' ), 11 );
|
46 |
add_action( 'deleted_user', array( $this, 'delete_new_user_approve_transient' ) );
|
47 |
-
add_action( 'register_post', array( $this, 'request_admin_approval_email' ), 10, 3 );
|
48 |
add_action( 'register_post', array( $this, 'create_new_user' ), 10, 3 );
|
49 |
add_action( 'lostpassword_post', array( $this, 'lost_password' ) );
|
50 |
add_action( 'user_register', array( $this, 'add_user_status' ) );
|
|
|
51 |
add_action( 'new_user_approve_approve_user', array( $this, 'approve_user' ) );
|
52 |
add_action( 'new_user_approve_deny_user', array( $this, 'deny_user' ) );
|
53 |
add_action( 'new_user_approve_deny_user', array( $this, 'update_deny_status' ) );
|
@@ -69,6 +73,18 @@ class pw_new_user_approve {
|
|
69 |
return plugin_dir_path( __FILE__ );
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
/**
|
73 |
* Require a minimum version of WordPress on activation
|
74 |
*
|
@@ -347,17 +363,34 @@ class pw_new_user_approve {
|
|
347 |
}
|
348 |
|
349 |
/**
|
350 |
-
*
|
351 |
*
|
352 |
-
* @
|
|
|
353 |
*/
|
354 |
-
public function
|
355 |
-
$
|
356 |
-
$
|
357 |
-
$message .= __( 'To approve or deny this user access to SITENAME go to', 'new-user-approve' ) . "\n\n";
|
358 |
-
$message .= "ADMINURL\n\n";
|
359 |
|
360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
}
|
362 |
|
363 |
/**
|
@@ -374,34 +407,17 @@ class pw_new_user_approve {
|
|
374 |
return;
|
375 |
}
|
376 |
|
377 |
-
|
378 |
-
|
379 |
-
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
380 |
-
|
381 |
-
$default_admin_url = admin_url( 'users.php?s&pw-status-query-submit=Filter&new_user_approve_filter=pending&paged=1' );
|
382 |
-
$admin_url = apply_filters( 'new_user_approve_admin_link', $default_admin_url );
|
383 |
-
|
384 |
-
/* send email to admin for approval */
|
385 |
-
$message = apply_filters( 'new_user_approve_request_approval_message_default', $this->default_notification_message() );
|
386 |
-
|
387 |
-
$message = str_replace( 'USERNAME', $user_login, $message );
|
388 |
-
$message = str_replace( 'USEREMAIL', $user_email, $message );
|
389 |
-
$message = str_replace( 'SITENAME', $blogname, $message );
|
390 |
-
$message = str_replace( 'SITEURL', home_url(), $message );
|
391 |
-
$message = str_replace( 'ADMINURL', $admin_url, $message );
|
392 |
-
|
393 |
-
$message = apply_filters( 'new_user_approve_request_approval_message', $message, $user_login, $user_email );
|
394 |
|
395 |
-
|
396 |
-
$
|
397 |
|
398 |
-
$
|
399 |
-
$
|
400 |
|
401 |
-
|
402 |
-
$send = wp_mail( $to, $subject, $message, $this->email_message_headers() );
|
403 |
}
|
404 |
-
|
405 |
/**
|
406 |
* Create a new user after the registration has been validated. Normally,
|
407 |
* when a user registers, an email is sent to the user containing their
|
@@ -427,20 +443,21 @@ class pw_new_user_approve {
|
|
427 |
}
|
428 |
|
429 |
/**
|
430 |
-
*
|
431 |
*
|
432 |
-
*
|
|
|
|
|
|
|
|
|
433 |
*/
|
434 |
-
public function
|
435 |
-
|
436 |
-
|
437 |
-
// password should only be reset for users that:
|
438 |
-
// * have never logged in
|
439 |
-
// * are just approved for the first time
|
440 |
|
441 |
// If the password has already been reset for this user,
|
442 |
// $password_reset will be a unix timestamp
|
443 |
-
$
|
444 |
|
445 |
// Get the current user status. By default each user is given a pending
|
446 |
// status when the user is created (with this plugin activated). If the
|
@@ -448,37 +465,29 @@ class pw_new_user_approve {
|
|
448 |
// have a status set.
|
449 |
$user_status = get_user_meta( $user_id, 'pw_user_status' );
|
450 |
|
451 |
-
// Default behavior is to reset password
|
452 |
-
$bypass_password_reset = false;
|
453 |
-
|
454 |
// if no status is set, don't reset password
|
455 |
if ( empty( $user_status ) ) {
|
456 |
-
$
|
457 |
}
|
458 |
|
459 |
// if the password has already been reset, absolutely bypass
|
460 |
-
if ( !empty( $
|
461 |
-
$
|
462 |
}
|
463 |
|
464 |
-
|
|
|
465 |
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
// reset password to know what to send the user
|
470 |
-
$new_pass = wp_generate_password( 12, false );
|
471 |
-
$data = array( 'user_pass' => md5( $new_pass ), 'user_activation_key' => '', );
|
472 |
-
$where = array( 'ID' => $user->ID, );
|
473 |
-
$wpdb->update( $wpdb->users, $data, $where, array( '%s', '%s' ), array( '%d' ) );
|
474 |
-
|
475 |
-
// Set up the Password change nag.
|
476 |
-
update_user_option( $user->ID, 'default_password_nag', true, true );
|
477 |
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
|
|
|
|
|
|
482 |
|
483 |
wp_cache_delete( $user->ID, 'users' );
|
484 |
wp_cache_delete( $user->data->user_login, 'userlogins' );
|
@@ -488,19 +497,14 @@ class pw_new_user_approve {
|
|
488 |
$user_email = stripslashes( $user->data->user_email );
|
489 |
|
490 |
// format the message
|
491 |
-
$message =
|
492 |
-
|
493 |
-
$message =
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
$message = str_replace( 'USEREMAIL', $user_email, $message );
|
500 |
-
$message = str_replace( 'SITENAME', get_option( 'blogname' ), $message );
|
501 |
-
$message = str_replace( 'SITEURL', home_url(), $message );
|
502 |
-
$message = str_replace( 'LOGINURL', wp_login_url(), $message );
|
503 |
-
|
504 |
$message = apply_filters( 'new_user_approve_approve_user_message', $message, $user );
|
505 |
|
506 |
$subject = sprintf( __( '[%s] Registration Approved', 'new-user-approve' ), get_option( 'blogname' ) );
|
@@ -515,21 +519,6 @@ class pw_new_user_approve {
|
|
515 |
do_action( 'new_user_approve_user_approved', $user );
|
516 |
}
|
517 |
|
518 |
-
public function default_approve_user_message() {
|
519 |
-
$message = __( 'You have been approved to access SITENAME', 'new-user-approve' ) . "\r\n\r\n";
|
520 |
-
$message .= "USERNAME\r\n";
|
521 |
-
$message .= "PASSWORD\r\n\r\n";
|
522 |
-
$message .= "LOGINURL";
|
523 |
-
|
524 |
-
return $message;
|
525 |
-
}
|
526 |
-
|
527 |
-
public function default_deny_user_message() {
|
528 |
-
$message = sprintf( __( 'You have been denied access to %s.', 'new-user-approve' ), get_option( 'blogname' ) );
|
529 |
-
|
530 |
-
return $message;
|
531 |
-
}
|
532 |
-
|
533 |
/**
|
534 |
* Send email to notify user of denial.
|
535 |
*
|
@@ -542,14 +531,17 @@ class pw_new_user_approve {
|
|
542 |
$user_email = stripslashes( $user->user_email );
|
543 |
|
544 |
// format the message
|
545 |
-
$message =
|
|
|
|
|
|
|
546 |
$message = apply_filters( 'new_user_approve_deny_user_message', $message, $user );
|
547 |
|
548 |
$subject = sprintf( __( '[%s] Registration Denied', 'new-user-approve' ), get_option( 'blogname' ) );
|
549 |
$subject = apply_filters( 'new_user_approve_deny_user_subject', $subject );
|
550 |
|
551 |
// send the mail
|
552 |
-
|
553 |
}
|
554 |
|
555 |
/**
|
@@ -584,14 +576,6 @@ class pw_new_user_approve {
|
|
584 |
return $headers;
|
585 |
}
|
586 |
|
587 |
-
public function default_registration_complete_message() {
|
588 |
-
$message = sprintf( __( 'An email has been sent to the site administrator. The administrator will review the information that has been submitted and either approve or deny your request.', 'new-user-approve' ) );
|
589 |
-
$message .= ' ';
|
590 |
-
$message .= sprintf( __( 'You will receive an email with instructions on what you will need to do next. Thanks for your patience.', 'new-user-approve' ) );
|
591 |
-
|
592 |
-
return $message;
|
593 |
-
}
|
594 |
-
|
595 |
/**
|
596 |
* Display a message to the user after they have registered
|
597 |
*
|
@@ -609,7 +593,10 @@ class pw_new_user_approve {
|
|
609 |
return $errors;
|
610 |
}
|
611 |
|
612 |
-
$message =
|
|
|
|
|
|
|
613 |
$message = apply_filters( 'new_user_approve_pending_message', $message );
|
614 |
|
615 |
$errors->add( 'registration_required', $message, 'message' );
|
@@ -645,18 +632,6 @@ class pw_new_user_approve {
|
|
645 |
}
|
646 |
}
|
647 |
|
648 |
-
public function default_welcome_message() {
|
649 |
-
$welcome = sprintf( __( 'Welcome to SITENAME. This site is accessible to approved users only. To be approved, you must first register.', 'new-user-approve' ), get_option( 'blogname' ) );
|
650 |
-
$welcome = apply_filters( 'new_user_approve_welcome_message_default', $welcome );
|
651 |
-
|
652 |
-
return $welcome;
|
653 |
-
}
|
654 |
-
|
655 |
-
public function default_registration_message() {
|
656 |
-
$message = __( 'After you register, your request will be sent to the site administrator for approval. You will then receive an email with further instructions.', 'new-user-approve' );
|
657 |
-
|
658 |
-
return $message;
|
659 |
-
}
|
660 |
/**
|
661 |
* Add message to login page saying registration is required.
|
662 |
*
|
@@ -666,18 +641,22 @@ class pw_new_user_approve {
|
|
666 |
*/
|
667 |
public function welcome_user( $message ) {
|
668 |
if ( !isset( $_GET['action'] ) ) {
|
669 |
-
$welcome =
|
|
|
|
|
|
|
670 |
$welcome = apply_filters( 'new_user_approve_welcome_message', $welcome );
|
671 |
|
672 |
-
$welcome = str_replace( 'SITENAME', get_option( 'blogname' ), $welcome );
|
673 |
-
|
674 |
if ( !empty( $welcome ) ) {
|
675 |
$message .= '<p class="message register">' . $welcome . '</p>';
|
676 |
}
|
677 |
}
|
678 |
|
679 |
if ( isset( $_GET['action'] ) && $_GET['action'] == 'register' && !$_POST ) {
|
680 |
-
$instructions =
|
|
|
|
|
|
|
681 |
$instructions = apply_filters( 'new_user_approve_register_instructions', $instructions );
|
682 |
|
683 |
if ( !empty( $instructions ) ) {
|
4 |
Plugin URI: http://www.picklewagon.com/wordpress/new-user-approve/
|
5 |
Description: Allow administrators to approve users once they register. Only approved users will be allowed to access the blog. For support, please go to the <a href="http://wordpress.org/support/plugin/new-user-approve">support forums</a> on wordpress.org.
|
6 |
Author: Josh Harrison
|
7 |
+
Version: 1.7
|
8 |
Author URI: http://picklewagon.com/
|
9 |
*/
|
10 |
|
25 |
public static function instance() {
|
26 |
if ( !isset( self::$instance ) ) {
|
27 |
self::$instance = new pw_new_user_approve();
|
28 |
+
|
29 |
+
self::$instance->includes();
|
30 |
+
self::$instance->email_tags = new NUA_Email_Template_Tags();
|
31 |
}
|
32 |
return self::$instance;
|
33 |
}
|
47 |
add_action( 'new_user_approve_approve_user', array( $this, 'delete_new_user_approve_transient' ), 11 );
|
48 |
add_action( 'new_user_approve_deny_user', array( $this, 'delete_new_user_approve_transient' ), 11 );
|
49 |
add_action( 'deleted_user', array( $this, 'delete_new_user_approve_transient' ) );
|
50 |
+
//add_action( 'register_post', array( $this, 'request_admin_approval_email' ), 10, 3 );
|
51 |
add_action( 'register_post', array( $this, 'create_new_user' ), 10, 3 );
|
52 |
add_action( 'lostpassword_post', array( $this, 'lost_password' ) );
|
53 |
add_action( 'user_register', array( $this, 'add_user_status' ) );
|
54 |
+
add_action( 'user_register', array( $this, 'request_admin_approval_email_2' ) );
|
55 |
add_action( 'new_user_approve_approve_user', array( $this, 'approve_user' ) );
|
56 |
add_action( 'new_user_approve_deny_user', array( $this, 'deny_user' ) );
|
57 |
add_action( 'new_user_approve_deny_user', array( $this, 'update_deny_status' ) );
|
73 |
return plugin_dir_path( __FILE__ );
|
74 |
}
|
75 |
|
76 |
+
/**
|
77 |
+
* Include required files
|
78 |
+
*
|
79 |
+
* @access private
|
80 |
+
* @since 1.4
|
81 |
+
* @return void
|
82 |
+
*/
|
83 |
+
private function includes() {
|
84 |
+
require_once( $this->get_plugin_dir() . 'includes/email-tags.php' );
|
85 |
+
require_once( $this->get_plugin_dir() . 'includes/messages.php' );
|
86 |
+
}
|
87 |
+
|
88 |
/**
|
89 |
* Require a minimum version of WordPress on activation
|
90 |
*
|
363 |
}
|
364 |
|
365 |
/**
|
366 |
+
* Send email to admin requesting approval.
|
367 |
*
|
368 |
+
* @param $user_login username
|
369 |
+
* @param $user_email email address of the user
|
370 |
*/
|
371 |
+
public function admin_approval_email( $user_login, $user_email ) {
|
372 |
+
$default_admin_url = admin_url( 'users.php?s&pw-status-query-submit=Filter&new_user_approve_filter=pending&paged=1' );
|
373 |
+
$admin_url = apply_filters( 'new_user_approve_admin_link', $default_admin_url );
|
|
|
|
|
374 |
|
375 |
+
/* send email to admin for approval */
|
376 |
+
$message = apply_filters( 'new_user_approve_request_approval_message_default', nua_default_notification_message() );
|
377 |
+
|
378 |
+
$message = nua_do_email_tags( $message, array(
|
379 |
+
'context' => 'request_admin_approval_email',
|
380 |
+
'user_login' => $user_login,
|
381 |
+
'user_email' => $user_email,
|
382 |
+
'admin_url' => $admin_url,
|
383 |
+
) );
|
384 |
+
$message = apply_filters( 'new_user_approve_request_approval_message', $message, $user_login, $user_email );
|
385 |
+
|
386 |
+
$subject = sprintf( __( '[%s] User Approval', 'new-user-approve' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) );
|
387 |
+
$subject = apply_filters( 'new_user_approve_request_approval_subject', $subject );
|
388 |
+
|
389 |
+
$to = apply_filters( 'new_user_approve_email_admins', array( get_option( 'admin_email' ) ) );
|
390 |
+
$to = array_unique( $to );
|
391 |
+
|
392 |
+
// send the mail
|
393 |
+
wp_mail( $to, $subject, $message, $this->email_message_headers() );
|
394 |
}
|
395 |
|
396 |
/**
|
407 |
return;
|
408 |
}
|
409 |
|
410 |
+
$this->admin_approval_email( $user_login, $user_email );
|
411 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
|
413 |
+
public function request_admin_approval_email_2( $user_id ) {
|
414 |
+
$user = new WP_User( $user_id );
|
415 |
|
416 |
+
$user_login = stripslashes( $user->data->user_login );
|
417 |
+
$user_email = stripslashes( $user->data->user_email );
|
418 |
|
419 |
+
$this->admin_approval_email( $user_login, $user_email );
|
|
|
420 |
}
|
|
|
421 |
/**
|
422 |
* Create a new user after the registration has been validated. Normally,
|
423 |
* when a user registers, an email is sent to the user containing their
|
443 |
}
|
444 |
|
445 |
/**
|
446 |
+
* Determine whether a password needs to be reset.
|
447 |
*
|
448 |
+
* password should only be reset for users that:
|
449 |
+
* * have never logged in
|
450 |
+
* * are just approved for the first time
|
451 |
+
*
|
452 |
+
* @return boolean
|
453 |
*/
|
454 |
+
public function do_password_reset( $user_id ) {
|
455 |
+
// Default behavior is to reset password
|
456 |
+
$do_password_reset = true;
|
|
|
|
|
|
|
457 |
|
458 |
// If the password has already been reset for this user,
|
459 |
// $password_reset will be a unix timestamp
|
460 |
+
$last_password_reset = get_user_meta( $user_id, 'pw_user_approve_password_reset' );
|
461 |
|
462 |
// Get the current user status. By default each user is given a pending
|
463 |
// status when the user is created (with this plugin activated). If the
|
465 |
// have a status set.
|
466 |
$user_status = get_user_meta( $user_id, 'pw_user_status' );
|
467 |
|
|
|
|
|
|
|
468 |
// if no status is set, don't reset password
|
469 |
if ( empty( $user_status ) ) {
|
470 |
+
$do_password_reset = false;
|
471 |
}
|
472 |
|
473 |
// if the password has already been reset, absolutely bypass
|
474 |
+
if ( ! empty( $last_password_reset ) ) {
|
475 |
+
$do_password_reset = false;
|
476 |
}
|
477 |
|
478 |
+
// for backward compatability
|
479 |
+
$bypass_password_reset = apply_filters( 'new_user_approve_bypass_password_reset', !$do_password_reset );
|
480 |
|
481 |
+
return apply_filters( 'new_user_approve_do_password_reset', !$bypass_password_reset );
|
482 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
483 |
|
484 |
+
/**
|
485 |
+
* Admin approval of user
|
486 |
+
*
|
487 |
+
* @uses new_user_approve_approve_user
|
488 |
+
*/
|
489 |
+
public function approve_user( $user_id ) {
|
490 |
+
$user = new WP_User( $user_id );
|
491 |
|
492 |
wp_cache_delete( $user->ID, 'users' );
|
493 |
wp_cache_delete( $user->data->user_login, 'userlogins' );
|
497 |
$user_email = stripslashes( $user->data->user_email );
|
498 |
|
499 |
// format the message
|
500 |
+
$message = nua_default_approve_user_message();
|
501 |
+
|
502 |
+
$message = nua_do_email_tags( $message, array(
|
503 |
+
'context' => 'approve_user',
|
504 |
+
'user' => $user,
|
505 |
+
'user_login' => $user_login,
|
506 |
+
'user_email' => $user_email,
|
507 |
+
) );
|
|
|
|
|
|
|
|
|
|
|
508 |
$message = apply_filters( 'new_user_approve_approve_user_message', $message, $user );
|
509 |
|
510 |
$subject = sprintf( __( '[%s] Registration Approved', 'new-user-approve' ), get_option( 'blogname' ) );
|
519 |
do_action( 'new_user_approve_user_approved', $user );
|
520 |
}
|
521 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
/**
|
523 |
* Send email to notify user of denial.
|
524 |
*
|
531 |
$user_email = stripslashes( $user->user_email );
|
532 |
|
533 |
// format the message
|
534 |
+
$message = nua_default_deny_user_message();
|
535 |
+
$message = nua_do_email_tags( $message, array(
|
536 |
+
'context' => 'deny_user',
|
537 |
+
) );
|
538 |
$message = apply_filters( 'new_user_approve_deny_user_message', $message, $user );
|
539 |
|
540 |
$subject = sprintf( __( '[%s] Registration Denied', 'new-user-approve' ), get_option( 'blogname' ) );
|
541 |
$subject = apply_filters( 'new_user_approve_deny_user_subject', $subject );
|
542 |
|
543 |
// send the mail
|
544 |
+
wp_mail( $user_email, $subject, $message, $this->email_message_headers() );
|
545 |
}
|
546 |
|
547 |
/**
|
576 |
return $headers;
|
577 |
}
|
578 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
579 |
/**
|
580 |
* Display a message to the user after they have registered
|
581 |
*
|
593 |
return $errors;
|
594 |
}
|
595 |
|
596 |
+
$message = nua_default_registration_complete_message();
|
597 |
+
$message = nua_do_email_tags( $message, array(
|
598 |
+
'context' => 'pending_message',
|
599 |
+
) );
|
600 |
$message = apply_filters( 'new_user_approve_pending_message', $message );
|
601 |
|
602 |
$errors->add( 'registration_required', $message, 'message' );
|
632 |
}
|
633 |
}
|
634 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
635 |
/**
|
636 |
* Add message to login page saying registration is required.
|
637 |
*
|
641 |
*/
|
642 |
public function welcome_user( $message ) {
|
643 |
if ( !isset( $_GET['action'] ) ) {
|
644 |
+
$welcome = nua_default_welcome_message();
|
645 |
+
$welcome = nua_do_email_tags( $welcome, array(
|
646 |
+
'context' => 'welcome_message',
|
647 |
+
) );
|
648 |
$welcome = apply_filters( 'new_user_approve_welcome_message', $welcome );
|
649 |
|
|
|
|
|
650 |
if ( !empty( $welcome ) ) {
|
651 |
$message .= '<p class="message register">' . $welcome . '</p>';
|
652 |
}
|
653 |
}
|
654 |
|
655 |
if ( isset( $_GET['action'] ) && $_GET['action'] == 'register' && !$_POST ) {
|
656 |
+
$instructions = nua_default_registration_message();
|
657 |
+
$instructions = nua_do_email_tags( $instructions, array(
|
658 |
+
'context' => 'registration_message',
|
659 |
+
) );
|
660 |
$instructions = apply_filters( 'new_user_approve_register_instructions', $instructions );
|
661 |
|
662 |
if ( !empty( $instructions ) ) {
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: picklewagon
|
|
3 |
Donate link: http://picklewagon.com/wordpress/new-user-approve/donate
|
4 |
Tags: users, registration, sign up, user management, login
|
5 |
Requires at least: 3.5.1
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -34,21 +34,26 @@ Each user that exists before New User Approve has been activated will be treated
|
|
34 |
an approved user.
|
35 |
|
36 |
Default WordPress registration process:
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
40 |
4. User logs in to site using login credentials.
|
|
|
41 |
|
42 |
WordPress registration process with New User Approve plugin activated:
|
|
|
43 |
1. User registers for access to site.
|
44 |
2. User is shown message to wait for approval.
|
45 |
-
3. Admin is notified of new user
|
46 |
-
4. Admin goes to admin to approve or deny new user.
|
47 |
5. Email is sent to user. If approved, email will include login credentials.
|
48 |
6. User logs in to site using login credentials.
|
49 |
|
50 |
[Fork New User Approve on Github](https://github.com/picklewagon/new-user-approve)
|
51 |
|
|
|
|
|
52 |
== Installation ==
|
53 |
|
54 |
1. Upload new-user-approve to the wp-content/plugins directory or download from
|
@@ -100,6 +105,13 @@ as they have their username and passwords.
|
|
100 |
|
101 |
== Changelog ==
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
= 1.6 =
|
104 |
* improve actions and filters
|
105 |
* refactor messages to make them easier to override
|
3 |
Donate link: http://picklewagon.com/wordpress/new-user-approve/donate
|
4 |
Tags: users, registration, sign up, user management, login
|
5 |
Requires at least: 3.5.1
|
6 |
+
Tested up to: 4.0
|
7 |
+
Stable tag: 1.7
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
34 |
an approved user.
|
35 |
|
36 |
Default WordPress registration process:
|
37 |
+
|
38 |
+
1. User registers.
|
39 |
+
2. User is shown message to check email.
|
40 |
+
3. Login credentials are sent to new user in an email.
|
41 |
4. User logs in to site using login credentials.
|
42 |
+
5. Admin is notified of new user sign up via email.
|
43 |
|
44 |
WordPress registration process with New User Approve plugin activated:
|
45 |
+
|
46 |
1. User registers for access to site.
|
47 |
2. User is shown message to wait for approval.
|
48 |
+
3. Admin is notified of new user sign up via email.
|
49 |
+
4. Admin goes to wp-admin to approve or deny new user.
|
50 |
5. Email is sent to user. If approved, email will include login credentials.
|
51 |
6. User logs in to site using login credentials.
|
52 |
|
53 |
[Fork New User Approve on Github](https://github.com/picklewagon/new-user-approve)
|
54 |
|
55 |
+
[newuserapprove.com](http://newuserapprove.com/)
|
56 |
+
|
57 |
== Installation ==
|
58 |
|
59 |
1. Upload new-user-approve to the wp-content/plugins directory or download from
|
105 |
|
106 |
== Changelog ==
|
107 |
|
108 |
+
= 1.7 =
|
109 |
+
* email/message tags
|
110 |
+
* refactor messages
|
111 |
+
* send admin approval email after the user has been created
|
112 |
+
* tested for WordPress 4.0
|
113 |
+
* finish updates in preparation of option addon plugin
|
114 |
+
|
115 |
= 1.6 =
|
116 |
* improve actions and filters
|
117 |
* refactor messages to make them easier to override
|
tests/bootstrap.php
CHANGED
@@ -1,11 +1,22 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
7 |
}
|
8 |
-
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
|
9 |
-
|
10 |
-
require getenv( 'WP_TESTS_DIR' ) . '/includes/bootstrap.php';
|
11 |
-
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Bootstrap the plugin unit testing environment.
|
4 |
+
*
|
5 |
+
* Edit 'active_plugins' setting below to point to your main plugin file.
|
6 |
+
*
|
7 |
+
* @package wordpress-plugin-tests
|
8 |
+
*/
|
9 |
|
10 |
+
// Activates this plugin in WordPress so it can be tested.
|
11 |
+
$GLOBALS['wp_tests_options'] = array(
|
12 |
+
'active_plugins' => array( 'new-user-approve/new-user-approve.php' ),
|
13 |
+
);
|
14 |
|
15 |
+
// If the develop repo location is defined (as WP_DEVELOP_DIR), use that
|
16 |
+
// location. Otherwise, we'll just assume that this plugin is installed in a
|
17 |
+
// WordPress develop SVN checkout.
|
18 |
+
if ( false !== getenv( 'WP_DEVELOP_DIR' ) ) {
|
19 |
+
require getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit/includes/bootstrap.php';
|
20 |
+
} else {
|
21 |
+
require '../../../includes/bootstrap.php';
|
22 |
}
|
|
|
|
|
|
|
|