Version Description
Sanitized forms against XSS exploits.
Download this release
Release Info
Developer | barinagabriel |
Plugin | User registration & user profile – Profile Builder |
Version | 1.1.66 |
Comparing to | |
See all releases |
Code changes from version 1.1.65 to 1.1.66
- front-end/wppb.edit.profile.php +83 -83
- front-end/wppb.recover.password.php +11 -11
- front-end/wppb.register.php +63 -60
- index.php +2 -2
- readme.txt +4 -1
front-end/wppb.edit.profile.php
CHANGED
@@ -22,7 +22,7 @@ function wppb_save_the_password(){
|
|
22 |
/* Update user password. */
|
23 |
if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ){
|
24 |
if ( $_POST['pass1'] == $_POST['pass2'] ){
|
25 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'user_pass' => $_POST['pass1'] ) );
|
26 |
$changesSaved = 'yes';
|
27 |
} else {
|
28 |
$changesSavedNoMatchingPass = 'yes';
|
@@ -36,7 +36,7 @@ add_action('init', 'wppb_save_the_password');
|
|
36 |
|
37 |
function wppb_front_end_profile_info() {
|
38 |
|
39 |
-
|
40 |
|
41 |
$editProfileFilterArray = array();
|
42 |
$editProfileFilterArray2 = array();
|
@@ -86,7 +86,7 @@ function wppb_front_end_profile_info() {
|
|
86 |
$allRequiredCompleted = apply_filters('wppb_edit_profile_all_required_completed', $allRequiredCompleted);
|
87 |
|
88 |
if ($wppb_defaultOptions['firstname'] == 'show'){
|
89 |
-
$_POST['first_name'] = apply_filters('wppb_edit_profile_posted_first_name_check', $_POST['first_name']);
|
90 |
if ($wppb_defaultOptions['firstnameRequired'] == 'yes'){
|
91 |
if (isset($_POST['first_name']) && (trim($_POST['first_name']) == '')){
|
92 |
$allRequiredCompleted = 'no';
|
@@ -95,7 +95,7 @@ function wppb_front_end_profile_info() {
|
|
95 |
}
|
96 |
|
97 |
if ($wppb_defaultOptions['lastname'] == 'show'){
|
98 |
-
$_POST['last_name'] = apply_filters('wppb_edit_profile_posted_last_name_check', $_POST['last_name']);
|
99 |
if ($wppb_defaultOptions['lastnameRequired'] == 'yes'){
|
100 |
if (isset($_POST['last_name']) && (trim($_POST['last_name']) == '')){
|
101 |
$allRequiredCompleted = 'no';
|
@@ -104,7 +104,7 @@ function wppb_front_end_profile_info() {
|
|
104 |
}
|
105 |
|
106 |
if ($wppb_defaultOptions['nickname'] == 'show'){
|
107 |
-
$_POST['nickname'] = apply_filters('wppb_edit_profile_posted_nickname_check', $_POST['nickname']);
|
108 |
if ($wppb_defaultOptions['nicknameRequired'] == 'yes'){
|
109 |
if (isset($_POST['nickname']) && (trim($_POST['nickname']) == '')){
|
110 |
$allRequiredCompleted = 'no';
|
@@ -113,7 +113,7 @@ function wppb_front_end_profile_info() {
|
|
113 |
}
|
114 |
|
115 |
if ($wppb_defaultOptions['dispname'] == 'show'){
|
116 |
-
$_POST['display_name'] = apply_filters('wppb_edit_profile_posted_display_name_check', $_POST['display_name']);
|
117 |
if ($wppb_defaultOptions['dispnameRequired'] == 'yes'){
|
118 |
if (isset($_POST['display_name']) && (trim($_POST['display_name']) == '')){
|
119 |
$allRequiredCompleted = 'no';
|
@@ -122,7 +122,7 @@ function wppb_front_end_profile_info() {
|
|
122 |
}
|
123 |
|
124 |
if ($wppb_defaultOptions['website'] == 'show'){
|
125 |
-
$_POST['website'] = apply_filters('wppb_edit_profile_posted_website_check', $_POST['website']);
|
126 |
if ($wppb_defaultOptions['websiteRequired'] == 'yes'){
|
127 |
if (isset($_POST['website']) && (trim($_POST['website']) == '')){
|
128 |
$allRequiredCompleted = 'no';
|
@@ -131,7 +131,7 @@ function wppb_front_end_profile_info() {
|
|
131 |
}
|
132 |
|
133 |
if ($wppb_defaultOptions['aim'] == 'show'){
|
134 |
-
$_POST['aim'] = apply_filters('wppb_edit_profile_posted_aim_check', $_POST['aim']);
|
135 |
if ($wppb_defaultOptions['aimRequired'] == 'yes'){
|
136 |
if (isset($_POST['aim']) && (trim($_POST['aim']) == '')){
|
137 |
$allRequiredCompleted = 'no';
|
@@ -140,7 +140,7 @@ function wppb_front_end_profile_info() {
|
|
140 |
}
|
141 |
|
142 |
if ($wppb_defaultOptions['yahoo'] == 'show'){
|
143 |
-
$_POST['yim'] = apply_filters('wppb_edit_profile_posted_yahoo_check', $_POST['yim']);
|
144 |
if ($wppb_defaultOptions['yahooRequired'] == 'yes'){
|
145 |
if (isset($_POST['yim']) && (trim($_POST['yim']) == '')){
|
146 |
$allRequiredCompleted = 'no';
|
@@ -149,7 +149,7 @@ function wppb_front_end_profile_info() {
|
|
149 |
}
|
150 |
|
151 |
if ($wppb_defaultOptions['jabber'] == 'show'){
|
152 |
-
$_POST['jabber'] = apply_filters('wppb_edit_profile_posted_jabber_check', $_POST['jabber']);
|
153 |
if ($wppb_defaultOptions['jabberRequired'] == 'yes'){
|
154 |
if (isset($_POST['jabber']) && (trim($_POST['jabber']) == '')){
|
155 |
$allRequiredCompleted = 'no';
|
@@ -158,7 +158,7 @@ function wppb_front_end_profile_info() {
|
|
158 |
}
|
159 |
|
160 |
if ($wppb_defaultOptions['bio'] == 'show'){
|
161 |
-
$_POST['description'] = apply_filters('wppb_edit_profile_posted_bio_check', $_POST['description']);
|
162 |
if ($wppb_defaultOptions['bioRequired'] == 'yes'){
|
163 |
if (isset($_POST['description']) && (trim($_POST['description']) == '')){
|
164 |
$allRequiredCompleted = 'no';
|
@@ -173,7 +173,7 @@ function wppb_front_end_profile_info() {
|
|
173 |
foreach ( $wppbFetchArray as $key => $value){
|
174 |
switch ($value['item_type']) {
|
175 |
case "input":{
|
176 |
-
$_POST[$value['item_type'].$value['id']] = apply_filters('wppb_edit_profile_input_custom_field_'.$value['id'].'_check', $_POST[$value['item_type'].$value['id']]);
|
177 |
if (isset($value['item_required'])){
|
178 |
if ($value['item_required'] == 'yes'){
|
179 |
if (trim($_POST[$value['item_type'].$value['id']]) == ''){
|
@@ -190,7 +190,7 @@ function wppb_front_end_profile_info() {
|
|
190 |
foreach($checkboxValue as $thisValue){
|
191 |
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
192 |
if (isset($_POST[$thisValue.$value['id']])){
|
193 |
-
$localValue = str_replace('#@space@#', ' ', $_POST[$thisValue.$value['id']]);
|
194 |
$checkboxOption = $checkboxOption.$localValue.',';
|
195 |
}
|
196 |
}
|
@@ -327,7 +327,7 @@ function wppb_front_end_profile_info() {
|
|
327 |
|
328 |
if (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email')){
|
329 |
}else{
|
330 |
-
$_POST['email'] = apply_filters('wppb_edit_profile_posted_email', $_POST['email']);
|
331 |
if ($wppb_defaultOptions['emailRequired'] == 'yes'){
|
332 |
if ((trim($_POST['email']) != '') && isset($_POST['email'])){
|
333 |
if (email_exists( $_POST['email'] ) != FALSE)
|
@@ -336,7 +336,7 @@ function wppb_front_end_profile_info() {
|
|
336 |
|
337 |
if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
|
338 |
if (($thisEmail == $current_user->ID)){ // if the entered email address is not already registered to some other user
|
339 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'user_email' =>
|
340 |
$changesSaved = 'yes';
|
341 |
}else{
|
342 |
$changesSavedNoEmailExist = 'yes';
|
@@ -352,7 +352,7 @@ function wppb_front_end_profile_info() {
|
|
352 |
|
353 |
if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
|
354 |
if (($thisEmail == $current_user->ID)){ // if the entered email address is not already registered to some other user
|
355 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'user_email' =>
|
356 |
$changesSaved = 'yes';
|
357 |
}else{
|
358 |
$changesSavedNoEmailExist = 'yes';
|
@@ -365,81 +365,81 @@ function wppb_front_end_profile_info() {
|
|
365 |
|
366 |
/* Update user information. */
|
367 |
if ($wppb_defaultOptions['firstname'] == 'show'){
|
368 |
-
$_POST['first_name'] = apply_filters('wppb_edit_profile_posted_first_name', $_POST['first_name']);
|
369 |
if ($wppb_defaultOptions['firstnameRequired'] == 'yes'){
|
370 |
if (isset($_POST['first_name']) && (trim($_POST['first_name']) != '')){
|
371 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'first_name' =>
|
372 |
$changesSaved = 'yes';
|
373 |
}
|
374 |
}else{
|
375 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'first_name' =>
|
376 |
$changesSaved = 'yes';
|
377 |
}
|
378 |
}
|
379 |
|
380 |
if ($wppb_defaultOptions['lastname'] == 'show'){
|
381 |
-
$_POST['last_name'] = apply_filters('wppb_edit_profile_posted_last_name', $_POST['last_name']);
|
382 |
if ($wppb_defaultOptions['lastnameRequired'] == 'yes'){
|
383 |
if (isset($_POST['last_name']) && (trim($_POST['last_name']) != '')){
|
384 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'last_name' =>
|
385 |
$changesSaved = 'yes';
|
386 |
}
|
387 |
}else{
|
388 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'last_name' =>
|
389 |
$changesSaved = 'yes';
|
390 |
}
|
391 |
}
|
392 |
|
393 |
if ($wppb_defaultOptions['nickname'] == 'show'){
|
394 |
-
$_POST['nickname'] = apply_filters('wppb_edit_profile_posted_nickname', $_POST['nickname']);
|
395 |
if ($wppb_defaultOptions['nicknameRequired'] == 'yes'){
|
396 |
if (isset($_POST['nickname']) && (trim($_POST['nickname']) != '')){
|
397 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'nickname' =>
|
398 |
$changesSaved = 'yes';
|
399 |
}
|
400 |
}else{
|
401 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'nickname' =>
|
402 |
$changesSaved = 'yes';
|
403 |
}
|
404 |
|
405 |
}
|
406 |
|
407 |
if ($wppb_defaultOptions['dispname'] == 'show'){
|
408 |
-
$_POST['display_name'] = apply_filters('wppb_edit_profile_posted_display_name', $_POST['display_name']);
|
409 |
if ($wppb_defaultOptions['dispnameRequired'] == 'yes'){
|
410 |
if (isset($_POST['display_name']) && (trim($_POST['display_name']) != '')){
|
411 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'display_name' =>
|
412 |
$changesSaved = 'yes';
|
413 |
}
|
414 |
}else{
|
415 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'display_name' =>
|
416 |
$changesSaved = 'yes';
|
417 |
}
|
418 |
}
|
419 |
|
420 |
if ($wppb_defaultOptions['website'] == 'show'){
|
421 |
-
$_POST['website'] = apply_filters('wppb_edit_profile_posted_website', $_POST['website']);
|
422 |
if ($wppb_defaultOptions['websiteRequired'] == 'yes'){
|
423 |
if (isset($_POST['website']) && (trim($_POST['website']) != '')){
|
424 |
$wppbPos = strpos( (string)$_POST['website'], 'http://' );
|
425 |
if($wppbPos !== FALSE){
|
426 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'user_url' =>
|
427 |
$changesSaved = 'yes';
|
428 |
}else{
|
429 |
-
wp_update_user( array( 'ID' => $current_user->ID, 'user_url' => 'http://'.
|
430 |
$changesSaved = 'yes';
|
431 |
}
|
432 |
}
|
433 |
}else{
|
434 |
$wppbPos = strpos( (string)$_POST['website'], 'http://' );
|
435 |
-
$website =
|
436 |
-
|
437 |
if ($website == 'http://')
|
438 |
$website = '';
|
439 |
wp_update_user( array( 'ID' => $current_user->ID, 'user_url' => $website));
|
440 |
$changesSaved = 'yes';
|
441 |
}else{
|
442 |
-
|
443 |
$website = 'http://'.$website;
|
444 |
wp_update_user( array( 'ID' => $current_user->ID, 'user_url' => $website));
|
445 |
$changesSaved = 'yes';
|
@@ -448,53 +448,53 @@ function wppb_front_end_profile_info() {
|
|
448 |
}
|
449 |
|
450 |
if ($wppb_defaultOptions['aim'] == 'show'){
|
451 |
-
$_POST['aim'] = apply_filters('wppb_edit_profile_posted_aim', $_POST['aim']);
|
452 |
if ($wppb_defaultOptions['aimRequired'] == 'yes'){
|
453 |
if (isset($_POST['aim']) && (trim($_POST['aim']) != '')){
|
454 |
-
update_user_meta( $current_user->ID, 'aim',
|
455 |
$changesSaved = 'yes';
|
456 |
}
|
457 |
}else{
|
458 |
-
update_user_meta( $current_user->ID, 'aim',
|
459 |
$changesSaved = 'yes';
|
460 |
}
|
461 |
}
|
462 |
|
463 |
if ($wppb_defaultOptions['yahoo'] == 'show'){
|
464 |
-
$_POST['yim'] = apply_filters('wppb_edit_profile_posted_yahoo', $_POST['yim']);
|
465 |
if ($wppb_defaultOptions['yahooRequired'] == 'yes'){
|
466 |
if (isset($_POST['yim']) && (trim($_POST['yim']) != '')){
|
467 |
-
update_user_meta( $current_user->ID, 'yim',
|
468 |
$changesSaved = 'yes';
|
469 |
}
|
470 |
}else{
|
471 |
-
update_user_meta( $current_user->ID, 'yim',
|
472 |
$changesSaved = 'yes';
|
473 |
}
|
474 |
}
|
475 |
|
476 |
if ($wppb_defaultOptions['jabber'] == 'show'){
|
477 |
-
$_POST['jabber'] = apply_filters('wppb_edit_profile_posted_jabber', $_POST['jabber']);
|
478 |
if ($wppb_defaultOptions['jabberRequired'] == 'yes'){
|
479 |
if (isset($_POST['jabber']) && (trim($_POST['jabber']) != '')){
|
480 |
-
update_user_meta( $current_user->ID, 'jabber',
|
481 |
$changesSaved = 'yes';
|
482 |
}
|
483 |
}else{
|
484 |
-
update_user_meta( $current_user->ID, 'jabber',
|
485 |
$changesSaved = 'yes';
|
486 |
}
|
487 |
}
|
488 |
|
489 |
if ($wppb_defaultOptions['bio'] == 'show'){
|
490 |
-
$_POST['description'] = apply_filters('wppb_edit_profile_posted_bio', $_POST['description']);
|
491 |
if ($wppb_defaultOptions['bioRequired'] == 'yes'){
|
492 |
if (isset($_POST['description']) && (trim($_POST['description']) != '')){
|
493 |
-
update_user_meta( $current_user->ID, 'description',
|
494 |
$changesSaved = 'yes';
|
495 |
}
|
496 |
}else{
|
497 |
-
update_user_meta( $current_user->ID, 'description',
|
498 |
$changesSaved = 'yes';
|
499 |
}
|
500 |
}
|
@@ -506,22 +506,22 @@ function wppb_front_end_profile_info() {
|
|
506 |
foreach ( $wppbFetchArray as $key => $value){
|
507 |
switch ($value['item_type']) {
|
508 |
case "input":{
|
509 |
-
$_POST[$value['item_type'].$value['id']] = apply_filters('wppb_edit_profile_input_custom_field_'.$value['id'].'_check2', $_POST[$value['item_type'].$value['id']]);
|
510 |
if (isset($value['item_required'])){
|
511 |
if ($value['item_required'] == 'yes'){
|
512 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
513 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
514 |
else
|
515 |
array_push($extraFieldsErrorHolder, $value['id']);
|
516 |
}else
|
517 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
518 |
}else
|
519 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
520 |
|
521 |
break;
|
522 |
}
|
523 |
case "hiddenInput":{
|
524 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
525 |
|
526 |
break;
|
527 |
}
|
@@ -531,7 +531,7 @@ function wppb_front_end_profile_info() {
|
|
531 |
foreach($checkboxValue as $thisValue){
|
532 |
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
533 |
if (isset($_POST[$thisValue.$value['id']])){
|
534 |
-
$localValue = str_replace('#@space@#', ' ', $_POST[$thisValue.$value['id']]);
|
535 |
$checkboxOption = $checkboxOption.$localValue.',';
|
536 |
}
|
537 |
}
|
@@ -553,39 +553,39 @@ function wppb_front_end_profile_info() {
|
|
553 |
if (isset($value['item_required'])){
|
554 |
if ($value['item_required'] == 'yes'){
|
555 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
556 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
557 |
else
|
558 |
array_push($extraFieldsErrorHolder, $value['id']);
|
559 |
}else
|
560 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
561 |
}else
|
562 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
563 |
break;
|
564 |
}
|
565 |
case "select":{
|
566 |
if (isset($value['item_required'])){
|
567 |
if ($value['item_required'] == 'yes'){
|
568 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
569 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
570 |
else
|
571 |
array_push($extraFieldsErrorHolder, $value['id']);
|
572 |
}else
|
573 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
574 |
}else
|
575 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
576 |
break;
|
577 |
}
|
578 |
case "countrySelect":{
|
579 |
if (isset($value['item_required'])){
|
580 |
if ($value['item_required'] == 'yes'){
|
581 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
582 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
583 |
else
|
584 |
array_push($extraFieldsErrorHolder, $value['id']);
|
585 |
}else
|
586 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
587 |
}else
|
588 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
589 |
|
590 |
break;
|
591 |
}
|
@@ -593,13 +593,13 @@ function wppb_front_end_profile_info() {
|
|
593 |
if (isset($value['item_required'])){
|
594 |
if ($value['item_required'] == 'yes'){
|
595 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
596 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
597 |
else
|
598 |
array_push($extraFieldsErrorHolder, $value['id']);
|
599 |
}else
|
600 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
601 |
}else
|
602 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
603 |
|
604 |
break;
|
605 |
}
|
@@ -607,13 +607,13 @@ function wppb_front_end_profile_info() {
|
|
607 |
if (isset($value['item_required'])){
|
608 |
if ($value['item_required'] == 'yes'){
|
609 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
610 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
611 |
else
|
612 |
array_push($extraFieldsErrorHolder, $value['id']);
|
613 |
}else
|
614 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
615 |
}else
|
616 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
617 |
|
618 |
break;
|
619 |
}
|
@@ -621,13 +621,13 @@ function wppb_front_end_profile_info() {
|
|
621 |
if (isset($value['item_required'])){
|
622 |
if ($value['item_required'] == 'yes'){
|
623 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
624 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
625 |
else
|
626 |
array_push($extraFieldsErrorHolder, $value['id']);
|
627 |
}else
|
628 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
629 |
}else
|
630 |
-
update_user_meta( $current_user->ID, $value['item_metaName'],
|
631 |
|
632 |
break;
|
633 |
}
|
@@ -902,7 +902,7 @@ function wppb_front_end_profile_info() {
|
|
902 |
$editProfileFilterArray2['contentName3'] = '
|
903 |
<p class="first_name'.$errorVar.'">
|
904 |
<label for="first_name">'. __('First Name', 'profilebuilder') .$errorMark.'</label>
|
905 |
-
<input class="text-input" name="first_name" type="text" id="first_name" value="'.( isset( $_POST['first_name'] ) ?
|
906 |
</p><!-- .first_name -->';
|
907 |
$editProfileFilterArray2['contentName3'] = apply_filters('wppb_edit_profile_content_name3', $editProfileFilterArray2['contentName3'], $current_user->ID, $errorVar, $errorMark);
|
908 |
}
|
@@ -922,7 +922,7 @@ function wppb_front_end_profile_info() {
|
|
922 |
$editProfileFilterArray2['contentName4'] = '
|
923 |
<p class="last_name'.$errorVar.'">
|
924 |
<label for="last_name">'. __('Last Name', 'profilebuilder') .$errorMark.'</label>
|
925 |
-
<input class="text-input" name="last_name" type="text" id="last_name" value="'.( isset( $_POST['last_name'] ) ?
|
926 |
</p><!-- .last_name -->';
|
927 |
$editProfileFilterArray2['contentName4'] = apply_filters('wppb_edit_profile_content_name4', $editProfileFilterArray2['contentName4'], $current_user->ID);
|
928 |
}
|
@@ -942,7 +942,7 @@ function wppb_front_end_profile_info() {
|
|
942 |
$editProfileFilterArray2['contentName5'] = '
|
943 |
<p class="nickname'.$errorVar.'">
|
944 |
<label for="nickname">'. __('Nickname', 'profilebuilder') .$errorMark.'</label>
|
945 |
-
<input class="text-input" name="nickname" type="text" id="nickname" value="'.( isset( $_POST['nickname'] ) ?
|
946 |
</p><!-- .nickname -->';
|
947 |
$editProfileFilterArray2['contentName5'] = apply_filters('wppb_edit_profile_content_name5', $editProfileFilterArray2['contentName5'], $current_user->ID, $errorVar, $errorMark);
|
948 |
}
|
@@ -1014,7 +1014,7 @@ function wppb_front_end_profile_info() {
|
|
1014 |
$editProfileFilterArray2['contentInfo2'] = '
|
1015 |
<p class="form-email'.$errorVar.'">
|
1016 |
<label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
|
1017 |
-
<input class="text-input" name="email" type="text" id="email" value="'.( isset( $_POST['email'] ) ?
|
1018 |
<span class="wppb-description-delimiter">'. __('(required)', 'profilebuilder') .'</span>
|
1019 |
</p><!-- .form-email -->';
|
1020 |
$editProfileFilterArray2['contentInfo2'] = apply_filters('wppb_edit_profile_content_info2', $editProfileFilterArray2['contentInfo2'], $current_user->ID, $errorVar, $errorMark);
|
@@ -1030,11 +1030,11 @@ function wppb_front_end_profile_info() {
|
|
1030 |
$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.', 'profilebuilder') .'"/>';
|
1031 |
$errorVar = ' errorHolder';
|
1032 |
}
|
1033 |
-
}
|
1034 |
-
|
1035 |
<p class="form-website'.$errorVar.'">
|
1036 |
<label for="website">'. __('Website', 'profilebuilder') .$errorMark.'</label>
|
1037 |
-
<input class="text-input" name="website" type="text" id="website" value="'.( isset( $_POST['website'] ) ?
|
1038 |
</p><!-- .form-website -->';
|
1039 |
$editProfileFilterArray2['contentInfo3'] = apply_filters('wppb_edit_profile_content_info3', $editProfileFilterArray2['contentInfo3'], $current_user->ID, $errorVar, $errorMark);
|
1040 |
}
|
@@ -1052,7 +1052,7 @@ function wppb_front_end_profile_info() {
|
|
1052 |
$editProfileFilterArray2['contentInfo4'] = '
|
1053 |
<p class="form-aim'.$errorVar.'">
|
1054 |
<label for="aim">'. __('AIM', 'profilebuilder') .'</label>
|
1055 |
-
<input class="text-input" name="aim" type="text" id="aim" value="'.( isset( $_POST['aim'] ) ?
|
1056 |
</p><!-- .form-aim -->';
|
1057 |
$editProfileFilterArray2['contentInfo4'] = apply_filters('wppb_edit_profile_content_info4', $editProfileFilterArray2['contentInfo4'], $current_user->ID, $errorVar, $errorMark);
|
1058 |
}
|
@@ -1070,7 +1070,7 @@ function wppb_front_end_profile_info() {
|
|
1070 |
$editProfileFilterArray2['contentInfo5'] = '
|
1071 |
<p class="form-yim'.$errorVar.'">
|
1072 |
<label for="yim">'. __('Yahoo IM', 'profilebuilder') .$errorMark.'</label>
|
1073 |
-
<input class="text-input" name="yim" type="text" id="yim" value="'.( isset( $_POST['yim'] ) ?
|
1074 |
</p><!-- .form-yim -->';
|
1075 |
$editProfileFilterArray2['contentInfo5'] = apply_filters('wppb_edit_profile_content_info5', $editProfileFilterArray2['contentInfo5'], $current_user->ID, $errorVar, $errorMark);
|
1076 |
}
|
@@ -1088,7 +1088,7 @@ function wppb_front_end_profile_info() {
|
|
1088 |
$editProfileFilterArray2['contentInfo6'] = '
|
1089 |
<p class="form-jabber'.$errorVar.'">
|
1090 |
<label for="jabber">'. __('Jabber / Google Talk', 'profilebuilder') .$errorMark.'</label>
|
1091 |
-
<input class="text-input" name="jabber" type="text" id="jabber" value="'.( isset( $_POST['jabber'] ) ?
|
1092 |
</p><!-- .form-jabber -->';
|
1093 |
$editProfileFilterArray2['contentInfo6'] = apply_filters('wppb_edit_profile_content_info6', $editProfileFilterArray2['contentInfo6'], $current_user->ID, $errorVar, $errorMark);
|
1094 |
}
|
@@ -1109,7 +1109,7 @@ function wppb_front_end_profile_info() {
|
|
1109 |
$editProfileFilterArray2['aboutYourself2'] = '
|
1110 |
<p class="form-description'.$errorVar.'">
|
1111 |
<label for="description">'. __('Biographical Info', 'profilebuilder') .$errorMark.'</label>
|
1112 |
-
<textarea class="text-input" name="description" id="description" rows="5" cols="30">'.( isset( $_POST['description'] ) ? trim( $_POST['description'] ) : get_the_author_meta( 'description', $current_user->ID ) ).'</textarea>
|
1113 |
</p><!-- .form-description -->';
|
1114 |
$editProfileFilterArray2['aboutYourself2'] = apply_filters('wppb_edit_profile_content_about_yourself2', $editProfileFilterArray2['aboutYourself2'], $current_user->ID, $errorVar, $errorMark);
|
1115 |
}
|
@@ -1119,12 +1119,12 @@ function wppb_front_end_profile_info() {
|
|
1119 |
$editProfileFilterArray2['aboutYourself3'] = '
|
1120 |
<p class="form-password">
|
1121 |
<label for="pass1">'. __('New Password', 'profilebuilder') .'</label>
|
1122 |
-
<input class="text-input" name="pass1" type="password" id="pass1" value="
|
1123 |
</p><!-- .form-password -->
|
1124 |
|
1125 |
<p class="form-password'.$errorVar.'">
|
1126 |
<label for="pass2">'. __('Repeat Password', 'profilebuilder') .$errorMark.'</label>
|
1127 |
-
<input class="text-input" name="pass2" type="password" id="pass2" value="
|
1128 |
</p><!-- .form-password -->';
|
1129 |
$editProfileFilterArray2['aboutYourself3'] = apply_filters('wppb_edit_profile_content_about_yourself3', $editProfileFilterArray2['aboutYourself3'], $errorVar, $errorMark);
|
1130 |
}
|
22 |
/* Update user password. */
|
23 |
if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ){
|
24 |
if ( $_POST['pass1'] == $_POST['pass2'] ){
|
25 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'user_pass' => esc_html( $_POST['pass1'] ) ) );
|
26 |
$changesSaved = 'yes';
|
27 |
} else {
|
28 |
$changesSavedNoMatchingPass = 'yes';
|
36 |
|
37 |
function wppb_front_end_profile_info() {
|
38 |
|
39 |
+
global $changesSaved, $changesSavedNoMatchingPass, $changesSavedNoPass, $wppb_shortcode_on_front, $current_user;
|
40 |
|
41 |
$editProfileFilterArray = array();
|
42 |
$editProfileFilterArray2 = array();
|
86 |
$allRequiredCompleted = apply_filters('wppb_edit_profile_all_required_completed', $allRequiredCompleted);
|
87 |
|
88 |
if ($wppb_defaultOptions['firstname'] == 'show'){
|
89 |
+
$_POST['first_name'] = apply_filters('wppb_edit_profile_posted_first_name_check', esc_html( $_POST['first_name'] ) );
|
90 |
if ($wppb_defaultOptions['firstnameRequired'] == 'yes'){
|
91 |
if (isset($_POST['first_name']) && (trim($_POST['first_name']) == '')){
|
92 |
$allRequiredCompleted = 'no';
|
95 |
}
|
96 |
|
97 |
if ($wppb_defaultOptions['lastname'] == 'show'){
|
98 |
+
$_POST['last_name'] = apply_filters('wppb_edit_profile_posted_last_name_check', esc_html( $_POST['last_name'] ));
|
99 |
if ($wppb_defaultOptions['lastnameRequired'] == 'yes'){
|
100 |
if (isset($_POST['last_name']) && (trim($_POST['last_name']) == '')){
|
101 |
$allRequiredCompleted = 'no';
|
104 |
}
|
105 |
|
106 |
if ($wppb_defaultOptions['nickname'] == 'show'){
|
107 |
+
$_POST['nickname'] = apply_filters('wppb_edit_profile_posted_nickname_check', esc_html( $_POST['nickname'] ) );
|
108 |
if ($wppb_defaultOptions['nicknameRequired'] == 'yes'){
|
109 |
if (isset($_POST['nickname']) && (trim($_POST['nickname']) == '')){
|
110 |
$allRequiredCompleted = 'no';
|
113 |
}
|
114 |
|
115 |
if ($wppb_defaultOptions['dispname'] == 'show'){
|
116 |
+
$_POST['display_name'] = apply_filters('wppb_edit_profile_posted_display_name_check', esc_html( $_POST['display_name'] ));
|
117 |
if ($wppb_defaultOptions['dispnameRequired'] == 'yes'){
|
118 |
if (isset($_POST['display_name']) && (trim($_POST['display_name']) == '')){
|
119 |
$allRequiredCompleted = 'no';
|
122 |
}
|
123 |
|
124 |
if ($wppb_defaultOptions['website'] == 'show'){
|
125 |
+
$_POST['website'] = apply_filters('wppb_edit_profile_posted_website_check', esc_html( $_POST['website'] ));
|
126 |
if ($wppb_defaultOptions['websiteRequired'] == 'yes'){
|
127 |
if (isset($_POST['website']) && (trim($_POST['website']) == '')){
|
128 |
$allRequiredCompleted = 'no';
|
131 |
}
|
132 |
|
133 |
if ($wppb_defaultOptions['aim'] == 'show'){
|
134 |
+
$_POST['aim'] = apply_filters('wppb_edit_profile_posted_aim_check', esc_html( $_POST['aim'] ) );
|
135 |
if ($wppb_defaultOptions['aimRequired'] == 'yes'){
|
136 |
if (isset($_POST['aim']) && (trim($_POST['aim']) == '')){
|
137 |
$allRequiredCompleted = 'no';
|
140 |
}
|
141 |
|
142 |
if ($wppb_defaultOptions['yahoo'] == 'show'){
|
143 |
+
$_POST['yim'] = apply_filters('wppb_edit_profile_posted_yahoo_check', esc_html( $_POST['yim'] ));
|
144 |
if ($wppb_defaultOptions['yahooRequired'] == 'yes'){
|
145 |
if (isset($_POST['yim']) && (trim($_POST['yim']) == '')){
|
146 |
$allRequiredCompleted = 'no';
|
149 |
}
|
150 |
|
151 |
if ($wppb_defaultOptions['jabber'] == 'show'){
|
152 |
+
$_POST['jabber'] = apply_filters('wppb_edit_profile_posted_jabber_check', esc_html( $_POST['jabber'] ) );
|
153 |
if ($wppb_defaultOptions['jabberRequired'] == 'yes'){
|
154 |
if (isset($_POST['jabber']) && (trim($_POST['jabber']) == '')){
|
155 |
$allRequiredCompleted = 'no';
|
158 |
}
|
159 |
|
160 |
if ($wppb_defaultOptions['bio'] == 'show'){
|
161 |
+
$_POST['description'] = apply_filters('wppb_edit_profile_posted_bio_check', esc_textarea( $_POST['description'] ) );
|
162 |
if ($wppb_defaultOptions['bioRequired'] == 'yes'){
|
163 |
if (isset($_POST['description']) && (trim($_POST['description']) == '')){
|
164 |
$allRequiredCompleted = 'no';
|
173 |
foreach ( $wppbFetchArray as $key => $value){
|
174 |
switch ($value['item_type']) {
|
175 |
case "input":{
|
176 |
+
$_POST[$value['item_type'].$value['id']] = apply_filters('wppb_edit_profile_input_custom_field_'.$value['id'].'_check', esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
177 |
if (isset($value['item_required'])){
|
178 |
if ($value['item_required'] == 'yes'){
|
179 |
if (trim($_POST[$value['item_type'].$value['id']]) == ''){
|
190 |
foreach($checkboxValue as $thisValue){
|
191 |
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
192 |
if (isset($_POST[$thisValue.$value['id']])){
|
193 |
+
$localValue = str_replace('#@space@#', ' ', esc_html( $_POST[$thisValue.$value['id']] ) );
|
194 |
$checkboxOption = $checkboxOption.$localValue.',';
|
195 |
}
|
196 |
}
|
327 |
|
328 |
if (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email')){
|
329 |
}else{
|
330 |
+
$_POST['email'] = apply_filters('wppb_edit_profile_posted_email', esc_html( $_POST['email'] ) );
|
331 |
if ($wppb_defaultOptions['emailRequired'] == 'yes'){
|
332 |
if ((trim($_POST['email']) != '') && isset($_POST['email'])){
|
333 |
if (email_exists( $_POST['email'] ) != FALSE)
|
336 |
|
337 |
if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
|
338 |
if (($thisEmail == $current_user->ID)){ // if the entered email address is not already registered to some other user
|
339 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'user_email' => esc_html( $_POST['email'] )));
|
340 |
$changesSaved = 'yes';
|
341 |
}else{
|
342 |
$changesSavedNoEmailExist = 'yes';
|
352 |
|
353 |
if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
|
354 |
if (($thisEmail == $current_user->ID)){ // if the entered email address is not already registered to some other user
|
355 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'user_email' => esc_html( $_POST['email'] )));
|
356 |
$changesSaved = 'yes';
|
357 |
}else{
|
358 |
$changesSavedNoEmailExist = 'yes';
|
365 |
|
366 |
/* Update user information. */
|
367 |
if ($wppb_defaultOptions['firstname'] == 'show'){
|
368 |
+
$_POST['first_name'] = apply_filters('wppb_edit_profile_posted_first_name', esc_html( $_POST['first_name'] ) );
|
369 |
if ($wppb_defaultOptions['firstnameRequired'] == 'yes'){
|
370 |
if (isset($_POST['first_name']) && (trim($_POST['first_name']) != '')){
|
371 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'first_name' => esc_html( $_POST['first_name'] )));
|
372 |
$changesSaved = 'yes';
|
373 |
}
|
374 |
}else{
|
375 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'first_name' => esc_html( $_POST['first_name'] )));
|
376 |
$changesSaved = 'yes';
|
377 |
}
|
378 |
}
|
379 |
|
380 |
if ($wppb_defaultOptions['lastname'] == 'show'){
|
381 |
+
$_POST['last_name'] = apply_filters('wppb_edit_profile_posted_last_name', esc_html( $_POST['last_name'] ) );
|
382 |
if ($wppb_defaultOptions['lastnameRequired'] == 'yes'){
|
383 |
if (isset($_POST['last_name']) && (trim($_POST['last_name']) != '')){
|
384 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'last_name' => esc_html( $_POST['last_name'] )));
|
385 |
$changesSaved = 'yes';
|
386 |
}
|
387 |
}else{
|
388 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'last_name' => esc_html( $_POST['last_name'] )));
|
389 |
$changesSaved = 'yes';
|
390 |
}
|
391 |
}
|
392 |
|
393 |
if ($wppb_defaultOptions['nickname'] == 'show'){
|
394 |
+
$_POST['nickname'] = apply_filters('wppb_edit_profile_posted_nickname', esc_html( $_POST['nickname'] ) );
|
395 |
if ($wppb_defaultOptions['nicknameRequired'] == 'yes'){
|
396 |
if (isset($_POST['nickname']) && (trim($_POST['nickname']) != '')){
|
397 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'nickname' => esc_html( $_POST['nickname'] )));
|
398 |
$changesSaved = 'yes';
|
399 |
}
|
400 |
}else{
|
401 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'nickname' => esc_html( $_POST['nickname'] )));
|
402 |
$changesSaved = 'yes';
|
403 |
}
|
404 |
|
405 |
}
|
406 |
|
407 |
if ($wppb_defaultOptions['dispname'] == 'show'){
|
408 |
+
$_POST['display_name'] = apply_filters('wppb_edit_profile_posted_display_name', esc_html( $_POST['display_name'] ) );
|
409 |
if ($wppb_defaultOptions['dispnameRequired'] == 'yes'){
|
410 |
if (isset($_POST['display_name']) && (trim($_POST['display_name']) != '')){
|
411 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'display_name' => esc_html( $_POST['display_name'] )));
|
412 |
$changesSaved = 'yes';
|
413 |
}
|
414 |
}else{
|
415 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'display_name' => esc_html( $_POST['display_name'] )));
|
416 |
$changesSaved = 'yes';
|
417 |
}
|
418 |
}
|
419 |
|
420 |
if ($wppb_defaultOptions['website'] == 'show'){
|
421 |
+
$_POST['website'] = apply_filters('wppb_edit_profile_posted_website', esc_html( $_POST['website'] ) );
|
422 |
if ($wppb_defaultOptions['websiteRequired'] == 'yes'){
|
423 |
if (isset($_POST['website']) && (trim($_POST['website']) != '')){
|
424 |
$wppbPos = strpos( (string)$_POST['website'], 'http://' );
|
425 |
if($wppbPos !== FALSE){
|
426 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'user_url' => esc_html( $_POST['website'] )));
|
427 |
$changesSaved = 'yes';
|
428 |
}else{
|
429 |
+
wp_update_user( array( 'ID' => $current_user->ID, 'user_url' => 'http://'.esc_html( $_POST['website'] )));
|
430 |
$changesSaved = 'yes';
|
431 |
}
|
432 |
}
|
433 |
}else{
|
434 |
$wppbPos = strpos( (string)$_POST['website'], 'http://' );
|
435 |
+
$website = esc_html( $_POST['website'] );
|
436 |
+
if($wppbPos !== FALSE){
|
437 |
if ($website == 'http://')
|
438 |
$website = '';
|
439 |
wp_update_user( array( 'ID' => $current_user->ID, 'user_url' => $website));
|
440 |
$changesSaved = 'yes';
|
441 |
}else{
|
442 |
+
if ($website != '')
|
443 |
$website = 'http://'.$website;
|
444 |
wp_update_user( array( 'ID' => $current_user->ID, 'user_url' => $website));
|
445 |
$changesSaved = 'yes';
|
448 |
}
|
449 |
|
450 |
if ($wppb_defaultOptions['aim'] == 'show'){
|
451 |
+
$_POST['aim'] = apply_filters('wppb_edit_profile_posted_aim', esc_html( $_POST['aim'] ) );
|
452 |
if ($wppb_defaultOptions['aimRequired'] == 'yes'){
|
453 |
if (isset($_POST['aim']) && (trim($_POST['aim']) != '')){
|
454 |
+
update_user_meta( $current_user->ID, 'aim', esc_html( $_POST['aim'] ) );
|
455 |
$changesSaved = 'yes';
|
456 |
}
|
457 |
}else{
|
458 |
+
update_user_meta( $current_user->ID, 'aim', esc_html( $_POST['aim'] ) );
|
459 |
$changesSaved = 'yes';
|
460 |
}
|
461 |
}
|
462 |
|
463 |
if ($wppb_defaultOptions['yahoo'] == 'show'){
|
464 |
+
$_POST['yim'] = apply_filters('wppb_edit_profile_posted_yahoo', esc_html( $_POST['yim'] ) );
|
465 |
if ($wppb_defaultOptions['yahooRequired'] == 'yes'){
|
466 |
if (isset($_POST['yim']) && (trim($_POST['yim']) != '')){
|
467 |
+
update_user_meta( $current_user->ID, 'yim', esc_html( $_POST['yim'] ) );
|
468 |
$changesSaved = 'yes';
|
469 |
}
|
470 |
}else{
|
471 |
+
update_user_meta( $current_user->ID, 'yim', esc_html( $_POST['yim'] ) );
|
472 |
$changesSaved = 'yes';
|
473 |
}
|
474 |
}
|
475 |
|
476 |
if ($wppb_defaultOptions['jabber'] == 'show'){
|
477 |
+
$_POST['jabber'] = apply_filters('wppb_edit_profile_posted_jabber', esc_html( $_POST['jabber'] ) );
|
478 |
if ($wppb_defaultOptions['jabberRequired'] == 'yes'){
|
479 |
if (isset($_POST['jabber']) && (trim($_POST['jabber']) != '')){
|
480 |
+
update_user_meta( $current_user->ID, 'jabber', esc_html( $_POST['jabber'] ) );
|
481 |
$changesSaved = 'yes';
|
482 |
}
|
483 |
}else{
|
484 |
+
update_user_meta( $current_user->ID, 'jabber', esc_html( $_POST['jabber'] ) );
|
485 |
$changesSaved = 'yes';
|
486 |
}
|
487 |
}
|
488 |
|
489 |
if ($wppb_defaultOptions['bio'] == 'show'){
|
490 |
+
$_POST['description'] = apply_filters('wppb_edit_profile_posted_bio', $_POST['description'] );
|
491 |
if ($wppb_defaultOptions['bioRequired'] == 'yes'){
|
492 |
if (isset($_POST['description']) && (trim($_POST['description']) != '')){
|
493 |
+
update_user_meta( $current_user->ID, 'description', trim( $_POST['description'] ) );
|
494 |
$changesSaved = 'yes';
|
495 |
}
|
496 |
}else{
|
497 |
+
update_user_meta( $current_user->ID, 'description', trim( $_POST['description'] ) );
|
498 |
$changesSaved = 'yes';
|
499 |
}
|
500 |
}
|
506 |
foreach ( $wppbFetchArray as $key => $value){
|
507 |
switch ($value['item_type']) {
|
508 |
case "input":{
|
509 |
+
$_POST[$value['item_type'].$value['id']] = apply_filters('wppb_edit_profile_input_custom_field_'.$value['id'].'_check2', esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
510 |
if (isset($value['item_required'])){
|
511 |
if ($value['item_required'] == 'yes'){
|
512 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
513 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
514 |
else
|
515 |
array_push($extraFieldsErrorHolder, $value['id']);
|
516 |
}else
|
517 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
518 |
}else
|
519 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
520 |
|
521 |
break;
|
522 |
}
|
523 |
case "hiddenInput":{
|
524 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
525 |
|
526 |
break;
|
527 |
}
|
531 |
foreach($checkboxValue as $thisValue){
|
532 |
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
533 |
if (isset($_POST[$thisValue.$value['id']])){
|
534 |
+
$localValue = str_replace('#@space@#', ' ', esc_html( $_POST[$thisValue.$value['id']] ) );
|
535 |
$checkboxOption = $checkboxOption.$localValue.',';
|
536 |
}
|
537 |
}
|
553 |
if (isset($value['item_required'])){
|
554 |
if ($value['item_required'] == 'yes'){
|
555 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
556 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
557 |
else
|
558 |
array_push($extraFieldsErrorHolder, $value['id']);
|
559 |
}else
|
560 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
561 |
}else
|
562 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
563 |
break;
|
564 |
}
|
565 |
case "select":{
|
566 |
if (isset($value['item_required'])){
|
567 |
if ($value['item_required'] == 'yes'){
|
568 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
569 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
570 |
else
|
571 |
array_push($extraFieldsErrorHolder, $value['id']);
|
572 |
}else
|
573 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
574 |
}else
|
575 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
576 |
break;
|
577 |
}
|
578 |
case "countrySelect":{
|
579 |
if (isset($value['item_required'])){
|
580 |
if ($value['item_required'] == 'yes'){
|
581 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
582 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
583 |
else
|
584 |
array_push($extraFieldsErrorHolder, $value['id']);
|
585 |
}else
|
586 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
587 |
}else
|
588 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
589 |
|
590 |
break;
|
591 |
}
|
593 |
if (isset($value['item_required'])){
|
594 |
if ($value['item_required'] == 'yes'){
|
595 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
596 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
597 |
else
|
598 |
array_push($extraFieldsErrorHolder, $value['id']);
|
599 |
}else
|
600 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
601 |
}else
|
602 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
603 |
|
604 |
break;
|
605 |
}
|
607 |
if (isset($value['item_required'])){
|
608 |
if ($value['item_required'] == 'yes'){
|
609 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
610 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
611 |
else
|
612 |
array_push($extraFieldsErrorHolder, $value['id']);
|
613 |
}else
|
614 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
615 |
}else
|
616 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
617 |
|
618 |
break;
|
619 |
}
|
621 |
if (isset($value['item_required'])){
|
622 |
if ($value['item_required'] == 'yes'){
|
623 |
if (trim($_POST[$value['item_type'].$value['id']]) != '')
|
624 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_textarea( $_POST[$value['item_type'].$value['id']] ) );
|
625 |
else
|
626 |
array_push($extraFieldsErrorHolder, $value['id']);
|
627 |
}else
|
628 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_textarea( $_POST[$value['item_type'].$value['id']] ) );
|
629 |
}else
|
630 |
+
update_user_meta( $current_user->ID, $value['item_metaName'], esc_textarea( $_POST[$value['item_type'].$value['id']] ) );
|
631 |
|
632 |
break;
|
633 |
}
|
902 |
$editProfileFilterArray2['contentName3'] = '
|
903 |
<p class="first_name'.$errorVar.'">
|
904 |
<label for="first_name">'. __('First Name', 'profilebuilder') .$errorMark.'</label>
|
905 |
+
<input class="text-input" name="first_name" type="text" id="first_name" value="'.( isset( $_POST['first_name'] ) ? stripslashes( esc_html( $_POST['first_name'] ) ) : get_the_author_meta( 'first_name', $current_user->ID ) ).'" />
|
906 |
</p><!-- .first_name -->';
|
907 |
$editProfileFilterArray2['contentName3'] = apply_filters('wppb_edit_profile_content_name3', $editProfileFilterArray2['contentName3'], $current_user->ID, $errorVar, $errorMark);
|
908 |
}
|
922 |
$editProfileFilterArray2['contentName4'] = '
|
923 |
<p class="last_name'.$errorVar.'">
|
924 |
<label for="last_name">'. __('Last Name', 'profilebuilder') .$errorMark.'</label>
|
925 |
+
<input class="text-input" name="last_name" type="text" id="last_name" value="'.( isset( $_POST['last_name'] ) ? stripslashes( esc_html( $_POST['last_name'] ) ) : get_the_author_meta( 'last_name', $current_user->ID ) ).'" />
|
926 |
</p><!-- .last_name -->';
|
927 |
$editProfileFilterArray2['contentName4'] = apply_filters('wppb_edit_profile_content_name4', $editProfileFilterArray2['contentName4'], $current_user->ID);
|
928 |
}
|
942 |
$editProfileFilterArray2['contentName5'] = '
|
943 |
<p class="nickname'.$errorVar.'">
|
944 |
<label for="nickname">'. __('Nickname', 'profilebuilder') .$errorMark.'</label>
|
945 |
+
<input class="text-input" name="nickname" type="text" id="nickname" value="'.( isset( $_POST['nickname'] ) ? stripslashes( esc_html( $_POST['nickname'] ) ) : get_the_author_meta( 'nickname', $current_user->ID ) ).'" />
|
946 |
</p><!-- .nickname -->';
|
947 |
$editProfileFilterArray2['contentName5'] = apply_filters('wppb_edit_profile_content_name5', $editProfileFilterArray2['contentName5'], $current_user->ID, $errorVar, $errorMark);
|
948 |
}
|
1014 |
$editProfileFilterArray2['contentInfo2'] = '
|
1015 |
<p class="form-email'.$errorVar.'">
|
1016 |
<label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
|
1017 |
+
<input class="text-input" name="email" type="text" id="email" value="'.( isset( $_POST['email'] ) ? stripslashes( esc_html( $_POST['email'] ) ) : get_the_author_meta( 'user_email', $current_user->ID ) ).'" />
|
1018 |
<span class="wppb-description-delimiter">'. __('(required)', 'profilebuilder') .'</span>
|
1019 |
</p><!-- .form-email -->';
|
1020 |
$editProfileFilterArray2['contentInfo2'] = apply_filters('wppb_edit_profile_content_info2', $editProfileFilterArray2['contentInfo2'], $current_user->ID, $errorVar, $errorMark);
|
1030 |
$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.', 'profilebuilder') .'"/>';
|
1031 |
$errorVar = ' errorHolder';
|
1032 |
}
|
1033 |
+
}
|
1034 |
+
$editProfileFilterArray2['contentInfo3'] = '
|
1035 |
<p class="form-website'.$errorVar.'">
|
1036 |
<label for="website">'. __('Website', 'profilebuilder') .$errorMark.'</label>
|
1037 |
+
<input class="text-input" name="website" type="text" id="website" value="'.( isset( $_POST['website'] ) ? stripslashes( esc_html( $_POST['website'] ) ) : get_the_author_meta( 'user_url', $current_user->ID ) ).'" />
|
1038 |
</p><!-- .form-website -->';
|
1039 |
$editProfileFilterArray2['contentInfo3'] = apply_filters('wppb_edit_profile_content_info3', $editProfileFilterArray2['contentInfo3'], $current_user->ID, $errorVar, $errorMark);
|
1040 |
}
|
1052 |
$editProfileFilterArray2['contentInfo4'] = '
|
1053 |
<p class="form-aim'.$errorVar.'">
|
1054 |
<label for="aim">'. __('AIM', 'profilebuilder') .'</label>
|
1055 |
+
<input class="text-input" name="aim" type="text" id="aim" value="'.( isset( $_POST['aim'] ) ? stripslashes( esc_html( $_POST['aim'] ) ) : get_the_author_meta( 'aim', $current_user->ID ) ).'" />
|
1056 |
</p><!-- .form-aim -->';
|
1057 |
$editProfileFilterArray2['contentInfo4'] = apply_filters('wppb_edit_profile_content_info4', $editProfileFilterArray2['contentInfo4'], $current_user->ID, $errorVar, $errorMark);
|
1058 |
}
|
1070 |
$editProfileFilterArray2['contentInfo5'] = '
|
1071 |
<p class="form-yim'.$errorVar.'">
|
1072 |
<label for="yim">'. __('Yahoo IM', 'profilebuilder') .$errorMark.'</label>
|
1073 |
+
<input class="text-input" name="yim" type="text" id="yim" value="'.( isset( $_POST['yim'] ) ? stripslashes( esc_html( $_POST['yim'] ) ) : get_the_author_meta( 'yim', $current_user->ID ) ).'" />
|
1074 |
</p><!-- .form-yim -->';
|
1075 |
$editProfileFilterArray2['contentInfo5'] = apply_filters('wppb_edit_profile_content_info5', $editProfileFilterArray2['contentInfo5'], $current_user->ID, $errorVar, $errorMark);
|
1076 |
}
|
1088 |
$editProfileFilterArray2['contentInfo6'] = '
|
1089 |
<p class="form-jabber'.$errorVar.'">
|
1090 |
<label for="jabber">'. __('Jabber / Google Talk', 'profilebuilder') .$errorMark.'</label>
|
1091 |
+
<input class="text-input" name="jabber" type="text" id="jabber" value="'.( isset( $_POST['jabber'] ) ? stripslashes( esc_html( $_POST['jabber'] ) ) : get_the_author_meta( 'jabber', $current_user->ID ) ).'" />
|
1092 |
</p><!-- .form-jabber -->';
|
1093 |
$editProfileFilterArray2['contentInfo6'] = apply_filters('wppb_edit_profile_content_info6', $editProfileFilterArray2['contentInfo6'], $current_user->ID, $errorVar, $errorMark);
|
1094 |
}
|
1109 |
$editProfileFilterArray2['aboutYourself2'] = '
|
1110 |
<p class="form-description'.$errorVar.'">
|
1111 |
<label for="description">'. __('Biographical Info', 'profilebuilder') .$errorMark.'</label>
|
1112 |
+
<textarea class="text-input" name="description" id="description" rows="5" cols="30">'.( isset( $_POST['description'] ) ? stripslashes( trim( $_POST['description'] ) ) : get_the_author_meta( 'description', $current_user->ID ) ).'</textarea>
|
1113 |
</p><!-- .form-description -->';
|
1114 |
$editProfileFilterArray2['aboutYourself2'] = apply_filters('wppb_edit_profile_content_about_yourself2', $editProfileFilterArray2['aboutYourself2'], $current_user->ID, $errorVar, $errorMark);
|
1115 |
}
|
1119 |
$editProfileFilterArray2['aboutYourself3'] = '
|
1120 |
<p class="form-password">
|
1121 |
<label for="pass1">'. __('New Password', 'profilebuilder') .'</label>
|
1122 |
+
<input class="text-input" name="pass1" type="password" id="pass1" value="" autocomplete="off" />
|
1123 |
</p><!-- .form-password -->
|
1124 |
|
1125 |
<p class="form-password'.$errorVar.'">
|
1126 |
<label for="pass2">'. __('Repeat Password', 'profilebuilder') .$errorMark.'</label>
|
1127 |
+
<input class="text-input" name="pass2" type="password" id="pass2" value="" autocomplete="off" />
|
1128 |
</p><!-- .form-password -->';
|
1129 |
$editProfileFilterArray2['aboutYourself3'] = apply_filters('wppb_edit_profile_content_about_yourself3', $editProfileFilterArray2['aboutYourself3'], $errorVar, $errorMark);
|
1130 |
}
|
front-end/wppb.recover.password.php
CHANGED
@@ -60,7 +60,7 @@ function wppb_front_end_password_recovery(){
|
|
60 |
/* If the user entered an email/username, process the request */
|
61 |
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'recover_password' && wp_verify_nonce($_POST['password_recovery_nonce_field'],'verify_true_password_recovery') ) {
|
62 |
|
63 |
-
$postedData = $_POST['username_email']; //we get the raw data
|
64 |
//check to see if it's an e-mail (and if this is valid/present in the database) or is a username
|
65 |
if (is_email($postedData)){
|
66 |
if (email_exists($postedData)){
|
@@ -169,7 +169,7 @@ function wppb_front_end_password_recovery(){
|
|
169 |
$message2 = __('Your password has been successfully changed!', 'profilebuilder');
|
170 |
$messageNo2 = '1';
|
171 |
|
172 |
-
$userID = $_POST['userData'];
|
173 |
$new_pass = $_POST['passw1'];
|
174 |
|
175 |
//update the new password and delete the key
|
@@ -247,14 +247,14 @@ function wppb_front_end_password_recovery(){
|
|
247 |
$recoverPasswordFilterArray['inputPassword'] = '
|
248 |
<p class="passw1">
|
249 |
<label for="passw1">'. __('Password', 'profilebuilder').'</label>
|
250 |
-
<input class="password" name="passw1" type="password" id="passw1" value="
|
251 |
</p><!-- .passw1 -->
|
252 |
<input type="hidden" name="userData" value="'.$user->ID.'"/>
|
253 |
<p class="passw2">
|
254 |
<label for="passw2">'. __('Repeat Password', 'profilebuilder').'</label>
|
255 |
-
<input class="password" name="passw2" type="password" id="passw2" value="
|
256 |
</p><!-- .passw2 -->';
|
257 |
-
$recoverPasswordFilterArray['inputPassword'] = apply_filters('
|
258 |
echo $recoverPasswordFilterArray['inputPassword'];
|
259 |
?>
|
260 |
<p class="form-submit">
|
@@ -278,14 +278,14 @@ function wppb_front_end_password_recovery(){
|
|
278 |
$recoverPasswordFilterArray['inputPassword'] = '
|
279 |
<p class="passw1">
|
280 |
<label for="passw1">'. __('Password', 'profilebuilder').'</label>
|
281 |
-
<input class="password" name="passw1" type="password" id="passw1" value="
|
282 |
</p><!-- .passw1 -->
|
283 |
<input type="hidden" name="userData" value="'.$user->ID.'"/>
|
284 |
<p class="passw2">
|
285 |
<label for="passw2">'. __('Repeat Password', 'profilebuilder').'</label>
|
286 |
-
<input class="password" name="passw2" type="password" id="passw2" value="
|
287 |
</p><!-- .passw2 -->';
|
288 |
-
$recoverPasswordFilterArray['inputPassword'] = apply_filters('
|
289 |
echo $recoverPasswordFilterArray['inputPassword'];
|
290 |
?>
|
291 |
<p class="form-submit">
|
@@ -327,13 +327,13 @@ function wppb_front_end_password_recovery(){
|
|
327 |
|
328 |
$username_email = '';
|
329 |
if (isset($_POST['username_email']))
|
330 |
-
$username_email = $_POST['username_email'];
|
331 |
$recoverPasswordFilterArray['input'] = '
|
332 |
<p class="username_email">
|
333 |
<label for="username_email">'. __('Username or E-mail', 'profilebuilder').'</label>
|
334 |
-
<input class="text-input" name="username_email" type="text" id="username_email" value="'
|
335 |
</p><!-- .username_email -->';
|
336 |
-
$recoverPasswordFilterArray['input'] = apply_filters('
|
337 |
echo $recoverPasswordFilterArray['input'];
|
338 |
|
339 |
|
60 |
/* If the user entered an email/username, process the request */
|
61 |
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'recover_password' && wp_verify_nonce($_POST['password_recovery_nonce_field'],'verify_true_password_recovery') ) {
|
62 |
|
63 |
+
$postedData = esc_html( $_POST['username_email'] ); //we get the raw data
|
64 |
//check to see if it's an e-mail (and if this is valid/present in the database) or is a username
|
65 |
if (is_email($postedData)){
|
66 |
if (email_exists($postedData)){
|
169 |
$message2 = __('Your password has been successfully changed!', 'profilebuilder');
|
170 |
$messageNo2 = '1';
|
171 |
|
172 |
+
$userID = esc_html( $_POST['userData'] );
|
173 |
$new_pass = $_POST['passw1'];
|
174 |
|
175 |
//update the new password and delete the key
|
247 |
$recoverPasswordFilterArray['inputPassword'] = '
|
248 |
<p class="passw1">
|
249 |
<label for="passw1">'. __('Password', 'profilebuilder').'</label>
|
250 |
+
<input class="password" name="passw1" type="password" id="passw1" value="" />
|
251 |
</p><!-- .passw1 -->
|
252 |
<input type="hidden" name="userData" value="'.$user->ID.'"/>
|
253 |
<p class="passw2">
|
254 |
<label for="passw2">'. __('Repeat Password', 'profilebuilder').'</label>
|
255 |
+
<input class="password" name="passw2" type="password" id="passw2" value="" />
|
256 |
</p><!-- .passw2 -->';
|
257 |
+
$recoverPasswordFilterArray['inputPassword'] = apply_filters('wppb_recover_password_input_filter1', $recoverPasswordFilterArray['inputPassword'], $_POST['passw1'], $_POST['passw2'], $user->ID);
|
258 |
echo $recoverPasswordFilterArray['inputPassword'];
|
259 |
?>
|
260 |
<p class="form-submit">
|
278 |
$recoverPasswordFilterArray['inputPassword'] = '
|
279 |
<p class="passw1">
|
280 |
<label for="passw1">'. __('Password', 'profilebuilder').'</label>
|
281 |
+
<input class="password" name="passw1" type="password" id="passw1" value="" />
|
282 |
</p><!-- .passw1 -->
|
283 |
<input type="hidden" name="userData" value="'.$user->ID.'"/>
|
284 |
<p class="passw2">
|
285 |
<label for="passw2">'. __('Repeat Password', 'profilebuilder').'</label>
|
286 |
+
<input class="password" name="passw2" type="password" id="passw2" value="" />
|
287 |
</p><!-- .passw2 -->';
|
288 |
+
$recoverPasswordFilterArray['inputPassword'] = apply_filters('wppb_recover_password_input_filter2', $recoverPasswordFilterArray['inputPassword'], $_POST['passw1'], $_POST['passw2'], $user->ID);
|
289 |
echo $recoverPasswordFilterArray['inputPassword'];
|
290 |
?>
|
291 |
<p class="form-submit">
|
327 |
|
328 |
$username_email = '';
|
329 |
if (isset($_POST['username_email']))
|
330 |
+
$username_email = esc_attr( $_POST['username_email'] );
|
331 |
$recoverPasswordFilterArray['input'] = '
|
332 |
<p class="username_email">
|
333 |
<label for="username_email">'. __('Username or E-mail', 'profilebuilder').'</label>
|
334 |
+
<input class="text-input" name="username_email" type="text" id="username_email" value="'.$username_email.'" />
|
335 |
</p><!-- .username_email -->';
|
336 |
+
$recoverPasswordFilterArray['input'] = apply_filters('wppb_recover_password_input_filter2', $recoverPasswordFilterArray['input'], $username_email);
|
337 |
echo $recoverPasswordFilterArray['input'];
|
338 |
|
339 |
|
front-end/wppb.register.php
CHANGED
@@ -10,7 +10,7 @@ function signup_password_random_password_filter( $password ) {
|
|
10 |
$key = ( !empty( $_POST['key'] ) ? $_POST['key'] : null );
|
11 |
|
12 |
if ( !empty( $_POST['user_pass'] ) )
|
13 |
-
$password = $_POST['user_pass'];
|
14 |
|
15 |
elseif ( !is_null( $key ) ) {
|
16 |
$signup = ( is_multisite() ? $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->signups . " WHERE activation_key = %s", $key ) ) : $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "signups WHERE activation_key = %s", $key ) ) );
|
@@ -287,24 +287,24 @@ function wppb_front_end_register($atts){
|
|
287 |
$user_pass = $_POST['passw1'];
|
288 |
$email = '';
|
289 |
if (isset($_POST['email']))
|
290 |
-
$email =
|
291 |
if (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email')){
|
292 |
$user_name = wppb_generate_random_username($email);
|
293 |
}else{
|
294 |
$user_name = '';
|
295 |
if (isset($_POST['user_name']))
|
296 |
-
$user_name =
|
297 |
}
|
298 |
$first_name = '';
|
299 |
if (isset($_POST['first_name']))
|
300 |
-
$first_name =
|
301 |
$last_name = '';
|
302 |
if (isset($_POST['last_name']))
|
303 |
-
$last_name =
|
304 |
$nickname = '';
|
305 |
if (isset($_POST['nickname'])){
|
306 |
//the field is filled by the user upon registration
|
307 |
-
$nickname =
|
308 |
}elseif (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email')){
|
309 |
//in case the nickname field is hidden, and the login with email is active
|
310 |
$nickname = $email;
|
@@ -314,19 +314,19 @@ function wppb_front_end_register($atts){
|
|
314 |
}
|
315 |
$website = '';
|
316 |
if (isset($_POST['website']))
|
317 |
-
$website =
|
318 |
$aim = '';
|
319 |
if (isset($_POST['aim']))
|
320 |
-
$aim =
|
321 |
$yim = '';
|
322 |
if (isset($_POST['yim']))
|
323 |
-
$yim =
|
324 |
$jabber = '';
|
325 |
if (isset($_POST['jabber']))
|
326 |
-
$jabber =
|
327 |
$description = '';
|
328 |
if (isset($_POST['description']))
|
329 |
-
$description =
|
330 |
|
331 |
/* use filters to modify (if needed) the posted data before creating the user-data */
|
332 |
$user_pass = apply_filters('wppb_register_posted_password', $user_pass);
|
@@ -381,42 +381,42 @@ function wppb_front_end_register($atts){
|
|
381 |
|
382 |
/* check if all the required fields were completed */
|
383 |
if($wppb_defaultOptions['firstname'] == 'show'){
|
384 |
-
if (($wppb_defaultOptions['firstnameRequired'] == 'yes') && (
|
385 |
$firstnameComplete = 'no';
|
386 |
}
|
387 |
|
388 |
if($wppb_defaultOptions['lastname'] == 'show'){
|
389 |
-
if (($wppb_defaultOptions['lastnameRequired'] == 'yes') && (
|
390 |
$lastnameComplete = 'no';
|
391 |
}
|
392 |
|
393 |
if($wppb_defaultOptions['nickname'] == 'show'){
|
394 |
-
if (($wppb_defaultOptions['nicknameRequired'] == 'yes') && (
|
395 |
$nicknameComplete = 'no';
|
396 |
}
|
397 |
|
398 |
if($wppb_defaultOptions['website'] == 'show'){
|
399 |
-
if (($wppb_defaultOptions['websiteRequired'] == 'yes') && (
|
400 |
$websiteComplete = 'no';
|
401 |
}
|
402 |
|
403 |
if($wppb_defaultOptions['aim'] == 'show'){
|
404 |
-
if (($wppb_defaultOptions['aimRequired'] == 'yes') && (
|
405 |
$aimComplete = 'no';
|
406 |
}
|
407 |
|
408 |
if($wppb_defaultOptions['yahoo'] == 'show'){
|
409 |
-
if (($wppb_defaultOptions['yahooRequired'] == 'yes') && (
|
410 |
$yahooComplete = 'no';
|
411 |
}
|
412 |
|
413 |
if($wppb_defaultOptions['jabber'] == 'show'){
|
414 |
-
if (($wppb_defaultOptions['jabberRequired'] == 'yes') && (
|
415 |
$jabberComplete = 'no';
|
416 |
}
|
417 |
|
418 |
if($wppb_defaultOptions['bio'] == 'show'){
|
419 |
-
if (($wppb_defaultOptions['bioRequired'] == 'yes') && (
|
420 |
$bioComplete = 'no';
|
421 |
}
|
422 |
|
@@ -612,7 +612,7 @@ function wppb_front_end_register($atts){
|
|
612 |
elseif(($firstnameComplete == 'no' || $lastnameComplete == 'no' || $nicknameComplete == 'no' || $websiteComplete == 'no' || $aimComplete == 'no' || $yahooComplete == 'no' || $jabberComplete == 'no' || $bioComplete == 'no' ) || !empty($extraFieldsErrorHolder))
|
613 |
$error = __('The account was NOT created!', 'profilebuilder') .'<br/>'. __('(Several required fields were left uncompleted)', 'profilebuilder');
|
614 |
else{
|
615 |
-
$registered_name = $_POST['user_name'];
|
616 |
|
617 |
//register the user normally if it is not a multi-site installation
|
618 |
if ( !is_multisite() ){
|
@@ -686,7 +686,7 @@ function wppb_front_end_register($atts){
|
|
686 |
foreach($checkboxValue as $thisValue){
|
687 |
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
688 |
if (isset($_POST[$thisValue.$value['id']])){
|
689 |
-
$localValue = str_replace('#@space@#', ' ', $_POST[$thisValue.$value['id']]);
|
690 |
$checkboxOption = $checkboxOption.$localValue.',';
|
691 |
}
|
692 |
}
|
@@ -695,27 +695,27 @@ function wppb_front_end_register($atts){
|
|
695 |
break;
|
696 |
}
|
697 |
case "radio":{
|
698 |
-
add_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_type'].$value['id']] );
|
699 |
break;
|
700 |
}
|
701 |
case "select":{
|
702 |
-
add_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_type'].$value['id']] );
|
703 |
break;
|
704 |
}
|
705 |
case "countrySelect":{
|
706 |
-
update_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_type'].$value['id']] );
|
707 |
break;
|
708 |
}
|
709 |
case "timeZone":{
|
710 |
-
update_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_type'].$value['id']] );
|
711 |
break;
|
712 |
}
|
713 |
case "datepicker":{
|
714 |
-
update_user_meta( $new_user, $value['item_metaName'], $_POST[$value['item_type'].$value['id']] );
|
715 |
break;
|
716 |
}
|
717 |
case "textarea":{
|
718 |
-
add_user_meta( $new_user, $value['item_metaName'],
|
719 |
break;
|
720 |
}
|
721 |
case "upload":{
|
@@ -802,7 +802,7 @@ function wppb_front_end_register($atts){
|
|
802 |
|
803 |
// send an email to the admin, and - if selected - to the user also.
|
804 |
$bloginfo = get_bloginfo( 'name' );
|
805 |
-
$sentEmailStatus = wppb_notify_user_registration_email($bloginfo,
|
806 |
|
807 |
do_action('wppb_user_register', $new_user);
|
808 |
}
|
@@ -844,13 +844,16 @@ function wppb_front_end_register($atts){
|
|
844 |
<?php
|
845 |
if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) :
|
846 |
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
|
|
|
|
|
|
852 |
$registerFilterArray['loginLogoutError'] = '
|
853 |
-
<p class="log-in-out alert">'. __('You are logged in as', 'profilebuilder') .' <a href="'.get_author_posts_url( $login->ID ).'" title="'.$
|
854 |
$registerFilterArray['loginLogoutError'] = apply_filters('wppb_register_have_account_alert', $registerFilterArray['loginLogoutError'], $login->ID);
|
855 |
echo $registerFilterArray['loginLogoutError'];
|
856 |
|
@@ -975,9 +978,9 @@ function wppb_front_end_register($atts){
|
|
975 |
$errorVar = '';
|
976 |
$errorMark = '';
|
977 |
if ($wppb_defaultOptions['usernameRequired'] == 'yes'){
|
978 |
-
$errorMark = '<font color="red" title="This field is required for registration.">*</font>';
|
979 |
if (isset($_POST['user_name'])){
|
980 |
-
if (
|
981 |
$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)', 'profilebuilder').'"/>';
|
982 |
$errorVar = ' errorHolder';
|
983 |
}
|
@@ -991,8 +994,8 @@ function wppb_front_end_register($atts){
|
|
991 |
if ($wppb_defaultOptions['emailRequired'] == 'yes'){
|
992 |
$errorMark = '<font color="red" title="'.__('This field is marked as required by the administrator', 'profilebuilder').'">*</font>';
|
993 |
if (isset($_POST['email'])){
|
994 |
-
if ( (trim($_POST['email']) == '') || (!is_email(
|
995 |
-
$errorMark = '<img src="'.WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="This field is required for registration."/>';
|
996 |
$errorVar = ' errorHolder';
|
997 |
}
|
998 |
}
|
@@ -1000,7 +1003,7 @@ function wppb_front_end_register($atts){
|
|
1000 |
|
1001 |
$localVar = '';
|
1002 |
if (isset($_POST['email']))
|
1003 |
-
$localVar = $_POST['email'];
|
1004 |
$registerFilterArray2['name2'] = '
|
1005 |
<p class="form-email'.$errorVar.'">
|
1006 |
<label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
|
@@ -1012,7 +1015,7 @@ function wppb_front_end_register($atts){
|
|
1012 |
}else{
|
1013 |
$localVar = '';
|
1014 |
if (isset($_POST['user_name']))
|
1015 |
-
$localVar = $_POST['user_name'];
|
1016 |
$registerFilterArray2['name2'] = '
|
1017 |
<p class="form-username'.$errorVar.'">
|
1018 |
<label for="user_name">'. __('Username', 'profilebuilder') .$errorMark.'</label>
|
@@ -1037,7 +1040,7 @@ function wppb_front_end_register($atts){
|
|
1037 |
|
1038 |
$localVar = '';
|
1039 |
if (isset($_POST['first_name']))
|
1040 |
-
$localVar = $_POST['first_name'];
|
1041 |
$registerFilterArray2['name3'] = '
|
1042 |
<p class="first_name'.$errorVar.'">
|
1043 |
<label for="first_name">'. __('First Name', 'profilebuilder') .$errorMark.'</label>
|
@@ -1061,7 +1064,7 @@ function wppb_front_end_register($atts){
|
|
1061 |
|
1062 |
$localVar = '';
|
1063 |
if (isset($_POST['last_name']))
|
1064 |
-
$localVar = $_POST['last_name'];
|
1065 |
$registerFilterArray2['name4'] = '
|
1066 |
<p class="last_name'.$errorVar.'">
|
1067 |
<label for="last_name">'. __('Last Name', 'profilebuilder') .$errorMark.'</label>
|
@@ -1085,7 +1088,7 @@ function wppb_front_end_register($atts){
|
|
1085 |
|
1086 |
$localVar = '';
|
1087 |
if (isset($_POST['nickname']))
|
1088 |
-
$localVar = $_POST['nickname'];
|
1089 |
$registerFilterArray2['name5'] = '
|
1090 |
<p class="nickname'.$errorVar.'">
|
1091 |
<label for="nickname">'. __('Nickname', 'profilebuilder') .$errorMark.'</label>
|
@@ -1106,7 +1109,7 @@ function wppb_front_end_register($atts){
|
|
1106 |
$errorMark = '<font color="red" title="'.__('This field is marked as required by the administrator', 'profilebuilder').'">*</font>';
|
1107 |
if (isset($_POST['email'])){
|
1108 |
if ( (trim($_POST['email']) == '') || (!is_email(trim($_POST['email']))) ){
|
1109 |
-
$errorMark = '<img src="'.WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="This field is required for registration."/>';
|
1110 |
$errorVar = ' errorHolder';
|
1111 |
}
|
1112 |
}
|
@@ -1114,7 +1117,7 @@ function wppb_front_end_register($atts){
|
|
1114 |
|
1115 |
$localVar = '';
|
1116 |
if (isset($_POST['email']))
|
1117 |
-
$localVar = $_POST['email'];
|
1118 |
$registerFilterArray2['info2'] = '
|
1119 |
<p class="form-email'.$errorVar.'">
|
1120 |
<label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
|
@@ -1139,7 +1142,7 @@ function wppb_front_end_register($atts){
|
|
1139 |
|
1140 |
$localVar = '';
|
1141 |
if (isset($_POST['website']))
|
1142 |
-
$localVar = $_POST['website'];
|
1143 |
$registerFilterArray2['info3'] = '
|
1144 |
<p class="form-website'.$errorVar.'">
|
1145 |
<label for="website">'. __('Website', 'profilebuilder') .$errorMark.'</label>
|
@@ -1163,11 +1166,11 @@ function wppb_front_end_register($atts){
|
|
1163 |
|
1164 |
$localVar = '';
|
1165 |
if (isset($_POST['aim']))
|
1166 |
-
$localVar = $_POST['aim'];
|
1167 |
$registerFilterArray2['info4'] = '
|
1168 |
<p class="form-aim'.$errorVar.'">
|
1169 |
<label for="aim">'. __('AIM', 'profilebuilder') .$errorMark.'</label>
|
1170 |
-
<input class="text-input" name="aim" type="text" id="aim" value="'.
|
1171 |
</p><!-- .form-aim -->';
|
1172 |
$registerFilterArray2['info4'] = apply_filters('wppb_register_content_info4', $registerFilterArray2['info4'], trim($localVar), $errorVar, $errorMark);
|
1173 |
}
|
@@ -1187,11 +1190,11 @@ function wppb_front_end_register($atts){
|
|
1187 |
|
1188 |
$localVar = '';
|
1189 |
if (isset($_POST['yim']))
|
1190 |
-
$localVar = $_POST['yim'];
|
1191 |
$registerFilterArray2['info5'] = '
|
1192 |
<p class="form-yim'.$errorVar.'">
|
1193 |
<label for="yim">'. __('Yahoo IM', 'profilebuilder') .$errorMark.'</label>
|
1194 |
-
<input class="text-input" name="yim" type="text" id="yim" value="'.
|
1195 |
</p><!-- .form-yim -->';
|
1196 |
$registerFilterArray2['info5'] = apply_filters('wppb_register_content_info5', $registerFilterArray2['info5'], trim($localVar), $errorVar, $errorMark);
|
1197 |
}
|
@@ -1211,11 +1214,11 @@ function wppb_front_end_register($atts){
|
|
1211 |
|
1212 |
$localVar = '';
|
1213 |
if (isset($_POST['jabber']))
|
1214 |
-
$localVar = $_POST['jabber'];
|
1215 |
$registerFilterArray2['info6'] = '
|
1216 |
<p class="form-jabber'.$errorVar.'">
|
1217 |
<label for="jabber">'. __('Jabber / Google Talk', 'profilebuilder') .$errorMark.'</label>
|
1218 |
-
<input class="text-input" name="jabber" type="text" id="jabber" value="'.
|
1219 |
</p><!-- .form-jabber -->';
|
1220 |
$registerFilterArray2['info6'] = apply_filters('wppb_register_content_info6', $registerFilterArray2['info6'], trim($localVar), $errorVar, $errorMark);
|
1221 |
}
|
@@ -1238,11 +1241,11 @@ function wppb_front_end_register($atts){
|
|
1238 |
|
1239 |
$localVar = '';
|
1240 |
if (isset($_POST['description']))
|
1241 |
-
$localVar = $_POST['description'];
|
1242 |
$registerFilterArray2['ay2'] = '
|
1243 |
<p class="form-description'.$errorVar.'">
|
1244 |
<label for="description">'. __('Biographical Info', 'profilebuilder') .$errorMark.'</label>
|
1245 |
-
<textarea class="text-input" name="description" id="description" rows="5" cols="30">'.
|
1246 |
</p><!-- .form-description -->';
|
1247 |
$registerFilterArray2['ay2'] = apply_filters('wppb_register_content_about_yourself2', $registerFilterArray2['ay2'], trim($localVar), $errorVar, $errorMark);
|
1248 |
}
|
@@ -1253,16 +1256,16 @@ function wppb_front_end_register($atts){
|
|
1253 |
$errorVar = '';
|
1254 |
$errorVar2 = '';
|
1255 |
if ($wppb_defaultOptions['passwordRequired'] == 'yes'){
|
1256 |
-
$errorMark = '<font color="red" title="This field is required for registration.">*</font>';
|
1257 |
-
$errorMark2 = '<font color="red" title="This field is required for registration.">*</font>';
|
1258 |
if (isset ($_POST['passw1']))
|
1259 |
if (trim($_POST['passw1']) == ''){
|
1260 |
-
$errorMark = '<img src="'.WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="This field is required for registration."/>';
|
1261 |
$errorVar = ' errorHolder';
|
1262 |
}
|
1263 |
if (isset ($_POST['passw2']))
|
1264 |
if (trim($_POST['passw2']) == ''){
|
1265 |
-
$errorMark2 = '<img src="'.WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="This field is required for registration."/>';
|
1266 |
$errorVar2 = ' errorHolder';
|
1267 |
}
|
1268 |
}
|
@@ -1276,12 +1279,12 @@ function wppb_front_end_register($atts){
|
|
1276 |
$registerFilterArray2['ay3'] = '
|
1277 |
<p class="form-password'.$errorVar.'">
|
1278 |
<label for="pass1">'. __('Password', 'profilebuilder') .$errorMark.'</label>
|
1279 |
-
<input class="text-input" name="passw1" type="password" id="pass1" value="
|
1280 |
</p><!-- .form-password -->
|
1281 |
|
1282 |
<p class="form-password'.$errorVar2.'">
|
1283 |
<label for="pass2">'. __('Repeat Password', 'profilebuilder') .$errorMark2.'</label>
|
1284 |
-
<input class="text-input" name="passw2" type="password" id="pass2" value="
|
1285 |
</p><!-- .form-password -->';
|
1286 |
$registerFilterArray2['ay3'] = apply_filters('wppb_register_content_about_yourself3', $registerFilterArray2['ay3'], trim($localVar1), trim($localVar2), $errorVar, $errorMark, $errorVar2, $errorMark2);
|
1287 |
}
|
10 |
$key = ( !empty( $_POST['key'] ) ? $_POST['key'] : null );
|
11 |
|
12 |
if ( !empty( $_POST['user_pass'] ) )
|
13 |
+
$password = esc_html( $_POST['user_pass'] );
|
14 |
|
15 |
elseif ( !is_null( $key ) ) {
|
16 |
$signup = ( is_multisite() ? $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->signups . " WHERE activation_key = %s", $key ) ) : $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "signups WHERE activation_key = %s", $key ) ) );
|
287 |
$user_pass = $_POST['passw1'];
|
288 |
$email = '';
|
289 |
if (isset($_POST['email']))
|
290 |
+
$email = esc_html( $_POST['email'] );
|
291 |
if (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email')){
|
292 |
$user_name = wppb_generate_random_username($email);
|
293 |
}else{
|
294 |
$user_name = '';
|
295 |
if (isset($_POST['user_name']))
|
296 |
+
$user_name = esc_html( $_POST['user_name'] );
|
297 |
}
|
298 |
$first_name = '';
|
299 |
if (isset($_POST['first_name']))
|
300 |
+
$first_name = esc_html( $_POST['first_name'] );
|
301 |
$last_name = '';
|
302 |
if (isset($_POST['last_name']))
|
303 |
+
$last_name = esc_html( $_POST['last_name'] );
|
304 |
$nickname = '';
|
305 |
if (isset($_POST['nickname'])){
|
306 |
//the field is filled by the user upon registration
|
307 |
+
$nickname = esc_html( $_POST['nickname'] );
|
308 |
}elseif (isset($wppb_generalSettings['loginWith']) && ($wppb_generalSettings['loginWith'] == 'email')){
|
309 |
//in case the nickname field is hidden, and the login with email is active
|
310 |
$nickname = $email;
|
314 |
}
|
315 |
$website = '';
|
316 |
if (isset($_POST['website']))
|
317 |
+
$website = esc_html( $_POST['website'] );
|
318 |
$aim = '';
|
319 |
if (isset($_POST['aim']))
|
320 |
+
$aim = esc_html( $_POST['aim'] );
|
321 |
$yim = '';
|
322 |
if (isset($_POST['yim']))
|
323 |
+
$yim = esc_html( $_POST['yim'] );
|
324 |
$jabber = '';
|
325 |
if (isset($_POST['jabber']))
|
326 |
+
$jabber = esc_html( $_POST['jabber'] );
|
327 |
$description = '';
|
328 |
if (isset($_POST['description']))
|
329 |
+
$description = esc_html( $_POST['description'] );
|
330 |
|
331 |
/* use filters to modify (if needed) the posted data before creating the user-data */
|
332 |
$user_pass = apply_filters('wppb_register_posted_password', $user_pass);
|
381 |
|
382 |
/* check if all the required fields were completed */
|
383 |
if($wppb_defaultOptions['firstname'] == 'show'){
|
384 |
+
if (($wppb_defaultOptions['firstnameRequired'] == 'yes') && (esc_html( $_POST['first_name'] ) == ''))
|
385 |
$firstnameComplete = 'no';
|
386 |
}
|
387 |
|
388 |
if($wppb_defaultOptions['lastname'] == 'show'){
|
389 |
+
if (($wppb_defaultOptions['lastnameRequired'] == 'yes') && (esc_html( $_POST['last_name'] ) == ''))
|
390 |
$lastnameComplete = 'no';
|
391 |
}
|
392 |
|
393 |
if($wppb_defaultOptions['nickname'] == 'show'){
|
394 |
+
if (($wppb_defaultOptions['nicknameRequired'] == 'yes') && (esc_html( $_POST['nickname'] ) == ''))
|
395 |
$nicknameComplete = 'no';
|
396 |
}
|
397 |
|
398 |
if($wppb_defaultOptions['website'] == 'show'){
|
399 |
+
if (($wppb_defaultOptions['websiteRequired'] == 'yes') && (esc_html( $_POST['website'] ) == ''))
|
400 |
$websiteComplete = 'no';
|
401 |
}
|
402 |
|
403 |
if($wppb_defaultOptions['aim'] == 'show'){
|
404 |
+
if (($wppb_defaultOptions['aimRequired'] == 'yes') && (esc_html( $_POST['aim'] ) == ''))
|
405 |
$aimComplete = 'no';
|
406 |
}
|
407 |
|
408 |
if($wppb_defaultOptions['yahoo'] == 'show'){
|
409 |
+
if (($wppb_defaultOptions['yahooRequired'] == 'yes') && (esc_html($_POST['yahoo']) == ''))
|
410 |
$yahooComplete = 'no';
|
411 |
}
|
412 |
|
413 |
if($wppb_defaultOptions['jabber'] == 'show'){
|
414 |
+
if (($wppb_defaultOptions['jabberRequired'] == 'yes') && (esc_html($_POST['jabber']) == ''))
|
415 |
$jabberComplete = 'no';
|
416 |
}
|
417 |
|
418 |
if($wppb_defaultOptions['bio'] == 'show'){
|
419 |
+
if (($wppb_defaultOptions['bioRequired'] == 'yes') && (esc_textarea($_POST['description']) == ''))
|
420 |
$bioComplete = 'no';
|
421 |
}
|
422 |
|
612 |
elseif(($firstnameComplete == 'no' || $lastnameComplete == 'no' || $nicknameComplete == 'no' || $websiteComplete == 'no' || $aimComplete == 'no' || $yahooComplete == 'no' || $jabberComplete == 'no' || $bioComplete == 'no' ) || !empty($extraFieldsErrorHolder))
|
613 |
$error = __('The account was NOT created!', 'profilebuilder') .'<br/>'. __('(Several required fields were left uncompleted)', 'profilebuilder');
|
614 |
else{
|
615 |
+
$registered_name = esc_html( $_POST['user_name'] );
|
616 |
|
617 |
//register the user normally if it is not a multi-site installation
|
618 |
if ( !is_multisite() ){
|
686 |
foreach($checkboxValue as $thisValue){
|
687 |
$thisValue = str_replace(' ', '#@space@#', $thisValue); //we need to escape the space-codification we sent earlier in the post
|
688 |
if (isset($_POST[$thisValue.$value['id']])){
|
689 |
+
$localValue = str_replace('#@space@#', ' ', esc_html( $_POST[$thisValue.$value['id']] ) );
|
690 |
$checkboxOption = $checkboxOption.$localValue.',';
|
691 |
}
|
692 |
}
|
695 |
break;
|
696 |
}
|
697 |
case "radio":{
|
698 |
+
add_user_meta( $new_user, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
699 |
break;
|
700 |
}
|
701 |
case "select":{
|
702 |
+
add_user_meta( $new_user, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
703 |
break;
|
704 |
}
|
705 |
case "countrySelect":{
|
706 |
+
update_user_meta( $new_user, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
707 |
break;
|
708 |
}
|
709 |
case "timeZone":{
|
710 |
+
update_user_meta( $new_user, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
711 |
break;
|
712 |
}
|
713 |
case "datepicker":{
|
714 |
+
update_user_meta( $new_user, $value['item_metaName'], esc_html( $_POST[$value['item_type'].$value['id']] ) );
|
715 |
break;
|
716 |
}
|
717 |
case "textarea":{
|
718 |
+
add_user_meta( $new_user, $value['item_metaName'], esc_textarea( $_POST[$value['item_type'].$value['id']] ) );
|
719 |
break;
|
720 |
}
|
721 |
case "upload":{
|
802 |
|
803 |
// send an email to the admin, and - if selected - to the user also.
|
804 |
$bloginfo = get_bloginfo( 'name' );
|
805 |
+
$sentEmailStatus = wppb_notify_user_registration_email($bloginfo, esc_html($_POST['user_name']), esc_html($_POST['email']), esc_html( $_POST['send_credentials_via_email']), $_POST['passw1'], $wppb_generalSettings['adminApproval']);
|
806 |
|
807 |
do_action('wppb_user_register', $new_user);
|
808 |
}
|
844 |
<?php
|
845 |
if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) :
|
846 |
|
847 |
+
global $user_ID;
|
848 |
+
$login = get_userdata( $user_ID );
|
849 |
+
if($login->display_name == ''){
|
850 |
+
$login->display_name = $login->user_login;
|
851 |
+
}
|
852 |
+
|
853 |
+
$display_name = ( ( isset( $wppb_generalSettings['loginWith'] ) && ( $wppb_generalSettings['loginWith'] == 'email' ) ) ? $login->user_email : $login->display_name );
|
854 |
+
|
855 |
$registerFilterArray['loginLogoutError'] = '
|
856 |
+
<p class="log-in-out alert">'. __('You are logged in as', 'profilebuilder') .' <a href="'.get_author_posts_url( $login->ID ).'" title="'.$display_name.'">'.$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 -->';
|
857 |
$registerFilterArray['loginLogoutError'] = apply_filters('wppb_register_have_account_alert', $registerFilterArray['loginLogoutError'], $login->ID);
|
858 |
echo $registerFilterArray['loginLogoutError'];
|
859 |
|
978 |
$errorVar = '';
|
979 |
$errorMark = '';
|
980 |
if ($wppb_defaultOptions['usernameRequired'] == 'yes'){
|
981 |
+
$errorMark = '<font color="red" title="'. __( 'This field is required for registration.', 'profilebuilder' ) .'">*</font>';
|
982 |
if (isset($_POST['user_name'])){
|
983 |
+
if (esc_html($_POST['user_name']) == ''){
|
984 |
$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)', 'profilebuilder').'"/>';
|
985 |
$errorVar = ' errorHolder';
|
986 |
}
|
994 |
if ($wppb_defaultOptions['emailRequired'] == 'yes'){
|
995 |
$errorMark = '<font color="red" title="'.__('This field is marked as required by the administrator', 'profilebuilder').'">*</font>';
|
996 |
if (isset($_POST['email'])){
|
997 |
+
if ( (trim($_POST['email']) == '') || (!is_email(esc_html($_POST['email']))) ){
|
998 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="'. __( 'This field is required for registration.', 'profilebuilder' ) .'"/>';
|
999 |
$errorVar = ' errorHolder';
|
1000 |
}
|
1001 |
}
|
1003 |
|
1004 |
$localVar = '';
|
1005 |
if (isset($_POST['email']))
|
1006 |
+
$localVar = esc_html( $_POST['email'] );
|
1007 |
$registerFilterArray2['name2'] = '
|
1008 |
<p class="form-email'.$errorVar.'">
|
1009 |
<label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
|
1015 |
}else{
|
1016 |
$localVar = '';
|
1017 |
if (isset($_POST['user_name']))
|
1018 |
+
$localVar = esc_html( $_POST['user_name'] );
|
1019 |
$registerFilterArray2['name2'] = '
|
1020 |
<p class="form-username'.$errorVar.'">
|
1021 |
<label for="user_name">'. __('Username', 'profilebuilder') .$errorMark.'</label>
|
1040 |
|
1041 |
$localVar = '';
|
1042 |
if (isset($_POST['first_name']))
|
1043 |
+
$localVar = esc_html( $_POST['first_name'] );
|
1044 |
$registerFilterArray2['name3'] = '
|
1045 |
<p class="first_name'.$errorVar.'">
|
1046 |
<label for="first_name">'. __('First Name', 'profilebuilder') .$errorMark.'</label>
|
1064 |
|
1065 |
$localVar = '';
|
1066 |
if (isset($_POST['last_name']))
|
1067 |
+
$localVar = esc_html( $_POST['last_name'] );
|
1068 |
$registerFilterArray2['name4'] = '
|
1069 |
<p class="last_name'.$errorVar.'">
|
1070 |
<label for="last_name">'. __('Last Name', 'profilebuilder') .$errorMark.'</label>
|
1088 |
|
1089 |
$localVar = '';
|
1090 |
if (isset($_POST['nickname']))
|
1091 |
+
$localVar = esc_html( $_POST['nickname'] );
|
1092 |
$registerFilterArray2['name5'] = '
|
1093 |
<p class="nickname'.$errorVar.'">
|
1094 |
<label for="nickname">'. __('Nickname', 'profilebuilder') .$errorMark.'</label>
|
1109 |
$errorMark = '<font color="red" title="'.__('This field is marked as required by the administrator', 'profilebuilder').'">*</font>';
|
1110 |
if (isset($_POST['email'])){
|
1111 |
if ( (trim($_POST['email']) == '') || (!is_email(trim($_POST['email']))) ){
|
1112 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="'. __( 'This field is required for registration.', 'profilebuilder' ) .'"/>';
|
1113 |
$errorVar = ' errorHolder';
|
1114 |
}
|
1115 |
}
|
1117 |
|
1118 |
$localVar = '';
|
1119 |
if (isset($_POST['email']))
|
1120 |
+
$localVar = esc_html( $_POST['email'] );
|
1121 |
$registerFilterArray2['info2'] = '
|
1122 |
<p class="form-email'.$errorVar.'">
|
1123 |
<label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
|
1142 |
|
1143 |
$localVar = '';
|
1144 |
if (isset($_POST['website']))
|
1145 |
+
$localVar = esc_html( $_POST['website'] );
|
1146 |
$registerFilterArray2['info3'] = '
|
1147 |
<p class="form-website'.$errorVar.'">
|
1148 |
<label for="website">'. __('Website', 'profilebuilder') .$errorMark.'</label>
|
1166 |
|
1167 |
$localVar = '';
|
1168 |
if (isset($_POST['aim']))
|
1169 |
+
$localVar = esc_html( $_POST['aim'] );
|
1170 |
$registerFilterArray2['info4'] = '
|
1171 |
<p class="form-aim'.$errorVar.'">
|
1172 |
<label for="aim">'. __('AIM', 'profilebuilder') .$errorMark.'</label>
|
1173 |
+
<input class="text-input" name="aim" type="text" id="aim" value="'.stripslashes( $localVar ) .'" />
|
1174 |
</p><!-- .form-aim -->';
|
1175 |
$registerFilterArray2['info4'] = apply_filters('wppb_register_content_info4', $registerFilterArray2['info4'], trim($localVar), $errorVar, $errorMark);
|
1176 |
}
|
1190 |
|
1191 |
$localVar = '';
|
1192 |
if (isset($_POST['yim']))
|
1193 |
+
$localVar = esc_html( $_POST['yim'] );
|
1194 |
$registerFilterArray2['info5'] = '
|
1195 |
<p class="form-yim'.$errorVar.'">
|
1196 |
<label for="yim">'. __('Yahoo IM', 'profilebuilder') .$errorMark.'</label>
|
1197 |
+
<input class="text-input" name="yim" type="text" id="yim" value="'.stripslashes($localVar).'" />
|
1198 |
</p><!-- .form-yim -->';
|
1199 |
$registerFilterArray2['info5'] = apply_filters('wppb_register_content_info5', $registerFilterArray2['info5'], trim($localVar), $errorVar, $errorMark);
|
1200 |
}
|
1214 |
|
1215 |
$localVar = '';
|
1216 |
if (isset($_POST['jabber']))
|
1217 |
+
$localVar = esc_html( $_POST['jabber'] );
|
1218 |
$registerFilterArray2['info6'] = '
|
1219 |
<p class="form-jabber'.$errorVar.'">
|
1220 |
<label for="jabber">'. __('Jabber / Google Talk', 'profilebuilder') .$errorMark.'</label>
|
1221 |
+
<input class="text-input" name="jabber" type="text" id="jabber" value="'.stripslashes($localVar).'" />
|
1222 |
</p><!-- .form-jabber -->';
|
1223 |
$registerFilterArray2['info6'] = apply_filters('wppb_register_content_info6', $registerFilterArray2['info6'], trim($localVar), $errorVar, $errorMark);
|
1224 |
}
|
1241 |
|
1242 |
$localVar = '';
|
1243 |
if (isset($_POST['description']))
|
1244 |
+
$localVar = esc_html( $_POST['description'] );
|
1245 |
$registerFilterArray2['ay2'] = '
|
1246 |
<p class="form-description'.$errorVar.'">
|
1247 |
<label for="description">'. __('Biographical Info', 'profilebuilder') .$errorMark.'</label>
|
1248 |
+
<textarea class="text-input" name="description" id="description" rows="5" cols="30">'.stripslashes($localVar).'</textarea>
|
1249 |
</p><!-- .form-description -->';
|
1250 |
$registerFilterArray2['ay2'] = apply_filters('wppb_register_content_about_yourself2', $registerFilterArray2['ay2'], trim($localVar), $errorVar, $errorMark);
|
1251 |
}
|
1256 |
$errorVar = '';
|
1257 |
$errorVar2 = '';
|
1258 |
if ($wppb_defaultOptions['passwordRequired'] == 'yes'){
|
1259 |
+
$errorMark = '<font color="red" title="'. __( 'This field is required for registration.', 'profilebuilder' ) .'">*</font>';
|
1260 |
+
$errorMark2 = '<font color="red" title="'. __( 'This field is required for registration.', 'profilebuilder' ) .'">*</font>';
|
1261 |
if (isset ($_POST['passw1']))
|
1262 |
if (trim($_POST['passw1']) == ''){
|
1263 |
+
$errorMark = '<img src="'.WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="'. __( 'This field is required for registration.', 'profilebuilder' ) .'"/>';
|
1264 |
$errorVar = ' errorHolder';
|
1265 |
}
|
1266 |
if (isset ($_POST['passw2']))
|
1267 |
if (trim($_POST['passw2']) == ''){
|
1268 |
+
$errorMark2 = '<img src="'.WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="'. __( 'This field is required for registration.', 'profilebuilder' ) .'"/>';
|
1269 |
$errorVar2 = ' errorHolder';
|
1270 |
}
|
1271 |
}
|
1279 |
$registerFilterArray2['ay3'] = '
|
1280 |
<p class="form-password'.$errorVar.'">
|
1281 |
<label for="pass1">'. __('Password', 'profilebuilder') .$errorMark.'</label>
|
1282 |
+
<input class="text-input" name="passw1" type="password" id="pass1" value="" />
|
1283 |
</p><!-- .form-password -->
|
1284 |
|
1285 |
<p class="form-password'.$errorVar2.'">
|
1286 |
<label for="pass2">'. __('Repeat Password', 'profilebuilder') .$errorMark2.'</label>
|
1287 |
+
<input class="text-input" name="passw2" type="password" id="pass2" value="" />
|
1288 |
</p><!-- .form-password -->';
|
1289 |
$registerFilterArray2['ay3'] = apply_filters('wppb_register_content_about_yourself3', $registerFilterArray2['ay3'], trim($localVar1), trim($localVar2), $errorVar, $errorMark, $errorVar2, $errorMark2);
|
1290 |
}
|
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: Cozmoslabs, Barina Gabriel, Antohe Cristian
|
8 |
Author URI: http://www.cozmoslabs.com/
|
9 |
License: GPL2
|
@@ -53,7 +53,7 @@ function wppb_return_bytes( $val ) {
|
|
53 |
return $val;
|
54 |
}
|
55 |
|
56 |
-
define( 'PROFILE_BUILDER_VERSION', '1.1.
|
57 |
define( 'WPPB_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
|
58 |
define( 'WPPB_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
59 |
define( 'WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters( 'wppb_server_max_upload_size_byte_constant', wppb_return_bytes( ini_get( 'upload_max_filesize') ) ) );
|
3 |
Plugin Name: Profile Builder
|
4 |
Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
|
5 |
Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
|
6 |
+
Version: 1.1.66
|
7 |
Author: Cozmoslabs, Barina Gabriel, Antohe Cristian
|
8 |
Author URI: http://www.cozmoslabs.com/
|
9 |
License: GPL2
|
53 |
return $val;
|
54 |
}
|
55 |
|
56 |
+
define( 'PROFILE_BUILDER_VERSION', '1.1.66' );
|
57 |
define( 'WPPB_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
|
58 |
define( 'WPPB_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
59 |
define( 'WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters( 'wppb_server_max_upload_size_byte_constant', wppb_return_bytes( ini_get( 'upload_max_filesize') ) ) );
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Tags: registration, user profile, user registration, custom field registration,
|
|
6 |
|
7 |
Requires at least: 3.1
|
8 |
Tested up to: 3.8.1
|
9 |
-
Stable tag: 1.1.
|
10 |
|
11 |
Simple to use profile plugin allowing front-end login, user registration and edit profile by using shortcodes.
|
12 |
|
@@ -94,6 +94,9 @@ This plugin only adds/removes user fields in the front-end. The default profile
|
|
94 |
7. Password Recovery Page
|
95 |
|
96 |
== Changelog ==
|
|
|
|
|
|
|
97 |
= 1.1.65 =
|
98 |
Minor changes in the readme and index files.
|
99 |
|
6 |
|
7 |
Requires at least: 3.1
|
8 |
Tested up to: 3.8.1
|
9 |
+
Stable tag: 1.1.66
|
10 |
|
11 |
Simple to use profile plugin allowing front-end login, user registration and edit profile by using shortcodes.
|
12 |
|
94 |
7. Password Recovery Page
|
95 |
|
96 |
== Changelog ==
|
97 |
+
= 1.1.66 =
|
98 |
+
Sanitized forms against XSS exploits.
|
99 |
+
|
100 |
= 1.1.65 =
|
101 |
Minor changes in the readme and index files.
|
102 |
|