Version Description
Minor changes in the index file.
Download this release
Release Info
| Developer | barinagabriel |
| Plugin | |
| Version | 1.1.15 |
| Comparing to | |
| See all releases | |
Code changes from version 1.1.14 to 1.1.15
- front-end/wppb.edit.profile.php +988 -962
- front-end/wppb.login.php +171 -166
- front-end/wppb.register.php +989 -934
- functions/functions.load.php +184 -184
- index.php +2 -2
- readme.txt +7 -1
front-end/wppb.edit.profile.php
CHANGED
|
@@ -1,963 +1,989 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/*
|
| 3 |
-
wp_update_user only attempts to clear and reset cookies if it's updating the password.
|
| 4 |
-
The php function setcookie(), used in both the cookie-clearing and cookie-resetting functions,
|
| 5 |
-
adds to the page headers and therefore must be called within the first php tag on the page, and
|
| 6 |
-
before the WordPress get_header() function. Since wp_update_user needs this, it must be at the
|
| 7 |
-
beginning of the page as well.
|
| 8 |
-
*/
|
| 9 |
-
$changesSaved = 'no';
|
| 10 |
-
$changesSavedNoMatchingPass = 'no';
|
| 11 |
-
$changesSavedNoPass = 'no';
|
| 12 |
-
|
| 13 |
-
function wppb_save_the_password(){
|
| 14 |
-
global $changesSaved;
|
| 15 |
-
global $changesSavedNoMatchingPass;
|
| 16 |
-
global $changesSavedNoPass;
|
| 17 |
-
|
| 18 |
-
/* Load registration file
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
{
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
$
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
$
|
| 54 |
-
$
|
| 55 |
-
$
|
| 56 |
-
$
|
| 57 |
-
$
|
| 58 |
-
$
|
| 59 |
-
$
|
| 60 |
-
$
|
| 61 |
-
$
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
require_once(ABSPATH . WPINC . '/registration.php');
|
| 68 |
-
/* Get user info. */
|
| 69 |
-
global $current_user;
|
| 70 |
-
|
| 71 |
-
/* delete the attachment if set */
|
| 72 |
-
if (isset($_GET['userID']) && isset($_GET['field'])){
|
| 73 |
-
update_user_meta( $_GET['userID'], $_GET['field'], '');
|
| 74 |
-
}
|
| 75 |
-
/* delete the avatar */
|
| 76 |
-
if (isset($_GET['userID']) && isset($_GET['fieldOriginal']) && isset($_GET['fieldResized'])){
|
| 77 |
-
update_user_meta( $_GET['userID'], $_GET['fieldOriginal'], '');
|
| 78 |
-
update_user_meta( $_GET['userID'], $_GET['fieldResized'], '');
|
| 79 |
-
}
|
| 80 |
-
|
| 81 |
-
//fallback if the file was largen then post_max_size, case in which no errors can be saved in $_FILES[fileName]['error']
|
| 82 |
-
if (empty($_FILES) && empty($_POST) && isset($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
|
| 83 |
-
$editProfileFilterArray['noPost'] = '
|
| 84 |
-
<p class="error">'.
|
| 85 |
-
__('The information size you were trying to submit was larger than', 'profilebuilder') .' '.
|
| 86 |
-
__('This is usually caused by a large file(s) trying to be uploaded.', 'profilebuilder') .'<br/>'.
|
| 87 |
-
__('Since it was also larger than', 'profilebuilder') .' '.
|
| 88 |
-
</p>';
|
| 89 |
-
$editProfileFilterArray['noPost'] = apply_filters('wppb_edit_profile_no_post_error', $editProfileFilterArray['noPost']);
|
| 90 |
-
echo $editProfileFilterArray['noPost'];
|
| 91 |
-
}
|
| 92 |
-
// a way to catch the user before updating his/her profile without completing a required field
|
| 93 |
-
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
|
| 94 |
-
//variable to control whether the user submitted data or not
|
| 95 |
-
|
| 96 |
-
$allRequiredCompleted = apply_filters('wppb_edit_profile_all_required_completed', $allRequiredCompleted);
|
| 97 |
-
}
|
| 98 |
-
|
| 99 |
-
/* If profile was saved, update profile. */
|
| 100 |
-
if ( ('POST' == $_SERVER['REQUEST_METHOD']) && (!empty( $_POST['action'] )) && ($_POST['action'] == 'update-user') && (wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user')) && ($allRequiredCompleted == 'yes') ) {
|
| 101 |
-
|
| 102 |
-
$_POST['email'] = apply_filters('wppb_edit_profile_posted_email', $_POST['email']);
|
| 103 |
-
if ($wppb_defaultOptions['emailRequired'] == 'yes'){
|
| 104 |
-
if ((trim($_POST['email']) != '') && isset($_POST['email'])){
|
| 105 |
-
if (email_exists( $_POST['email'] ) != FALSE)
|
| 106 |
-
$thisEmail = email_exists( $_POST['email'] );
|
| 107 |
-
else $thisEmail = $current_user->id;
|
| 108 |
-
|
| 109 |
-
if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
|
| 110 |
-
if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
|
| 111 |
-
wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
|
| 112 |
-
$changesSaved = 'yes';
|
| 113 |
-
}else{
|
| 114 |
-
$changesSavedNoEmailExist = 'yes';
|
| 115 |
-
}
|
| 116 |
-
}else{
|
| 117 |
-
$changesSavedNoEmail = 'yes';
|
| 118 |
-
}
|
| 119 |
-
}
|
| 120 |
-
}else{
|
| 121 |
-
if (email_exists( $_POST['email'] ) != FALSE)
|
| 122 |
-
$thisEmail = email_exists( $_POST['email'] );
|
| 123 |
-
else $thisEmail = $current_user->id;
|
| 124 |
-
|
| 125 |
-
if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
|
| 126 |
-
if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
|
| 127 |
-
wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
|
| 128 |
-
$changesSaved = 'yes';
|
| 129 |
-
}else{
|
| 130 |
-
$changesSavedNoEmailExist = 'yes';
|
| 131 |
-
}
|
| 132 |
-
}else{
|
| 133 |
-
$changesSavedNoEmail = 'yes';
|
| 134 |
-
}
|
| 135 |
-
}
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
/* Update user information. */
|
| 139 |
-
if ($wppb_defaultOptions['firstname'] == 'show'){
|
| 140 |
-
$_POST['first_name'] = apply_filters('wppb_edit_profile_posted_first_name', $_POST['first_name']);
|
| 141 |
-
if ($wppb_defaultOptions['firstnameRequired'] == 'yes'){
|
| 142 |
-
if ((trim($_POST['first_name']) != '') && isset($_POST['first_name'])){
|
| 143 |
-
wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
|
| 144 |
-
$changesSaved = 'yes';
|
| 145 |
-
}
|
| 146 |
-
}else{
|
| 147 |
-
wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
|
| 148 |
-
$changesSaved = 'yes';
|
| 149 |
-
}
|
| 150 |
-
}
|
| 151 |
-
|
| 152 |
-
if ($wppb_defaultOptions['lastname'] == 'show'){
|
| 153 |
-
$_POST['last_name'] = apply_filters('wppb_edit_profile_posted_last_name', $_POST['last_name']);
|
| 154 |
-
if ($wppb_defaultOptions['lastnameRequired'] == 'yes'){
|
| 155 |
-
if ((trim($_POST['last_name']) != '') && isset($_POST['last_name'])){
|
| 156 |
-
wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
|
| 157 |
-
$changesSaved = 'yes';
|
| 158 |
-
}
|
| 159 |
-
}else{
|
| 160 |
-
wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
|
| 161 |
-
$changesSaved = 'yes';
|
| 162 |
-
}
|
| 163 |
-
}
|
| 164 |
-
|
| 165 |
-
if ($wppb_defaultOptions['nickname'] == 'show'){
|
| 166 |
-
$_POST['nickname'] = apply_filters('wppb_edit_profile_posted_nickname', $_POST['nickname']);
|
| 167 |
-
if ($wppb_defaultOptions['nicknameRequired'] == 'yes'){
|
| 168 |
-
if ((trim($_POST['nickname']) != '') && isset($_POST['nickname'])){
|
| 169 |
-
wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
|
| 170 |
-
$changesSaved = 'yes';
|
| 171 |
-
}
|
| 172 |
-
}else{
|
| 173 |
-
wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
|
| 174 |
-
$changesSaved = 'yes';
|
| 175 |
-
}
|
| 176 |
-
|
| 177 |
-
}
|
| 178 |
-
|
| 179 |
-
if ($wppb_defaultOptions['dispname'] == 'show'){
|
| 180 |
-
$_POST['display_name'] = apply_filters('wppb_edit_profile_posted_display_name', $_POST['display_name']);
|
| 181 |
-
if ($wppb_defaultOptions['dispnameRequired'] == 'yes'){
|
| 182 |
-
if ((trim($_POST['display_name']) != '') && isset($_POST['display_name'])){
|
| 183 |
-
wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
|
| 184 |
-
$changesSaved = 'yes';
|
| 185 |
-
}
|
| 186 |
-
}else{
|
| 187 |
-
wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
|
| 188 |
-
$changesSaved = 'yes';
|
| 189 |
-
}
|
| 190 |
-
}
|
| 191 |
-
|
| 192 |
-
if ($wppb_defaultOptions['website'] == 'show'){
|
| 193 |
-
$_POST['website'] = apply_filters('wppb_edit_profile_posted_website', $_POST['website']);
|
| 194 |
-
if ($wppb_defaultOptions['websiteRequired'] == 'yes'){
|
| 195 |
-
if ((trim($_POST['website']) != '') && isset($_POST['website'])){
|
| 196 |
-
$wppbPos = strpos($_POST['website'], 'http://');
|
| 197 |
-
if($wppbPos !== FALSE){
|
| 198 |
-
wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
|
| 199 |
-
$changesSaved = 'yes';
|
| 200 |
-
}else{
|
| 201 |
-
wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
|
| 202 |
-
$changesSaved = 'yes';
|
| 203 |
-
}
|
| 204 |
-
}
|
| 205 |
-
}else{
|
| 206 |
-
$wppbPos = strpos($_POST['website'], 'http://');
|
| 207 |
-
$website = esc_attr( $_POST['website'] );
|
| 208 |
-
if($wppbPos !== FALSE){
|
| 209 |
-
if ($website == 'http://')
|
| 210 |
-
$website = '';
|
| 211 |
-
wp_update_user( array( 'ID' => $current_user->id, 'user_url' => $website));
|
| 212 |
-
$changesSaved = 'yes';
|
| 213 |
-
}else{
|
| 214 |
-
if ($website != '')
|
| 215 |
-
$website = 'http://'.$website;
|
| 216 |
-
wp_update_user( array( 'ID' => $current_user->id, 'user_url' => $website));
|
| 217 |
-
$changesSaved = 'yes';
|
| 218 |
-
}
|
| 219 |
-
}
|
| 220 |
-
}
|
| 221 |
-
|
| 222 |
-
if ($wppb_defaultOptions['aim'] == 'show'){
|
| 223 |
-
$_POST['aim'] = apply_filters('wppb_edit_profile_posted_aim', $_POST['aim']);
|
| 224 |
-
if ($wppb_defaultOptions['aimRequired'] == 'yes'){
|
| 225 |
-
if ((trim($_POST['aim']) != '') && isset($_POST['aim'])){
|
| 226 |
-
update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
|
| 227 |
-
$changesSaved = 'yes';
|
| 228 |
-
}
|
| 229 |
-
}else{
|
| 230 |
-
update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
|
| 231 |
-
$changesSaved = 'yes';
|
| 232 |
-
}
|
| 233 |
-
}
|
| 234 |
-
|
| 235 |
-
if ($wppb_defaultOptions['yahoo'] == 'show'){
|
| 236 |
-
$_POST['yim'] = apply_filters('wppb_edit_profile_posted_yahoo', $_POST['yim']);
|
| 237 |
-
if ($wppb_defaultOptions['yahooRequired'] == 'yes'){
|
| 238 |
-
if ((trim($_POST['yim']) != '') && isset($_POST['yim'])){
|
| 239 |
-
update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
|
| 240 |
-
$changesSaved = 'yes';
|
| 241 |
-
}
|
| 242 |
-
}else{
|
| 243 |
-
update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
|
| 244 |
-
$changesSaved = 'yes';
|
| 245 |
-
}
|
| 246 |
-
}
|
| 247 |
-
|
| 248 |
-
if ($wppb_defaultOptions['jabber'] == 'show'){
|
| 249 |
-
$_POST['jabber'] = apply_filters('wppb_edit_profile_posted_jabber', $_POST['jabber']);
|
| 250 |
-
if ($wppb_defaultOptions['jabberRequired'] == 'yes'){
|
| 251 |
-
if ((trim($_POST['jabber']) != '') && isset($_POST['jabber'])){
|
| 252 |
-
update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
|
| 253 |
-
$changesSaved = 'yes';
|
| 254 |
-
}
|
| 255 |
-
}else{
|
| 256 |
-
update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
|
| 257 |
-
$changesSaved = 'yes';
|
| 258 |
-
}
|
| 259 |
-
}
|
| 260 |
-
|
| 261 |
-
if ($wppb_defaultOptions['bio'] == 'show'){
|
| 262 |
-
$_POST['description'] = apply_filters('wppb_edit_profile_posted_bio', $_POST['description']);
|
| 263 |
-
if ($wppb_defaultOptions['bioRequired'] == 'yes'){
|
| 264 |
-
if ((trim($_POST['description']) != '') && isset($_POST['description'])){
|
| 265 |
-
update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
|
| 266 |
-
$changesSaved = 'yes';
|
| 267 |
-
}
|
| 268 |
-
}else{
|
| 269 |
-
update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
|
| 270 |
-
$changesSaved = 'yes';
|
| 271 |
-
}
|
| 272 |
-
}
|
| 273 |
-
|
| 274 |
-
/* update the extra profile information */
|
| 275 |
-
$wppb_premium =
|
| 276 |
-
if (file_exists ( $wppb_premium.'extra.fields.php' )){
|
| 277 |
-
$wppbFetchArray = get_option('wppb_custom_fields');
|
| 278 |
-
foreach ( $wppbFetchArray as $key => $value){
|
| 279 |
-
switch ($value['item_type']) {
|
| 280 |
-
case "input":{
|
| 281 |
-
$_POST[$value['item_id'].$value['id']] = apply_filters('wppb_edit_profile_input_custom_field_'.$value['id'], $_POST[$value['item_id'].$value['id']]);
|
| 282 |
-
if (isset($value['item_required'])){
|
| 283 |
-
if ($value['item_required'] == 'yes'){
|
| 284 |
-
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 285 |
-
update_user_meta( $current_user->id,
|
| 286 |
-
else
|
| 287 |
-
array_push($extraFieldsErrorHolder, $value['id']);
|
| 288 |
-
}else
|
| 289 |
-
update_user_meta( $current_user->id,
|
| 290 |
-
}else
|
| 291 |
-
update_user_meta( $current_user->id,
|
| 292 |
-
|
| 293 |
-
break;
|
| 294 |
-
}
|
| 295 |
-
case "hiddenInput":{
|
| 296 |
-
update_user_meta( $current_user->id,
|
| 297 |
-
|
| 298 |
-
break;
|
| 299 |
-
}
|
| 300 |
-
case "checkbox":{
|
| 301 |
-
$checkboxOption = '';
|
| 302 |
-
$checkboxValue = explode(',', $value['item_options']);
|
| 303 |
-
foreach($checkboxValue as $thisValue){
|
| 304 |
-
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
| 305 |
-
if (isset($_POST[$thisValue.$value['id']])){
|
| 306 |
-
$localValue = str_replace('#@space@#', ' ', $_POST[$thisValue.$value['id']]);
|
| 307 |
-
$checkboxOption = $checkboxOption.$localValue.',';
|
| 308 |
-
}
|
| 309 |
-
}
|
| 310 |
-
|
| 311 |
-
if (isset($value['item_required'])){
|
| 312 |
-
if ($value['item_required'] == 'yes'){
|
| 313 |
-
if (trim($checkboxOption) != '')
|
| 314 |
-
update_user_meta( $current_user->id,
|
| 315 |
-
else
|
| 316 |
-
array_push($extraFieldsErrorHolder, $value['id']);
|
| 317 |
-
}else
|
| 318 |
-
update_user_meta( $current_user->id,
|
| 319 |
-
}else
|
| 320 |
-
update_user_meta( $current_user->id,
|
| 321 |
-
|
| 322 |
-
break;
|
| 323 |
-
}
|
| 324 |
-
case "radio":{
|
| 325 |
-
if (isset($value['item_required'])){
|
| 326 |
-
if ($value['item_required'] == 'yes'){
|
| 327 |
-
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 328 |
-
update_user_meta( $current_user->id,
|
| 329 |
-
else
|
| 330 |
-
array_push($extraFieldsErrorHolder, $value['id']);
|
| 331 |
-
}else
|
| 332 |
-
update_user_meta( $current_user->id,
|
| 333 |
-
}else
|
| 334 |
-
update_user_meta( $current_user->id,
|
| 335 |
-
break;
|
| 336 |
-
}
|
| 337 |
-
case "select":{
|
| 338 |
-
if (isset($value['item_required'])){
|
| 339 |
-
if ($value['item_required'] == 'yes'){
|
| 340 |
-
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 341 |
-
update_user_meta( $current_user->id,
|
| 342 |
-
else
|
| 343 |
-
array_push($extraFieldsErrorHolder, $value['id']);
|
| 344 |
-
}else
|
| 345 |
-
update_user_meta( $current_user->id,
|
| 346 |
-
}else
|
| 347 |
-
update_user_meta( $current_user->id,
|
| 348 |
-
break;
|
| 349 |
-
}
|
| 350 |
-
case "countrySelect":{
|
| 351 |
-
if (isset($value['item_required'])){
|
| 352 |
-
if ($value['item_required'] == 'yes'){
|
| 353 |
-
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 354 |
-
update_user_meta( $current_user->id,
|
| 355 |
-
else
|
| 356 |
-
array_push($extraFieldsErrorHolder, $value['id']);
|
| 357 |
-
}else
|
| 358 |
-
update_user_meta( $current_user->id,
|
| 359 |
-
}else
|
| 360 |
-
update_user_meta( $current_user->id,
|
| 361 |
-
|
| 362 |
-
break;
|
| 363 |
-
}
|
| 364 |
-
case "timeZone":{
|
| 365 |
-
if (isset($value['item_required'])){
|
| 366 |
-
if ($value['item_required'] == 'yes'){
|
| 367 |
-
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 368 |
-
update_user_meta( $current_user->id,
|
| 369 |
-
else
|
| 370 |
-
array_push($extraFieldsErrorHolder, $value['id']);
|
| 371 |
-
}else
|
| 372 |
-
update_user_meta( $current_user->id,
|
| 373 |
-
}else
|
| 374 |
-
update_user_meta( $current_user->id,
|
| 375 |
-
|
| 376 |
-
break;
|
| 377 |
-
}
|
| 378 |
-
case "datepicker":{
|
| 379 |
-
if (isset($value['item_required'])){
|
| 380 |
-
if ($value['item_required'] == 'yes'){
|
| 381 |
-
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 382 |
-
update_user_meta( $current_user->id,
|
| 383 |
-
else
|
| 384 |
-
array_push($extraFieldsErrorHolder, $value['id']);
|
| 385 |
-
}else
|
| 386 |
-
update_user_meta( $current_user->id,
|
| 387 |
-
}else
|
| 388 |
-
update_user_meta( $current_user->id,
|
| 389 |
-
|
| 390 |
-
break;
|
| 391 |
-
}
|
| 392 |
-
case "textarea":{
|
| 393 |
-
if (isset($value['item_required'])){
|
| 394 |
-
if ($value['item_required'] == 'yes'){
|
| 395 |
-
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 396 |
-
update_user_meta( $current_user->id,
|
| 397 |
-
else
|
| 398 |
-
array_push($extraFieldsErrorHolder, $value['id']);
|
| 399 |
-
}else
|
| 400 |
-
update_user_meta( $current_user->id,
|
| 401 |
-
}else
|
| 402 |
-
update_user_meta( $current_user->id,
|
| 403 |
-
|
| 404 |
-
break;
|
| 405 |
-
}
|
| 406 |
-
case "upload":{
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
$
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
$
|
| 457 |
-
|
| 458 |
-
$
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
$
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
$
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
$
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
$
|
| 698 |
-
<p class="
|
| 699 |
-
<label for="
|
| 700 |
-
<input class="text-input" name="
|
| 701 |
-
</p><!-- .first_name -->';
|
| 702 |
-
$
|
| 703 |
-
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
|
| 707 |
-
$
|
| 708 |
-
$
|
| 709 |
-
|
| 710 |
-
$
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
$
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
<
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
$
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
|
| 742 |
-
|
| 743 |
-
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
|
| 770 |
-
|
| 771 |
-
|
| 772 |
-
|
| 773 |
-
$
|
| 774 |
-
|
| 775 |
-
|
| 776 |
-
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
|
| 786 |
-
|
| 787 |
-
|
| 788 |
-
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
|
| 794 |
-
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
|
| 801 |
-
|
| 802 |
-
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
-
|
| 808 |
-
|
| 809 |
-
|
| 810 |
-
|
| 811 |
-
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
|
| 815 |
-
|
| 816 |
-
|
| 817 |
-
$
|
| 818 |
-
$
|
| 819 |
-
|
| 820 |
-
$
|
| 821 |
-
|
| 822 |
-
|
| 823 |
-
|
| 824 |
-
|
| 825 |
-
|
| 826 |
-
|
| 827 |
-
|
| 828 |
-
|
| 829 |
-
<
|
| 830 |
-
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
|
| 836 |
-
|
| 837 |
-
$
|
| 838 |
-
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
$
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
<
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
}
|
| 853 |
-
|
| 854 |
-
if ($wppb_defaultOptions['
|
| 855 |
-
$errorVar = '';
|
| 856 |
-
$errorMark = '';
|
| 857 |
-
if ($wppb_defaultOptions['
|
| 858 |
-
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 859 |
-
if ((trim($_POST['
|
| 860 |
-
$errorMark = '<img src="'.
|
| 861 |
-
$errorVar = ' errorHolder';
|
| 862 |
-
}
|
| 863 |
-
}
|
| 864 |
-
$
|
| 865 |
-
<p class="form-
|
| 866 |
-
<label for="
|
| 867 |
-
<input class="text-input" name="
|
| 868 |
-
</p><!-- .form-
|
| 869 |
-
$
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
$
|
| 875 |
-
$
|
| 876 |
-
|
| 877 |
-
$
|
| 878 |
-
|
| 879 |
-
$
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
<
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
-
|
| 891 |
-
|
| 892 |
-
|
| 893 |
-
|
| 894 |
-
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
<
|
| 925 |
-
|
| 926 |
-
|
| 927 |
-
|
| 928 |
-
|
| 929 |
-
|
| 930 |
-
|
| 931 |
-
|
| 932 |
-
|
| 933 |
-
|
| 934 |
-
|
| 935 |
-
|
| 936 |
-
|
| 937 |
-
|
| 938 |
-
|
| 939 |
-
|
| 940 |
-
|
| 941 |
-
|
| 942 |
-
|
| 943 |
-
|
| 944 |
-
|
| 945 |
-
|
| 946 |
-
|
| 947 |
-
|
| 948 |
-
|
| 949 |
-
|
| 950 |
-
|
| 951 |
-
|
| 952 |
-
|
| 953 |
-
|
| 954 |
-
|
| 955 |
-
|
| 956 |
-
|
| 957 |
-
|
| 958 |
-
|
| 959 |
-
|
| 960 |
-
|
| 961 |
-
|
| 962 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 963 |
?>
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
wp_update_user only attempts to clear and reset cookies if it's updating the password.
|
| 4 |
+
The php function setcookie(), used in both the cookie-clearing and cookie-resetting functions,
|
| 5 |
+
adds to the page headers and therefore must be called within the first php tag on the page, and
|
| 6 |
+
before the WordPress get_header() function. Since wp_update_user needs this, it must be at the
|
| 7 |
+
beginning of the page as well.
|
| 8 |
+
*/
|
| 9 |
+
$changesSaved = 'no';
|
| 10 |
+
$changesSavedNoMatchingPass = 'no';
|
| 11 |
+
$changesSavedNoPass = 'no';
|
| 12 |
+
|
| 13 |
+
function wppb_save_the_password(){
|
| 14 |
+
global $changesSaved;
|
| 15 |
+
global $changesSavedNoMatchingPass;
|
| 16 |
+
global $changesSavedNoPass;
|
| 17 |
+
|
| 18 |
+
/* Load registration file. */
|
| 19 |
+
require_once(ABSPATH . WPINC . '/registration.php');
|
| 20 |
+
/* Get user info. */
|
| 21 |
+
global $current_user;
|
| 22 |
+
|
| 23 |
+
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
|
| 24 |
+
/* Update user password. */
|
| 25 |
+
if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ){
|
| 26 |
+
if ( $_POST['pass1'] == $_POST['pass2'] ){
|
| 27 |
+
wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
|
| 28 |
+
$changesSaved = 'yes';
|
| 29 |
+
} else {
|
| 30 |
+
$changesSavedNoMatchingPass = 'yes';
|
| 31 |
+
}
|
| 32 |
+
}elseif (( empty($_POST['pass1'] ) && !empty( $_POST['pass2'] )) || ( !empty($_POST['pass1'] ) && empty( $_POST['pass2'] )) ) {
|
| 33 |
+
$changesSavedNoPass = 'yes';
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
add_action('init', 'wppb_save_the_password');
|
| 38 |
+
|
| 39 |
+
function wppb_front_end_profile_info() {
|
| 40 |
+
|
| 41 |
+
global $changesSaved;
|
| 42 |
+
global $changesSavedNoMatchingPass;
|
| 43 |
+
global $changesSavedNoPass;
|
| 44 |
+
$editProfileFilterArray = array();
|
| 45 |
+
$editProfileFilterArray2 = array();
|
| 46 |
+
$extraFieldsErrorHolder = array(); //we will use this array to store the ID's of the extra-fields left uncompleted
|
| 47 |
+
|
| 48 |
+
global $wppb_shortcode_on_front;
|
| 49 |
+
|
| 50 |
+
$wppb_shortcode_on_front = true;
|
| 51 |
+
ob_start();
|
| 52 |
+
get_currentuserinfo();
|
| 53 |
+
$wppb_defaultOptions = get_option('wppb_default_settings');
|
| 54 |
+
$changesSavedNoEmail = 'no';
|
| 55 |
+
$changesSavedNoEmailExist = 'no';
|
| 56 |
+
$previousError = 'no';
|
| 57 |
+
$pictureUpload = 'no';
|
| 58 |
+
$avatarUpload = 'yes';
|
| 59 |
+
$allRequiredCompleted = 'yes';
|
| 60 |
+
$uploadName = array();
|
| 61 |
+
$uploadExt = array();
|
| 62 |
+
$uploadSize = array();
|
| 63 |
+
$editFilterArray = array();
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
/* Load registration file. */
|
| 67 |
+
require_once(ABSPATH . WPINC . '/registration.php');
|
| 68 |
+
/* Get user info. */
|
| 69 |
+
global $current_user;
|
| 70 |
+
|
| 71 |
+
/* delete the attachment if set */
|
| 72 |
+
if (isset($_GET['userID']) && isset($_GET['field'])){
|
| 73 |
+
update_user_meta( $_GET['userID'], $_GET['field'], '');
|
| 74 |
+
}
|
| 75 |
+
/* delete the avatar */
|
| 76 |
+
if (isset($_GET['userID']) && isset($_GET['fieldOriginal']) && isset($_GET['fieldResized'])){
|
| 77 |
+
update_user_meta( $_GET['userID'], $_GET['fieldOriginal'], '');
|
| 78 |
+
update_user_meta( $_GET['userID'], $_GET['fieldResized'], '');
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
//fallback if the file was largen then post_max_size, case in which no errors can be saved in $_FILES[fileName]['error']
|
| 82 |
+
if (empty($_FILES) && empty($_POST) && isset($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
|
| 83 |
+
$editProfileFilterArray['noPost'] = '
|
| 84 |
+
<p class="error">'.
|
| 85 |
+
__('The information size you were trying to submit was larger than', 'profilebuilder') .' '. WPPB_SERVER_MAX_UPLOAD_SIZE_MEGA .'b!<br/>'.
|
| 86 |
+
__('This is usually caused by a large file(s) trying to be uploaded.', 'profilebuilder') .'<br/>'.
|
| 87 |
+
__('Since it was also larger than', 'profilebuilder') .' '. WPPB_SERVER_MAX_POST_SIZE_MEGA .'b '. __('no additional information is available.', 'profilebuilder') .'<br/>
|
| 88 |
+
</p>';
|
| 89 |
+
$editProfileFilterArray['noPost'] = apply_filters('wppb_edit_profile_no_post_error', $editProfileFilterArray['noPost']);
|
| 90 |
+
echo $editProfileFilterArray['noPost'];
|
| 91 |
+
}
|
| 92 |
+
// a way to catch the user before updating his/her profile without completing a required field
|
| 93 |
+
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
|
| 94 |
+
//variable to control whether the user submitted data or not
|
| 95 |
+
|
| 96 |
+
$allRequiredCompleted = apply_filters('wppb_edit_profile_all_required_completed', $allRequiredCompleted);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
/* If profile was saved, update profile. */
|
| 100 |
+
if ( ('POST' == $_SERVER['REQUEST_METHOD']) && (!empty( $_POST['action'] )) && ($_POST['action'] == 'update-user') && (wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user')) && ($allRequiredCompleted == 'yes') ) {
|
| 101 |
+
|
| 102 |
+
$_POST['email'] = apply_filters('wppb_edit_profile_posted_email', $_POST['email']);
|
| 103 |
+
if ($wppb_defaultOptions['emailRequired'] == 'yes'){
|
| 104 |
+
if ((trim($_POST['email']) != '') && isset($_POST['email'])){
|
| 105 |
+
if (email_exists( $_POST['email'] ) != FALSE)
|
| 106 |
+
$thisEmail = email_exists( $_POST['email'] );
|
| 107 |
+
else $thisEmail = $current_user->id;
|
| 108 |
+
|
| 109 |
+
if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
|
| 110 |
+
if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
|
| 111 |
+
wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
|
| 112 |
+
$changesSaved = 'yes';
|
| 113 |
+
}else{
|
| 114 |
+
$changesSavedNoEmailExist = 'yes';
|
| 115 |
+
}
|
| 116 |
+
}else{
|
| 117 |
+
$changesSavedNoEmail = 'yes';
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
}else{
|
| 121 |
+
if (email_exists( $_POST['email'] ) != FALSE)
|
| 122 |
+
$thisEmail = email_exists( $_POST['email'] );
|
| 123 |
+
else $thisEmail = $current_user->id;
|
| 124 |
+
|
| 125 |
+
if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
|
| 126 |
+
if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
|
| 127 |
+
wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
|
| 128 |
+
$changesSaved = 'yes';
|
| 129 |
+
}else{
|
| 130 |
+
$changesSavedNoEmailExist = 'yes';
|
| 131 |
+
}
|
| 132 |
+
}else{
|
| 133 |
+
$changesSavedNoEmail = 'yes';
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
/* Update user information. */
|
| 139 |
+
if ($wppb_defaultOptions['firstname'] == 'show'){
|
| 140 |
+
$_POST['first_name'] = apply_filters('wppb_edit_profile_posted_first_name', $_POST['first_name']);
|
| 141 |
+
if ($wppb_defaultOptions['firstnameRequired'] == 'yes'){
|
| 142 |
+
if ((trim($_POST['first_name']) != '') && isset($_POST['first_name'])){
|
| 143 |
+
wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
|
| 144 |
+
$changesSaved = 'yes';
|
| 145 |
+
}
|
| 146 |
+
}else{
|
| 147 |
+
wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
|
| 148 |
+
$changesSaved = 'yes';
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
if ($wppb_defaultOptions['lastname'] == 'show'){
|
| 153 |
+
$_POST['last_name'] = apply_filters('wppb_edit_profile_posted_last_name', $_POST['last_name']);
|
| 154 |
+
if ($wppb_defaultOptions['lastnameRequired'] == 'yes'){
|
| 155 |
+
if ((trim($_POST['last_name']) != '') && isset($_POST['last_name'])){
|
| 156 |
+
wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
|
| 157 |
+
$changesSaved = 'yes';
|
| 158 |
+
}
|
| 159 |
+
}else{
|
| 160 |
+
wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
|
| 161 |
+
$changesSaved = 'yes';
|
| 162 |
+
}
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
if ($wppb_defaultOptions['nickname'] == 'show'){
|
| 166 |
+
$_POST['nickname'] = apply_filters('wppb_edit_profile_posted_nickname', $_POST['nickname']);
|
| 167 |
+
if ($wppb_defaultOptions['nicknameRequired'] == 'yes'){
|
| 168 |
+
if ((trim($_POST['nickname']) != '') && isset($_POST['nickname'])){
|
| 169 |
+
wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
|
| 170 |
+
$changesSaved = 'yes';
|
| 171 |
+
}
|
| 172 |
+
}else{
|
| 173 |
+
wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
|
| 174 |
+
$changesSaved = 'yes';
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
if ($wppb_defaultOptions['dispname'] == 'show'){
|
| 180 |
+
$_POST['display_name'] = apply_filters('wppb_edit_profile_posted_display_name', $_POST['display_name']);
|
| 181 |
+
if ($wppb_defaultOptions['dispnameRequired'] == 'yes'){
|
| 182 |
+
if ((trim($_POST['display_name']) != '') && isset($_POST['display_name'])){
|
| 183 |
+
wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
|
| 184 |
+
$changesSaved = 'yes';
|
| 185 |
+
}
|
| 186 |
+
}else{
|
| 187 |
+
wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
|
| 188 |
+
$changesSaved = 'yes';
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
if ($wppb_defaultOptions['website'] == 'show'){
|
| 193 |
+
$_POST['website'] = apply_filters('wppb_edit_profile_posted_website', $_POST['website']);
|
| 194 |
+
if ($wppb_defaultOptions['websiteRequired'] == 'yes'){
|
| 195 |
+
if ((trim($_POST['website']) != '') && isset($_POST['website'])){
|
| 196 |
+
$wppbPos = strpos($_POST['website'], 'http://');
|
| 197 |
+
if($wppbPos !== FALSE){
|
| 198 |
+
wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
|
| 199 |
+
$changesSaved = 'yes';
|
| 200 |
+
}else{
|
| 201 |
+
wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
|
| 202 |
+
$changesSaved = 'yes';
|
| 203 |
+
}
|
| 204 |
+
}
|
| 205 |
+
}else{
|
| 206 |
+
$wppbPos = strpos($_POST['website'], 'http://');
|
| 207 |
+
$website = esc_attr( $_POST['website'] );
|
| 208 |
+
if($wppbPos !== FALSE){
|
| 209 |
+
if ($website == 'http://')
|
| 210 |
+
$website = '';
|
| 211 |
+
wp_update_user( array( 'ID' => $current_user->id, 'user_url' => $website));
|
| 212 |
+
$changesSaved = 'yes';
|
| 213 |
+
}else{
|
| 214 |
+
if ($website != '')
|
| 215 |
+
$website = 'http://'.$website;
|
| 216 |
+
wp_update_user( array( 'ID' => $current_user->id, 'user_url' => $website));
|
| 217 |
+
$changesSaved = 'yes';
|
| 218 |
+
}
|
| 219 |
+
}
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
if ($wppb_defaultOptions['aim'] == 'show'){
|
| 223 |
+
$_POST['aim'] = apply_filters('wppb_edit_profile_posted_aim', $_POST['aim']);
|
| 224 |
+
if ($wppb_defaultOptions['aimRequired'] == 'yes'){
|
| 225 |
+
if ((trim($_POST['aim']) != '') && isset($_POST['aim'])){
|
| 226 |
+
update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
|
| 227 |
+
$changesSaved = 'yes';
|
| 228 |
+
}
|
| 229 |
+
}else{
|
| 230 |
+
update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
|
| 231 |
+
$changesSaved = 'yes';
|
| 232 |
+
}
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
if ($wppb_defaultOptions['yahoo'] == 'show'){
|
| 236 |
+
$_POST['yim'] = apply_filters('wppb_edit_profile_posted_yahoo', $_POST['yim']);
|
| 237 |
+
if ($wppb_defaultOptions['yahooRequired'] == 'yes'){
|
| 238 |
+
if ((trim($_POST['yim']) != '') && isset($_POST['yim'])){
|
| 239 |
+
update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
|
| 240 |
+
$changesSaved = 'yes';
|
| 241 |
+
}
|
| 242 |
+
}else{
|
| 243 |
+
update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
|
| 244 |
+
$changesSaved = 'yes';
|
| 245 |
+
}
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
if ($wppb_defaultOptions['jabber'] == 'show'){
|
| 249 |
+
$_POST['jabber'] = apply_filters('wppb_edit_profile_posted_jabber', $_POST['jabber']);
|
| 250 |
+
if ($wppb_defaultOptions['jabberRequired'] == 'yes'){
|
| 251 |
+
if ((trim($_POST['jabber']) != '') && isset($_POST['jabber'])){
|
| 252 |
+
update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
|
| 253 |
+
$changesSaved = 'yes';
|
| 254 |
+
}
|
| 255 |
+
}else{
|
| 256 |
+
update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
|
| 257 |
+
$changesSaved = 'yes';
|
| 258 |
+
}
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
if ($wppb_defaultOptions['bio'] == 'show'){
|
| 262 |
+
$_POST['description'] = apply_filters('wppb_edit_profile_posted_bio', $_POST['description']);
|
| 263 |
+
if ($wppb_defaultOptions['bioRequired'] == 'yes'){
|
| 264 |
+
if ((trim($_POST['description']) != '') && isset($_POST['description'])){
|
| 265 |
+
update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
|
| 266 |
+
$changesSaved = 'yes';
|
| 267 |
+
}
|
| 268 |
+
}else{
|
| 269 |
+
update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
|
| 270 |
+
$changesSaved = 'yes';
|
| 271 |
+
}
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
/* update the extra profile information */
|
| 275 |
+
$wppb_premium = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 276 |
+
if (file_exists ( $wppb_premium.'extra.fields.php' )){
|
| 277 |
+
$wppbFetchArray = get_option('wppb_custom_fields');
|
| 278 |
+
foreach ( $wppbFetchArray as $key => $value){
|
| 279 |
+
switch ($value['item_type']) {
|
| 280 |
+
case "input":{
|
| 281 |
+
$_POST[$value['item_id'].$value['id']] = apply_filters('wppb_edit_profile_input_custom_field_'.$value['id'], $_POST[$value['item_id'].$value['id']]);
|
| 282 |
+
if (isset($value['item_required'])){
|
| 283 |
+
if ($value['item_required'] == 'yes'){
|
| 284 |
+
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 285 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 286 |
+
else
|
| 287 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 288 |
+
}else
|
| 289 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 290 |
+
}else
|
| 291 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 292 |
+
|
| 293 |
+
break;
|
| 294 |
+
}
|
| 295 |
+
case "hiddenInput":{
|
| 296 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 297 |
+
|
| 298 |
+
break;
|
| 299 |
+
}
|
| 300 |
+
case "checkbox":{
|
| 301 |
+
$checkboxOption = '';
|
| 302 |
+
$checkboxValue = explode(',', $value['item_options']);
|
| 303 |
+
foreach($checkboxValue as $thisValue){
|
| 304 |
+
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
| 305 |
+
if (isset($_POST[$thisValue.$value['id']])){
|
| 306 |
+
$localValue = str_replace('#@space@#', ' ', $_POST[$thisValue.$value['id']]);
|
| 307 |
+
$checkboxOption = $checkboxOption.$localValue.',';
|
| 308 |
+
}
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
if (isset($value['item_required'])){
|
| 312 |
+
if ($value['item_required'] == 'yes'){
|
| 313 |
+
if (trim($checkboxOption) != '')
|
| 314 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $checkboxOption ) );
|
| 315 |
+
else
|
| 316 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 317 |
+
}else
|
| 318 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $checkboxOption ) );
|
| 319 |
+
}else
|
| 320 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $checkboxOption ) );
|
| 321 |
+
|
| 322 |
+
break;
|
| 323 |
+
}
|
| 324 |
+
case "radio":{
|
| 325 |
+
if (isset($value['item_required'])){
|
| 326 |
+
if ($value['item_required'] == 'yes'){
|
| 327 |
+
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 328 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 329 |
+
else
|
| 330 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 331 |
+
}else
|
| 332 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 333 |
+
}else
|
| 334 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 335 |
+
break;
|
| 336 |
+
}
|
| 337 |
+
case "select":{
|
| 338 |
+
if (isset($value['item_required'])){
|
| 339 |
+
if ($value['item_required'] == 'yes'){
|
| 340 |
+
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 341 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 342 |
+
else
|
| 343 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 344 |
+
}else
|
| 345 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 346 |
+
}else
|
| 347 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 348 |
+
break;
|
| 349 |
+
}
|
| 350 |
+
case "countrySelect":{
|
| 351 |
+
if (isset($value['item_required'])){
|
| 352 |
+
if ($value['item_required'] == 'yes'){
|
| 353 |
+
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 354 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 355 |
+
else
|
| 356 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 357 |
+
}else
|
| 358 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 359 |
+
}else
|
| 360 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 361 |
+
|
| 362 |
+
break;
|
| 363 |
+
}
|
| 364 |
+
case "timeZone":{
|
| 365 |
+
if (isset($value['item_required'])){
|
| 366 |
+
if ($value['item_required'] == 'yes'){
|
| 367 |
+
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 368 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 369 |
+
else
|
| 370 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 371 |
+
}else
|
| 372 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 373 |
+
}else
|
| 374 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 375 |
+
|
| 376 |
+
break;
|
| 377 |
+
}
|
| 378 |
+
case "datepicker":{
|
| 379 |
+
if (isset($value['item_required'])){
|
| 380 |
+
if ($value['item_required'] == 'yes'){
|
| 381 |
+
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 382 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 383 |
+
else
|
| 384 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 385 |
+
}else
|
| 386 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 387 |
+
}else
|
| 388 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 389 |
+
|
| 390 |
+
break;
|
| 391 |
+
}
|
| 392 |
+
case "textarea":{
|
| 393 |
+
if (isset($value['item_required'])){
|
| 394 |
+
if ($value['item_required'] == 'yes'){
|
| 395 |
+
if (trim($_POST[$value['item_id'].$value['id']]) != '')
|
| 396 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 397 |
+
else
|
| 398 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 399 |
+
}else
|
| 400 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 401 |
+
}else
|
| 402 |
+
update_user_meta( $current_user->id, $value['item_metaName'], esc_attr( $_POST[$value['item_id'].$value['id']] ) );
|
| 403 |
+
|
| 404 |
+
break;
|
| 405 |
+
}
|
| 406 |
+
case "upload":{
|
| 407 |
+
$uploadedfile = $value['item_type'].$value['id'];
|
| 408 |
+
|
| 409 |
+
//get allowed file types
|
| 410 |
+
if (($value['item_options'] != NULL) || ($value['item_options'] != '')){
|
| 411 |
+
$allFiles = false;
|
| 412 |
+
$extensions = explode(',', $value['item_options']);
|
| 413 |
+
foreach($extensions as $key3 => $value3)
|
| 414 |
+
$extensions[$key3] = trim($value3);
|
| 415 |
+
}else
|
| 416 |
+
$allFiles = true;
|
| 417 |
+
//first we need to verify if we don't try to upload a 0b or 0 length file
|
| 418 |
+
if ( (basename( $_FILES[$uploadedfile]['name']) != '')){
|
| 419 |
+
//get this attachments extension
|
| 420 |
+
$thisFileExtStart = strrpos($_FILES[$uploadedfile]['name'], '.');
|
| 421 |
+
$thisFileExt = substr($_FILES[$uploadedfile]['name'], $thisFileExtStart);
|
| 422 |
+
|
| 423 |
+
if ($allFiles === false){
|
| 424 |
+
if (in_array($thisFileExt, $extensions)){
|
| 425 |
+
//second we need to verify if the uploaded file size is less then the set file size in php.ini
|
| 426 |
+
if (($_FILES[$uploadedfile]['size'] < WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE) && ($_FILES[$uploadedfile]['size'] !=0)){
|
| 427 |
+
//we need to prepare the basename of the file, so that ' becomes ` as ' gives an error
|
| 428 |
+
$fileName = basename( $_FILES[$uploadedfile]['name']);
|
| 429 |
+
$finalFileName = '';
|
| 430 |
+
|
| 431 |
+
for ($i=0; $i < strlen($fileName); $i++){
|
| 432 |
+
if ($fileName[$i] == "'")
|
| 433 |
+
$finalFileName .= '`';
|
| 434 |
+
else $finalFileName .= $fileName[$i];
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
//create the target path for uploading
|
| 438 |
+
$wpUploadPath = wp_upload_dir(); // Array of key => value pairs
|
| 439 |
+
$target_path = $wpUploadPath['basedir']."/profile_builder/attachments/";
|
| 440 |
+
$target_path = $target_path . 'userID_'.$current_user->id.'_attachment_'. $finalFileName;
|
| 441 |
+
|
| 442 |
+
if (move_uploaded_file($_FILES[$uploadedfile]['tmp_name'], $target_path)){
|
| 443 |
+
$upFile = $wpUploadPath['baseurl'].'/profile_builder/attachments/userID_'.$current_user->id.'_attachment_'. $finalFileName;
|
| 444 |
+
update_user_meta( $current_user->id, $value['item_metaName'], $upFile);
|
| 445 |
+
$pictureUpload = 'yes';
|
| 446 |
+
}else{
|
| 447 |
+
//insert the name of the file in an array so that in case an error comes up, we know which files we just uploaded
|
| 448 |
+
array_push($uploadName, basename( $_FILES[$uploadedfile]['name']));
|
| 449 |
+
}
|
| 450 |
+
}else{
|
| 451 |
+
//insert the name of the file in an array so that in case an error comes up, we know which files we just uploaded
|
| 452 |
+
array_push($uploadName, basename( $_FILES[$uploadedfile]['name']));
|
| 453 |
+
}
|
| 454 |
+
}else{
|
| 455 |
+
array_push($uploadExt, basename( $_FILES[$uploadedfile]['name']));
|
| 456 |
+
$allowedExtensions = '';
|
| 457 |
+
(int)$nrOfExt = count($extensions)-2;
|
| 458 |
+
foreach($extensions as $key4 => $value4){
|
| 459 |
+
$allowedExtensions .= $value4;
|
| 460 |
+
if ($key4 <= $nrOfExt)
|
| 461 |
+
$allowedExtensions .= ', ';
|
| 462 |
+
|
| 463 |
+
}
|
| 464 |
+
}
|
| 465 |
+
}else{
|
| 466 |
+
//second we need to verify if the uploaded file size is less then the set file size in php.ini
|
| 467 |
+
if (($_FILES[$uploadedfile]['size'] < WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE) && ($_FILES[$uploadedfile]['size'] !=0)){
|
| 468 |
+
//we need to prepare the basename of the file, so that ' becomes ` as ' gives an error
|
| 469 |
+
$fileName = basename( $_FILES[$uploadedfile]['name']);
|
| 470 |
+
$finalFileName = '';
|
| 471 |
+
|
| 472 |
+
for ($i=0; $i < strlen($fileName); $i++){
|
| 473 |
+
if ($fileName[$i] == "'")
|
| 474 |
+
$finalFileName .= '`';
|
| 475 |
+
else $finalFileName .= $fileName[$i];
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
//create the target path for uploading
|
| 479 |
+
$wpUploadPath = wp_upload_dir(); // Array of key => value pairs
|
| 480 |
+
$target_path = $wpUploadPath['basedir']."/profile_builder/attachments/";
|
| 481 |
+
$target_path = $target_path . 'userID_'.$current_user->id.'_attachment_'. $finalFileName;
|
| 482 |
+
|
| 483 |
+
if (move_uploaded_file($_FILES[$uploadedfile]['tmp_name'], $target_path)){
|
| 484 |
+
$upFile = $wpUploadPath['baseurl'].'/profile_builder/attachments/userID_'.$current_user->id.'_attachment_'. $finalFileName;
|
| 485 |
+
update_user_meta( $current_user->id, $value['item_metaName'], $upFile);
|
| 486 |
+
$pictureUpload = 'yes';
|
| 487 |
+
}else{
|
| 488 |
+
//insert the name of the file in an array so that in case an error comes up, we know which files we just uploaded
|
| 489 |
+
array_push($uploadName, basename( $_FILES[$uploadedfile]['name']));
|
| 490 |
+
}
|
| 491 |
+
}else{
|
| 492 |
+
//insert the name of the file in an array so that in case an error comes up, we know which files we just uploaded
|
| 493 |
+
array_push($uploadName, basename( $_FILES[$uploadedfile]['name']));
|
| 494 |
+
}
|
| 495 |
+
}
|
| 496 |
+
}
|
| 497 |
+
break;
|
| 498 |
+
}
|
| 499 |
+
case "avatar":{
|
| 500 |
+
$avatarUpload = 'no';
|
| 501 |
+
$uploadedfile = $value['item_type'].$value['id'];
|
| 502 |
+
$wpUploadPath = wp_upload_dir(); // Array of key => value pairs
|
| 503 |
+
$target_path_original = $wpUploadPath['basedir']."/profile_builder/avatars/";
|
| 504 |
+
$fileName = $_FILES[$uploadedfile]['name'];
|
| 505 |
+
$finalFileName = '';
|
| 506 |
+
|
| 507 |
+
for ($i=0; $i < strlen($fileName); $i++){
|
| 508 |
+
if ($fileName[$i] == "'")
|
| 509 |
+
$finalFileName .= '`';
|
| 510 |
+
elseif ($fileName[$i] == ' ')
|
| 511 |
+
$finalFileName .= '_';
|
| 512 |
+
else $finalFileName .= $fileName[$i];
|
| 513 |
+
}
|
| 514 |
+
|
| 515 |
+
$fileName = $finalFileName;
|
| 516 |
+
|
| 517 |
+
$target_path = $target_path_original . 'userID_'.$current_user->id.'_originalAvatar_'. $fileName;
|
| 518 |
+
|
| 519 |
+
/* when trying to upload file, be sure it's one of the accepted image file-types */
|
| 520 |
+
if ( (($_FILES[$uploadedfile]['type'] == 'image/jpeg') || ($_FILES[$uploadedfile]['type'] == 'image/jpg') || ($_FILES[$uploadedfile]['type'] == 'image/png') || ($_FILES[$uploadedfile]['type'] == 'image/bmp') || ($_FILES[$uploadedfile]['type'] == 'image/pjpeg') || ($_FILES[$uploadedfile]['type'] == 'image/x-png')) && (($_FILES[$uploadedfile]['size'] < WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE) && ($_FILES[$uploadedfile]['size'] !=0)) ){
|
| 521 |
+
$avatarUpload = 'yes';
|
| 522 |
+
$wp_filetype = wp_check_filetype(basename( $_FILES[$uploadedfile]['name']), null );
|
| 523 |
+
$attachment = array(
|
| 524 |
+
'post_mime_type' => $wp_filetype['type'],
|
| 525 |
+
'post_title' => $fileName,
|
| 526 |
+
'post_content' => '',
|
| 527 |
+
'post_status' => 'inherit'
|
| 528 |
+
);
|
| 529 |
+
|
| 530 |
+
|
| 531 |
+
$attach_id = wp_insert_attachment( $attachment, $target_path);
|
| 532 |
+
|
| 533 |
+
$upFile = image_downsize( $attach_id, 'thumbnail' );
|
| 534 |
+
$upFile = $upFile[0];
|
| 535 |
+
|
| 536 |
+
//if file upload succeded
|
| 537 |
+
if (move_uploaded_file($_FILES[$uploadedfile]['tmp_name'], $target_path)){
|
| 538 |
+
update_user_meta( $current_user->id, $value['item_metaName'], $upFile);
|
| 539 |
+
update_user_meta( $current_user->id, 'resized_avatar_'.$value['id'], '');
|
| 540 |
+
|
| 541 |
+
}else $avatarUpload = 'no';
|
| 542 |
+
}elseif ( (($_FILES[$uploadedfile]['size'] > WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE) || ($_FILES[$uploadedfile]['size'] == 0)) && ($fileName != '') )
|
| 543 |
+
$avatarUpload = 'no';
|
| 544 |
+
elseif ($fileName == '')
|
| 545 |
+
$avatarUpload = 'yes';
|
| 546 |
+
break;
|
| 547 |
+
}
|
| 548 |
+
}
|
| 549 |
+
}
|
| 550 |
+
}
|
| 551 |
+
|
| 552 |
+
}
|
| 553 |
+
|
| 554 |
+
?>
|
| 555 |
+
<div class="wppb_holder" id="wppb_modify">
|
| 556 |
+
<?php
|
| 557 |
+
if ( !is_user_logged_in() ) :
|
| 558 |
+
$editProfileFilterArray['notLoggedIn'] = '
|
| 559 |
+
<p class="warning">'. __('You must be logged in to edit your profile.', 'profilebuilder') .'</p><!-- .warning -->';
|
| 560 |
+
$editProfileFilterArray['notLoggedIn'] = apply_filters('wppb_edit_profile_user_not_logged_in', $editProfileFilterArray['notLoggedIn']);
|
| 561 |
+
echo $editProfileFilterArray['notLoggedIn'];
|
| 562 |
+
|
| 563 |
+
else :
|
| 564 |
+
{
|
| 565 |
+
/* messages for the the delete avatar/attachment */
|
| 566 |
+
if (isset($_GET['fileType'])){
|
| 567 |
+
if ($_GET['fileType'] == 'avatar'){
|
| 568 |
+
$editProfileFilterArray['avatarChangesSaved'] = '
|
| 569 |
+
<p class="changes-saved">'. __('The avatar was successfully deleted.', 'profilebuilder') .'</p><!-- .changes-saved -->';
|
| 570 |
+
$editProfileFilterArray['avatarChangesSaved'] = apply_filters('wppb_edit_profile_avatar_changes_saved', $editProfileFilterArray['avatarChangesSaved']);
|
| 571 |
+
echo $editProfileFilterArray['avatarChangesSaved'];
|
| 572 |
+
unset($_GET['fileType']);
|
| 573 |
+
}elseif ($_GET['fileType'] == 'attachment'){
|
| 574 |
+
$editProfileFilterArray['attachmentChangesSaved'] = '
|
| 575 |
+
<p class="changes-saved">'.
|
| 576 |
+
__('The attachment', 'profilebuilder') .' "'. $_GET['fileName'] .'" '. __('was successfully deleted.', 'profilebuilder') .'
|
| 577 |
+
</p><!-- .changes-saved -->';
|
| 578 |
+
$editProfileFilterArray['attachmentChangesSaved'] = apply_filters('wppb_edit_profile_attachment_changes_saved', $editProfileFilterArray['attachmentChangesSaved']);
|
| 579 |
+
echo $editProfileFilterArray['attachmentChangesSaved'];
|
| 580 |
+
unset($_GET['fileType']);
|
| 581 |
+
unset($_GET['fileName']);
|
| 582 |
+
}
|
| 583 |
+
}
|
| 584 |
+
|
| 585 |
+
/* all the other messages/errors */
|
| 586 |
+
$nrOfBadUploads = 0;
|
| 587 |
+
$nrOfBadUploads = count($uploadName);
|
| 588 |
+
$nrOfBadExtUploads = count($uploadExt);
|
| 589 |
+
if (($changesSaved == 'yes') && ($changesSavedNoMatchingPass == 'no') && ($changesSavedNoPass == 'no') && ($changesSavedNoEmail == 'no') && ($changesSavedNoEmailExist == 'no') && ($avatarUpload == 'yes') && ($nrOfBadUploads == 0) && ($nrOfBadExtUploads == 0)){
|
| 590 |
+
$editProfileFilterArray['allChangesSaved'] = '
|
| 591 |
+
<p class="changes-saved">'. __('The changes have been successfully saved.', 'profilebuilder') .'</p><!-- .changes-saved -->';
|
| 592 |
+
$editProfileFilterArray['allChangesSaved'] = apply_filters('wppb_edit_profile_all_changes_saved', $editProfileFilterArray['allChangesSaved']);
|
| 593 |
+
echo $editProfileFilterArray['allChangesSaved'];
|
| 594 |
+
}
|
| 595 |
+
elseif (($changesSaved == 'yes') && ($changesSavedNoEmailExist == 'yes') && ($previousError == 'no')){
|
| 596 |
+
$editProfileFilterArray['allChangesSavedExceptExistingEmail'] = '
|
| 597 |
+
<p class="semi-saved"> '.
|
| 598 |
+
__('The email address you entered is already registered to a different user.', 'profilebuilder') .'<br/>'. __('The email address was', 'profilebuilder') .' <span class="error">'. __('NOT', 'profilebuilder') .'</span> '. __('updated along with the rest of the information.', 'profilebuilder') .'
|
| 599 |
+
</p>';
|
| 600 |
+
$editProfileFilterArray['allChangesSavedExceptExistingEmail'] = apply_filters('wppb_edit_profile_all_changes_saved_except_existing_email', $editProfileFilterArray['allChangesSavedExceptExistingEmail']);
|
| 601 |
+
echo $editProfileFilterArray['allChangesSavedExceptExistingEmail'];
|
| 602 |
+
$previousError = 'yes';
|
| 603 |
+
}
|
| 604 |
+
|
| 605 |
+
if (($changesSaved == 'yes') && ($changesSavedNoEmail == 'yes') && ($previousError == 'no')){
|
| 606 |
+
$editProfileFilterArray['allChangesSavedExceptInvalidEmail'] = '
|
| 607 |
+
<p class="semi-saved"> '.
|
| 608 |
+
__('The email address you entered is invalid.', 'profilebuilder') .'<br/>'. __('The email address was', 'profilebuilder') .' <span class="error">'. __('NOT', 'profilebuilder') .'</span> '. __('updated along with the rest of the information.', 'profilebuilder') .'
|
| 609 |
+
</p>';
|
| 610 |
+
$editProfileFilterArray['allChangesSavedExceptInvalidEmail'] = apply_filters('wppb_edit_profile_all_changes_saved_except_invalid_email', $editProfileFilterArray['allChangesSavedExceptInvalidEmail']);
|
| 611 |
+
echo $editProfileFilterArray['allChangesSavedExceptInvalidEmail'];
|
| 612 |
+
$previousError = 'yes';
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
if (($changesSaved == 'yes') && ($changesSavedNoMatchingPass == 'yes') && ($previousError == 'no')){
|
| 616 |
+
$editProfileFilterArray['allChangesSavedMismatchedPass'] = '
|
| 617 |
+
<p class="semi-saved">';
|
| 618 |
+
__('The passwords you entered do not match.', 'profilebuilder') .'<br/>'. __('The password was', 'profilebuilder') .' <span class="error">'. __('NOT', 'profilebuilder') .'</span> '. __('updated along with the rest of the information.', 'profilebuilder') .'
|
| 619 |
+
</p>';
|
| 620 |
+
$editProfileFilterArray['allChangesSavedMismatchedPass'] = apply_filters('wppb_edit_profile_all_changes_saved_except_mismatch_password', $editProfileFilterArray['allChangesSavedMismatchedPass']);
|
| 621 |
+
echo $editProfileFilterArray['allChangesSavedMismatchedPass'];
|
| 622 |
+
$previousError = 'yes';
|
| 623 |
+
}
|
| 624 |
+
if (($changesSaved == 'yes') && ($changesSavedNoPass == 'yes') && ($previousError == 'no')){
|
| 625 |
+
$editProfileFilterArray['allChangesSavedUncompletedPass'] = '
|
| 626 |
+
<p class="semi-saved">'.
|
| 627 |
+
__('You didn\'t complete both password fields.', 'profilebuilder') .'<br/>'. __('The password was', 'profilebuilder') .' <span class="error">'. __('NOT', 'profilebuilder') .'</span> '. __('updated along with the rest of the information.', 'profilebuilder') .'
|
| 628 |
+
</p>';
|
| 629 |
+
$editProfileFilterArray['allChangesSavedUncompletedPass'] = apply_filters('wppb_edit_profile_all_changes_saved_except_uncompleted_password', $editProfileFilterArray['allChangesSavedUncompletedPass']);
|
| 630 |
+
echo $editProfileFilterArray['allChangesSavedUncompletedPass'];
|
| 631 |
+
$previousError = 'yes';
|
| 632 |
+
}
|
| 633 |
+
if ($allRequiredCompleted == 'no'){
|
| 634 |
+
$editProfileFilterArray['errorSavingChanges'] = '<p class="error">'.$errorMessage.'<br/>'. __('Your profile was NOT updated!', 'profilebuilder').'</p><!-- .error -->';
|
| 635 |
+
$editProfileFilterArray['errorSavingChanges'] = apply_filters('wppb_edit_profile_error_saving_changes', $editProfileFilterArray['errorSavingChanges']);
|
| 636 |
+
echo $editProfileFilterArray['errorSavingChanges'];
|
| 637 |
+
}
|
| 638 |
+
$wppb_premium = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 639 |
+
if (file_exists ( $wppb_premium.'extra.fields.php' )){
|
| 640 |
+
if (($changesSaved == 'yes') && ($nrOfBadUploads > 0) && ($previousError == 'no')){
|
| 641 |
+
$lastOne = 0;
|
| 642 |
+
$editProfileFilterArray['errorUploadingAttachments'] = '
|
| 643 |
+
<p class="semi-saved">'. __('There was an error while trying to upload the following attachments:', 'profilebuilder') .'<br/>
|
| 644 |
+
<span class="error">';
|
| 645 |
+
foreach ($uploadName as $key => $name){
|
| 646 |
+
$lastOne++;
|
| 647 |
+
$editProfileFilterArray['errorUploadingAttachments'] .= $name;
|
| 648 |
+
if ($nrOfBadUploads-$lastOne > 0)
|
| 649 |
+
$editProfileFilterArray['errorUploadingAttachments'] .= ';<span style="padding-left:10px"></span>';
|
| 650 |
+
}
|
| 651 |
+
$editProfileFilterArray['errorUploadingAttachments'] .= '
|
| 652 |
+
</span><br/>'.
|
| 653 |
+
__('Possible cause: the size was bigger than', 'profilebuilder') .' '.WPPB_SERVER_MAX_UPLOAD_SIZE_MEGA.'b.<br/>'. __('The listed attachements were', 'profilebuilder') .' <span class="error">'. __('NOT', 'profilebuilder') .'</span> '. __('updated along with the rest of the information.', 'profilebuilder') .'
|
| 654 |
+
</p>';
|
| 655 |
+
$editProfileFilterArray['errorUploadingAttachments'] = apply_filters('wppb_edit_profile_error_uploading_attachments', $editProfileFilterArray['errorUploadingAttachments']);
|
| 656 |
+
echo $editProfileFilterArray['errorUploadingAttachments'];
|
| 657 |
+
$previousError = 'yes';
|
| 658 |
+
}if (($changesSaved == 'yes') && ($avatarUpload == 'no') && ($previousError == 'no')){
|
| 659 |
+
$editProfileFilterArray['errorUploadingAvatar'] = '
|
| 660 |
+
<p class="semi-saved">'.
|
| 661 |
+
__('There was an error while trying to upload your avatar picture.', 'profilebuilder') .'<br/>'. __('Possible cause: size/incorrect file-type.', 'profilebuilder') .'<br/>'. __('The avatar was', 'profilebuilder') .' <span class="error">'. __('NOT', 'profilebuilder') .'</span> '. __('updated along with the rest of the information.', 'profilebuilder') .'
|
| 662 |
+
</p>';
|
| 663 |
+
$editProfileFilterArray['errorUploadingAvatar'] = apply_filters('wppb_edit_profile_error_uploading_avatar', $editProfileFilterArray['errorUploadingAvatar']);
|
| 664 |
+
echo $editProfileFilterArray['errorUploadingAvatar'];
|
| 665 |
+
$previousError = 'yes';
|
| 666 |
+
}if (($changesSaved == 'yes') && ($nrOfBadExtUploads != 0) && ($previousError == 'no')){
|
| 667 |
+
$editProfileFilterArray['errorUploadingAttachmentExts'] = '
|
| 668 |
+
<p class="semi-saved">'.
|
| 669 |
+
__('There was an error while trying to upload the following attachment(s)', 'profilebuilder') .': <span class="error">';
|
| 670 |
+
foreach ($uploadExt as $key5 => $name5){
|
| 671 |
+
$lastOne++;
|
| 672 |
+
$editProfileFilterArray['errorUploadingAttachmentExts'] .= $name5;
|
| 673 |
+
if ($nrOfBadExtUploads-$lastOne > 0)
|
| 674 |
+
$editProfileFilterArray['errorUploadingAttachmentExts'] .= ';<span style="padding-left:10px"></span>';
|
| 675 |
+
}
|
| 676 |
+
$editProfileFilterArray['errorUploadingAttachmentExts'] .= '</span><br/>'. __('Only files with the following extension(s) can be uploaded:', 'profilebuilder') .' <span class="error">'.$allowedExtensions.'</span><br/>'. __('This file was', 'profilebuilder') .' <span class="error">'. __('NOT', 'profilebuilder') .'</span> '. __('updated along with the rest of the information.', 'profilebuilder') .'
|
| 677 |
+
</p>';
|
| 678 |
+
$editProfileFilterArray['errorUploadingAttachmentExts'] = apply_filters('wppb_edit_profile_error_uploading_attachment', $editProfileFilterArray['errorUploadingAttachmentExts']);
|
| 679 |
+
echo $editProfileFilterArray['errorUploadingAttachmentExts'];
|
| 680 |
+
$previousError = 'yes';
|
| 681 |
+
}
|
| 682 |
+
}
|
| 683 |
+
}
|
| 684 |
+
|
| 685 |
+
/* use this action hook to add extra content before the edit profile form. */
|
| 686 |
+
do_action( 'wppb_before_edit_profile_fields' );
|
| 687 |
+
?>
|
| 688 |
+
|
| 689 |
+
<form enctype="multipart/form-data" method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
|
| 690 |
+
<?php
|
| 691 |
+
echo '<input type="hidden" name="MAX_FILE_SIZE" value="'.WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE.'" /><!-- set the MAX_FILE_SIZE to the server\'s current max upload size in bytes -->';
|
| 692 |
+
|
| 693 |
+
$editProfileFilterArray2['contentName1'] = '<p class="nameHeader"><strong>'. __('Name', 'profilebuilder') .'</strong></p>';
|
| 694 |
+
$editProfileFilterArray2['contentName1'] = apply_filters('wppb_edit_profile_content_name1', $editProfileFilterArray2['contentName1']);
|
| 695 |
+
|
| 696 |
+
if ($wppb_defaultOptions['username'] == 'show'){
|
| 697 |
+
$editProfileFilterArray2['contentName2'] = '
|
| 698 |
+
<p class="username">
|
| 699 |
+
<label for="user_login">'. __('Username', 'profilebuilder') .'</label>
|
| 700 |
+
<input class="text-input" name="user_login" type="text" id="user_login" value="'. get_the_author_meta( 'user_login', $current_user->id ) .'" disabled="disabled"/> <span class="wppb-description-delimiter"> '. __('Usernames cannot be changed.', 'profilebuilder') .'</span>
|
| 701 |
+
</p><!-- .first_name -->';
|
| 702 |
+
$editProfileFilterArray2['contentName2'] = apply_filters('wppb_edit_profile_content_name2', $editProfileFilterArray2['contentName2']);
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
if ($wppb_defaultOptions['firstname'] == 'show'){
|
| 706 |
+
$errorVar = '';
|
| 707 |
+
$errorMark = '';
|
| 708 |
+
if ($wppb_defaultOptions['firstnameRequired'] == 'yes'){
|
| 709 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 710 |
+
if (isset($_POST['first_name'])){
|
| 711 |
+
if (trim($_POST['first_name']) == ''){
|
| 712 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 713 |
+
$errorVar = ' errorHolder';
|
| 714 |
+
}
|
| 715 |
+
}
|
| 716 |
+
}
|
| 717 |
+
$editProfileFilterArray2['contentName3'] = '
|
| 718 |
+
<p class="first_name'.$errorVar.'">
|
| 719 |
+
<label for="first_name">'. __('First Name', 'profilebuilder') .$errorMark.'</label>
|
| 720 |
+
<input class="text-input" name="first_name" type="text" id="first_name" value="'. get_the_author_meta( 'first_name', $current_user->id ) .'" />
|
| 721 |
+
</p><!-- .first_name -->';
|
| 722 |
+
$editProfileFilterArray2['contentName3'] = apply_filters('wppb_edit_profile_content_name3', $editProfileFilterArray2['contentName3']);
|
| 723 |
+
}
|
| 724 |
+
|
| 725 |
+
if ($wppb_defaultOptions['lastname'] == 'show'){
|
| 726 |
+
$errorVar = '';
|
| 727 |
+
$errorMark = '';
|
| 728 |
+
if ($wppb_defaultOptions['lastnameRequired'] == 'yes'){
|
| 729 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 730 |
+
if (isset($_POST['last_name'])){
|
| 731 |
+
if (trim($_POST['last_name']) == ''){
|
| 732 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 733 |
+
$errorVar = ' errorHolder';
|
| 734 |
+
}
|
| 735 |
+
}
|
| 736 |
+
}
|
| 737 |
+
$editProfileFilterArray2['contentName4'] = '
|
| 738 |
+
<p class="last_name'.$errorVar.'">
|
| 739 |
+
<label for="last_name">'. __('Last Name', 'profilebuilder') .$errorMark.'</label>
|
| 740 |
+
<input class="text-input" name="last_name" type="text" id="last_name" value="'. get_the_author_meta( 'last_name', $current_user->id ) .'" />
|
| 741 |
+
</p><!-- .last_name -->';
|
| 742 |
+
$editProfileFilterArray2['contentName4'] = apply_filters('wppb_edit_profile_content_name4', $editProfileFilterArray2['contentName4']);
|
| 743 |
+
}
|
| 744 |
+
|
| 745 |
+
if ($wppb_defaultOptions['nickname'] == 'show'){
|
| 746 |
+
$errorVar = '';
|
| 747 |
+
$errorMark = '';
|
| 748 |
+
if ($wppb_defaultOptions['nicknameRequired'] == 'yes'){
|
| 749 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 750 |
+
if (isset($_POST['nickname'])){
|
| 751 |
+
if (trim($_POST['nickname']) == ''){
|
| 752 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 753 |
+
$errorVar = ' errorHolder';
|
| 754 |
+
}
|
| 755 |
+
}
|
| 756 |
+
}
|
| 757 |
+
$editProfileFilterArray2['contentName5'] = '
|
| 758 |
+
<p class="nickname'.$errorVar.'">
|
| 759 |
+
<label for="nickname">'. __('Nickname', 'profilebuilder') .$errorMark.'</label>
|
| 760 |
+
<input class="text-input" name="nickname" type="text" id="nickname" value="'. get_the_author_meta( 'nickname', $current_user->id ) .'" />
|
| 761 |
+
</p><!-- .nickname -->';
|
| 762 |
+
$editProfileFilterArray2['contentName5'] = apply_filters('wppb_edit_profile_content_name5', $editProfileFilterArray2['contentName5']);
|
| 763 |
+
}
|
| 764 |
+
|
| 765 |
+
if ($wppb_defaultOptions['dispname'] == 'show'){
|
| 766 |
+
$errorVar = '';
|
| 767 |
+
$errorMark = '';
|
| 768 |
+
if ($wppb_defaultOptions['dispnameRequired'] == 'yes'){
|
| 769 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 770 |
+
if (isset($_POST['display_name'])){
|
| 771 |
+
if (trim($_POST['display_name']) == ''){
|
| 772 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 773 |
+
$errorVar = ' errorHolder';
|
| 774 |
+
}
|
| 775 |
+
}
|
| 776 |
+
}
|
| 777 |
+
|
| 778 |
+
$editProfileFilterArray2['displayName'] = '
|
| 779 |
+
<p class="display_name'.$errorVar.'">
|
| 780 |
+
<label for="display_name">'. __('Display name publicly as', 'profilebuilder') .$errorMark.'</label>
|
| 781 |
+
<select name="display_name" id="display_name">';
|
| 782 |
+
$public_display = array();
|
| 783 |
+
$public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
|
| 784 |
+
$thisFirstName = get_the_author_meta('first_name', $current_user->id);
|
| 785 |
+
if ( !empty($thisFirstName))
|
| 786 |
+
$public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
|
| 787 |
+
$thisLastName = get_the_author_meta('last_name', $current_user->id);
|
| 788 |
+
if ( !empty($thisLastName))
|
| 789 |
+
$public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
|
| 790 |
+
$public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
|
| 791 |
+
if ( !empty($thisFirstName) && !empty($thisLastName) ) {
|
| 792 |
+
$public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
|
| 793 |
+
$public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
|
| 794 |
+
}
|
| 795 |
+
$thisDisplayName = get_the_author_meta('display_name', $current_user->id);
|
| 796 |
+
if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
|
| 797 |
+
$public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
|
| 798 |
+
$public_display = array_map( 'trim', $public_display );
|
| 799 |
+
foreach ( $public_display as $id => $item ) {
|
| 800 |
+
$editProfileFilterArray2['displayName'] .= '<option id="'.$id.'" value="'.$item.'"';
|
| 801 |
+
if ($thisDisplayName == $item)
|
| 802 |
+
$editProfileFilterArray2['displayName'] .= ' selected';
|
| 803 |
+
$editProfileFilterArray2['displayName'] .= '>'.$item.'</option>';
|
| 804 |
+
}
|
| 805 |
+
$editProfileFilterArray2['displayName'] .= '
|
| 806 |
+
</select>
|
| 807 |
+
</p><!-- .display_name -->';
|
| 808 |
+
|
| 809 |
+
$editProfileFilterArray2['displayName'] = apply_filters('wppb_edit_profile_display_name', $editProfileFilterArray2['displayName']);
|
| 810 |
+
}
|
| 811 |
+
|
| 812 |
+
$editProfileFilterArray2['contentInfo1'] = '<p class="contactInfoHeader"><strong>'. __('Contact Info', 'profilebuilder') .'</strong></p>';
|
| 813 |
+
$editProfileFilterArray2['contentInfo1'] = apply_filters('wppb_edit_profile_content_info1', $editProfileFilterArray2['contentInfo1']);
|
| 814 |
+
|
| 815 |
+
if ($wppb_defaultOptions['email'] == 'show'){
|
| 816 |
+
$errorVar = '';
|
| 817 |
+
$errorMark = '';
|
| 818 |
+
if ($wppb_defaultOptions['emailRequired'] == 'yes'){
|
| 819 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 820 |
+
if (isset($_POST['email'])){
|
| 821 |
+
if (trim($_POST['email']) == ''){
|
| 822 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 823 |
+
$errorVar = ' errorHolder';
|
| 824 |
+
}
|
| 825 |
+
}
|
| 826 |
+
}
|
| 827 |
+
$editProfileFilterArray2['contentInfo2'] = '
|
| 828 |
+
<p class="form-email'.$errorVar.'">
|
| 829 |
+
<label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
|
| 830 |
+
<input class="text-input" name="email" type="text" id="email" value="'. get_the_author_meta( 'user_email', $current_user->id ) .'" />
|
| 831 |
+
<span class="wppb-description-delimiter">'. __('(required)', 'profilebuilder') .'</span>
|
| 832 |
+
</p><!-- .form-email -->';
|
| 833 |
+
$editProfileFilterArray2['contentInfo2'] = apply_filters('wppb_edit_profile_content_info2', $editProfileFilterArray2['contentInfo2']);
|
| 834 |
+
}
|
| 835 |
+
|
| 836 |
+
if ($wppb_defaultOptions['website'] == 'show'){
|
| 837 |
+
$errorVar = '';
|
| 838 |
+
$errorMark = '';
|
| 839 |
+
if ($wppb_defaultOptions['websiteRequired'] == 'yes'){
|
| 840 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 841 |
+
if ((trim($_POST['website']) == '') && isset($_POST['website'])){
|
| 842 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 843 |
+
$errorVar = ' errorHolder';
|
| 844 |
+
}
|
| 845 |
+
}
|
| 846 |
+
$editProfileFilterArray2['contentInfo3'] = '
|
| 847 |
+
<p class="form-website'.$errorVar.'">
|
| 848 |
+
<label for="website">'. __('Website', 'profilebuilder') .$errorMark.'</label>
|
| 849 |
+
<input class="text-input" name="website" type="text" id="website" value="'. get_the_author_meta( 'user_url', $current_user->id ) .'" />
|
| 850 |
+
</p><!-- .form-website -->';
|
| 851 |
+
$editProfileFilterArray2['contentInfo3'] = apply_filters('wppb_edit_profile_content_info3', $editProfileFilterArray2['contentInfo3']);
|
| 852 |
+
}
|
| 853 |
+
|
| 854 |
+
if ($wppb_defaultOptions['aim'] == 'show'){
|
| 855 |
+
$errorVar = '';
|
| 856 |
+
$errorMark = '';
|
| 857 |
+
if ($wppb_defaultOptions['aimRequired'] == 'yes'){
|
| 858 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 859 |
+
if ((trim($_POST['aim']) == '') && isset($_POST['aim'])){
|
| 860 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 861 |
+
$errorVar = ' errorHolder';
|
| 862 |
+
}
|
| 863 |
+
}
|
| 864 |
+
$editProfileFilterArray2['contentInfo4'] = '
|
| 865 |
+
<p class="form-aim'.$errorVar.'">
|
| 866 |
+
<label for="aim">'. __('AIM', 'profilebuilder') .'</label>
|
| 867 |
+
<input class="text-input" name="aim" type="text" id="aim" value="'. get_the_author_meta( 'aim', $current_user->id ) .'" />
|
| 868 |
+
</p><!-- .form-aim -->';
|
| 869 |
+
$editProfileFilterArray2['contentInfo4'] = apply_filters('wppb_edit_profile_content_info4', $editProfileFilterArray2['contentInfo4']);
|
| 870 |
+
}
|
| 871 |
+
|
| 872 |
+
if ($wppb_defaultOptions['yahoo'] == 'show'){
|
| 873 |
+
$errorVar = '';
|
| 874 |
+
$errorMark = '';
|
| 875 |
+
if ($wppb_defaultOptions['yahooRequired'] == 'yes'){
|
| 876 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 877 |
+
if ((trim($_POST['yim']) == '') && isset($_POST['yim'])){
|
| 878 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 879 |
+
$errorVar = ' errorHolder';
|
| 880 |
+
}
|
| 881 |
+
}
|
| 882 |
+
$editProfileFilterArray2['contentInfo5'] = '
|
| 883 |
+
<p class="form-yim'.$errorVar.'">
|
| 884 |
+
<label for="yim">'. __('Yahoo IM', 'profilebuilder') .$errorMark.'</label>
|
| 885 |
+
<input class="text-input" name="yim" type="text" id="yim" value="'. get_the_author_meta( 'yim', $current_user->id ) .'" />
|
| 886 |
+
</p><!-- .form-yim -->';
|
| 887 |
+
$editProfileFilterArray2['contentInfo5'] = apply_filters('wppb_edit_profile_content_info5', $editProfileFilterArray2['contentInfo5']);
|
| 888 |
+
}
|
| 889 |
+
|
| 890 |
+
if ($wppb_defaultOptions['jabber'] == 'show'){
|
| 891 |
+
$errorVar = '';
|
| 892 |
+
$errorMark = '';
|
| 893 |
+
if ($wppb_defaultOptions['jabberRequired'] == 'yes'){
|
| 894 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 895 |
+
if ((trim($_POST['jabber']) == '') && isset($_POST['jabber'])){
|
| 896 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 897 |
+
$errorVar = ' errorHolder';
|
| 898 |
+
}
|
| 899 |
+
}
|
| 900 |
+
$editProfileFilterArray2['contentInfo6'] = '
|
| 901 |
+
<p class="form-jabber'.$errorVar.'">
|
| 902 |
+
<label for="jabber">'. __('Jabber / Google Talk', 'profilebuilder') .$errorMark.'</label>
|
| 903 |
+
<input class="text-input" name="jabber" type="text" id="jabber" value="'. get_the_author_meta( 'jabber', $current_user->id ) .'" />
|
| 904 |
+
</p><!-- .form-jabber -->';
|
| 905 |
+
$editProfileFilterArray2['contentInfo6'] = apply_filters('wppb_edit_profile_content_info6', $editProfileFilterArray2['contentInfo6']);
|
| 906 |
+
}
|
| 907 |
+
|
| 908 |
+
$editProfileFilterArray2['aboutYourself1'] = '<p class="aboutYourselfHeader"><strong>'. __('About Yourself', 'profilebuilder') .'</strong></p>';
|
| 909 |
+
$editProfileFilterArray2['aboutYourself1'] = apply_filters('wppb_edit_profile_content_about_yourself1', $editProfileFilterArray2['aboutYourself1']);
|
| 910 |
+
|
| 911 |
+
if ($wppb_defaultOptions['bio'] == 'show'){
|
| 912 |
+
$errorVar = '';
|
| 913 |
+
$errorMark = '';
|
| 914 |
+
if ($wppb_defaultOptions['bioRequired'] == 'yes'){
|
| 915 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 916 |
+
if ((trim($_POST['description']) == '') && isset($_POST['description'])){
|
| 917 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field wasn\'t updated because you entered and empty string (It was marked as required by the administrator)."/>';
|
| 918 |
+
$errorVar = ' errorHolder';
|
| 919 |
+
}
|
| 920 |
+
}
|
| 921 |
+
$editProfileFilterArray2['aboutYourself2'] = '
|
| 922 |
+
<p class="form-description'.$errorVar.'">
|
| 923 |
+
<label for="description">'. __('Biographical Info', 'profilebuilder') .$errorMark.'</label>
|
| 924 |
+
<textarea class="text-input" name="description" id="description" rows="5" cols="30">'. get_the_author_meta( 'description', $current_user->id ) .'</textarea>
|
| 925 |
+
</p><!-- .form-description -->';
|
| 926 |
+
$editProfileFilterArray2['aboutYourself2'] = apply_filters('wppb_edit_profile_content_about_yourself2', $editProfileFilterArray2['aboutYourself2']);
|
| 927 |
+
}
|
| 928 |
+
|
| 929 |
+
if ($wppb_defaultOptions['password'] == 'show'){
|
| 930 |
+
|
| 931 |
+
$editProfileFilterArray2['aboutYourself3'] = '
|
| 932 |
+
<p class="form-password">
|
| 933 |
+
<label for="pass1">'. __('New Password', 'profilebuilder') .'</label>
|
| 934 |
+
<input class="text-input" name="pass1" type="password" id="pass1" />
|
| 935 |
+
</p><!-- .form-password -->
|
| 936 |
+
|
| 937 |
+
<p class="form-password'.$errorVar.'">
|
| 938 |
+
<label for="pass2">'. __('Repeat Password', 'profilebuilder') .$errorMark.'</label>
|
| 939 |
+
<input class="text-input" name="pass2" type="password" id="pass2" />
|
| 940 |
+
</p><!-- .form-password -->';
|
| 941 |
+
$editProfileFilterArray2['aboutYourself3'] = apply_filters('wppb_edit_profile_content_about_yourself3', $editProfileFilterArray2['aboutYourself3']);
|
| 942 |
+
}
|
| 943 |
+
|
| 944 |
+
|
| 945 |
+
$wppb_premium = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 946 |
+
if (file_exists ( $wppb_premium.'extra.fields.php' )){
|
| 947 |
+
require_once($wppb_premium.'extra.fields.php');
|
| 948 |
+
|
| 949 |
+
$page = 'edit_profile';
|
| 950 |
+
$returnedValue = wppb_extra_fields($current_user->id, $extraFieldsErrorHolder, $editProfileFilterArray2, $page, $error, $_POST);
|
| 951 |
+
|
| 952 |
+
//copy over extra fields to the rest of the fieldso on the edit profile
|
| 953 |
+
foreach($returnedValue as $key => $value)
|
| 954 |
+
$editProfileFilterArray2[$key] = $value;
|
| 955 |
+
}
|
| 956 |
+
|
| 957 |
+
/* additional filter, just in case it is needed */
|
| 958 |
+
$editProfileFilterArray2['extraEditProfileFilter'] = '';
|
| 959 |
+
$editProfileFilterArray2['extraEditProfileFilter'] = apply_filters('extraEditProfileFilter', $editProfileFilterArray2['extraEditProfileFilter']);
|
| 960 |
+
/* END additional filter, just in case it is needed */
|
| 961 |
+
|
| 962 |
+
|
| 963 |
+
$editProfileFilterArray2 = apply_filters('wppb_edit_profile', $editProfileFilterArray2);
|
| 964 |
+
foreach ($editProfileFilterArray2 as $key => $value)
|
| 965 |
+
echo $value;
|
| 966 |
+
?>
|
| 967 |
+
|
| 968 |
+
<p class="form-submit">
|
| 969 |
+
<input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
|
| 970 |
+
<?php// wp_nonce_field( 'update-user' ) ?>
|
| 971 |
+
<input name="action" type="hidden" id="action" value="update-user" />
|
| 972 |
+
</p><!-- .form-submit -->
|
| 973 |
+
<?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
|
| 974 |
+
</form><!-- #edituser -->
|
| 975 |
+
|
| 976 |
+
<?php endif; ?>
|
| 977 |
+
<?php /* use this action hook to add extra content after the edit profile form. */ ?>
|
| 978 |
+
<?php do_action( 'wppb_after_edit_profile_fields' ); ?>
|
| 979 |
+
|
| 980 |
+
</div>
|
| 981 |
+
|
| 982 |
+
<?php
|
| 983 |
+
|
| 984 |
+
$output = ob_get_contents();
|
| 985 |
+
ob_end_clean();
|
| 986 |
+
|
| 987 |
+
return $output;
|
| 988 |
+
}
|
| 989 |
?>
|
front-end/wppb.login.php
CHANGED
|
@@ -1,167 +1,172 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
if(!function_exists('wppb_curpageurl')){
|
| 3 |
-
function wppb_curpageurl() {
|
| 4 |
-
$pageURL = 'http';
|
| 5 |
-
if ((isset($_SERVER["HTTPS"])) && ($_SERVER["HTTPS"] == "on")) {
|
| 6 |
-
$pageURL .= "s";
|
| 7 |
-
}
|
| 8 |
-
$pageURL .= "://";
|
| 9 |
-
if ($_SERVER["SERVER_PORT"] != "80") {
|
| 10 |
-
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
| 11 |
-
} else {
|
| 12 |
-
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
| 13 |
-
}
|
| 14 |
-
return $pageURL;
|
| 15 |
-
}
|
| 16 |
-
}
|
| 17 |
-
|
| 18 |
-
/* wp_signon can only be executed before anything is outputed in the page because of that we're adding it to the init hook */
|
| 19 |
-
global $wppb_login;
|
| 20 |
-
$wppb_login = false;
|
| 21 |
-
|
| 22 |
-
function wppb_signon(){
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
if (isset($_POST['remember-me']))
|
| 28 |
-
$remember = $_POST['remember-me'];
|
| 29 |
-
else $remember = false;
|
| 30 |
-
$wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
|
| 31 |
-
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
$loginFilterArray['loginMessage1'] =
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
$loginFilterArray['loginMessage2'] =
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
<?php
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
<?php
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
<input type="
|
| 130 |
-
</p><!-- .form-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
}
|
| 1 |
+
<?php
|
| 2 |
+
if(!function_exists('wppb_curpageurl')){
|
| 3 |
+
function wppb_curpageurl() {
|
| 4 |
+
$pageURL = 'http';
|
| 5 |
+
if ((isset($_SERVER["HTTPS"])) && ($_SERVER["HTTPS"] == "on")) {
|
| 6 |
+
$pageURL .= "s";
|
| 7 |
+
}
|
| 8 |
+
$pageURL .= "://";
|
| 9 |
+
if ($_SERVER["SERVER_PORT"] != "80") {
|
| 10 |
+
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
| 11 |
+
} else {
|
| 12 |
+
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
| 13 |
+
}
|
| 14 |
+
return $pageURL;
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
/* wp_signon can only be executed before anything is outputed in the page because of that we're adding it to the init hook */
|
| 19 |
+
global $wppb_login;
|
| 20 |
+
$wppb_login = false;
|
| 21 |
+
|
| 22 |
+
function wppb_signon(){
|
| 23 |
+
global $error;
|
| 24 |
+
global $wppb_login;
|
| 25 |
+
|
| 26 |
+
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')){
|
| 27 |
+
if (isset($_POST['remember-me']))
|
| 28 |
+
$remember = $_POST['remember-me'];
|
| 29 |
+
else $remember = false;
|
| 30 |
+
$wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
|
| 31 |
+
|
| 32 |
+
}elseif (isset($_GET['userName']) && isset($_GET['passWord'])){
|
| 33 |
+
$remember = true;
|
| 34 |
+
$username = $_GET['userName'];
|
| 35 |
+
$password = base64_decode($_GET['passWord']);
|
| 36 |
+
$wppb_login = wp_signon( array( 'user_login' => $username, 'user_password' => $password, 'remember' => $remember ), false );
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
add_action('init', 'wppb_signon');
|
| 40 |
+
|
| 41 |
+
function wppb_front_end_login(){
|
| 42 |
+
$loginFilterArray = array();
|
| 43 |
+
ob_start();
|
| 44 |
+
global $wppb_login;
|
| 45 |
+
|
| 46 |
+
echo '<div class="wppb_holder" id="wppb_login">';
|
| 47 |
+
|
| 48 |
+
if ( is_user_logged_in() ) : // Already logged in
|
| 49 |
+
global $user_ID;
|
| 50 |
+
$wppb_user = get_userdata( $user_ID );
|
| 51 |
+
if($wppb_user->display_name == ''){
|
| 52 |
+
$wppb_user->display_name = $wppb_user->user_login;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
?>
|
| 56 |
+
<?php
|
| 57 |
+
$loginFilterArray['loginMessage1'] = '
|
| 58 |
+
<p class="alert">'.
|
| 59 |
+
__('You are currently logged in as', 'profilebuilder').' <a href="'.$authorPostsUrl = get_author_posts_url( $wppb_user->ID ).'" title="'.$wppb_user->display_name.'">'.$wppb_user->display_name.'</a>.
|
| 60 |
+
<a href="'.wp_logout_url( get_permalink() ).'" title="'. __('Log out of this account', 'profilebuilder').'">'. __('Log out', 'profilebuilder').' »</a>
|
| 61 |
+
</p><!-- .alert-->';
|
| 62 |
+
|
| 63 |
+
$loginFilterArray['loginMessage1'] = apply_filters('wppb_login_login_message1', $loginFilterArray['loginMessage1']);
|
| 64 |
+
echo $loginFilterArray['loginMessage1'];
|
| 65 |
+
?>
|
| 66 |
+
|
| 67 |
+
<?php elseif ( $wppb_login->ID ) : // Successful login ?>
|
| 68 |
+
<?php
|
| 69 |
+
if($wppb_login->display_name == ''){
|
| 70 |
+
$wppb_login->display_name = $wppb_login->user_login;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
?>
|
| 74 |
+
|
| 75 |
+
<?php
|
| 76 |
+
$loginFilterArray['loginMessage2'] = '
|
| 77 |
+
<p class="success">'.
|
| 78 |
+
__('You have successfully logged in as', 'profilebuilder').' <a href="'.$authorPostsUrl = get_author_posts_url( $wppb_login->ID ).'" title="'.$wppb_login->display_name.'">'.$wppb_login->display_name.'</a>.
|
| 79 |
+
</p><!-- .success-->';
|
| 80 |
+
|
| 81 |
+
$loginFilterArray['loginMessage2'] = apply_filters('wppb_login_login_message2', $loginFilterArray['loginMessage2']);
|
| 82 |
+
echo $loginFilterArray['loginMessage2'];
|
| 83 |
+
?>
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
<?php
|
| 87 |
+
$permaLnk2 = get_permalink();
|
| 88 |
+
$wppb_addons = WPPB_PLUGIN_DIR . '/premium/addon/';
|
| 89 |
+
if (file_exists ( $wppb_addons.'addon.php' )){
|
| 90 |
+
//check to see if the redirecting addon is present and activated
|
| 91 |
+
$wppb_premium_addon_settings = get_option('wppb_premium_addon_settings'); //fetch the descriptions array
|
| 92 |
+
if ($wppb_premium_addon_settings['customRedirect'] == 'show'){
|
| 93 |
+
//check to see if the redirect location is not an empty string and is activated
|
| 94 |
+
$customRedirectSettings = get_option('customRedirectSettings');
|
| 95 |
+
if ((trim($customRedirectSettings['afterLoginTarget']) != '') && ($customRedirectSettings['afterLogin'] == 'yes')){
|
| 96 |
+
$permaLnk2 = trim($customRedirectSettings['afterLoginTarget']);
|
| 97 |
+
$findHttp = strpos($permaLnk2, 'http');
|
| 98 |
+
if ($findHttp === false)
|
| 99 |
+
$permaLnk2 = 'http://'. $permaLnk2;
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
$loginFilterArray['redirectMessage'] = '
|
| 105 |
+
<font color="black">'. __('You will soon be redirected automatically. If you see this page for more than 1 second, please click', 'profilebuilder').' <a href="'.$permaLnk2.'">'. __('here', 'profilebuilder').'</a>.<meta http-equiv="Refresh" content="1;url='.$permaLnk2.'" /></font><br/><br/>';
|
| 106 |
+
$loginFilterArray['redirectMessage'] = apply_filters('wppb_login_redirect_message', $loginFilterArray['redirectMessage']);
|
| 107 |
+
echo $loginFilterArray['redirectMessage'];
|
| 108 |
+
?>
|
| 109 |
+
<?php else : // Not logged in ?>
|
| 110 |
+
|
| 111 |
+
<?php if (!empty( $_POST['action'] )): ?>
|
| 112 |
+
<p class="error">
|
| 113 |
+
<?php if ( trim($_POST['user-name']) == '') echo '<strong>'. __('ERROR:','profilebuilder').'</strong> '. __('The username field is empty', 'profilebuilder').'. '; ?>
|
| 114 |
+
<?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
|
| 115 |
+
</p><!-- .error -->
|
| 116 |
+
<?php endif; ?>
|
| 117 |
+
|
| 118 |
+
<?php /* use this action hook to add extra content before the login form. */ ?>
|
| 119 |
+
<?php do_action( 'wppb_before_login' ); ?>
|
| 120 |
+
|
| 121 |
+
<form action="<?php wppb_curpageurl(); ?>" method="post" class="sign-in">
|
| 122 |
+
<p class="login-form-username">
|
| 123 |
+
<label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
|
| 124 |
+
<?php
|
| 125 |
+
if (isset($_POST['user-name']))
|
| 126 |
+
$userName = esc_html( $_POST['user-name'] );
|
| 127 |
+
else $userName = '';
|
| 128 |
+
?>
|
| 129 |
+
<?php echo '<input type="text" name="user-name" id="user-name" class="text-input" value="'.$userName.'" />'; ?>
|
| 130 |
+
</p><!-- .form-username -->
|
| 131 |
+
|
| 132 |
+
<p class="login-form-password">
|
| 133 |
+
<label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
|
| 134 |
+
<input type="password" name="password" id="password" class="text-input" />
|
| 135 |
+
</p><!-- .form-password -->
|
| 136 |
+
<p class="login-form-submit">
|
| 137 |
+
<input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
|
| 138 |
+
<?php
|
| 139 |
+
$loginFilterArray['rememberMe'] = '
|
| 140 |
+
<input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
|
| 141 |
+
<label for="remember-me">'. __('Remember me', 'profilebuilder').'</label>';
|
| 142 |
+
$loginFilterArray['rememberMe'] = apply_filters('wppb_login_remember_me', $loginFilterArray['rememberMe']);
|
| 143 |
+
echo $loginFilterArray['rememberMe'];
|
| 144 |
+
?>
|
| 145 |
+
|
| 146 |
+
<input type="hidden" name="action" value="log-in" />
|
| 147 |
+
</p><!-- .form-submit -->
|
| 148 |
+
<?php
|
| 149 |
+
$loginFilterArray['loginURL'] = '
|
| 150 |
+
<p>
|
| 151 |
+
<a href="'.$siteURL=get_option('siteurl').'/wp-login.php?action=lostpassword">'. __('Lost password?', 'profilebuilder').'</a>
|
| 152 |
+
</p>';
|
| 153 |
+
$loginFilterArray['loginURL'] = apply_filters('wppb_login_url', $loginFilterArray['loginURL']);
|
| 154 |
+
echo $loginFilterArray['loginURL'];
|
| 155 |
+
?>
|
| 156 |
+
<?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
|
| 157 |
+
</form><!-- .sign-in -->
|
| 158 |
+
|
| 159 |
+
<?php endif;?>
|
| 160 |
+
|
| 161 |
+
<?php /* use this action hook to add extra content after the login form. */ ?>
|
| 162 |
+
<?php do_action( 'wppb_after_login' ); ?>
|
| 163 |
+
|
| 164 |
+
</div>
|
| 165 |
+
<?php
|
| 166 |
+
$output = ob_get_contents();
|
| 167 |
+
ob_end_clean();
|
| 168 |
+
|
| 169 |
+
$loginFilterArray = apply_filters('wppb_login', $loginFilterArray);
|
| 170 |
+
|
| 171 |
+
return $output;
|
| 172 |
}
|
front-end/wppb.register.php
CHANGED
|
@@ -1,935 +1,990 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
function wppb_front_end_register($atts){
|
| 4 |
-
ob_start();
|
| 5 |
-
$wppb_defaultOptions = get_option('wppb_default_settings');
|
| 6 |
-
global $current_user;
|
| 7 |
-
global $wp_roles;
|
| 8 |
-
global $wpdb;
|
| 9 |
-
global $error;
|
| 10 |
-
|
| 11 |
-
$
|
| 12 |
-
|
| 13 |
-
$
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
$
|
| 18 |
-
$
|
| 19 |
-
$
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
$
|
| 24 |
-
$
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
$
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
$
|
| 105 |
-
$
|
| 106 |
-
$
|
| 107 |
-
$
|
| 108 |
-
$
|
| 109 |
-
$
|
| 110 |
-
$
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
$
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
'
|
| 119 |
-
'
|
| 120 |
-
'
|
| 121 |
-
'
|
| 122 |
-
'
|
| 123 |
-
'
|
| 124 |
-
'
|
| 125 |
-
'
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
if (($
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
}
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
$
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
$
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
$
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
}
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
$registerFilterArray['
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
$
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
$
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
$
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
$
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
$
|
| 736 |
-
$
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
|
| 742 |
-
|
| 743 |
-
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
$
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
|
| 770 |
-
|
| 771 |
-
|
| 772 |
-
|
| 773 |
-
|
| 774 |
-
|
| 775 |
-
$
|
| 776 |
-
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
|
| 786 |
-
$
|
| 787 |
-
if ($
|
| 788 |
-
$
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
|
| 794 |
-
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
$
|
| 800 |
-
|
| 801 |
-
|
| 802 |
-
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
-
|
| 808 |
-
|
| 809 |
-
|
| 810 |
-
$
|
| 811 |
-
$
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
|
| 815 |
-
|
| 816 |
-
|
| 817 |
-
|
| 818 |
-
|
| 819 |
-
|
| 820 |
-
|
| 821 |
-
|
| 822 |
-
$
|
| 823 |
-
|
| 824 |
-
|
| 825 |
-
|
| 826 |
-
|
| 827 |
-
|
| 828 |
-
|
| 829 |
-
|
| 830 |
-
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
|
| 836 |
-
|
| 837 |
-
|
| 838 |
-
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
|
| 859 |
-
|
| 860 |
-
|
| 861 |
-
|
| 862 |
-
|
| 863 |
-
|
| 864 |
-
|
| 865 |
-
|
| 866 |
-
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
|
| 875 |
-
$
|
| 876 |
-
<
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
$
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
-
|
| 891 |
-
|
| 892 |
-
|
| 893 |
-
|
| 894 |
-
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
$
|
| 899 |
-
<
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
|
| 925 |
-
|
| 926 |
-
|
| 927 |
-
|
| 928 |
-
|
| 929 |
-
|
| 930 |
-
|
| 931 |
-
|
| 932 |
-
|
| 933 |
-
|
| 934 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 935 |
?>
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
function wppb_front_end_register($atts){
|
| 4 |
+
ob_start();
|
| 5 |
+
$wppb_defaultOptions = get_option('wppb_default_settings');
|
| 6 |
+
global $current_user;
|
| 7 |
+
global $wp_roles;
|
| 8 |
+
global $wpdb;
|
| 9 |
+
global $error;
|
| 10 |
+
|
| 11 |
+
global $wppb_shortcode_on_front;
|
| 12 |
+
|
| 13 |
+
$wppb_shortcode_on_front = true;
|
| 14 |
+
$agreed = true;
|
| 15 |
+
$new_user = 'no';
|
| 16 |
+
$registerFilterArray = array();
|
| 17 |
+
$registerFilterArray2 = array();
|
| 18 |
+
$uploadExt = array();
|
| 19 |
+
$extraFieldsErrorHolder = array(); //we will use this array to store the ID's of the extra-fields left uncompleted
|
| 20 |
+
get_currentuserinfo();
|
| 21 |
+
|
| 22 |
+
/* variables used to verify if all required fields were submitted*/
|
| 23 |
+
$firstnameComplete = 'yes';
|
| 24 |
+
$lastnameComplete = 'yes';
|
| 25 |
+
$nicknameComplete = 'yes';
|
| 26 |
+
$websiteComplete = 'yes';
|
| 27 |
+
$aimComplete = 'yes';
|
| 28 |
+
$yahooComplete = 'yes';
|
| 29 |
+
$jabberComplete = 'yes';
|
| 30 |
+
$bioComplete = 'yes';
|
| 31 |
+
/* END variables used to verify if all required fields were submitted*/
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
/* Load registration file. */
|
| 35 |
+
require_once( ABSPATH . WPINC . '/registration.php' );
|
| 36 |
+
|
| 37 |
+
/* Check if users can register. */
|
| 38 |
+
$registration = get_option( 'users_can_register' );
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
//fallback if the file was largen then post_max_size, case in which no errors can be saved in $_FILES[fileName]['error']
|
| 42 |
+
if (empty($_FILES) && empty($_POST) && isset($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
|
| 43 |
+
$registerFilterArray['noPostError'] = '
|
| 44 |
+
<p class="error">'.
|
| 45 |
+
__('The information size you were trying to submit was larger than', 'profilebuilder') .' '. WPPB_SERVER_MAX_UPLOAD_SIZE_MEGA .'b!<br/>'.
|
| 46 |
+
__('This is usually caused by a large file(s) trying to be uploaded.', 'profilebuilder') .'<br/>'.
|
| 47 |
+
__('Since it was also larger than', 'profilebuilder') .' '. WPPB_SERVER_MAX_POST_SIZE_MEGA .'b, '. __('no additional information is available.', 'profilebuilder'). '<br/>'.
|
| 48 |
+
__('The user was NOT created!', 'profilebuilder') .
|
| 49 |
+
'</p>';
|
| 50 |
+
$registerFilterArray['noPostError'] = apply_filters('wppb_register_no_post_error_message', $registerFilterArray['noPostError']);
|
| 51 |
+
echo $registerFilterArray['noPostError'];
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/* If user registered, input info. */
|
| 55 |
+
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
|
| 56 |
+
//global $wp_roles;
|
| 57 |
+
|
| 58 |
+
//get value sent in the shortcode as parameter, default to "subscriber" if not set
|
| 59 |
+
extract(shortcode_atts(array('role' => 'subscriber'), $atts));
|
| 60 |
+
|
| 61 |
+
//check if the specified role exists in the database, else fall back to the "safe-zone"
|
| 62 |
+
$found = get_role($role);
|
| 63 |
+
|
| 64 |
+
if ($found != null)
|
| 65 |
+
$aprovedRole = $role;
|
| 66 |
+
else $aprovedRole = get_option( 'default_role' );
|
| 67 |
+
|
| 68 |
+
/* preset the values in case some are not submitted */
|
| 69 |
+
$user_pass = '';
|
| 70 |
+
if (isset($_POST['passw1']))
|
| 71 |
+
$user_pass = esc_attr( $_POST['passw1'] );
|
| 72 |
+
$user_name = '';
|
| 73 |
+
if (isset($_POST['user_name']))
|
| 74 |
+
$user_name = trim ($_POST['user_name']);
|
| 75 |
+
$first_name = '';
|
| 76 |
+
if (isset($_POST['first_name']))
|
| 77 |
+
$first_name = trim ($_POST['first_name']);
|
| 78 |
+
$last_name = '';
|
| 79 |
+
if (isset($_POST['last_name']))
|
| 80 |
+
$last_name = trim ($_POST['last_name']);
|
| 81 |
+
$nickname = '';
|
| 82 |
+
if (isset($_POST['nickname']))
|
| 83 |
+
$nickname = trim ($_POST['nickname']);
|
| 84 |
+
$email = '';
|
| 85 |
+
if (isset($_POST['email']))
|
| 86 |
+
$email = trim ($_POST['email']);
|
| 87 |
+
$website = '';
|
| 88 |
+
if (isset($_POST['website']))
|
| 89 |
+
$website = trim ($_POST['website']);
|
| 90 |
+
$aim = '';
|
| 91 |
+
if (isset($_POST['aim']))
|
| 92 |
+
$aim = trim ($_POST['aim']);
|
| 93 |
+
$yim = '';
|
| 94 |
+
if (isset($_POST['yim']))
|
| 95 |
+
$yim = trim ($_POST['yim']);
|
| 96 |
+
$jabber = '';
|
| 97 |
+
if (isset($_POST['jabber']))
|
| 98 |
+
$jabber = trim ($_POST['jabber']);
|
| 99 |
+
$description = '';
|
| 100 |
+
if (isset($_POST['description']))
|
| 101 |
+
$description = trim ($_POST['description']);
|
| 102 |
+
|
| 103 |
+
/* use filters to modify (if needed) the posted data before creating the user-data */
|
| 104 |
+
$user_pass = apply_filters('wppb_register_posted_password', $user_pass);
|
| 105 |
+
$user_name = apply_filters('wppb_register_posted_email', $user_name);
|
| 106 |
+
$first_name = apply_filters('wppb_register_posted_first_name', $first_name);
|
| 107 |
+
$last_name = apply_filters('wppb_register_posted_last_name', $last_name);
|
| 108 |
+
$nickname = apply_filters('wppb_register_posted_nickname', $nickname);
|
| 109 |
+
$email = apply_filters('wppb_register_posted_email', $email);
|
| 110 |
+
$website = apply_filters('wppb_register_posted_website', $website);
|
| 111 |
+
$aim = apply_filters('wppb_register_posted_aim', $aim);
|
| 112 |
+
$yim = apply_filters('wppb_register_posted_yahoo', $yim);
|
| 113 |
+
$jabber = apply_filters('wppb_register_posted_jabber', $jabber);
|
| 114 |
+
$description = apply_filters('wppb_register_posted_bio', $description);
|
| 115 |
+
/* END use filters to modify (if needed) the posted data before creating the user-data */
|
| 116 |
+
|
| 117 |
+
$userdata = array(
|
| 118 |
+
'user_pass' => $user_pass,
|
| 119 |
+
'user_login' => esc_attr( $_POST['user_name'] ),
|
| 120 |
+
'first_name' => esc_attr( $_POST['first_name'] ),
|
| 121 |
+
'last_name' => esc_attr( $_POST['last_name'] ),
|
| 122 |
+
'nickname' => esc_attr( $_POST['nickname'] ),
|
| 123 |
+
'user_email' => esc_attr( $_POST['email'] ),
|
| 124 |
+
'user_url' => esc_attr( $_POST['website'] ),
|
| 125 |
+
'aim' => esc_attr( $_POST['aim'] ),
|
| 126 |
+
'yim' => esc_attr( $_POST['yim'] ),
|
| 127 |
+
'jabber' => esc_attr( $_POST['jabber'] ),
|
| 128 |
+
'description' => esc_attr( $_POST['description'] ),
|
| 129 |
+
'role' => $aprovedRole);
|
| 130 |
+
$userdata = apply_filters('wppb_register_userdata', $userdata);
|
| 131 |
+
|
| 132 |
+
//get required and shown fields
|
| 133 |
+
$wppb_defaultOptions = get_option('wppb_default_settings');
|
| 134 |
+
|
| 135 |
+
//check if the user agreed to the terms and conditions (if it was set)
|
| 136 |
+
$wppb_premium = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 137 |
+
if (file_exists ( $wppb_premium.'extra.fields.php' )){
|
| 138 |
+
$wppbFetchArray = get_option('wppb_custom_fields');
|
| 139 |
+
foreach ( $wppbFetchArray as $key => $value){
|
| 140 |
+
switch ($value['item_type']) {
|
| 141 |
+
case "agreeToTerms":{
|
| 142 |
+
$agreed = false;
|
| 143 |
+
if ( (isset($_POST[$value['item_id'].$value['id']] )) && ($_POST[$value['item_id'].$value['id']] == 'agree'))
|
| 144 |
+
$agreed = true;
|
| 145 |
+
break;
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
$registerFilterArray['extraError'] = ''; //this is for creating extra error message and bypassing registration
|
| 152 |
+
$registerFilterArray['extraError'] = apply_filters('wppb_register_extra_error', $registerFilterArray['extraError']);
|
| 153 |
+
|
| 154 |
+
/* check if all the required fields were completed */
|
| 155 |
+
if($wppb_defaultOptions['firstname'] == 'show'){
|
| 156 |
+
if (($wppb_defaultOptions['firstnameRequired'] == 'yes') && (trim($_POST['first_name']) == ''))
|
| 157 |
+
$firstnameComplete = 'no';
|
| 158 |
+
}elseif($wppb_defaultOptions['lastname'] == 'show'){
|
| 159 |
+
if (($wppb_defaultOptions['lastnameRequired'] == 'yes') && (trim($_POST['last_name']) == ''))
|
| 160 |
+
$lastnameComplete = 'no';
|
| 161 |
+
}elseif($wppb_defaultOptions['nickname'] == 'show'){
|
| 162 |
+
if (($wppb_defaultOptions['nicknameRequired'] == 'yes') && (trim($_POST['nickname']) == ''))
|
| 163 |
+
$nicknameComplete = 'no';
|
| 164 |
+
}elseif($wppb_defaultOptions['website'] == 'show'){
|
| 165 |
+
if (($wppb_defaultOptions['websiteRequired'] == 'yes') && (trim($_POST['website']) == ''))
|
| 166 |
+
$websiteComplete = 'no';
|
| 167 |
+
}elseif($wppb_defaultOptions['aim'] == 'show'){
|
| 168 |
+
if (($wppb_defaultOptions['aimRequired'] == 'yes') && (trim($_POST['aim']) == ''))
|
| 169 |
+
$aimComplete = 'no';
|
| 170 |
+
}elseif($wppb_defaultOptions['yahoo'] == 'show'){
|
| 171 |
+
if (($wppb_defaultOptions['yahooRequired'] == 'yes') && (trim($_POST['yahoo']) == ''))
|
| 172 |
+
$yahooComplete = 'no';
|
| 173 |
+
}elseif($wppb_defaultOptions['jabber'] == 'show'){
|
| 174 |
+
if (($wppb_defaultOptions['jabberRequired'] == 'yes') && (trim($_POST['jabber']) == ''))
|
| 175 |
+
$jabberComplete = 'no';
|
| 176 |
+
}elseif($wppb_defaultOptions['bio'] == 'show'){
|
| 177 |
+
if (($wppb_defaultOptions['bioRequired'] == 'yes') && (trim($_POST['description']) == ''))
|
| 178 |
+
$bioComplete = 'no';
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
// check the extra fields also
|
| 182 |
+
$wppb_premium = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 183 |
+
if (file_exists ( $wppb_premium.'extra.fields.php' )){
|
| 184 |
+
$wppbFetchArray = get_option('wppb_custom_fields');
|
| 185 |
+
foreach ( $wppbFetchArray as $key => $value){
|
| 186 |
+
switch ($value['item_type']) {
|
| 187 |
+
case "input":{
|
| 188 |
+
$_POST[$value['item_id'].$value['id']] = apply_filters('wppb_register_input_custom_field_'.$value['id'], $_POST[$value['item_id'].$value['id']]);
|
| 189 |
+
if (isset($value['item_required'])){
|
| 190 |
+
if ($value['item_required'] == 'yes'){
|
| 191 |
+
if (trim($_POST[$value['item_id'].$value['id']]) == '')
|
| 192 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
break;
|
| 196 |
+
}
|
| 197 |
+
case "checkbox":{
|
| 198 |
+
$checkboxOption = '';
|
| 199 |
+
$checkboxValue = explode(',', $value['item_options']);
|
| 200 |
+
foreach($checkboxValue as $thisValue){
|
| 201 |
+
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
| 202 |
+
if (isset($_POST[$thisValue.$value['id']])){
|
| 203 |
+
$localValue = str_replace('#@space@#', ' ', $_POST[$thisValue.$value['id']]);
|
| 204 |
+
$checkboxOption = $checkboxOption.$localValue.',';
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
if (isset($value['item_required'])){
|
| 209 |
+
if ($value['item_required'] == 'yes'){
|
| 210 |
+
if (trim($checkboxOption) == '')
|
| 211 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
+
break;
|
| 215 |
+
}
|
| 216 |
+
case "radio":{
|
| 217 |
+
if (isset($value['item_required'])){
|
| 218 |
+
if ($value['item_required'] == 'yes'){
|
| 219 |
+
if (trim($_POST[$value['item_id'].$value['id']]) == '')
|
| 220 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 221 |
+
}
|
| 222 |
+
}
|
| 223 |
+
break;
|
| 224 |
+
}
|
| 225 |
+
case "select":{
|
| 226 |
+
if (isset($value['item_required'])){
|
| 227 |
+
if ($value['item_required'] == 'yes'){
|
| 228 |
+
if (trim($_POST[$value['item_id'].$value['id']]) == '')
|
| 229 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 230 |
+
}
|
| 231 |
+
}
|
| 232 |
+
break;
|
| 233 |
+
}
|
| 234 |
+
case "countrySelect":{
|
| 235 |
+
if (isset($value['item_required'])){
|
| 236 |
+
if ($value['item_required'] == 'yes'){
|
| 237 |
+
if (trim($_POST[$value['item_id'].$value['id']]) == '')
|
| 238 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 239 |
+
}
|
| 240 |
+
}
|
| 241 |
+
break;
|
| 242 |
+
}
|
| 243 |
+
case "timeZone":{
|
| 244 |
+
if (isset($value['item_required'])){
|
| 245 |
+
if ($value['item_required'] == 'yes'){
|
| 246 |
+
if (trim($_POST[$value['item_id'].$value['id']]) == '')
|
| 247 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 248 |
+
}
|
| 249 |
+
}
|
| 250 |
+
break;
|
| 251 |
+
}
|
| 252 |
+
case "datepicker":{
|
| 253 |
+
if (isset($value['item_required'])){
|
| 254 |
+
if ($value['item_required'] == 'yes'){
|
| 255 |
+
if (trim($_POST[$value['item_id'].$value['id']]) == '')
|
| 256 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 257 |
+
}
|
| 258 |
+
}
|
| 259 |
+
break;
|
| 260 |
+
}
|
| 261 |
+
case "textarea":{
|
| 262 |
+
if (isset($value['item_required'])){
|
| 263 |
+
if ($value['item_required'] == 'yes'){
|
| 264 |
+
if (trim($_POST[$value['item_id'].$value['id']]) == '')
|
| 265 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
break;
|
| 269 |
+
}
|
| 270 |
+
case "upload":{
|
| 271 |
+
$uploadedfile = $value['item_type'].$value['id'];
|
| 272 |
+
|
| 273 |
+
if ( (basename( $_FILES[$uploadedfile]['name']) == '')){
|
| 274 |
+
if (isset($value['item_required'])){
|
| 275 |
+
if ($value['item_required'] == 'yes')
|
| 276 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 277 |
+
}
|
| 278 |
+
}elseif ( (basename( $_FILES[$uploadedfile]['name']) != '')){
|
| 279 |
+
//get allowed file types
|
| 280 |
+
if (($value['item_options'] != NULL) || ($value['item_options'] != '')){
|
| 281 |
+
$allFiles = false;
|
| 282 |
+
$extensions = explode(',', $value['item_options']);
|
| 283 |
+
foreach($extensions as $key2 => $value2)
|
| 284 |
+
$extensions[$key2] = trim($value2);
|
| 285 |
+
}else
|
| 286 |
+
$allFiles = true;
|
| 287 |
+
|
| 288 |
+
$thisFileExtStart = strrpos($_FILES[$uploadedfile]['name'], '.');
|
| 289 |
+
$thisFileExt = substr($_FILES[$uploadedfile]['name'], $thisFileExtStart);
|
| 290 |
+
|
| 291 |
+
if (($allFiles == false) && (!in_array($thisFileExt, $extensions))){
|
| 292 |
+
array_push($uploadExt, basename( $_FILES[$uploadedfile]['name']));
|
| 293 |
+
$allowedExtensions = '';
|
| 294 |
+
(int)$nrOfExt = count($extensions)-2;
|
| 295 |
+
foreach($extensions as $key2 => $value2){
|
| 296 |
+
$allowedExtensions .= $value2;
|
| 297 |
+
if ($key2 <= $nrOfExt)
|
| 298 |
+
$allowedExtensions .= ', ';
|
| 299 |
+
|
| 300 |
+
}
|
| 301 |
+
}
|
| 302 |
+
}
|
| 303 |
+
break;
|
| 304 |
+
}
|
| 305 |
+
case "avatar":{
|
| 306 |
+
$uploadedfile = $value['item_type'].$value['id'];
|
| 307 |
+
|
| 308 |
+
if ( (basename( $_FILES[$uploadedfile]['name']) == '')){
|
| 309 |
+
if (($_FILES[$uploadedfile]['type'] != 'image/jpeg') || ($_FILES[$uploadedfile]['type'] != 'image/jpg') || ($_FILES[$uploadedfile]['type'] != 'image/png') || ($_FILES[$uploadedfile]['type'] != 'image/bmp') || ($_FILES[$uploadedfile]['type'] != 'image/pjpeg') || ($_FILES[$uploadedfile]['type'] != 'image/x-png'))
|
| 310 |
+
if (isset($value['item_required'])){
|
| 311 |
+
if ($value['item_required'] == 'yes')
|
| 312 |
+
array_push($extraFieldsErrorHolder, $value['id']);
|
| 313 |
+
}
|
| 314 |
+
}
|
| 315 |
+
break;
|
| 316 |
+
}
|
| 317 |
+
}
|
| 318 |
+
}
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
/* END check if all the required fields were completed */
|
| 322 |
+
if ($registerFilterArray['extraError'] != '')
|
| 323 |
+
$error = $registerFilterArray['extraError'];
|
| 324 |
+
elseif ( !$userdata['user_login'] )
|
| 325 |
+
$error = __('A username is required for registration.', 'profilebuilder');
|
| 326 |
+
elseif ( username_exists($userdata['user_login']) )
|
| 327 |
+
$error = __('Sorry, that username already exists!', 'profilebuilder');
|
| 328 |
+
elseif ( !is_email($userdata['user_email'], true) )
|
| 329 |
+
$error = __('You must enter a valid email address.', 'profilebuilder');
|
| 330 |
+
elseif ( email_exists($userdata['user_email']) )
|
| 331 |
+
$error = __('Sorry, that email address is already used!', 'profilebuilder');
|
| 332 |
+
elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['passw1'] != $_POST['passw2'] )){
|
| 333 |
+
if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
|
| 334 |
+
$error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
|
| 335 |
+
elseif ( $_POST['passw1'] != $_POST['passw2'] ) //verify if the the password and the retyped password are a match
|
| 336 |
+
$error = __('The entered passwords don\'t match!', 'profilebuilder');
|
| 337 |
+
}elseif(count($uploadExt) > 0){
|
| 338 |
+
$error ='<p class="semi-saved">'.
|
| 339 |
+
__('There was an error while trying to upload the following attachment(s)', 'profilebuilder') .': <span class="error">';
|
| 340 |
+
foreach ($uploadExt as $key5 => $name5){
|
| 341 |
+
$lastOne++;
|
| 342 |
+
$error .= $name5;
|
| 343 |
+
if (count($uploadExt)-$lastOne > 0)
|
| 344 |
+
$error .= ';<span style="padding-left:10px"></span>';
|
| 345 |
+
}
|
| 346 |
+
$error .= '</span><br/>'. __('Only files with the following extension(s) can be uploaded:', 'profilebuilder') .' <span class="error">'.$allowedExtensions.'</span><br/><span class="error">'. __('The account was NOT created!', 'profilebuilder') .'</span>
|
| 347 |
+
</p>';
|
| 348 |
+
}
|
| 349 |
+
elseif ( $agreed == false )
|
| 350 |
+
$error = __('You must agree to the terms and conditions before registering!', 'profilebuilder');
|
| 351 |
+
elseif(($firstnameComplete == 'no' || $lastnameComplete == 'no' || $nicknameComplete == 'no' || $websiteComplete == 'no' || $aimComplete == 'no' || $yahooComplete == 'no' || $jabberComplete == 'no' || $bioComplete == 'no' ) || !empty($extraFieldsErrorHolder))
|
| 352 |
+
$error = __('The account was NOT created!', 'profilebuilder') .'<br/>'. __('(Several required fields were left uncompleted)', 'profilebuilder');
|
| 353 |
+
else{
|
| 354 |
+
$registered_name = $_POST['user_name'];
|
| 355 |
+
$new_user = wp_insert_user( $userdata );
|
| 356 |
+
|
| 357 |
+
/* add the extra profile information */
|
| 358 |
+
$wppb_premium = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 359 |
+
if (file_exists ( $wppb_premium.'extra.fields.php' )){
|
| 360 |
+
$wppbFetchArray = get_option('wppb_custom_fields');
|
| 361 |
+
foreach ( $wppbFetchArray as $key => $value){
|
| 362 |
+
switch ($value['item_type']) {
|
| 363 |
+
case "input":{
|
| 364 |
+
add_user_meta( $new_user, $value['item_metaName'], esc_attr($_POST[$value['item_id'].$value['id']]) );
|
| 365 |
+
break;
|
| 366 |
+
}
|
| 367 |
+
case "hiddenInput":{
|
| 368 |
+
add_user_meta( $new_user, $value['item_metaName'], esc_attr($_POST[$value['item_id'].$value['id']]) );
|
| 369 |
+
break;
|
| 370 |
+
}
|
| 371 |
+
case "checkbox":{
|
| 372 |
+
$checkboxOption = '';
|
| 373 |
+
$checkboxValue = explode(',', $value['item_options']);
|
| 374 |
+
foreach($checkboxValue as $thisValue){
|
| 375 |
+
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
| 376 |
+
if (isset($_POST[$thisValue.$value['id']])){
|
| 377 |
+
$localValue = str_replace('#@space@#', ' ', $_POST[$thisValue.$value['id']]);
|
| 378 |
+
$checkboxOption = $checkboxOption.$localValue.',';
|
| 379 |
+
}
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
add_user_meta( $new_user, $value['item_metaName'], $checkboxOption );
|
| 383 |
+
break;
|
| 384 |
+
}
|
| 385 |
+
case "radio":{
|
| 386 |
+
add_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_id'].$value['id']] );
|
| 387 |
+
break;
|
| 388 |
+
}
|
| 389 |
+
case "select":{
|
| 390 |
+
add_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_id'].$value['id']] );
|
| 391 |
+
break;
|
| 392 |
+
}
|
| 393 |
+
case "countrySelect":{
|
| 394 |
+
update_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_id'].$value['id']] );
|
| 395 |
+
break;
|
| 396 |
+
}
|
| 397 |
+
case "timeZone":{
|
| 398 |
+
update_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_id'].$value['id']] );
|
| 399 |
+
break;
|
| 400 |
+
}
|
| 401 |
+
case "datepicker":{
|
| 402 |
+
update_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_id'].$value['id']] );
|
| 403 |
+
break;
|
| 404 |
+
}
|
| 405 |
+
case "textarea":{
|
| 406 |
+
add_user_meta( $new_user, $value['item_metaName'], esc_attr($_POST[$value['item_id'].$value['id']]) );
|
| 407 |
+
break;
|
| 408 |
+
}
|
| 409 |
+
case "upload":{
|
| 410 |
+
$uploadedfile = $value['item_type'].$value['id'];
|
| 411 |
+
|
| 412 |
+
//first we need to verify if we don't try to upload a 0b or 0 length file
|
| 413 |
+
if ( (basename( $_FILES[$uploadedfile]['name']) != '')){
|
| 414 |
+
|
| 415 |
+
//second we need to verify if the uploaded file size is less then the set file size in php.ini
|
| 416 |
+
if (($_FILES[$uploadedfile]['size'] < WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE) && ($_FILES[$uploadedfile]['size'] !=0)){
|
| 417 |
+
//we need to prepare the basename of the file, so that ' becomes ` as ' gives an error
|
| 418 |
+
$fileName = basename( $_FILES[$uploadedfile]['name']);
|
| 419 |
+
$finalFileName = '';
|
| 420 |
+
|
| 421 |
+
for ($i=0; $i < strlen($fileName); $i++){
|
| 422 |
+
if ($fileName[$i] == "'")
|
| 423 |
+
$finalFileName .= '`';
|
| 424 |
+
else $finalFileName .= $fileName[$i];
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
//create the target path for uploading
|
| 428 |
+
$wpUploadPath = wp_upload_dir(); // Array of key => value pairs
|
| 429 |
+
$target_path = $wpUploadPath['basedir']."/profile_builder/attachments/";
|
| 430 |
+
$target_path = $target_path . 'userID_'.$new_user.'_attachment_'. $finalFileName;
|
| 431 |
+
|
| 432 |
+
if (move_uploaded_file($_FILES[$uploadedfile]['tmp_name'], $target_path)){
|
| 433 |
+
//$upFile = get_bloginfo('home').'/'.$target_path;
|
| 434 |
+
$upFile = $wpUploadPath['baseurl'].'/profile_builder/attachments/userID_'.$new_user.'_attachment_'. $finalFileName;
|
| 435 |
+
add_user_meta( $new_user, $value['item_metaName'], $upFile );
|
| 436 |
+
$pictureUpload = 'yes';
|
| 437 |
+
}
|
| 438 |
+
}
|
| 439 |
+
}
|
| 440 |
+
break;
|
| 441 |
+
}
|
| 442 |
+
case "avatar":{
|
| 443 |
+
|
| 444 |
+
$uploadedfile = $value['item_type'].$value['id'];
|
| 445 |
+
$wpUploadPath = wp_upload_dir(); // Array of key => value pairs
|
| 446 |
+
$target_path_original = $wpUploadPath['basedir']."/profile_builder/avatars/";
|
| 447 |
+
$fileName = $_FILES[$uploadedfile]['name'];
|
| 448 |
+
$finalFileName = '';
|
| 449 |
+
|
| 450 |
+
for ($i=0; $i < strlen($fileName); $i++){
|
| 451 |
+
if ($fileName[$i] == "'")
|
| 452 |
+
$finalFileName .= '`';
|
| 453 |
+
elseif ($fileName[$i] == ' ')
|
| 454 |
+
$finalFileName .= '_';
|
| 455 |
+
else $finalFileName .= $fileName[$i];
|
| 456 |
+
}
|
| 457 |
+
|
| 458 |
+
$fileName = $finalFileName;
|
| 459 |
+
|
| 460 |
+
$target_path = $target_path_original . 'userID_'.$new_user.'_originalAvatar_'. $fileName;
|
| 461 |
+
|
| 462 |
+
/* when trying to upload file, be sure it's one of the accepted image file-types */
|
| 463 |
+
if ( (($_FILES[$uploadedfile]['type'] == 'image/jpeg') || ($_FILES[$uploadedfile]['type'] == 'image/jpg') || ($_FILES[$uploadedfile]['type'] == 'image/png') || ($_FILES[$uploadedfile]['type'] == 'image/bmp') || ($_FILES[$uploadedfile]['type'] == 'image/pjpeg') || ($_FILES[$uploadedfile]['type'] == 'image/x-png')) && (($_FILES[$uploadedfile]['size'] < WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE) && ($_FILES[$uploadedfile]['size'] !=0)) ){
|
| 464 |
+
$wp_filetype = wp_check_filetype(basename( $_FILES[$uploadedfile]['name']), null );
|
| 465 |
+
$attachment = array('post_mime_type' => $wp_filetype['type'],
|
| 466 |
+
'post_title' => $fileName, //preg_replace('/\.[^.]+$/', '', basename($_FILES[$uploadedfile]['name'])),
|
| 467 |
+
'post_content' => '',
|
| 468 |
+
'post_status' => 'inherit'
|
| 469 |
+
);
|
| 470 |
+
|
| 471 |
+
|
| 472 |
+
$attach_id = wp_insert_attachment( $attachment, $target_path);
|
| 473 |
+
|
| 474 |
+
$upFile = image_downsize( $attach_id, 'thumbnail' );
|
| 475 |
+
$upFile = $upFile[0];
|
| 476 |
+
|
| 477 |
+
//if file upload succeded
|
| 478 |
+
if (move_uploaded_file($_FILES[$uploadedfile]['tmp_name'], $target_path)){
|
| 479 |
+
add_user_meta( $new_user, $value['item_metaName'], $upFile );
|
| 480 |
+
wppb_resize_avatar($new_user);
|
| 481 |
+
$avatarUpload = 'yes';
|
| 482 |
+
}
|
| 483 |
+
else $avatarUpload = 'no';
|
| 484 |
+
}
|
| 485 |
+
if (($_FILES[$uploadedfile]['type'] == ''))
|
| 486 |
+
$avatarUpload = 'yes';
|
| 487 |
+
|
| 488 |
+
break;
|
| 489 |
+
}
|
| 490 |
+
}
|
| 491 |
+
}
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
|
| 495 |
+
//send an email to the admin regarding each and every new subscriber
|
| 496 |
+
$bloginfo = get_bloginfo( 'name' );
|
| 497 |
+
$registerFilterArray['adminMessageOnRegistration'] = '';
|
| 498 |
+
$registerFilterArray['adminMessageOnRegistration'] = __('New subscriber on', 'profilebuilder') .' '.$bloginfo . "\r\n\r\n";
|
| 499 |
+
$registerFilterArray['adminMessageOnRegistration'] .= __('Username', 'profilebuilder') .': '. esc_attr($_POST['user_name']) . "\r\n";
|
| 500 |
+
$registerFilterArray['adminMessageOnRegistration'] .= __('E-mail', 'profilebuilder') .': '. esc_attr($_POST['email']) . "\r\n";
|
| 501 |
+
$registerFilterArray['adminMessageOnRegistration'] = apply_filters('wppb_register_admin_message_content', $registerFilterArray['adminMessageOnRegistration']);
|
| 502 |
+
|
| 503 |
+
$registerFilterArray['adminMessageOnRegistrationTitle'] = '['. $bloginfo .']'. __('A new subscriber has (been) registered!');
|
| 504 |
+
$registerFilterArray['adminMessageOnRegistrationTitle'] = apply_filters ('wppb_register_admin_message_title', $registerFilterArray['adminMessageOnRegistrationTitle']);
|
| 505 |
+
|
| 506 |
+
if (trim($registerFilterArray['adminMessageOnRegistration']) != '')
|
| 507 |
+
wp_mail(get_option('admin_email'), $registerFilterArray['adminMessageOnRegistrationTitle'], $registerFilterArray['adminMessageOnRegistration']);
|
| 508 |
+
|
| 509 |
+
|
| 510 |
+
//send an email to the newly registered user, if this option was selected
|
| 511 |
+
if (isset($_POST['send_credentials_via_email']) && ($_POST['send_credentials_via_email'] == 'sending')){
|
| 512 |
+
//change these variables to modify sent email message, destination and source.
|
| 513 |
+
$email = $_POST['email'];
|
| 514 |
+
$mailPassword = $_POST['passw1'];
|
| 515 |
+
$mailUsername = $_POST['user_name'];
|
| 516 |
+
|
| 517 |
+
$registerFilterArray['userMessageFrom'] = get_bloginfo('name');
|
| 518 |
+
$registerFilterArray['userMessageFrom'] = apply_filters('wppb_register_from_email_content', $registerFilterArray['userMessageFrom']);
|
| 519 |
+
|
| 520 |
+
$registerFilterArray['userMessageSubject'] = 'A new account has been created for you.';
|
| 521 |
+
$registerFilterArray['userMessageSubject'] = apply_filters('wppb_register_subject_email_content', $registerFilterArray['userMessageSubject']);
|
| 522 |
+
|
| 523 |
+
$registerFilterArray['userMessageContent'] = 'Welcome to '.$registerFilterArray['userMessageFrom'].'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
|
| 524 |
+
$registerFilterArray['userMessageContent'] = apply_filters('wppb_register_email_content', $registerFilterArray['userMessageContent']);
|
| 525 |
+
|
| 526 |
+
$messageSent = wp_mail( $email, $registerFilterArray['userMessageSubject'], $registerFilterArray['userMessageContent']);
|
| 527 |
+
if( $messageSent == TRUE)
|
| 528 |
+
$sentEmailStatus = 2;
|
| 529 |
+
else
|
| 530 |
+
$sentEmailStatus = 1;
|
| 531 |
+
}
|
| 532 |
+
|
| 533 |
+
}
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
?>
|
| 537 |
+
<div class="wppb_holder" id="wppb_register">
|
| 538 |
+
<?php
|
| 539 |
+
if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) :
|
| 540 |
+
|
| 541 |
+
global $user_ID;
|
| 542 |
+
$login = get_userdata( $user_ID );
|
| 543 |
+
if($login->display_name == ''){
|
| 544 |
+
$login->display_name = $login->user_login;
|
| 545 |
+
}
|
| 546 |
+
$registerFilterArray['loginLogoutError'] = '
|
| 547 |
+
<p class="log-in-out alert">'. __('You are logged in as', 'profilebuilder') .' <a href="'.get_author_posts_url( $login->ID ).'" title="'.$login->display_name.'">'.$login->display_name.'</a>. '. __('You don\'t need another account.', 'profilebuilder') .' <a href="'.wp_logout_url(get_permalink()).'" title="'. __('Log out of this account.', 'profilebuilder') .'">'. __('Logout', 'profilebuilder') .' »</a></p><!-- .log-in-out .alert -->';
|
| 548 |
+
$registerFilterArray['loginLogoutError'] = apply_filters('wppb_register_have_account_alert', $registerFilterArray['loginLogoutError']);
|
| 549 |
+
echo $registerFilterArray['loginLogoutError'];
|
| 550 |
+
|
| 551 |
+
elseif ( $new_user != 'no' ) :
|
| 552 |
+
if ( current_user_can( 'create_users' ) ){
|
| 553 |
+
$registerFilterArray['registrationMessage1'] = '
|
| 554 |
+
<p class="success">'. __('A user account has been created for', 'profilebuilder') .' '. $registered_name. '.</p><!-- .success -->';
|
| 555 |
+
$registerFilterArray['registrationMessage1'] = apply_filters('wppb_register_account_created1', $registerFilterArray['registrationMessage1']);
|
| 556 |
+
echo $registerFilterArray['registrationMessage1'];
|
| 557 |
+
|
| 558 |
+
$wppb_addons = WPPB_PLUGIN_DIR . '/premium/addon/';
|
| 559 |
+
if (file_exists ( $wppb_addons.'addon.php' )){
|
| 560 |
+
//check to see if the redirecting addon is present and activated
|
| 561 |
+
$wppb_premium_addon_settings = get_option('wppb_premium_addon_settings');
|
| 562 |
+
if ($wppb_premium_addon_settings['customRedirect'] == 'show'){
|
| 563 |
+
//check to see if the redirect location is not an empty string and is activated
|
| 564 |
+
$customRedirectSettings = get_option('customRedirectSettings');
|
| 565 |
+
if ((trim($customRedirectSettings['afterRegisterTarget']) != '') && ($customRedirectSettings['afterRegister'] == 'yes')){
|
| 566 |
+
$redirectLink = trim($customRedirectSettings['afterRegisterTarget']);
|
| 567 |
+
$findHttp = strpos($redirectLink, 'http');
|
| 568 |
+
if ($findHttp === false)
|
| 569 |
+
$redirectLink = 'http://'. $redirectLink;
|
| 570 |
+
}
|
| 571 |
+
}
|
| 572 |
+
}
|
| 573 |
+
$registerFilterArray['redirectMessage1'] = '<font color="black">You will soon be redirected automatically. If you see this page for more than 3 seconds, please click <a href="'.$redirectLink.'">here</a>.<meta http-equiv="Refresh" content="3;url='.$redirectLink.'" /></font><br/><br/>';
|
| 574 |
+
$registerFilterArray['redirectMessage1'] = apply_filters('wppb_register_redirect_after_creation1', $registerFilterArray['redirectMessage1']);
|
| 575 |
+
echo $registerFilterArray['redirectMessage1'];
|
| 576 |
+
|
| 577 |
+
}else{
|
| 578 |
+
$registerFilterArray['registrationMessage2'] = '
|
| 579 |
+
<p class="success">'. __('Thank you for registering', 'profilebuilder') .' '. $registered_name .'.</p><!-- .success -->';
|
| 580 |
+
$registerFilterArray['registrationMessage2'] = apply_filters('wppb_register_account_created2', $registerFilterArray['registrationMessage2']);
|
| 581 |
+
echo $registerFilterArray['registrationMessage2'];
|
| 582 |
+
|
| 583 |
+
$wppb_addons = WPPB_PLUGIN_DIR . '/premium/addon/';
|
| 584 |
+
if (file_exists ( $wppb_addons.'addon.php' )){
|
| 585 |
+
//check to see if the redirecting addon is present and activated
|
| 586 |
+
$wppb_premium_addon_settings = get_option('wppb_premium_addon_settings');
|
| 587 |
+
if ($wppb_premium_addon_settings['customRedirect'] == 'show'){
|
| 588 |
+
//check to see if the redirect location is not an empty string and is activated
|
| 589 |
+
$customRedirectSettings = get_option('customRedirectSettings');
|
| 590 |
+
if ((trim($customRedirectSettings['afterRegisterTarget']) != '') && ($customRedirectSettings['afterRegister'] == 'yes')){
|
| 591 |
+
$redirectLink = trim($customRedirectSettings['afterRegisterTarget']);
|
| 592 |
+
$findHttp = strpos($redirectLink, 'http');
|
| 593 |
+
if ($findHttp === false)
|
| 594 |
+
$redirectLink = 'http://'. $redirectLink;
|
| 595 |
+
}
|
| 596 |
+
}
|
| 597 |
+
}
|
| 598 |
+
$registerFilterArray['redirectMessage2'] = '<font color="black">You will soon be redirected automatically. If you see this page for more than 3 second, please click <a href="'.$redirectLink.'">here</a>.<meta http-equiv="Refresh" content="3;url='.$redirectLink.'" /></font><br/><br/>';
|
| 599 |
+
$registerFilterArray['redirectMessage2'] = apply_filters('wppb_register_redirect_after_creation2', $registerFilterArray['redirectMessage2']);
|
| 600 |
+
echo $registerFilterArray['redirectMessage2'];
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
|
| 604 |
+
if(isset($_POST['send_credentials_via_email'])){
|
| 605 |
+
if ($sentEmailStatus == 1){
|
| 606 |
+
$registerFilterArray['emailMessage1'] = '<p class="error">'. __('An error occured while trying to send the notification email.', 'profilebuilder') .'</p><!-- .error -->';
|
| 607 |
+
$registerFilterArray['emailMessage1'] = apply_filters('wppb_register_send_notification_email_fail', $registerFilterArray['emailMessage1']);
|
| 608 |
+
echo $registerFilterArray['emailMessage1'];
|
| 609 |
+
}elseif ($sentEmailStatus == 2){
|
| 610 |
+
$registerFilterArray['emailMessage2'] = '<p class="success">'. __('An email containing the username and password was successfully sent.', 'profilebuilder') .'</p><!-- .success -->';
|
| 611 |
+
$registerFilterArray['emailMessage2'] = apply_filters('wppb_register_send_notification_email_success', $registerFilterArray['emailMessage2']);
|
| 612 |
+
echo $registerFilterArray['emailMessage2'];
|
| 613 |
+
}
|
| 614 |
+
}
|
| 615 |
+
?>
|
| 616 |
+
<?php
|
| 617 |
+
else :
|
| 618 |
+
if ( $error ) :
|
| 619 |
+
$registerFilterArray['errorMessage'] = '<p class="error">'. $error .'</p><!-- .error -->';
|
| 620 |
+
$registerFilterArray['errorMessage'] = apply_filters('wppb_register_error_messaging', $registerFilterArray['errorMessage']);
|
| 621 |
+
echo $registerFilterArray['errorMessage'];
|
| 622 |
+
endif;
|
| 623 |
+
|
| 624 |
+
if ( current_user_can( 'create_users' ) && $registration ) :
|
| 625 |
+
$registerFilterArray['alertMessage1'] = '<p class="alert">'. __('Users can register themselves or you can manually create users here.', 'profilebuilder') .'</p><!-- .alert -->';
|
| 626 |
+
$registerFilterArray['alertMessage1'] = apply_filters('wppb_register_alert_messaging1', $registerFilterArray['alertMessage1']);
|
| 627 |
+
echo $registerFilterArray['alertMessage1'];
|
| 628 |
+
|
| 629 |
+
elseif ( current_user_can( 'create_users' ) ) :
|
| 630 |
+
$registerFilterArray['alertMessage2'] = '<p class="alert">'. __('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder') .'</p><!-- .alert -->';
|
| 631 |
+
$registerFilterArray['alertMessage2'] = apply_filters('wppb_register_alert_messaging2', $registerFilterArray['alertMessage2']);
|
| 632 |
+
echo $registerFilterArray['alertMessage2'];
|
| 633 |
+
|
| 634 |
+
elseif ( !current_user_can( 'create_users' ) && !$registration) :
|
| 635 |
+
$registerFilterArray['alertMessage3'] = '<p class="alert">'. __('Only an administrator can add new users.', 'profilebuilder') .'</p><!-- .alert -->';
|
| 636 |
+
$registerFilterArray['alertMessage3'] = apply_filters('wppb_register_alert_messaging3', $registerFilterArray['alertMessage3']);
|
| 637 |
+
echo $registerFilterArray['alertMessage3'];
|
| 638 |
+
endif;
|
| 639 |
+
|
| 640 |
+
if ( $registration || current_user_can( 'create_users' ) ) :
|
| 641 |
+
/* use this action hook to add extra content before the register form. */
|
| 642 |
+
do_action( 'wppb_before_register_fields' );
|
| 643 |
+
?>
|
| 644 |
+
<form enctype="multipart/form-data" method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
|
| 645 |
+
<?php
|
| 646 |
+
echo '<input type="hidden" name="MAX_FILE_SIZE" value="'.WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE.'" /><!-- set the MAX_FILE_SIZE to the server\'s current max upload size in bytes -->';
|
| 647 |
+
|
| 648 |
+
$registerFilterArray2['name1'] = '<p class="registerNameHeading"><strong>'. __('Name', 'profilebuilder') .'</strong></p>';
|
| 649 |
+
$registerFilterArray2['name1'] = apply_filters('wppb_register_content_name1', $registerFilterArray2['name1']);
|
| 650 |
+
|
| 651 |
+
if ($wppb_defaultOptions['username'] == 'show'){
|
| 652 |
+
$errorMark = '';
|
| 653 |
+
if ($wppb_defaultOptions['usernameRequired'] == 'yes'){
|
| 654 |
+
$errorMark = '<font color="red" title="This field is required for registration.">*</font>';
|
| 655 |
+
if (isset($_POST['user_name'])){
|
| 656 |
+
if (trim($_POST['user_name']) == ''){
|
| 657 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field must be filled out before registering (It was marked as required by the administrator)."/>';
|
| 658 |
+
$errorVar = ' errorHolder';
|
| 659 |
+
}
|
| 660 |
+
}
|
| 661 |
+
}
|
| 662 |
+
|
| 663 |
+
$localVar = '';
|
| 664 |
+
if (isset($_POST['user_name']))
|
| 665 |
+
$localVar = $_POST['user_name'];
|
| 666 |
+
$registerFilterArray2['name2'] = '
|
| 667 |
+
<p class="form-username'.$errorVar.'">
|
| 668 |
+
<label for="user_name">'. __('Username', 'profilebuilder') .$errorMark.'</label>
|
| 669 |
+
<input class="text-input" name="user_name" type="text" id="user_name" value="'.trim($localVar).'" />
|
| 670 |
+
</p><!-- .form-username -->';
|
| 671 |
+
$registerFilterArray2['name2'] = apply_filters('wppb_register_content_name2', $registerFilterArray2['name2']);
|
| 672 |
+
}
|
| 673 |
+
|
| 674 |
+
if ($wppb_defaultOptions['firstname'] == 'show'){
|
| 675 |
+
$errorVar = '';
|
| 676 |
+
$errorMark = '';
|
| 677 |
+
if ($wppb_defaultOptions['firstnameRequired'] == 'yes'){
|
| 678 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 679 |
+
if (isset($_POST['first_name'])){
|
| 680 |
+
if (trim($_POST['first_name']) == ''){
|
| 681 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field must be filled out before registering (It was marked as required by the administrator)."/>';
|
| 682 |
+
$errorVar = ' errorHolder';
|
| 683 |
+
}
|
| 684 |
+
}
|
| 685 |
+
}
|
| 686 |
+
|
| 687 |
+
$localVar = '';
|
| 688 |
+
if (isset($_POST['first_name']))
|
| 689 |
+
$localVar = $_POST['first_name'];
|
| 690 |
+
$registerFilterArray2['name3'] = '
|
| 691 |
+
<p class="first_name'.$errorVar.'">
|
| 692 |
+
<label for="first_name">'. __('First Name', 'profilebuilder') .$errorMark.'</label>
|
| 693 |
+
<input class="text-input" name="first_name" type="text" id="first_name" value="'.trim($localVar).'" />
|
| 694 |
+
</p><!-- .first_name -->';
|
| 695 |
+
$registerFilterArray2['name3'] = apply_filters('wppb_register_content_name3', $registerFilterArray2['name3']);
|
| 696 |
+
}
|
| 697 |
+
|
| 698 |
+
if ($wppb_defaultOptions['lastname'] == 'show'){
|
| 699 |
+
$errorVar = '';
|
| 700 |
+
$errorMark = '';
|
| 701 |
+
if ($wppb_defaultOptions['lastnameRequired'] == 'yes'){
|
| 702 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 703 |
+
if (isset($_POST['last_name'])){
|
| 704 |
+
if (trim($_POST['last_name']) == ''){
|
| 705 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field must be filled out before registering (It was marked as required by the administrator)."/>';
|
| 706 |
+
$errorVar = ' errorHolder';
|
| 707 |
+
}
|
| 708 |
+
}
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
$localVar = '';
|
| 712 |
+
if (isset($_POST['last_name']))
|
| 713 |
+
$localVar = $_POST['last_name'];
|
| 714 |
+
$registerFilterArray2['name4'] = '
|
| 715 |
+
<p class="last_name'.$errorVar.'">
|
| 716 |
+
<label for="last_name">'. __('Last Name', 'profilebuilder') .$errorMark.'</label>
|
| 717 |
+
<input class="text-input" name="last_name" type="text" id="last_name" value="'.trim($localVar).'" />
|
| 718 |
+
</p><!-- .last_name -->';
|
| 719 |
+
$registerFilterArray2['name4'] = apply_filters('wppb_register_content_name4', $registerFilterArray2['name4']);
|
| 720 |
+
}
|
| 721 |
+
|
| 722 |
+
if ($wppb_defaultOptions['nickname'] == 'show'){
|
| 723 |
+
$errorVar = '';
|
| 724 |
+
$errorMark = '';
|
| 725 |
+
if ($wppb_defaultOptions['nicknameRequired'] == 'yes'){
|
| 726 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 727 |
+
if (isset($_POST['nickname'])){
|
| 728 |
+
if (trim($_POST['nickname']) == ''){
|
| 729 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field must be filled out before registering (It was marked as required by the administrator)."/>';
|
| 730 |
+
$errorVar = ' errorHolder';
|
| 731 |
+
}
|
| 732 |
+
}
|
| 733 |
+
}
|
| 734 |
+
|
| 735 |
+
$localVar = '';
|
| 736 |
+
if (isset($_POST['nickname']))
|
| 737 |
+
$localVar = $_POST['nickname'];
|
| 738 |
+
$registerFilterArray2['name5'] = '
|
| 739 |
+
<p class="nickname'.$errorVar.'">
|
| 740 |
+
<label for="nickname">'. __('Nickname', 'profilebuilder') .$errorMark.'</label>
|
| 741 |
+
<input class="text-input" name="nickname" type="text" id="nickname" value="'.trim($localVar).'" />
|
| 742 |
+
</p><!-- .nickname -->';
|
| 743 |
+
$registerFilterArray2['name5'] = apply_filters('wppb_register_content_name5', $registerFilterArray2['name5']);
|
| 744 |
+
}
|
| 745 |
+
|
| 746 |
+
$registerFilterArray2['info1'] = '<p class="registerContactInfoHeading"><strong>'. __('Contact Info', 'profilebuilder') .'</strong></p>';
|
| 747 |
+
$registerFilterArray2['info1'] = apply_filters('wppb_register_content_info1', $registerFilterArray2['info1']);
|
| 748 |
+
|
| 749 |
+
if ($wppb_defaultOptions['email'] == 'show'){
|
| 750 |
+
$errorVar = '';
|
| 751 |
+
$errorMark = '';
|
| 752 |
+
if ($wppb_defaultOptions['emailRequired'] == 'yes'){
|
| 753 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 754 |
+
if (isset($_POST['email'])){
|
| 755 |
+
if (trim($_POST['email']) == ''){
|
| 756 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field is required for registration."/>';
|
| 757 |
+
$errorVar = ' errorHolder';
|
| 758 |
+
}
|
| 759 |
+
}
|
| 760 |
+
}
|
| 761 |
+
|
| 762 |
+
$localVar = '';
|
| 763 |
+
if (isset($_POST['email']))
|
| 764 |
+
$localVar = $_POST['email'];
|
| 765 |
+
$registerFilterArray2['info2'] = '
|
| 766 |
+
<p class="form-email'.$errorVar.'">
|
| 767 |
+
<label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
|
| 768 |
+
<input class="text-input" name="email" type="text" id="email" value="'.trim($localVar).'" />
|
| 769 |
+
</p><!-- .form-email -->';
|
| 770 |
+
$registerFilterArray2['info2'] = apply_filters('wppb_register_content_info2', $registerFilterArray2['info2']);
|
| 771 |
+
}
|
| 772 |
+
|
| 773 |
+
if ($wppb_defaultOptions['website'] == 'show'){
|
| 774 |
+
$errorVar = '';
|
| 775 |
+
$errorMark = '';
|
| 776 |
+
if ($wppb_defaultOptions['websiteRequired'] == 'yes'){
|
| 777 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 778 |
+
if (isset($_POST['website'])){
|
| 779 |
+
if (trim($_POST['website']) == ''){
|
| 780 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field must be filled out before registering (It was marked as required by the administrator)."/>';
|
| 781 |
+
$errorVar = ' errorHolder';
|
| 782 |
+
}
|
| 783 |
+
}
|
| 784 |
+
}
|
| 785 |
+
|
| 786 |
+
$localVar = '';
|
| 787 |
+
if (isset($_POST['website']))
|
| 788 |
+
$localVar = $_POST['website'];
|
| 789 |
+
$registerFilterArray2['info3'] = '
|
| 790 |
+
<p class="form-website'.$errorVar.'">
|
| 791 |
+
<label for="website">'. __('Website', 'profilebuilder') .$errorMark.'</label>
|
| 792 |
+
<input class="text-input" name="website" type="text" id="website" value="'.trim($localVar).'" />
|
| 793 |
+
</p><!-- .form-website -->';
|
| 794 |
+
$registerFilterArray2['info3'] = apply_filters('wppb_register_content_info3', $registerFilterArray2['info3']);
|
| 795 |
+
}
|
| 796 |
+
|
| 797 |
+
if ($wppb_defaultOptions['aim'] == 'show'){
|
| 798 |
+
$errorVar = '';
|
| 799 |
+
$errorMark = '';
|
| 800 |
+
if ($wppb_defaultOptions['aimRequired'] == 'yes'){
|
| 801 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 802 |
+
if (isset($_POST['aim'])){
|
| 803 |
+
if (trim($_POST['aim']) == ''){
|
| 804 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field must be filled out before registering (It was marked as required by the administrator)."/>';
|
| 805 |
+
$errorVar = ' errorHolder';
|
| 806 |
+
}
|
| 807 |
+
}
|
| 808 |
+
}
|
| 809 |
+
|
| 810 |
+
$localVar = '';
|
| 811 |
+
if (isset($_POST['aim']))
|
| 812 |
+
$localVar = $_POST['aim'];
|
| 813 |
+
$registerFilterArray2['info4'] = '
|
| 814 |
+
<p class="form-aim'.$errorVar.'">
|
| 815 |
+
<label for="aim">'. __('AIM', 'profilebuilder') .$errorMark.'</label>
|
| 816 |
+
<input class="text-input" name="aim" type="text" id="aim" value="'.trim($localVar).'" />
|
| 817 |
+
</p><!-- .form-aim -->';
|
| 818 |
+
$registerFilterArray2['info4'] = apply_filters('wppb_register_content_info4', $registerFilterArray2['info4']);
|
| 819 |
+
}
|
| 820 |
+
|
| 821 |
+
if ($wppb_defaultOptions['yahoo'] == 'show'){
|
| 822 |
+
$errorVar = '';
|
| 823 |
+
$errorMark = '';
|
| 824 |
+
if ($wppb_defaultOptions['yahooRequired'] == 'yes'){
|
| 825 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 826 |
+
if (isset($_POST['yim'])){
|
| 827 |
+
if (trim($_POST['yim']) == ''){
|
| 828 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field must be filled out before registering (It was marked as required by the administrator)."/>';
|
| 829 |
+
$errorVar = ' errorHolder';
|
| 830 |
+
}
|
| 831 |
+
}
|
| 832 |
+
}
|
| 833 |
+
|
| 834 |
+
$localVar = '';
|
| 835 |
+
if (isset($_POST['yim']))
|
| 836 |
+
$localVar = $_POST['yim'];
|
| 837 |
+
$registerFilterArray2['info5'] = '
|
| 838 |
+
<p class="form-yim'.$errorVar.'">
|
| 839 |
+
<label for="yim">'. __('Yahoo IM', 'profilebuilder') .$errorMark.'</label>
|
| 840 |
+
<input class="text-input" name="yim" type="text" id="yim" value="'.trim($localVar).'" />
|
| 841 |
+
</p><!-- .form-yim -->';
|
| 842 |
+
$registerFilterArray2['info5'] = apply_filters('wppb_register_content_info5', $registerFilterArray2['info5']);
|
| 843 |
+
}
|
| 844 |
+
|
| 845 |
+
if ($wppb_defaultOptions['jabber'] == 'show'){
|
| 846 |
+
$errorVar = '';
|
| 847 |
+
$errorMark = '';
|
| 848 |
+
if ($wppb_defaultOptions['jabberRequired'] == 'yes'){
|
| 849 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 850 |
+
if (isset($_POST['jabber'])){
|
| 851 |
+
if (trim($_POST['jabber']) == ''){
|
| 852 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field must be filled out before registering (It was marked as required by the administrator)."/>';
|
| 853 |
+
$errorVar = ' errorHolder';
|
| 854 |
+
}
|
| 855 |
+
}
|
| 856 |
+
}
|
| 857 |
+
|
| 858 |
+
$localVar = '';
|
| 859 |
+
if (isset($_POST['jabber']))
|
| 860 |
+
$localVar = $_POST['jabber'];
|
| 861 |
+
$registerFilterArray2['info6'] = '
|
| 862 |
+
<p class="form-jabber'.$errorVar.'">
|
| 863 |
+
<label for="jabber">'. __('Jabber / Google Talk', 'profilebuilder') .$errorMark.'</label>
|
| 864 |
+
<input class="text-input" name="jabber" type="text" id="jabber" value="'.trim($localVar).'" />
|
| 865 |
+
</p><!-- .form-jabber -->';
|
| 866 |
+
$registerFilterArray2['info6'] = apply_filters('wppb_register_content_info6', $registerFilterArray2['info6']);
|
| 867 |
+
}
|
| 868 |
+
|
| 869 |
+
$registerFilterArray2['ay1'] = '<p class="registerAboutYourselfHeader"><strong>'. __('About Yourself', 'profilebuilder') .'</strong></p>';
|
| 870 |
+
$registerFilterArray2['ay1'] = apply_filters('wppb_register_content_about_yourself1', $registerFilterArray2['ay1']);
|
| 871 |
+
|
| 872 |
+
if ($wppb_defaultOptions['bio'] == 'show'){
|
| 873 |
+
$errorVar = '';
|
| 874 |
+
$errorMark = '';
|
| 875 |
+
if ($wppb_defaultOptions['bioRequired'] == 'yes'){
|
| 876 |
+
$errorMark = '<font color="red" title="This field is marked as required by the administrator.">*</font>';
|
| 877 |
+
if (isset($_POST['description'])){
|
| 878 |
+
if (trim($_POST['description']) == ''){
|
| 879 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field must be filled out before registering (It was marked as required by the administrator)."/>';
|
| 880 |
+
$errorVar = ' errorHolder';
|
| 881 |
+
}
|
| 882 |
+
}
|
| 883 |
+
}
|
| 884 |
+
|
| 885 |
+
$localVar = '';
|
| 886 |
+
if (isset($_POST['description']))
|
| 887 |
+
$localVar = $_POST['description'];
|
| 888 |
+
$registerFilterArray2['ay2'] = '
|
| 889 |
+
<p class="form-description'.$errorVar.'">
|
| 890 |
+
<label for="description">'. __('Biographical Info', 'profilebuilder') .$errorMark.'</label>
|
| 891 |
+
<textarea class="text-input" name="description" id="description" rows="5" cols="30">'.trim($localVar).'</textarea>
|
| 892 |
+
</p><!-- .form-description -->';
|
| 893 |
+
$registerFilterArray2['ay2'] = apply_filters('wppb_register_content_about_yourself2', $registerFilterArray2['ay2']);
|
| 894 |
+
}
|
| 895 |
+
|
| 896 |
+
if ($wppb_defaultOptions['password'] == 'show'){
|
| 897 |
+
$errorMark = '';
|
| 898 |
+
if ($wppb_defaultOptions['passwordRequired'] == 'yes'){
|
| 899 |
+
$errorMark = '<font color="red" title="This field is required for registration.">*</font>';
|
| 900 |
+
$errorMark2 = '<font color="red" title="This field is required for registration.">*</font>';
|
| 901 |
+
if ((trim($_POST['passw1']) == '') && isset ($_POST['passw1'])){
|
| 902 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field is required for registration."/>';
|
| 903 |
+
$errorVar = ' errorHolder';
|
| 904 |
+
}
|
| 905 |
+
if ((trim($_POST['passw2']) == '') && isset ($_POST['passw2'])){
|
| 906 |
+
$errorMark2 = '<img src="'.WPPB_PLUGIN_URL . '/assets/images/pencil_delete.png" title="This field is required for registration."/>';
|
| 907 |
+
$errorVar2 = ' errorHolder';
|
| 908 |
+
}
|
| 909 |
+
}
|
| 910 |
+
|
| 911 |
+
$localVar1 = '';
|
| 912 |
+
if (isset($_POST['passw1']))
|
| 913 |
+
$localVar1 = $_POST['passw1'];
|
| 914 |
+
$localVar2 = '';
|
| 915 |
+
if (isset($_POST['passw2']))
|
| 916 |
+
$localVar2 = $_POST['passw2'];
|
| 917 |
+
$registerFilterArray2['ay3'] = '
|
| 918 |
+
<p class="form-password'.$errorVar.'">
|
| 919 |
+
<label for="pass1">'. __('Password', 'profilebuilder') .$errorMark.'</label>
|
| 920 |
+
<input class="text-input" name="passw1" type="password" id="pass1" value="'.trim($localVar1).'" />
|
| 921 |
+
</p><!-- .form-password -->
|
| 922 |
+
|
| 923 |
+
<p class="form-password'.$errorVar2.'">
|
| 924 |
+
<label for="pass2">'. __('Repeat Password', 'profilebuilder') .$errorMark2.'</label>
|
| 925 |
+
<input class="text-input" name="passw2" type="password" id="pass2" value="'.trim($localVar2).'" />
|
| 926 |
+
</p><!-- .form-password -->';
|
| 927 |
+
$registerFilterArray2['ay3'] = apply_filters('wppb_register_content_about_yourself3', $registerFilterArray2['ay3']);
|
| 928 |
+
}
|
| 929 |
+
|
| 930 |
+
$wppb_premium = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 931 |
+
if (file_exists ( $wppb_premium.'extra.fields.php' )){
|
| 932 |
+
require_once($wppb_premium.'extra.fields.php');
|
| 933 |
+
|
| 934 |
+
//register_user_extra_fields($error, $_POST, $extraFieldsErrorHolder);
|
| 935 |
+
$page = 'register';
|
| 936 |
+
$returnedValue = wppb_extra_fields($current_user->id, $extraFieldsErrorHolder, $editProfileFilterArray, $page, $error, $_POST);
|
| 937 |
+
|
| 938 |
+
//copy over extra fields to the rest of the fieldso on the edit profile
|
| 939 |
+
foreach($returnedValue as $key => $value)
|
| 940 |
+
$registerFilterArray2[$key] = $value;
|
| 941 |
+
}
|
| 942 |
+
|
| 943 |
+
/* additional filter, just in case it is needed (for instance for a recaptcha form) */
|
| 944 |
+
$registerFilterArray2['extraRegistrationFilter'] = '';
|
| 945 |
+
$registerFilterArray2['extraRegistrationFilter'] = apply_filters('extraRegistrationField', $registerFilterArray2['extraRegistrationFilter']);
|
| 946 |
+
/* END additional filter, just in case it is needed (for instance for a recaptcha form) */
|
| 947 |
+
|
| 948 |
+
if (isset($_POST['send_credentials_via_email']))
|
| 949 |
+
$checkedVar = ' checked';
|
| 950 |
+
else $checkedVar = '';
|
| 951 |
+
$registerFilterArray2['confirmationEmailForm'] = '
|
| 952 |
+
<p class="send-confirmation-email">
|
| 953 |
+
<label for="send-confirmation-email">
|
| 954 |
+
<input id="send_credentials_via_email" type="checkbox" name="send_credentials_via_email" value="sending"'. $checkedVar .'/>
|
| 955 |
+
<span class="wppb-description-delimiter"> '. __('Send these credentials via email.', 'profilebuilder') .'</span>
|
| 956 |
+
</label>
|
| 957 |
+
</p><!-- .send-confirmation-email -->';
|
| 958 |
+
$registerFilterArray2['confirmationEmailForm'] = apply_filters('wppb_register_confirmation_email_form', $registerFilterArray2['confirmationEmailForm']);
|
| 959 |
+
|
| 960 |
+
|
| 961 |
+
$registerFilterArray2 = apply_filters('wppb_register', $registerFilterArray2);
|
| 962 |
+
foreach ($registerFilterArray2 as $key => $value)
|
| 963 |
+
echo $value;
|
| 964 |
+
?>
|
| 965 |
+
|
| 966 |
+
<p class="form-submit">
|
| 967 |
+
<input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
|
| 968 |
+
<input name="action" type="hidden" id="action" value="adduser" />
|
| 969 |
+
</p><!-- .form-submit -->
|
| 970 |
+
<?php
|
| 971 |
+
wp_nonce_field('verify_true_registration','register_nonce_field');
|
| 972 |
+
?>
|
| 973 |
+
</form><!-- #adduser -->
|
| 974 |
+
|
| 975 |
+
<?php
|
| 976 |
+
endif;
|
| 977 |
+
endif;
|
| 978 |
+
|
| 979 |
+
/* use this action hook to add extra content after the register form. */
|
| 980 |
+
do_action( 'wppb_after_register_fields' );
|
| 981 |
+
?>
|
| 982 |
+
|
| 983 |
+
</div>
|
| 984 |
+
<?php
|
| 985 |
+
$output = ob_get_contents();
|
| 986 |
+
ob_end_clean();
|
| 987 |
+
|
| 988 |
+
return $output;
|
| 989 |
+
}
|
| 990 |
?>
|
functions/functions.load.php
CHANGED
|
@@ -1,185 +1,185 @@
|
|
| 1 |
-
<?php if (!defined('
|
| 2 |
-
/*
|
| 3 |
-
Original Plugin Name: OptionTree
|
| 4 |
-
Original Plugin URI: http://wp.envato.com
|
| 5 |
-
Original Author: Derek Herman
|
| 6 |
-
Original Author URI: http://valendesigns.com
|
| 7 |
-
*/
|
| 8 |
-
|
| 9 |
-
/**
|
| 10 |
-
* Functions Load
|
| 11 |
-
*
|
| 12 |
-
*/
|
| 13 |
-
/* whitelist options, you can add more register_settings changing the second parameter */
|
| 14 |
-
|
| 15 |
-
function wppb_register_settings() {
|
| 16 |
-
$premiumPresent =
|
| 17 |
-
$addonPresent =
|
| 18 |
-
|
| 19 |
-
register_setting( 'wppb_option_group', 'wppb_default_settings' );
|
| 20 |
-
register_setting( 'wppb_default_style', 'wppb_default_style' );
|
| 21 |
-
register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
|
| 22 |
-
if (file_exists($premiumPresent)){
|
| 23 |
-
register_setting( 'wppb_profile_builder_pro_serial', 'wppb_profile_builder_pro_serial' );
|
| 24 |
-
}
|
| 25 |
-
if (file_exists($addonPresent)){
|
| 26 |
-
register_setting( 'wppb_premium_addon_settings', 'wppb_premium_addon_settings' );
|
| 27 |
-
register_setting( 'customRedirectSettings', 'customRedirectSettings' );
|
| 28 |
-
register_setting( 'userListingSettings', 'userListingSettings' );
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
$
|
| 41 |
-
$
|
| 42 |
-
$
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
wp_register_style('wppb_stylesheet', $
|
| 48 |
-
wp_enqueue_style( 'wppb_stylesheet');
|
| 49 |
-
}elseif ( (file_exists($
|
| 50 |
-
wp_register_style('wppb_stylesheet', $
|
| 51 |
-
wp_enqueue_style( 'wppb_stylesheet');
|
| 52 |
-
}
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
}
|
| 76 |
-
|
| 77 |
-
if(
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
if (
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
add_action( '
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
add_action('
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
/*
|
| 159 |
-
add_filter('
|
| 160 |
-
|
| 161 |
-
/*
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
/*
|
| 171 |
-
|
| 172 |
-
}
|
| 173 |
-
|
| 174 |
-
$wppb_premiumAddon =
|
| 175 |
-
if (file_exists ( $wppb_premiumAddon.'addon.functions.php' )){
|
| 176 |
-
//include the file containing the addon functions
|
| 177 |
-
include_once($wppb_premiumAddon.'addon.functions.php');
|
| 178 |
-
|
| 179 |
-
$wppb_addonOptions = get_option('wppb_premium_addon_settings');
|
| 180 |
-
if ($wppb_addonOptions['userListing'] == 'show'){
|
| 181 |
-
//add shortcode for the user-listing functionality
|
| 182 |
-
add_shortcode('wppb-list-users', 'wppb_list_all_users');
|
| 183 |
-
}
|
| 184 |
-
}
|
| 185 |
}
|
| 1 |
+
<?php if (!defined('PROFILE_BUILDER_VERSION')) exit('No direct script access allowed');
|
| 2 |
+
/*
|
| 3 |
+
Original Plugin Name: OptionTree
|
| 4 |
+
Original Plugin URI: http://wp.envato.com
|
| 5 |
+
Original Author: Derek Herman
|
| 6 |
+
Original Author URI: http://valendesigns.com
|
| 7 |
+
*/
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* Functions Load
|
| 11 |
+
*
|
| 12 |
+
*/
|
| 13 |
+
/* whitelist options, you can add more register_settings changing the second parameter */
|
| 14 |
+
|
| 15 |
+
function wppb_register_settings() {
|
| 16 |
+
$premiumPresent = WPPB_PLUGIN_DIR . '/premium/premium.php';
|
| 17 |
+
$addonPresent = WPPB_PLUGIN_DIR . '/premium/addon/addon.php';
|
| 18 |
+
|
| 19 |
+
register_setting( 'wppb_option_group', 'wppb_default_settings' );
|
| 20 |
+
register_setting( 'wppb_default_style', 'wppb_default_style' );
|
| 21 |
+
register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
|
| 22 |
+
if (file_exists($premiumPresent)){
|
| 23 |
+
register_setting( 'wppb_profile_builder_pro_serial', 'wppb_profile_builder_pro_serial' );
|
| 24 |
+
}
|
| 25 |
+
if (file_exists($addonPresent)){
|
| 26 |
+
register_setting( 'wppb_premium_addon_settings', 'wppb_premium_addon_settings' );
|
| 27 |
+
register_setting( 'customRedirectSettings', 'customRedirectSettings' );
|
| 28 |
+
register_setting( 'userListingSettings', 'userListingSettings' );
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
$wppb_premiumAdmin = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 35 |
+
if (file_exists ( $wppb_premiumAdmin.'premium.functions.load.php' ))
|
| 36 |
+
include_once($wppb_premiumAdmin.'premium.functions.load.php');
|
| 37 |
+
|
| 38 |
+
function wppb_add_plugin_stylesheet() {
|
| 39 |
+
$wppb_showDefaultCss = get_option('wppb_default_style');
|
| 40 |
+
$styleUrl_default = WPPB_PLUGIN_URL . '/assets/css/front.end.css';
|
| 41 |
+
$styleUrl_white = WPPB_PLUGIN_URL . '/premium/assets/css/front.end.white.css';
|
| 42 |
+
$styleUrl_black = WPPB_PLUGIN_URL . '/premium/assets/css/front.end.black.css';
|
| 43 |
+
$styleFile_default = WPPB_PLUGIN_DIR . '/assets/css/front.end.css';
|
| 44 |
+
$styleFile_white = WPPB_PLUGIN_DIR . '/premium/assets/css/front.end.white.css';
|
| 45 |
+
$styleFile_black = WPPB_PLUGIN_DIR . '/premium/assets/css/front.end.black.css';
|
| 46 |
+
if ( (file_exists($styleFile_default)) && ($wppb_showDefaultCss == 'yes') ) {
|
| 47 |
+
wp_register_style('wppb_stylesheet', $styleUrl_default);
|
| 48 |
+
wp_enqueue_style( 'wppb_stylesheet');
|
| 49 |
+
}elseif ( (file_exists($styleFile_white)) && ($wppb_showDefaultCss == 'white') ) {
|
| 50 |
+
wp_register_style('wppb_stylesheet', $styleUrl_white);
|
| 51 |
+
wp_enqueue_style( 'wppb_stylesheet');
|
| 52 |
+
}elseif ( (file_exists($styleFile_black)) && ($wppb_showDefaultCss == 'black') ) {
|
| 53 |
+
wp_register_style('wppb_stylesheet', $styleUrl_black);
|
| 54 |
+
wp_enqueue_style( 'wppb_stylesheet');
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
function wppb_show_admin_bar($content){
|
| 60 |
+
global $current_user;
|
| 61 |
+
global $wpdb;
|
| 62 |
+
$admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
|
| 63 |
+
|
| 64 |
+
if ($admintSettingsPresent != 'not_found'){
|
| 65 |
+
if ($current_user->ID != 0){
|
| 66 |
+
$capabilityName = $wpdb->prefix.'capabilities';
|
| 67 |
+
$userRole = ($current_user->data->$capabilityName);
|
| 68 |
+
if ($userRole != NULL){
|
| 69 |
+
$currentRole = key($userRole);
|
| 70 |
+
$getSettings = $admintSettingsPresent[$currentRole];
|
| 71 |
+
if ($getSettings == 'show')
|
| 72 |
+
return true;
|
| 73 |
+
elseif ($getSettings == 'hide')
|
| 74 |
+
return false;
|
| 75 |
+
}elseif ($userRole == NULL){ // this is for the WP v.3.3
|
| 76 |
+
$userRole = ($current_user->roles[0]);
|
| 77 |
+
if ($userRole != NULL){
|
| 78 |
+
$getSettings = $admintSettingsPresent[$userRole];
|
| 79 |
+
if ($getSettings == 'show')
|
| 80 |
+
return true;
|
| 81 |
+
elseif ($getSettings == 'hide')
|
| 82 |
+
return false;
|
| 83 |
+
}
|
| 84 |
+
}else
|
| 85 |
+
return true;
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
else
|
| 89 |
+
return true;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
if(!function_exists('wppb_curpageurl')){
|
| 93 |
+
function wppb_curpageurl() {
|
| 94 |
+
$pageURL = 'http';
|
| 95 |
+
if ((isset($_SERVER["HTTPS"])) && ($_SERVER["HTTPS"] == "on")) {
|
| 96 |
+
$pageURL .= "s";
|
| 97 |
+
}
|
| 98 |
+
$pageURL .= "://";
|
| 99 |
+
if ($_SERVER["SERVER_PORT"] != "80") {
|
| 100 |
+
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
| 101 |
+
} else {
|
| 102 |
+
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
| 103 |
+
}
|
| 104 |
+
return $pageURL;
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
if ( is_admin() ){
|
| 111 |
+
/* include the css for the datepicker */
|
| 112 |
+
$wppb_premiumDatepicker = WPPB_PLUGIN_DIR . '/premium/assets/css/';
|
| 113 |
+
if (file_exists ( $wppb_premiumDatepicker.'datepicker.style.css' ))
|
| 114 |
+
wp_enqueue_style( 'profile-builder-admin-datepicker-style', WPPB_PLUGIN_URL.'/premium/assets/css/datepicker.style.css', false, PROFILE_BUILDER_VERSION);
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
/* register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin" */
|
| 119 |
+
add_action('admin_init', 'wppb_register_settings');
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
/* display the same extra profile fields in the admin panel also */
|
| 123 |
+
$wppb_premium = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 124 |
+
if (file_exists ( $wppb_premium.'extra.fields.php' )){
|
| 125 |
+
include( $wppb_premium.'extra.fields.php' );
|
| 126 |
+
add_action( 'show_user_profile', 'display_profile_extra_fields_in_admin', 10 );
|
| 127 |
+
add_action( 'edit_user_profile', 'display_profile_extra_fields_in_admin', 10 );
|
| 128 |
+
add_action( 'personal_options_update', 'save_profile_extra_fields_in_admin', 10 );
|
| 129 |
+
add_action( 'edit_user_profile_update', 'save_profile_extra_fields_in_admin', 10 );
|
| 130 |
+
|
| 131 |
+
/* check to see if the inserted serial number is valid or not; purely for visual needs */
|
| 132 |
+
add_action('admin_init', 'wppb_check_serial_number');
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
}
|
| 136 |
+
else if ( !is_admin() ){
|
| 137 |
+
/* include the stylesheet */
|
| 138 |
+
add_action('wp_print_styles', 'wppb_add_plugin_stylesheet');
|
| 139 |
+
|
| 140 |
+
$wppb_plugin = WPPB_PLUGIN_DIR . '/';
|
| 141 |
+
|
| 142 |
+
/* include the menu file for the profile informations */
|
| 143 |
+
include_once($wppb_plugin.'front-end/wppb.edit.profile.php');
|
| 144 |
+
add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
|
| 145 |
+
|
| 146 |
+
/*include the menu file for the login screen */
|
| 147 |
+
include_once($wppb_plugin.'front-end/wppb.login.php');
|
| 148 |
+
add_shortcode('wppb-login', 'wppb_front_end_login');
|
| 149 |
+
|
| 150 |
+
/* include the menu file for the register screen */
|
| 151 |
+
include_once($wppb_plugin.'front-end/wppb.register.php');
|
| 152 |
+
add_shortcode('wppb-register', 'wppb_front_end_register');
|
| 153 |
+
|
| 154 |
+
/* include the menu file for the recover password screen */
|
| 155 |
+
include_once($wppb_plugin.'front-end/wppb.recover.password.php');
|
| 156 |
+
add_shortcode('wppb-recover-password', 'wppb_front_end_password_recovery');
|
| 157 |
+
|
| 158 |
+
/* set the front-end admin bar to show/hide */
|
| 159 |
+
add_filter( 'show_admin_bar' , 'wppb_show_admin_bar');
|
| 160 |
+
|
| 161 |
+
/* Shortcodes used for the widget area. Just uncomment whichever you need */
|
| 162 |
+
add_filter('widget_text', 'do_shortcode', 11);
|
| 163 |
+
|
| 164 |
+
/* check to see if the premium functions are present */
|
| 165 |
+
$wppb_premiumAdmin = WPPB_PLUGIN_DIR . '/premium/functions/';
|
| 166 |
+
if (file_exists ( $wppb_premiumAdmin.'premium.functions.load.php' )){
|
| 167 |
+
|
| 168 |
+
include_once($wppb_premiumAdmin.'premium.functions.load.php');
|
| 169 |
+
|
| 170 |
+
/* filter to set current users custom avatar */
|
| 171 |
+
add_filter('get_avatar', 'wppb_changeDefaultAvatar', 21, 5);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
$wppb_premiumAddon = WPPB_PLUGIN_DIR . '/premium/addon/';
|
| 175 |
+
if (file_exists ( $wppb_premiumAddon.'addon.functions.php' )){
|
| 176 |
+
//include the file containing the addon functions
|
| 177 |
+
include_once($wppb_premiumAddon.'addon.functions.php');
|
| 178 |
+
|
| 179 |
+
$wppb_addonOptions = get_option('wppb_premium_addon_settings');
|
| 180 |
+
if ($wppb_addonOptions['userListing'] == 'show'){
|
| 181 |
+
//add shortcode for the user-listing functionality
|
| 182 |
+
add_shortcode('wppb-list-users', 'wppb_list_all_users');
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
}
|
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.
|
| 7 |
Author: Reflection Media, Barina Gabriel
|
| 8 |
Author URI: http://www.reflectionmedia.ro
|
| 9 |
License: GPL2
|
|
@@ -54,7 +54,7 @@ function return_bytes($val) {
|
|
| 54 |
}
|
| 55 |
|
| 56 |
|
| 57 |
-
define( 'ProfileBuilderVersion', '1.1.
|
| 58 |
define( 'wppb_plugin_dir', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
|
| 59 |
define( 'wppb_plugin_url', WP_PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) );
|
| 60 |
define( 'ServerMaxUploadSizeByte', 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.16
|
| 7 |
Author: Reflection Media, Barina Gabriel
|
| 8 |
Author URI: http://www.reflectionmedia.ro
|
| 9 |
License: GPL2
|
| 54 |
}
|
| 55 |
|
| 56 |
|
| 57 |
+
define( 'ProfileBuilderVersion', '1.1.16' );
|
| 58 |
define( 'wppb_plugin_dir', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
|
| 59 |
define( 'wppb_plugin_url', WP_PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) );
|
| 60 |
define( 'ServerMaxUploadSizeByte', return_bytes( ini_get( 'upload_max_filesize') ) );
|
readme.txt
CHANGED
|
@@ -7,7 +7,7 @@ custom registration, custom registration form, custom registration page, extra u
|
|
| 7 |
front-end register, front-end registration, frontend edit profile, edit profile
|
| 8 |
Requires at least: 3.1
|
| 9 |
Tested up to: 3.3
|
| 10 |
-
Stable tag: 1.1.
|
| 11 |
|
| 12 |
Simple to use profile plugin allowing front-end login, registration and edit profile by using shortcodes.
|
| 13 |
|
|
@@ -89,6 +89,12 @@ This plugin only adds/removes fields in the front-end. The default information-f
|
|
| 89 |
7. Logged in Page: screenshot7.jpg
|
| 90 |
|
| 91 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
= 1.1.14 =
|
| 93 |
Compatibility fix for WP version 3.3
|
| 94 |
|
| 7 |
front-end register, front-end registration, frontend edit profile, edit profile
|
| 8 |
Requires at least: 3.1
|
| 9 |
Tested up to: 3.3
|
| 10 |
+
Stable tag: 1.1.16
|
| 11 |
|
| 12 |
Simple to use profile plugin allowing front-end login, registration and edit profile by using shortcodes.
|
| 13 |
|
| 89 |
7. Logged in Page: screenshot7.jpg
|
| 90 |
|
| 91 |
== Changelog ==
|
| 92 |
+
= 1.1.16 =
|
| 93 |
+
Minor bugfixes.
|
| 94 |
+
|
| 95 |
+
= 1.1.15 =
|
| 96 |
+
Minor changes in the index file.
|
| 97 |
+
|
| 98 |
= 1.1.14 =
|
| 99 |
Compatibility fix for WP version 3.3
|
| 100 |
|
