Cimy User Extra Fields - Version 2.5.3

Version Description

Download this release

Release Info

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

Code changes from version 2.5.2 to 2.5.3

README_OFFICIAL.txt CHANGED
@@ -627,6 +627,12 @@ A lot of times I cannot reproduce the problem and I need more details, so if you
627
 
628
 
629
  CHANGELOG:
 
 
 
 
 
 
630
  v2.5.2 - 03/06/2013
631
  - Added support for Theme My Login v6.3.x
632
  - Fixed Users Extended page is blank when the WordPress installation hosts a lot (10.000+) of users (thanks to mightypixel, eArtboard and more)
627
 
628
 
629
  CHANGELOG:
630
+ v2.5.3 - 24/06/2013
631
+ - Fixed updating extra fields from a different blog doesn't work (MS per-blog only) (thanks to GilesFarrow)
632
+ - Fixed Securimage captcha sometimes does not validate correctly codes (thanks to websitesareus)
633
+ - Fixed two PHP warnings produced in the plug-in's admin panel (thanks to Ov3rfly)
634
+ - Fixed tabindex is no longer needed for WordPress 3.5 and Theme My Login users with Securimage captcha too
635
+
636
  v2.5.2 - 03/06/2013
637
  - Added support for Theme My Login v6.3.x
638
  - Fixed Users Extended page is blank when the WordPress installation hosts a lot (10.000+) of users (thanks to mightypixel, eArtboard and more)
cimy_uef_admin.php CHANGED
@@ -214,9 +214,12 @@ function cimy_admin_define_extra_fields() {
214
  $errors['delete'] = __("Nothing selected", $cimy_uef_domain);
215
  }
216
 
217
- if (($action == "add") || ($action == "edit")) {
218
- $store_rule = array();
 
 
219
 
 
220
  // RETRIEVE DATA FROM THE FORM
221
  $name = substr(stripslashes($_POST['name'][$field_order]), 0, $max_length_name);
222
  $value = substr(stripslashes($_POST['value'][$field_order]), 0, $max_length_value);
214
  $errors['delete'] = __("Nothing selected", $cimy_uef_domain);
215
  }
216
 
217
+ // TODO add more defaults here and get rid of selected_input
218
+ $store_rule = array();
219
+ $store_rule['email'] = false;
220
+ $store_rule['email_admin'] = false;
221
 
222
+ if (($action == "add") || ($action == "edit")) {
223
  // RETRIEVE DATA FROM THE FORM
224
  $name = substr(stripslashes($_POST['name'][$field_order]), 0, $max_length_name);
225
  $value = substr(stripslashes($_POST['value'][$field_order]), 0, $max_length_value);
cimy_uef_db.php CHANGED
@@ -513,7 +513,7 @@ if (!function_exists("cimy_rfr")) {
513
  }
514
 
515
  function cimy_delete_blog_info($blog_id, $drop) {
516
- global $cuef_upload_path, $cimy_uef_plugins_dir;
517
 
518
  $file_path = $cuef_upload_path.$blog_id."/";
519
 
@@ -525,7 +525,7 @@ function cimy_delete_blog_info($blog_id, $drop) {
525
  rmdir($file_path);
526
 
527
  // in this case no need to delete anything, per blog tables are not created
528
- if ((is_multisite()) && ($cimy_uef_plugins_dir == "mu-plugins"))
529
  $drop = false;
530
 
531
  if ($drop) {
@@ -580,9 +580,9 @@ function cimy_insert_ExtraFields_if_not_exist($user_id, $field_id) {
580
  }
581
 
582
  function cimy_get_options() {
583
- global $cimy_uef_options, $cimy_uef_plugins_dir;
584
 
585
- if ((is_multisite()) && ($cimy_uef_plugins_dir == "mu-plugins"))
586
  $options = get_site_option($cimy_uef_options);
587
  else
588
  $options = get_option($cimy_uef_options);
@@ -591,9 +591,9 @@ function cimy_get_options() {
591
  }
592
 
593
  function cimy_set_options($options) {
594
- global $cimy_uef_options, $cimy_uef_options_descr, $cimy_uef_plugins_dir;
595
 
596
- if ((is_multisite()) && ($cimy_uef_plugins_dir == "mu-plugins"))
597
  update_site_option($cimy_uef_options, $options);
598
  else
599
  update_option($cimy_uef_options, $options, $cimy_uef_options_descr, "no");
513
  }
514
 
515
  function cimy_delete_blog_info($blog_id, $drop) {
516
+ global $cuef_upload_path;
517
 
518
  $file_path = $cuef_upload_path.$blog_id."/";
519
 
525
  rmdir($file_path);
526
 
527
  // in this case no need to delete anything, per blog tables are not created
528
+ if (cimy_uef_is_multisite_unique_installation())
529
  $drop = false;
530
 
531
  if ($drop) {
580
  }
581
 
582
  function cimy_get_options() {
583
+ global $cimy_uef_options;
584
 
585
+ if (cimy_uef_is_multisite_unique_installation())
586
  $options = get_site_option($cimy_uef_options);
587
  else
588
  $options = get_option($cimy_uef_options);
591
  }
592
 
593
  function cimy_set_options($options) {
594
+ global $cimy_uef_options, $cimy_uef_options_descr;
595
 
596
+ if (cimy_uef_is_multisite_unique_installation())
597
  update_site_option($cimy_uef_options, $options);
598
  else
599
  update_option($cimy_uef_options, $options, $cimy_uef_options_descr, "no");
cimy_uef_functions.php CHANGED
@@ -406,9 +406,7 @@ function cimy_uef_sanitize_content($content, $override_allowed_tags=null) {
406
  }
407
 
408
  function cimy_check_admin($permission) {
409
- global $cimy_uef_plugins_dir;
410
-
411
- if ((is_multisite()) && ($cimy_uef_plugins_dir == "mu-plugins"))
412
  return is_super_admin();
413
  else
414
  return current_user_can($permission);
@@ -992,3 +990,13 @@ function cimy_uef_is_theme_my_login_profile_page() {
992
  return defined('IS_PROFILE_PAGE') && constant('IS_PROFILE_PAGE');
993
  return false;
994
  }
 
 
 
 
 
 
 
 
 
 
406
  }
407
 
408
  function cimy_check_admin($permission) {
409
+ if (cimy_uef_is_multisite_unique_installation())
 
 
410
  return is_super_admin();
411
  else
412
  return current_user_can($permission);
990
  return defined('IS_PROFILE_PAGE') && constant('IS_PROFILE_PAGE');
991
  return false;
992
  }
993
+
994
+ function cimy_uef_is_multisite_unique_installation() {
995
+ global $cimy_uef_plugins_dir;
996
+ return is_multisite() && $cimy_uef_plugins_dir == "mu-plugins";
997
+ }
998
+
999
+ function cimy_uef_is_multisite_per_blog_installation() {
1000
+ global $cimy_uef_plugins_dir;
1001
+ return is_multisite() && $cimy_uef_plugins_dir != "mu-plugins";
1002
+ }
cimy_uef_init.php CHANGED
@@ -14,7 +14,7 @@ function cimy_uef_i18n_setup() {
14
  }
15
 
16
  function cimy_admin_menu_custom() {
17
- global $cimy_uef_name, $cimy_uef_domain, $cimy_top_menu, $cimy_uef_plugins_dir;
18
 
19
  $aue_page = "";
20
  if (isset($cimy_top_menu) && (!is_multisite())) {
@@ -23,7 +23,7 @@ function cimy_admin_menu_custom() {
23
  $aue_page = add_submenu_page('profile.php', __('Users Extended', $cimy_uef_domain), __('Users Extended', $cimy_uef_domain), 'list_users', "users_extended", 'cimy_admin_users_list_page');
24
  }
25
  else {
26
- if ((is_multisite()) && ($cimy_uef_plugins_dir == "mu-plugins")) {
27
  // $aue_page = add_submenu_page('wpmu-admin.php', __("Users Extended", $cimy_uef_domain), __("Users Extended", $cimy_uef_domain), 'list_users', "users_extended", 'cimy_admin_users_list_page');
28
  // add_submenu_page('wpmu-admin.php', $cimy_uef_name, $cimy_uef_name, 'manage_options', "user_extra_fields", 'cimy_admin_define_extra_fields');
29
 
@@ -53,6 +53,14 @@ function cimy_uef_admin_init() {
53
  wp_register_script("cimy_uef_ajax_new_value", $cuef_js_webpath."/ajax_new_value.js", array(), false);
54
  }
55
 
 
 
 
 
 
 
 
 
56
  function cimy_uef_admin_init_js() {
57
  wp_enqueue_script("cimy_uef_invert_sel");
58
  cimy_uef_init_upload_js();
14
  }
15
 
16
  function cimy_admin_menu_custom() {
17
+ global $cimy_uef_name, $cimy_uef_domain, $cimy_top_menu;
18
 
19
  $aue_page = "";
20
  if (isset($cimy_top_menu) && (!is_multisite())) {
23
  $aue_page = add_submenu_page('profile.php', __('Users Extended', $cimy_uef_domain), __('Users Extended', $cimy_uef_domain), 'list_users', "users_extended", 'cimy_admin_users_list_page');
24
  }
25
  else {
26
+ if (cimy_uef_is_multisite_unique_installation()) {
27
  // $aue_page = add_submenu_page('wpmu-admin.php', __("Users Extended", $cimy_uef_domain), __("Users Extended", $cimy_uef_domain), 'list_users', "users_extended", 'cimy_admin_users_list_page');
28
  // add_submenu_page('wpmu-admin.php', $cimy_uef_name, $cimy_uef_name, 'manage_options', "user_extra_fields", 'cimy_admin_define_extra_fields');
29
 
53
  wp_register_script("cimy_uef_ajax_new_value", $cuef_js_webpath."/ajax_new_value.js", array(), false);
54
  }
55
 
56
+ function cimy_uef_init() {
57
+ if (!cimy_uef_is_register_page())
58
+ return;
59
+ $options = cimy_get_options();
60
+ if ($options['captcha'] == "securimage")
61
+ session_start();
62
+ }
63
+
64
  function cimy_uef_admin_init_js() {
65
  wp_enqueue_script("cimy_uef_invert_sel");
66
  cimy_uef_init_upload_js();
cimy_uef_profile.php CHANGED
@@ -28,6 +28,8 @@ function cimy_extract_ExtraFields() {
28
  $options = cimy_get_options();
29
 
30
  $extra_fields = get_cimyFields(false, true);
 
 
31
 
32
  if (!empty($extra_fields)) {
33
  $upload_image_function = false;
28
  $options = cimy_get_options();
29
 
30
  $extra_fields = get_cimyFields(false, true);
31
+ if (cimy_uef_is_multisite_per_blog_installation())
32
+ echo "<input type=\"hidden\" name=\"from_blog_id\" value=\"".strval(get_current_blog_id())."\" />\n";
33
 
34
  if (!empty($extra_fields)) {
35
  $upload_image_function = false;
cimy_uef_register.php CHANGED
@@ -1218,10 +1218,10 @@ function cimy_registration_form($errors=null, $show_type=0) {
1218
  <img id="captcha" align="left" style="padding-right: 5px; border: 0" src="<?php echo $cuef_securimage_webpath; ?>/securimage_show_captcha.php" alt="CAPTCHA Image" />
1219
  <object type="application/x-shockwave-flash" data="<?php echo $cuef_securimage_webpath; ?>/securimage_play.swf?audio_file=<?php echo $cuef_securimage_webpath; ?>/securimage_play.php&#038;bgColor1=#fff&#038;bgColor2=#fff&#038;iconColor=#777&#038;borderWidth=1&#038;borderColor=#000" height="19" width="19"><param name="movie" value="<?php echo $cuef_securimage_webpath; ?>/securimage_play.swf?audio_file=<?php echo $cuef_securimage_webpath; ?>/securimage_play.php&#038;bgColor1=#fff&#038;bgColor2=#fff&#038;iconColor=#777&#038;borderWidth=1&#038;borderColor=#000" /></object>
1220
  <br /><br /><br />
1221
- <a align="right" <?php if (!empty($obj_tabindex)) echo "tabindex=\"".$tabindex."\""; $tabindex++; ?> style="border-style: none" href="#" onclick="document.getElementById('captcha').src = '<?php echo $cuef_securimage_webpath; ?>/securimage_show_captcha.php?' + Math.random(); return false"><img src="<?php echo $cuef_securimage_webpath; ?>/images/refresh.png" alt="<?php _e("Change image", $cimy_uef_domain); ?>" border="0" onclick="this.blur()" align="bottom" height="19" width="19" /></a>
1222
  </div>
1223
  <div style="width: <?php echo $width; ?>px; float: left; height: 50px; vertical-align: bottom; padding: 5px;">
1224
- <?php _e("Insert the code:", $cimy_uef_domain); ?>&nbsp;<input type="text" name="securimage_response_field" size="12" maxlength="16" tabindex="<?php echo $tabindex; $tabindex++; ?>" />
1225
  </div>
1226
  <?php
1227
  }
1218
  <img id="captcha" align="left" style="padding-right: 5px; border: 0" src="<?php echo $cuef_securimage_webpath; ?>/securimage_show_captcha.php" alt="CAPTCHA Image" />
1219
  <object type="application/x-shockwave-flash" data="<?php echo $cuef_securimage_webpath; ?>/securimage_play.swf?audio_file=<?php echo $cuef_securimage_webpath; ?>/securimage_play.php&#038;bgColor1=#fff&#038;bgColor2=#fff&#038;iconColor=#777&#038;borderWidth=1&#038;borderColor=#000" height="19" width="19"><param name="movie" value="<?php echo $cuef_securimage_webpath; ?>/securimage_play.swf?audio_file=<?php echo $cuef_securimage_webpath; ?>/securimage_play.php&#038;bgColor1=#fff&#038;bgColor2=#fff&#038;iconColor=#777&#038;borderWidth=1&#038;borderColor=#000" /></object>
1220
  <br /><br /><br />
1221
+ <a align="right"<?php if (!empty($obj_tabindex)) echo " tabindex=\"".$tabindex."\""; $tabindex++; ?> style="border-style: none" href="#" onclick="document.getElementById('captcha').src = '<?php echo $cuef_securimage_webpath; ?>/securimage_show_captcha.php?' + Math.random(); return false"><img src="<?php echo $cuef_securimage_webpath; ?>/images/refresh.png" alt="<?php _e("Change image", $cimy_uef_domain); ?>" border="0" onclick="this.blur()" align="bottom" height="19" width="19" /></a>
1222
  </div>
1223
  <div style="width: <?php echo $width; ?>px; float: left; height: 50px; vertical-align: bottom; padding: 5px;">
1224
+ <?php _e("Insert the code:", $cimy_uef_domain); ?>&nbsp;<input type="text" name="securimage_response_field" size="12" maxlength="16"<?php if (!empty($obj_tabindex)) echo " tabindex=\"".$tabindex."\""; $tabindex++; ?> />
1225
  </div>
1226
  <?php
1227
  }
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
  Description: Add some useful fields to registration and user's info
6
- Version: 2.5.2
7
  Author: Marco Cimmino
8
  Author URI: mailto:cimmino.marco@gmail.com
9
  License: GPL2
@@ -158,9 +158,10 @@ require_once($cuef_plugin_dir.'/cimy_uef_functions.php');
158
  require_once($cuef_plugin_dir.'/cimy_uef_profile.php');
159
 
160
  add_action('admin_init', 'cimy_uef_admin_init');
 
161
 
162
  $cimy_uef_name = "Cimy User Extra Fields";
163
- $cimy_uef_version = "2.5.2";
164
  $cimy_uef_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/";
165
  $cimy_project_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/support-the-cimy-project-paypal/";
166
 
3
  Plugin Name: Cimy User Extra Fields
4
  Plugin URI: http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/
5
  Description: Add some useful fields to registration and user's info
6
+ Version: 2.5.3
7
  Author: Marco Cimmino
8
  Author URI: mailto:cimmino.marco@gmail.com
9
  License: GPL2
158
  require_once($cuef_plugin_dir.'/cimy_uef_profile.php');
159
 
160
  add_action('admin_init', 'cimy_uef_admin_init');
161
+ add_action('init', 'cimy_uef_init');
162
 
163
  $cimy_uef_name = "Cimy User Extra Fields";
164
+ $cimy_uef_version = "2.5.3";
165
  $cimy_uef_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/";
166
  $cimy_project_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/support-the-cimy-project-paypal/";
167
 
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://www.marcocimmino.net/cimy-wordpress-plugins/support-the-cimy
4
  Website link: http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/
5
  Tags: cimy, admin, registration, profile, extra fields, avatar, gravatar, recaptcha, captcha
6
  Requires at least: 3.1
7
- Tested up to: 3.5
8
- Stable tag: 2.5.2
9
 
10
  Add some useful fields to registration and user's info
11
 
4
  Website link: http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/
5
  Tags: cimy, admin, registration, profile, extra fields, avatar, gravatar, recaptcha, captcha
6
  Requires at least: 3.1
7
+ Tested up to: 3.6
8
+ Stable tag: 2.5.3
9
 
10
  Add some useful fields to registration and user's info
11