User registration & user profile – Profile Builder - Version 1.1.58

Version Description

Download this release

Release Info

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

Code changes from version 1.1.57 to 1.1.58

classes/class.bulk.approve.unapprove.php CHANGED
@@ -106,6 +106,26 @@ class wpp_list_approved_unapproved_users extends WP_List_Table {
106
  * @param array $item A singular item (one full row's worth of data)
107
  * @return string Text to be placed inside the column <td>
108
  **************************************************************************/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  function column_username($item){
110
  global $current_user;
111
 
@@ -114,7 +134,7 @@ class wpp_list_approved_unapproved_users extends WP_List_Table {
114
  $currentUser = wp_get_current_user();
115
  $wppb_nonce = wp_create_nonce( '_nonce_'.$current_user->ID.$user->ID);
116
 
117
- $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
118
 
119
  $actions['remove'] = sprintf('<a class=\'edit_view\' href="%s">'. __('View or Edit', 'profilebuilder') .'</a>', $edit_link);
120
 
@@ -455,7 +475,7 @@ class wpp_list_approved_unapproved_users extends WP_List_Table {
455
  * Now we just need to define an admin page.
456
  */
457
  function wppb_add_au_submenu_page() {
458
- if (is_multisite()){
459
  add_submenu_page( 'users.php', 'Admin Approval', 'Admin Approval', 'manage_options', 'admin_approval', 'wppb_approved_unapproved_users_custom_menu_page' );
460
  remove_submenu_page( 'users.php', 'admin_approval' ); //hide the page in the admin menu
461
 
106
  * @param array $item A singular item (one full row's worth of data)
107
  * @return string Text to be placed inside the column <td>
108
  **************************************************************************/
109
+ function wppb_get_edit_user_link( $user_id = null ) {
110
+ if ( ! $user_id )
111
+ $user_id = get_current_user_id();
112
+
113
+ if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) )
114
+ return '';
115
+
116
+ $user = get_userdata( $user_id );
117
+
118
+ if ( ! $user )
119
+ return '';
120
+
121
+ if ( get_current_user_id() == $user->ID )
122
+ $link = get_edit_profile_url( $user->ID );
123
+ else
124
+ $link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
125
+
126
+ return apply_filters( 'wppb_get_edit_user_link', $link, $user->ID );
127
+ }
128
+
129
  function column_username($item){
130
  global $current_user;
131
 
134
  $currentUser = wp_get_current_user();
135
  $wppb_nonce = wp_create_nonce( '_nonce_'.$current_user->ID.$user->ID);
136
 
137
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), $this->wppb_get_edit_user_link( $user->ID ) ) );
138
 
139
  $actions['remove'] = sprintf('<a class=\'edit_view\' href="%s">'. __('View or Edit', 'profilebuilder') .'</a>', $edit_link);
140
 
475
  * Now we just need to define an admin page.
476
  */
477
  function wppb_add_au_submenu_page() {
478
+ if ( is_multisite() ){
479
  add_submenu_page( 'users.php', 'Admin Approval', 'Admin Approval', 'manage_options', 'admin_approval', 'wppb_approved_unapproved_users_custom_menu_page' );
480
  remove_submenu_page( 'users.php', 'admin_approval' ); //hide the page in the admin menu
481
 
front-end/wppb.login.php CHANGED
@@ -11,29 +11,28 @@ 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
- if (isset($_POST['remember-me']))
15
- $remember = $_POST['remember-me'];
16
- else $remember = false;
17
 
18
- $username = trim($_POST['user-name']);
19
- if (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email')){
20
- // if this setting is active, the posted username is, in fact the user's email
21
- $username = $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM $wpdb->users WHERE user_email= %s LIMIT 1", $username ) );
22
- }
23
-
24
- $wppb_login = wp_signon( array( 'user_login' => $username, 'user_password' => trim($_POST['password']), 'remember' => trim($_POST['remember-me']) ), false );
 
 
 
 
25
 
26
- }elseif (isset($_GET['userName']) && isset($_GET['passWord'])){
27
- $remember = true;
28
- $username = trim($_GET['userName']);
29
- $password = base64_decode(trim($_GET['passWord']));
30
 
31
- if (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email')){
32
- // if this setting is active, the posted username is, in fact the user's email
33
  $username = $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM $wpdb->users WHERE user_email= %s LIMIT 1", $username ) );
34
- }
35
 
36
- $wppb_login = wp_signon( array( 'user_login' => $username, 'user_password' => $password, 'remember' => $remember ), false );
37
  }
38
  }
39
  add_action('init', 'wppb_signon');
@@ -112,30 +111,18 @@ function wppb_front_end_login( $atts ){
112
  if ($_POST['formName'] == 'login'){
113
  ?>
114
  <p class="error">
115
- <?php
116
- if (trim($_POST['user-name']) == ''){
117
- if (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email')){
118
- $loginFilterArray['emptyUsernameError'] = '<strong>'. __('ERROR:','profilebuilder').'</strong> '. __('The email field is empty', 'profilebuilder').'.';
119
- $loginFilterArray['emptyUsernameError'] = apply_filters('wppb_login_empty_email_as_username_error_message', $loginFilterArray['emptyUsernameError']);
120
-
121
- }else{
122
- $loginFilterArray['emptyUsernameError'] = '<strong>'. __('ERROR:','profilebuilder').'</strong> '. __('The username field is empty', 'profilebuilder').'.';
123
- $loginFilterArray['emptyUsernameError'] = apply_filters('wppb_login_empty_username_error_message', $loginFilterArray['emptyUsernameError']);
124
- }
125
 
126
- echo $loginFilterArray['emptyUsernameError'];
 
 
127
 
128
- }elseif (trim($_POST['password']) == ''){
129
- $loginFilterArray['emptyPasswordError'] = '<strong>'. __('ERROR:','profilebuilder').'</strong> '. __('The password field is empty', 'profilebuilder').'.';
130
- $loginFilterArray['emptyPasswordError'] = apply_filters('wppb_login_empty_password_error_message', $loginFilterArray['emptyPasswordError']);
131
-
132
- echo $loginFilterArray['emptyPasswordError'];
133
- }
134
-
135
- if ( is_wp_error($wppb_login) ){
136
- $loginFilterArray['wpError'] = $wppb_login->get_error_message();
137
- $loginFilterArray['wpError'] = apply_filters('wppb_login_wp_error_message', $loginFilterArray['wpError'],$wppb_login);
138
- echo $loginFilterArray['wpError'];
139
  }
140
  ?>
141
  </p><!-- .error -->
@@ -148,14 +135,15 @@ function wppb_front_end_login( $atts ){
148
 
149
  <form action="<?php wppb_curpageurl(); ?>" method="post" class="sign-in" name="loginForm">
150
  <?php
151
- if (isset($_POST['user-name']))
152
  $userName = esc_html( $_POST['user-name'] );
153
- else $userName = '';
 
154
 
155
- if (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email'))
156
- $loginWith = __('Email', 'profilebuilder');
157
  else
158
- $loginWith = __('Username', 'profilebuilder');
159
 
160
  $loginFilterArray['loginUsername'] = '
161
  <p class="login-form-username">
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' ) ){
18
+ $username = $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM $wpdb->users WHERE user_email= %s LIMIT 1", trim( $_POST['user-name'] ) ) );
19
+
20
+ if ( $username == NULL )
21
+ $username = trim( $_POST['user-name'] );
22
+
23
+ }else
24
+ $username = trim( $_POST['user-name'] );
25
+
26
+ $wppb_login = wp_signon( array( 'user_login' => $username, 'user_password' => trim( $_POST['password'] ), 'remember' => $remember ), false );
27
 
28
+ }elseif ( isset( $_GET['userName'] ) && isset( $_GET['passWord'] ) ){
29
+ $password = base64_decode( trim( $_GET['passWord'] ) );
 
 
30
 
31
+ // if this setting is active, the posted username is, in fact the user's email
32
+ if ( isset( $wppb_generalSettings['loginWith'] ) && ( $wppb_generalSettings['loginWith'] == 'email' ) )
33
  $username = $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM $wpdb->users WHERE user_email= %s LIMIT 1", $username ) );
 
34
 
35
+ $wppb_login = wp_signon( array( 'user_login' => $username, 'user_password' => base64_decode( trim( $_GET['passWord'] ) ), 'remember' => true ), false );
36
  }
37
  }
38
  add_action('init', 'wppb_signon');
111
  if ($_POST['formName'] == 'login'){
112
  ?>
113
  <p class="error">
114
+ <?php
115
+ if ( ( isset( $_POST['user-name'] ) && isset( $_POST['password'] ) ) && ( ( trim( $_POST['user-name'] ) == '' ) && ( trim( $_POST['password'] == '' ) ) ) )
116
+ echo $loginFilterArray['emptyFieldsError'] = apply_filters ( 'wppb_login_empty_fields_error_message', '<strong>'. __( 'ERROR:','profilebuilder' ).'</strong> '. __( 'Both fields are empty.', 'profilebuilder' ) );
 
 
 
 
 
 
 
117
 
118
+ elseif ( is_wp_error( $wppb_login ) ){
119
+ if ( ( isset( $wppb_generalSettings['loginWith'] ) && ( $wppb_generalSettings['loginWith'] == 'email' ) ) && isset( $wppb_login->errors['empty_username'] ) ){
120
+ echo $loginFilterArray['emptyEmailError'] = apply_filters ( 'wppb_login_empty_email_error_message', '<strong>'. __( 'ERROR:','profilebuilder' ).'</strong> '. __( 'The email field is empty.', 'profilebuilder' ) );
121
 
122
+ }else{
123
+ $loginFilterArray['wpError'] = $wppb_login->get_error_message();
124
+ echo $loginFilterArray['wpError'] = apply_filters( 'wppb_login_wp_error_message', $loginFilterArray['wpError'], $wppb_login );
125
+ }
 
 
 
 
 
 
 
126
  }
127
  ?>
128
  </p><!-- .error -->
135
 
136
  <form action="<?php wppb_curpageurl(); ?>" method="post" class="sign-in" name="loginForm">
137
  <?php
138
+ if ( isset( $_POST['user-name'] ) )
139
  $userName = esc_html( $_POST['user-name'] );
140
+ else
141
+ $userName = '';
142
 
143
+ if ( isset( $wppb_generalSettings['loginWith'] ) && ( $wppb_generalSettings['loginWith'] == 'email' ) )
144
+ $loginWith = __( 'Email', 'profilebuilder' );
145
  else
146
+ $loginWith = __( 'Username', 'profilebuilder' );
147
 
148
  $loginFilterArray['loginUsername'] = '
149
  <p class="login-form-username">
front-end/wppb.recover.password.php CHANGED
@@ -5,20 +5,14 @@ function wppb_check_for_unapproved_user($data, $what){
5
  $messageNo = '';
6
 
7
  $wppb_generalSettings = get_option( 'wppb_general_settings' );
8
-
9
  if( $wppb_generalSettings['adminApproval'] == 'yes' ){
10
-
11
- if ( $what == 'user_email' ){
12
- require_once(ABSPATH . WPINC . '/ms-functions.php');
13
- $userID = get_user_id_from_string( $data );
14
-
15
- }else{
16
- $user = get_user_by('login', $data);
17
- $userID = $user->ID;
18
- }
19
-
20
 
21
- if ( wp_get_object_terms( $userID, 'user_status' ) ){
22
  $retMessage = '<strong>'. __('ERROR', 'profilebuilder') . '</strong>: ' . __('Your account has to be confirmed by an administrator before you can use the "Password Reset" feature.', 'profilebuilder');
23
  $retMessage = apply_filters('wppb_recover_password_unapporved_user', $retMessage);
24
 
@@ -27,7 +21,7 @@ function wppb_check_for_unapproved_user($data, $what){
27
  }
28
  }
29
 
30
- return $retArray = array(0 => $retMessage, 1 => $messageNo);
31
  }
32
 
33
  function wppb_retrieve_activation_key( $requestedUserLogin ){
5
  $messageNo = '';
6
 
7
  $wppb_generalSettings = get_option( 'wppb_general_settings' );
 
8
  if( $wppb_generalSettings['adminApproval'] == 'yes' ){
9
+ if ( $what == 'user_email' )
10
+ $user = get_user_by( 'email', $data );
11
+ else
12
+ $user = get_user_by( 'login', $data );
13
+
 
 
 
 
 
14
 
15
+ if ( wp_get_object_terms( $user->data->ID, 'user_status' ) ){
16
  $retMessage = '<strong>'. __('ERROR', 'profilebuilder') . '</strong>: ' . __('Your account has to be confirmed by an administrator before you can use the "Password Reset" feature.', 'profilebuilder');
17
  $retMessage = apply_filters('wppb_recover_password_unapporved_user', $retMessage);
18
 
21
  }
22
  }
23
 
24
+ return array(0 => $retMessage, 1 => $messageNo);
25
  }
26
 
27
  function wppb_retrieve_activation_key( $requestedUserLogin ){
front-end/wppb.register.php CHANGED
@@ -178,7 +178,7 @@ function wppb_activate_signup( $key ) {
178
 
179
  if ( $signup->active )
180
  if ( empty( $signup->domain ) )
181
- return $activateUserErrorMessage2 = apply_filters('wppb_register_activate_user_error_message2', '<p class="error">'. __('The user is already active!', 'profilebuilder') .'</p>');
182
 
183
  $meta = unserialize( $signup->meta );
184
 
@@ -198,15 +198,12 @@ function wppb_activate_signup( $key ) {
198
  return $activateUserErrorMessage4 = apply_filters('wppb_register_activate_user_error_message4', '<p class="error">'. __('Could not create user!', 'profilebuilder') .'</p>');
199
 
200
  elseif ( isset( $user_already_exists ) )
201
- return $activateUserErrorMessage5 = apply_filters('wppb_register_activate_user_error_message5', '<p class="error">'. __('That username is already activated!', 'profilebuilder') .'</p>');
202
 
203
  else{
204
  $now = current_time('mysql', true);
205
 
206
- if ( is_multisite() )
207
- $retVal = $wpdb->update( $wpdb->signups, array('active' => 1, 'activated' => $now), array('activation_key' => $key) );
208
- else
209
- $retVal = $wpdb->update( $wpdb->prefix.'signups', array('active' => 1, 'activated' => $now), array('activation_key' => $key) );
210
 
211
  wppb_add_meta_to_user_on_activation($user_id, '', $meta);
212
 
178
 
179
  if ( $signup->active )
180
  if ( empty( $signup->domain ) )
181
+ return $activateUserErrorMessage2 = apply_filters('wppb_register_activate_user_error_message2', '<p class="error">'. __('This username is now active!', 'profilebuilder') .'</p>');
182
 
183
  $meta = unserialize( $signup->meta );
184
 
198
  return $activateUserErrorMessage4 = apply_filters('wppb_register_activate_user_error_message4', '<p class="error">'. __('Could not create user!', 'profilebuilder') .'</p>');
199
 
200
  elseif ( isset( $user_already_exists ) )
201
+ return $activateUserErrorMessage5 = apply_filters('wppb_register_activate_user_error_message5', '<p class="error">'. __('This username is already activated!', 'profilebuilder') .'</p>');
202
 
203
  else{
204
  $now = current_time('mysql', true);
205
 
206
+ $retVal = ( is_multisite() ? $wpdb->update( $wpdb->signups, array('active' => 1, 'activated' => $now), array('activation_key' => $key) ) : $wpdb->update( $wpdb->prefix.'signups', array('active' => 1, 'activated' => $now), array('activation_key' => $key) ) );
 
 
 
207
 
208
  wppb_add_meta_to_user_on_activation($user_id, '', $meta);
209
 
index.php CHANGED
@@ -3,7 +3,7 @@
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.57
7
  Author: Reflection Media, Barina Gabriel
8
  Author URI: http://www.reflectionmedia.ro
9
  License: GPL2
@@ -53,7 +53,7 @@ function wppb_return_bytes( $val ) {
53
  return $val;
54
  }
55
 
56
- define( 'PROFILE_BUILDER_VERSION', '1.1.57' );
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.58
7
  Author: Reflection Media, Barina Gabriel
8
  Author URI: http://www.reflectionmedia.ro
9
  License: GPL2
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') ) ) );
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: registration, user profile, user registration, custom field registration,
6
 
7
  Requires at least: 3.1
8
  Tested up to: 3.6.1
9
- Stable tag: 1.1.57
10
 
11
  Simple to use profile plugin allowing front-end login, user registration and edit profile by using shortcodes.
12
 
@@ -94,6 +94,9 @@ 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
  Minor changes to the readme.txt file.
99
 
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
  7. Password Recovery Page
95
 
96
  == Changelog ==
97
+ = 1.1.57 =
98
+ Fixed some bugs which only appeared in WPMU sites.
99
+
100
  = 1.1.57 =
101
  Minor changes to the readme.txt file.
102