Cimy User Extra Fields - Version 2.1.1

Version Description

Download this release

Release Info

Developer Cimmo
Plugin Icon wp plugin Cimy User Extra Fields
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1.0 to 2.1.1

README_OFFICIAL.txt CHANGED
@@ -37,11 +37,11 @@ Following WordPress hidden fields can be enabled during registration:
37
 
38
  Other features:
39
  * reCAPTCHA
 
40
  * custom welcome email (non MS installations)
41
  * custom registration logo (non MS installations)
42
  * email confirmation (non MS installations)
43
  * form confirmation (non MS installations)
44
- * image upload with crop/resize functions
45
  * much more!
46
 
47
  The plug-in adds two new menu voices in the admin for the administrator and two for users.
@@ -483,6 +483,7 @@ KNOWN ISSUES:
483
  - dropdown issues:
484
  - custom value is not supported
485
  - comma is not allowed as it is the delimiter
 
486
 
487
 
488
  FAQ:
@@ -583,7 +584,7 @@ A: Sure, visit the donation page or contact me via e-mail.
583
  Q: Can I hack this plug-in and hope to see my code in the next release?
584
 
585
  A: For sure, this is just happened and can happen again if you write useful new features and good code. Try to see how I maintain the code and try to do the same (or even better of course), I have rules on how I write it, don't want "spaghetti code", I'm Italian and I want spaghetti only on my plate.
586
- There is no guarantee that your patch will reach Cimy User Extra Fields, but feel free to do a fork of this project and distribuite it, this is GPL!
587
 
588
 
589
  Q1: I have found a bug what can I do?
@@ -603,9 +604,13 @@ A lot of times I cannot reproduce the problem and I need more details, so if you
603
 
604
 
605
  CHANGELOG:
 
 
 
 
606
  v2.1.0 - 28/06/2011
607
- - Added confirmation registration (thanks to Marcello Foglia for sponsoring it)
608
- - Added custom welcome email (thanks to Marcello Foglia for sponsoring it)
609
  - Added crop functionalities for picture and avatar fields (thanks to Marcello Foglia for sponsoring it)
610
  - Added advanced options (thanks to Marcello Foglia for sponsoring it)
611
  - Code cleanup
37
 
38
  Other features:
39
  * reCAPTCHA
40
+ * image upload with crop/resize functions
41
  * custom welcome email (non MS installations)
42
  * custom registration logo (non MS installations)
43
  * email confirmation (non MS installations)
44
  * form confirmation (non MS installations)
 
45
  * much more!
46
 
47
  The plug-in adds two new menu voices in the admin for the administrator and two for users.
483
  - dropdown issues:
484
  - custom value is not supported
485
  - comma is not allowed as it is the delimiter
486
+ - registration confirmation does not work if you use Theme My Login plug-in
487
 
488
 
489
  FAQ:
584
  Q: Can I hack this plug-in and hope to see my code in the next release?
585
 
586
  A: For sure, this is just happened and can happen again if you write useful new features and good code. Try to see how I maintain the code and try to do the same (or even better of course), I have rules on how I write it, don't want "spaghetti code", I'm Italian and I want spaghetti only on my plate.
587
+ There is no guarantee that your patch will hit an official upcoming release of the plug-in, but feel free to do a fork of this project and distribute it, this is GPL!
588
 
589
 
590
  Q1: I have found a bug what can I do?
604
 
605
 
606
  CHANGELOG:
607
+ v2.1.1 - 11/07/2011
608
+ - Fixed compatibility with Theme My Login plug-in (introduced with v2.1.0) (thanks to Michele and Mark)
609
+ - Fixed compatibility with WP-reCAPTCHA plug-in (thanks to des for the patch)
610
+
611
  v2.1.0 - 28/06/2011
612
+ - Added confirmation registration (non MS only) (thanks to Marcello Foglia for sponsoring it)
613
+ - Added custom welcome email (non MS only) (thanks to Marcello Foglia for sponsoring it)
614
  - Added crop functionalities for picture and avatar fields (thanks to Marcello Foglia for sponsoring it)
615
  - Added advanced options (thanks to Marcello Foglia for sponsoring it)
616
  - Code cleanup
cimy_uef_register.php CHANGED
@@ -540,7 +540,7 @@ function cimy_registration_check($user_login, $user_email, $errors) {
540
  }
541
  }
542
 
543
- if (isset($_POST["recaptcha_response_field"])) {
544
  $recaptcha_code_ok = false;
545
 
546
  if ($_POST["recaptcha_response_field"]) {
@@ -752,11 +752,6 @@ function cimy_registration_form($errors=null, $show_type=0) {
752
  else
753
  $value = "";
754
 
755
- if ($show_type == 2)
756
- $value = cimy_uef_sanitize_content($value);
757
- else
758
- $value = esc_attr($value);
759
-
760
  if (($i != 1) && ($fieldset > $current_fieldset) && (isset($fieldset_titles[$fieldset]))) {
761
  $current_fieldset = $fieldset;
762
 
@@ -787,7 +782,7 @@ function cimy_registration_form($errors=null, $show_type=0) {
787
  else
788
  $obj_type = ' type="'.$type.'"';
789
 
790
- $obj_value = ' value="'.$value.'"';
791
  $obj_value2 = "";
792
  $obj_checked = "";
793
  $obj_tag = "input";
@@ -796,7 +791,7 @@ function cimy_registration_form($errors=null, $show_type=0) {
796
 
797
  case "dropdown":
798
  case "dropdown-multi":
799
- $ret = cimy_dropDownOptions($label, $value);
800
  $label = $ret['label'];
801
  $html = $ret['html'];
802
 
@@ -823,7 +818,7 @@ function cimy_registration_form($errors=null, $show_type=0) {
823
  $obj_name = ' name="'.$input_name.'"';
824
  $obj_type = "";
825
  $obj_value = "";
826
- $obj_value2 = $value;
827
  $obj_checked = "";
828
  $obj_tag = "textarea";
829
  $obj_closing_tag = true;
@@ -840,7 +835,7 @@ function cimy_registration_form($errors=null, $show_type=0) {
840
  $obj_name = ' name="'.$input_name.'"';
841
  $obj_type = "";
842
  $obj_value = "";
843
- $obj_value2 = $value;
844
  $obj_checked = "";
845
  $obj_tag = "textarea";
846
  $obj_closing_tag = true;
@@ -906,7 +901,7 @@ function cimy_registration_form($errors=null, $show_type=0) {
906
  $obj_class = ' class="cimy_uef_picture"';
907
  $obj_name = ' name="'.$input_name.'"';
908
  $obj_type = ' type="file"';
909
- $obj_value = ' value="'.$value.'"';
910
  $obj_value2 = "";
911
  $obj_tag = "input";
912
  $obj_closing_tag = false;
@@ -924,7 +919,7 @@ function cimy_registration_form($errors=null, $show_type=0) {
924
  break;
925
  case 'dropdown':
926
  case 'dropdown-multi':
927
- $ret = cimy_dropDownOptions($label, $value);
928
  $label = $ret['label'];
929
  break;
930
  case 'picture':
@@ -943,12 +938,12 @@ function cimy_registration_form($errors=null, $show_type=0) {
943
  if ($old_type != "password") {
944
  $obj_label = '<label for="'.$unique_id.'">'.$label.' </label>';
945
  if (empty($obj_value2))
946
- $obj_value2 = $value;
947
  }
948
  $obj_class = '';
949
  $obj_name = ' name="'.$input_name.'"';
950
  $obj_type = ' type="hidden"';
951
- $obj_value = ' value="'.$value.'"';
952
  $obj_checked = "";
953
  $obj_tag = "input";
954
  $obj_closing_tag = false;
@@ -959,7 +954,7 @@ function cimy_registration_form($errors=null, $show_type=0) {
959
  $obj_class = '';
960
  $obj_name = ' name="'.$input_name.'"';
961
  $obj_type = ' type="hidden"';
962
- $obj_value = ' value="'.$value.'"';
963
  $obj_value2 = "";
964
  $obj_checked = "";
965
  $obj_tag = "input";
@@ -1000,8 +995,8 @@ function cimy_registration_form($errors=null, $show_type=0) {
1000
  else if ($type == "hidden") {
1001
  $form_object.= " />".$obj_value2;
1002
  if (in_array($old_type, $cimy_uef_file_types)) {
1003
- echo "<input type=\"hidden\" name=\"".$field_id_data."_size\" id=\"".$field_id_data."_size\" value=\"".strval($_FILES[$input_name]['size'] / 1024)."\" />";
1004
- echo "<input type=\"hidden\" name=\"".$field_id_data."_type\" id=\"".$field_id_data."_type\" value=\"".strval($_FILES[$input_name]['type'])."\" />";
1005
  }
1006
  if (($old_type == "picture") || ($old_type == "avatar")) {
1007
  if (!$is_jquery_added) {
@@ -1009,14 +1004,14 @@ function cimy_registration_form($errors=null, $show_type=0) {
1009
  $is_jquery_added = true;
1010
  }
1011
  $crop_image_function = true;
1012
- echo '<img id="'.$field_id_data.'" src="'.$value.'" alt="picture" /><br />';
1013
- echo "<input type=\"hidden\" name=\"".$field_id_data."_button\" id=\"".$field_id_data."_button\" value=\"1\" />";
1014
- echo "<input type=\"hidden\" name=\"".$field_id_data."_x1\" id=\"".$field_id_data."_x1\" value=\"\" />";
1015
- echo "<input type=\"hidden\" name=\"".$field_id_data."_y1\" id=\"".$field_id_data."_y1\" value=\"\" />";
1016
- echo "<input type=\"hidden\" name=\"".$field_id_data."_x2\" id=\"".$field_id_data."_x2\" value=\"\" />";
1017
- echo "<input type=\"hidden\" name=\"".$field_id_data."_y2\" id=\"".$field_id_data."_y2\" value=\"\" />";
1018
- echo "<input type=\"hidden\" name=\"".$field_id_data."_w\" id=\"".$field_id_data."_w\" value=\"\" />";
1019
- echo "<input type=\"hidden\" name=\"".$field_id_data."_h\" id=\"".$field_id_data."_h\" value=\"\" />";
1020
  $imgarea_options = "handles: true, fadeSpeed: 200, onSelectChange: preview";
1021
  if ((isset($advanced_options["crop_x1"])) && (isset($advanced_options["crop_y1"])) && (isset($advanced_options["crop_x2"])) && (isset($advanced_options["crop_y2"]))) {
1022
  $imgarea_options.= ", x1: ".intval($advanced_options["crop_x1"]);
@@ -1148,7 +1143,12 @@ function cimy_confirmation_form() {
1148
  if ($http_post) {
1149
  $user_login = $_POST['user_login'];
1150
  $user_email = $_POST['user_email'];
1151
- $errors = register_new_user($user_login, $user_email);
 
 
 
 
 
1152
 
1153
  if (!is_wp_error($errors)) {
1154
  $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
540
  }
541
  }
542
 
543
+ if ((isset($_POST["recaptcha_response_field"])) && ($options['captcha'] == "recaptcha") && (!empty($options['recaptcha_private_key']))) {
544
  $recaptcha_code_ok = false;
545
 
546
  if ($_POST["recaptcha_response_field"]) {
752
  else
753
  $value = "";
754
 
 
 
 
 
 
755
  if (($i != 1) && ($fieldset > $current_fieldset) && (isset($fieldset_titles[$fieldset]))) {
756
  $current_fieldset = $fieldset;
757
 
782
  else
783
  $obj_type = ' type="'.$type.'"';
784
 
785
+ $obj_value = ' value="'.esc_attr($value).'"';
786
  $obj_value2 = "";
787
  $obj_checked = "";
788
  $obj_tag = "input";
791
 
792
  case "dropdown":
793
  case "dropdown-multi":
794
+ $ret = cimy_dropDownOptions($label, esc_attr($value));
795
  $label = $ret['label'];
796
  $html = $ret['html'];
797
 
818
  $obj_name = ' name="'.$input_name.'"';
819
  $obj_type = "";
820
  $obj_value = "";
821
+ $obj_value2 = esc_html($value);
822
  $obj_checked = "";
823
  $obj_tag = "textarea";
824
  $obj_closing_tag = true;
835
  $obj_name = ' name="'.$input_name.'"';
836
  $obj_type = "";
837
  $obj_value = "";
838
+ $obj_value2 = esc_html($value);
839
  $obj_checked = "";
840
  $obj_tag = "textarea";
841
  $obj_closing_tag = true;
901
  $obj_class = ' class="cimy_uef_picture"';
902
  $obj_name = ' name="'.$input_name.'"';
903
  $obj_type = ' type="file"';
904
+ $obj_value = ' value="'.esc_attr($value).'"';
905
  $obj_value2 = "";
906
  $obj_tag = "input";
907
  $obj_closing_tag = false;
919
  break;
920
  case 'dropdown':
921
  case 'dropdown-multi':
922
+ $ret = cimy_dropDownOptions($label, esc_attr($value));
923
  $label = $ret['label'];
924
  break;
925
  case 'picture':
938
  if ($old_type != "password") {
939
  $obj_label = '<label for="'.$unique_id.'">'.$label.' </label>';
940
  if (empty($obj_value2))
941
+ $obj_value2 = cimy_uef_sanitize_content($value);
942
  }
943
  $obj_class = '';
944
  $obj_name = ' name="'.$input_name.'"';
945
  $obj_type = ' type="hidden"';
946
+ $obj_value = ' value="'.esc_attr($value).'"';
947
  $obj_checked = "";
948
  $obj_tag = "input";
949
  $obj_closing_tag = false;
954
  $obj_class = '';
955
  $obj_name = ' name="'.$input_name.'"';
956
  $obj_type = ' type="hidden"';
957
+ $obj_value = ' value="'.esc_attr($value).'"';
958
  $obj_value2 = "";
959
  $obj_checked = "";
960
  $obj_tag = "input";
995
  else if ($type == "hidden") {
996
  $form_object.= " />".$obj_value2;
997
  if (in_array($old_type, $cimy_uef_file_types)) {
998
+ echo "<input type=\"hidden\" name=\"".esc_attr($field_id_data)."_size\" id=\"".esc_attr($field_id_data)."_size\" value=\"".strval($_FILES[$input_name]['size'] / 1024)."\" />";
999
+ echo "<input type=\"hidden\" name=\"".esc_attr($field_id_data)."_type\" id=\"".esc_attr($field_id_data)."_type\" value=\"".strval($_FILES[$input_name]['type'])."\" />";
1000
  }
1001
  if (($old_type == "picture") || ($old_type == "avatar")) {
1002
  if (!$is_jquery_added) {
1004
  $is_jquery_added = true;
1005
  }
1006
  $crop_image_function = true;
1007
+ echo '<img id="'.esc_attr($field_id_data).'" src="'.esc_attr($value).'" alt="picture" /><br />';
1008
+ echo "<input type=\"hidden\" name=\"".esc_attr($field_id_data)."_button\" id=\"".esc_attr($field_id_data)."_button\" value=\"1\" />";
1009
+ echo "<input type=\"hidden\" name=\"".esc_attr($field_id_data)."_x1\" id=\"".esc_attr($field_id_data)."_x1\" value=\"\" />";
1010
+ echo "<input type=\"hidden\" name=\"".esc_attr($field_id_data)."_y1\" id=\"".esc_attr($field_id_data)."_y1\" value=\"\" />";
1011
+ echo "<input type=\"hidden\" name=\"".esc_attr($field_id_data)."_x2\" id=\"".esc_attr($field_id_data)."_x2\" value=\"\" />";
1012
+ echo "<input type=\"hidden\" name=\"".esc_attr($field_id_data)."_y2\" id=\"".esc_attr($field_id_data)."_y2\" value=\"\" />";
1013
+ echo "<input type=\"hidden\" name=\"".esc_attr($field_id_data)."_w\" id=\"".esc_attr($field_id_data)."_w\" value=\"\" />";
1014
+ echo "<input type=\"hidden\" name=\"".esc_attr($field_id_data)."_h\" id=\"".esc_attr($field_id_data)."_h\" value=\"\" />";
1015
  $imgarea_options = "handles: true, fadeSpeed: 200, onSelectChange: preview";
1016
  if ((isset($advanced_options["crop_x1"])) && (isset($advanced_options["crop_y1"])) && (isset($advanced_options["crop_x2"])) && (isset($advanced_options["crop_y2"]))) {
1017
  $imgarea_options.= ", x1: ".intval($advanced_options["crop_x1"]);
1143
  if ($http_post) {
1144
  $user_login = $_POST['user_login'];
1145
  $user_email = $_POST['user_email'];
1146
+
1147
+ // Might be Theme My Login, they have its own register_new_user but they don't have login_header seems so, so let's return for now!
1148
+ if (function_exists("register_new_user"))
1149
+ $errors = register_new_user($user_login, $user_email);
1150
+ else
1151
+ return;
1152
 
1153
  if (!is_wp_error($errors)) {
1154
  $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
cimy_user_extra_fields.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Cimy User Extra Fields
4
  Plugin URI: http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/
5
  Plugin Description: Add some useful fields to registration and user's info
6
- Version: 2.1.0
7
  Author: Marco Cimmino
8
  Author URI: mailto:cimmino.marco@gmail.com
9
  */
@@ -190,7 +190,7 @@ require_once($cuef_plugin_dir.'/cimy_uef_options.php');
190
  require_once($cuef_plugin_dir.'/cimy_uef_admin.php');
191
 
192
  $cimy_uef_name = "Cimy User Extra Fields";
193
- $cimy_uef_version = "2.1.0";
194
  $cimy_uef_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/";
195
  $cimy_project_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/support-the-cimy-project-paypal/";
196
 
3
  Plugin Name: Cimy User Extra Fields
4
  Plugin URI: http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/
5
  Plugin Description: Add some useful fields to registration and user's info
6
+ Version: 2.1.1
7
  Author: Marco Cimmino
8
  Author URI: mailto:cimmino.marco@gmail.com
9
  */
190
  require_once($cuef_plugin_dir.'/cimy_uef_admin.php');
191
 
192
  $cimy_uef_name = "Cimy User Extra Fields";
193
+ $cimy_uef_version = "2.1.1";
194
  $cimy_uef_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/";
195
  $cimy_project_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/support-the-cimy-project-paypal/";
196
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Website link: http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra
5
  Tags: cimy, admin, registration, profile, extra fields, avatar, gravatar, recaptcha, captcha
6
  Requires at least: 3.0
7
  Tested up to: 3.2
8
- Stable tag: 2.1.0
9
 
10
  Add some useful fields to registration and user's info
11
 
@@ -44,11 +44,11 @@ future versions can have more.
44
 
45
  = Other features: =
46
  * reCAPTCHA
 
47
  * custom welcome email (non MS installations)
48
  * custom registration logo (non MS installations)
49
  * email confirmation (non MS installations)
50
  * form confirmation (non MS installations)
51
- * image upload with crop/resize functions
52
  * much more!
53
 
54
  The plug-in adds two new menu voices in the admin for the administrator and two for users.
5
  Tags: cimy, admin, registration, profile, extra fields, avatar, gravatar, recaptcha, captcha
6
  Requires at least: 3.0
7
  Tested up to: 3.2
8
+ Stable tag: 2.1.1
9
 
10
  Add some useful fields to registration and user's info
11
 
44
 
45
  = Other features: =
46
  * reCAPTCHA
47
+ * image upload with crop/resize functions
48
  * custom welcome email (non MS installations)
49
  * custom registration logo (non MS installations)
50
  * email confirmation (non MS installations)
51
  * form confirmation (non MS installations)
 
52
  * much more!
53
 
54
  The plug-in adds two new menu voices in the admin for the administrator and two for users.