User registration & user profile – Profile Builder - Version 1.1.59

Version Description

Improved some of the queries meant to select users at certain points, hidden input value on front-end (Pro version) and the remember me checkbox on the login page.

Download this release

Release Info

Developer barinagabriel
Plugin Icon 128x128 User registration & user profile – Profile Builder
Version 1.1.59
Comparing to
See all releases

Code changes from version 1.1.58 to 1.1.59

classes/class.email.confirmation.php CHANGED
@@ -221,54 +221,43 @@ class wpp_list_unfonfirmed_email_table extends WP_List_Table {
221
  echo "<script type=\"text/javascript\">confirmECActionBulk( '".$url."', '".$message."' )</script>";
222
  }
223
 
224
-
225
-
226
  function wppb_process_bulk_action() {
227
  global $current_user;
228
  global $wpdb;
229
 
230
  if ( current_user_can( 'delete_users' ) ){
231
- $iterator = 0;
232
- $results = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."signups WHERE active = 0");
233
-
234
- //Detect when a bulk action is being triggered...
235
  if( 'delete' === $this->current_action() ) {
236
- foreach ( $results as $result ){
237
- if ( in_array( (string)$iterator, $_GET['user'] ) ){
238
- $sql_result = $wpdb->delete( $wpdb->prefix.'signups', array( 'user_login' => $result->user_login, 'user_email' => $result->user_email ) );
239
- if ( !$sql_result )
240
- $this->wppb_process_bulk_action_message( sprintf( __( "%s couldn't be deleted", "profilebuilder" ), $result->user_login ), get_bloginfo('url').'/wp-admin/users.php?page=unconfirmed_emails' );
241
- }
242
- $iterator++;
243
  }
244
 
245
  $this->wppb_process_bulk_action_message( __( 'All users have been successfully deleted', 'profilebuilder' ), get_bloginfo('url').'/wp-admin/users.php?page=unconfirmed_emails' );
246
 
247
  }elseif( 'confirm' === $this->current_action() ) {
248
- foreach ( $results as $result ){
249
- if ( in_array( (string)$iterator, $_GET['user'] ) )
250
- wppb_manual_activate_signup( $result->activation_key );
251
-
252
- $iterator++;
253
  }
254
 
255
  $this->wppb_process_bulk_action_message( __( 'The selected users have been activated', 'profilebuilder' ), get_bloginfo('url').'/wp-admin/users.php?page=unconfirmed_emails' );
256
 
257
  }elseif( 'resend' === $this->current_action() ) {
258
- foreach ( $results as $result ){
259
- if (in_array((string)$iterator, $_GET['user'])){
260
- $sql_result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "signups WHERE user_login = %s AND user_email = %s", $result->user_login, $result->user_email ), ARRAY_A );
261
-
262
- if ( $sql_result )
263
- wppb_signup_user_notification( esc_sql( $sql_result['user_login'] ), esc_sql( $sql_result['user_email'] ), $sql_result['activation_key'], esc_sql( $sql_result['meta'] ) );
264
- }
265
 
266
- $iterator++;
 
 
267
  }
268
 
269
  $this->wppb_process_bulk_action_message( __( 'The selected users have had their activation emails resent', 'profilebuilder' ), get_bloginfo('url').'/wp-admin/users.php?page=unconfirmed_emails' );
270
  }
271
-
272
  }else
273
  $this->wppb_process_bulk_action_message( __( "Sorry, but you don't have permission to do that!", "profilebuilder" ), get_bloginfo('url').'/wp-admin/' );
274
  }
@@ -297,7 +286,7 @@ class wpp_list_unfonfirmed_email_table extends WP_List_Table {
297
 
298
  $results = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."signups WHERE active = 0");
299
  foreach ($results as $result){
300
- $tempArray = array('ID' => $iterator, 'username' => $result->user_login, 'email' => $result->user_email, 'registered' => $result->registered);
301
 
302
  array_push($this->dataArray, $tempArray);
303
  $iterator++;
221
  echo "<script type=\"text/javascript\">confirmECActionBulk( '".$url."', '".$message."' )</script>";
222
  }
223
 
 
 
224
  function wppb_process_bulk_action() {
225
  global $current_user;
226
  global $wpdb;
227
 
228
  if ( current_user_can( 'delete_users' ) ){
 
 
 
 
229
  if( 'delete' === $this->current_action() ) {
230
+ foreach ( $_GET['user'] as $user ){
231
+ $sql_result = $wpdb->delete( $wpdb->prefix.'signups', array( 'user_login' => $result->user_login, 'user_email' => $result->user_email ) );
232
+ if ( !$sql_result )
233
+ $this->wppb_process_bulk_action_message( sprintf( __( "%s couldn't be deleted", "profilebuilder" ), $result->user_login ), get_bloginfo('url').'/wp-admin/users.php?page=unconfirmed_emails' );
234
+
 
 
235
  }
236
 
237
  $this->wppb_process_bulk_action_message( __( 'All users have been successfully deleted', 'profilebuilder' ), get_bloginfo('url').'/wp-admin/users.php?page=unconfirmed_emails' );
238
 
239
  }elseif( 'confirm' === $this->current_action() ) {
240
+ foreach ( $_GET['user'] as $user ){
241
+ $sql_result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "signups WHERE user_email = %s", $user ), ARRAY_A );
242
+
243
+ if ( $sql_result )
244
+ wppb_manual_activate_signup( $sql_result->activation_key );
245
  }
246
 
247
  $this->wppb_process_bulk_action_message( __( 'The selected users have been activated', 'profilebuilder' ), get_bloginfo('url').'/wp-admin/users.php?page=unconfirmed_emails' );
248
 
249
  }elseif( 'resend' === $this->current_action() ) {
250
+ foreach ( $_GET['user'] as $user ){
251
+ $sql_result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "signups WHERE user_email = %s", $user ), ARRAY_A );
 
 
 
 
 
252
 
253
+ if ( $sql_result )
254
+ wppb_signup_user_notification( esc_sql( $sql_result['user_login'] ), esc_sql( $sql_result['user_email'] ), $sql_result['activation_key'], $sql_result['meta'] );
255
+
256
  }
257
 
258
  $this->wppb_process_bulk_action_message( __( 'The selected users have had their activation emails resent', 'profilebuilder' ), get_bloginfo('url').'/wp-admin/users.php?page=unconfirmed_emails' );
259
  }
260
+
261
  }else
262
  $this->wppb_process_bulk_action_message( __( "Sorry, but you don't have permission to do that!", "profilebuilder" ), get_bloginfo('url').'/wp-admin/' );
263
  }
286
 
287
  $results = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."signups WHERE active = 0");
288
  foreach ($results as $result){
289
+ $tempArray = array('ID' => $result->user_email, 'username' => $result->user_login, 'email' => $result->user_email, 'registered' => $result->registered);
290
 
291
  array_push($this->dataArray, $tempArray);
292
  $iterator++;
front-end/wppb.login.php CHANGED
@@ -11,7 +11,7 @@ function wppb_signon(){
11
  $wppb_generalSettings = get_option('wppb_general_settings');
12
 
13
  if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login') && ($_POST['formName'] == 'login') ){
14
- $remember = ( ( isset( $_POST['remember-me'] ) && trim( $_POST['remember-me'] != '' ) ) ? trim( $_POST['remember-me'] ) : false );
15
 
16
  // if this setting is active, the posted username is, in fact the user's email
17
  if ( isset( $wppb_generalSettings['loginWith'] ) && ( $wppb_generalSettings['loginWith'] == 'email' ) ){
11
  $wppb_generalSettings = get_option('wppb_general_settings');
12
 
13
  if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login') && ($_POST['formName'] == 'login') ){
14
+ $remember = ( ( isset( $_POST['remember-me'] ) && trim( $_POST['remember-me'] != '' ) ) ? true : false );
15
 
16
  // if this setting is active, the posted username is, in fact the user's email
17
  if ( isset( $wppb_generalSettings['loginWith'] ) && ( $wppb_generalSettings['loginWith'] == 'email' ) ){
functions/email.confirmation.php CHANGED
@@ -55,11 +55,11 @@ function wppb_add_pending_users_header_script(){
55
  }
56
 
57
  // script to create a confirmation box for the user upon approving/unapproving a user
58
- function confirmECAction( URL, todo, userID, actionText ) {
59
  actionText = '<?php _e( 'Do you want to', 'profilebuilder' ); ?>' + ' ' + actionText;
60
 
61
  if (confirm(actionText)) {
62
- jQuery.post( ajaxurl , { action:"wppb_handle_email_confirmation_cases", URL:URL, todo:todo, userID:userID}, function(response) {
63
  if (jQuery.trim(response) == 'ok')
64
  window.location=URL;
65
 
@@ -73,12 +73,10 @@ function wppb_add_pending_users_header_script(){
73
  }
74
 
75
  function wppb_get_unconfirmed_email_number(){
76
- global $wpdb;
77
-
78
- $result = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."signups WHERE active = 0");
79
 
80
  header( 'Content-type: application/json' );
81
- die( json_encode( array( 'number' => (int)$wpdb->num_rows ) ) );
82
  }
83
 
84
 
@@ -89,47 +87,36 @@ function wppb_handle_email_confirmation_cases() {
89
  //die($current_user);
90
  $url = trim($_POST['URL']);
91
  $todo = trim($_POST['todo']);
92
- $userID = trim($_POST['userID']);
93
 
94
- if (current_user_can('delete_users'))
95
- if ( ( $todo != '' ) && ( $userID != '' ) ){
 
 
96
 
97
- $iterator = 0;
98
- $results = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix."signups WHERE active = 0" );
99
-
100
- if ( $todo == 'delete' ){
101
- foreach ( $results as $result ){
102
- if ( (string)$iterator === $userID ){
103
- $sql_result = $wpdb->delete( $wpdb->prefix.'signups', array( 'user_login' => $result->user_login, 'user_email' => $result->user_email ) );
104
- if ( $sql_result )
105
- die( 'ok' );
106
-
107
- else
108
- die( __( "The selected user couldn't be deleted", "profilebuilder" ) );
109
- }
110
 
111
- $iterator++;
112
- }
 
113
  }elseif ( $todo == 'confirm' ){
114
- foreach ( $results as $result ){
115
- if ( (string)$iterator === $userID )
116
- die( wppb_manual_activate_signup( $result->activation_key ) );
117
-
118
- $iterator++;
119
- }
120
  }elseif ( $todo == 'resend' ){
121
- foreach ( $results as $result ){
122
- if ( (string)$iterator === $userID ){
123
- $sql_result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "signups WHERE user_login = %s AND user_email = %s", $result->user_login, $result->user_email ), ARRAY_A );
124
-
125
- if ( $sql_result ){
126
- wppb_signup_user_notification( esc_sql( $sql_result['user_login'] ), esc_sql( $sql_result['user_email'] ), $sql_result['activation_key'], $sql_result['meta'] );
127
-
128
- die( __( "Email notification resent to user", "profilebuilder" ) );
129
- }
130
- }
131
- $iterator++;
132
  }
 
133
  }
134
  }
135
 
55
  }
56
 
57
  // script to create a confirmation box for the user upon approving/unapproving a user
58
+ function confirmECAction( URL, todo, user_email, actionText ) {
59
  actionText = '<?php _e( 'Do you want to', 'profilebuilder' ); ?>' + ' ' + actionText;
60
 
61
  if (confirm(actionText)) {
62
+ jQuery.post( ajaxurl , { action:"wppb_handle_email_confirmation_cases", URL:URL, todo:todo, user_email:user_email}, function(response) {
63
  if (jQuery.trim(response) == 'ok')
64
  window.location=URL;
65
 
73
  }
74
 
75
  function wppb_get_unconfirmed_email_number(){
76
+ global $wpdb;
 
 
77
 
78
  header( 'Content-type: application/json' );
79
+ die( json_encode( array( 'number' => (int)$wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."signups WHERE active = 0" ) ) ) );
80
  }
81
 
82
 
87
  //die($current_user);
88
  $url = trim($_POST['URL']);
89
  $todo = trim($_POST['todo']);
90
+ $user_email = trim($_POST['user_email']);
91
 
92
+ if ( current_user_can( 'delete_users' ) )
93
+ if ( ( $todo != '' ) && ( $user_email != '' ) ){
94
+
95
+ $results = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "signups WHERE active = 0 AND user_email = %s", $user_email ) );
96
 
97
+ if ( count( $results ) != 1 )
98
+ die( __("There was an error performing that action!", "profilebuilder") );
99
+
100
+ elseif ( $todo == 'delete' ){
101
+ $sql_result = $wpdb->delete( $wpdb->prefix.'signups', array( 'user_login' => $results[0]->user_login, 'user_email' => $results[0]->user_email ) );
102
+ if ( $sql_result )
103
+ die( 'ok' );
 
 
 
 
 
 
104
 
105
+ else
106
+ die( __( "The selected user couldn't be deleted", "profilebuilder" ) );
107
+
108
  }elseif ( $todo == 'confirm' ){
109
+ die( wppb_manual_activate_signup( $results[0]->activation_key ) );
110
+
 
 
 
 
111
  }elseif ( $todo == 'resend' ){
112
+ $sql_result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "signups WHERE user_login = %s AND user_email = %s", $results[0]->user_login, $results[0]->user_email ), ARRAY_A );
113
+
114
+ if ( $sql_result ){
115
+ wppb_signup_user_notification( esc_sql( $sql_result['user_login'] ), esc_sql( $sql_result['user_email'] ), $sql_result['activation_key'], $sql_result['meta'] );
116
+
117
+ die( __( "Email notification resent to user", "profilebuilder" ) );
 
 
 
 
 
118
  }
119
+
120
  }
121
  }
122
 
index.php CHANGED
@@ -3,8 +3,8 @@
3
  Plugin Name: Profile Builder
4
  Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
  Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
6
- Version: 1.1.58
7
- Author: Reflection Media, Barina Gabriel
8
  Author URI: http://www.reflectionmedia.ro
9
  License: GPL2
10
 
@@ -53,7 +53,7 @@ function wppb_return_bytes( $val ) {
53
  return $val;
54
  }
55
 
56
- define( 'PROFILE_BUILDER_VERSION', '1.1.58' );
57
  define( 'WPPB_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
58
  define( 'WPPB_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
59
  define( 'WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters( 'wppb_server_max_upload_size_byte_constant', wppb_return_bytes( ini_get( 'upload_max_filesize') ) ) );
3
  Plugin Name: Profile Builder
4
  Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
  Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
6
+ Version: 1.1.59
7
+ Author: Reflection Media, Barina Gabriel, Antohe Cristian
8
  Author URI: http://www.reflectionmedia.ro
9
  License: GPL2
10
 
53
  return $val;
54
  }
55
 
56
+ define( 'PROFILE_BUILDER_VERSION', '1.1.59' );
57
  define( 'WPPB_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
58
  define( 'WPPB_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
59
  define( 'WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters( 'wppb_server_max_upload_size_byte_constant', wppb_return_bytes( ini_get( 'upload_max_filesize') ) ) );
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === Profile Builder - front-end user registration, login and edit profile ===
2
 
3
- Contributors: reflectionmedia, barinagabriel
4
  Donate link: http://www.cozmoslabs.com/wordpress-profile-builder/
5
  Tags: registration, user profile, user registration, custom field registration, customize profile, user fields, extra user fields, builder, profile builder, custom user profile, user profile page, edit profile, custom registration, custom registration form, custom registration page, registration page, user custom fields, user listing, front-end user listing, user login, user registration form, front-end login, front-end register, front-end registration, front-end edit profile, front-end user registration, custom redirects, user email, avatar upload
6
 
7
  Requires at least: 3.1
8
- Tested up to: 3.6.1
9
- Stable tag: 1.1.58
10
 
11
  Simple to use profile plugin allowing front-end login, user registration and edit profile by using shortcodes.
12
 
@@ -94,6 +94,12 @@ This plugin only adds/removes user fields in the front-end. The default profile
94
  7. Password Recovery Page
95
 
96
  == Changelog ==
 
 
 
 
 
 
97
  = 1.1.57 =
98
  Fixed some bugs which only appeared in WPMU sites.
99
 
1
  === Profile Builder - front-end user registration, login and edit profile ===
2
 
3
+ Contributors: reflectionmedia, barinagabriel, sareiodata
4
  Donate link: http://www.cozmoslabs.com/wordpress-profile-builder/
5
  Tags: registration, user profile, user registration, custom field registration, customize profile, user fields, extra user fields, builder, profile builder, custom user profile, user profile page, edit profile, custom registration, custom registration form, custom registration page, registration page, user custom fields, user listing, front-end user listing, user login, user registration form, front-end login, front-end register, front-end registration, front-end edit profile, front-end user registration, custom redirects, user email, avatar upload
6
 
7
  Requires at least: 3.1
8
+ Tested up to: 3.8.1
9
+ Stable tag: 1.1.59
10
 
11
  Simple to use profile plugin allowing front-end login, user registration and edit profile by using shortcodes.
12
 
94
  7. Password Recovery Page
95
 
96
  == Changelog ==
97
+ = 1.1.59 =
98
+ Improved some of the queries meant to select users at certain points, hidden input value on front-end (Pro version) and the remember me checkbox on the login page.
99
+
100
+ = 1.1.58 =
101
+ Small changes to the index.php file
102
+
103
  = 1.1.57 =
104
  Fixed some bugs which only appeared in WPMU sites.
105