Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP v4.1+ compat. with Advanced Import/Export tools. Closes websharks/s2member#448 #456

Merged
merged 1 commit into from
Jan 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion s2member/includes/classes/profile-mods-in.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function handle_profile_modifications()
if(!empty($_p['ws_plugin__s2member_profile_last_name']))
$userdata['last_name'] = $_p['ws_plugin__s2member_profile_last_name'];

wp_update_user($userdata); // OK. Now send this array for an update.
wp_update_user(wp_slash($userdata)); // OK. Now send this array for an update.

if($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields'])
if($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level('auto-detection', 'profile'))
Expand Down
28 changes: 14 additions & 14 deletions s2member/includes/classes/registrations.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public static function ms_activate_existing_user($_error = NULL, $vars = array()
if(!empty($user_already_exists) && c_ws_plugin__s2member_utils_users::ms_user_login_email_exists_but_not_on_blog($user_login, $user_email, $meta['add_to_blog']))
{
add_user_to_blog($meta['add_to_blog'], $user_id, $meta['new_role']); // Add this User to the specified Blog.
wp_update_user(array('ID' => $user_id, 'user_pass' => $password)); // Update Password so it's the same as in the following msg.
wp_update_user(wp_slash(array('ID' => $user_id, 'user_pass' => $password))); // Update Password so it's the same as in the following msg.
wpmu_welcome_user_notification($user_id, $password, $meta); // Send welcome letter via email just like ``wpmu_activate_signup()`` does.

do_action('wpmu_activate_user', $user_id, $password, $meta); // Process Hook that would have been fired inside ``wpmu_activate_signup()``.
Expand Down Expand Up @@ -503,7 +503,7 @@ public static function ms_create_existing_user($user_login = '', $user_email = '
{
$role = get_option('default_role'); // Use default Role.
add_existing_user_to_blog(array('user_id' => $user_id, 'role' => $role)); // Add User.
wp_update_user(array('ID' => $user_id, 'user_pass' => $user_pass)); // Update to ``$user_pass``.
wp_update_user(wp_slash(array('ID' => $user_id, 'user_pass' => $user_pass))); // Update to ``$user_pass``.

do_action('ws_plugin__s2member_during_ms_create_existing_user', get_defined_vars());
do_action('user_register', $user_id); // So s2Member knows a User is registering.
Expand Down Expand Up @@ -669,13 +669,13 @@ public static function configure_user_registration($user_id = '', $password = ''
if(!$user->display_name || $user->display_name === $user->user_login)
{
if($custom_reg_display_name === 'full' && $name)
wp_update_user(array('ID' => $user_id, 'display_name' => $name));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $name)));
else if($custom_reg_display_name === 'first' && $fname)
wp_update_user(array('ID' => $user_id, 'display_name' => $fname));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $fname)));
else if($custom_reg_display_name === 'last' && $lname)
wp_update_user(array('ID' => $user_id, 'display_name' => $lname));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $lname)));
else if($custom_reg_display_name === 'login' && $login)
wp_update_user(array('ID' => $user_id, 'display_name' => $login));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $login)));
}
if(is_multisite()) // Should we handle Main Site permissions and Originating Blog ID#?
{
Expand Down Expand Up @@ -844,13 +844,13 @@ public static function configure_user_registration($user_id = '', $password = ''
if(!$user->display_name || $user->display_name === $user->user_login)
{
if($custom_reg_display_name === 'full' && $name)
wp_update_user(array('ID' => $user_id, 'display_name' => $name));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $name)));
else if($custom_reg_display_name === 'first' && $fname)
wp_update_user(array('ID' => $user_id, 'display_name' => $fname));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $fname)));
else if($custom_reg_display_name === 'last' && $lname)
wp_update_user(array('ID' => $user_id, 'display_name' => $lname));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $lname)));
else if($custom_reg_display_name === 'login' && $login)
wp_update_user(array('ID' => $user_id, 'display_name' => $login));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $login)));
}
if(is_multisite( /* Should we handle Main Site permissions and Originating Blog ID#? */))
{
Expand Down Expand Up @@ -985,13 +985,13 @@ public static function configure_user_registration($user_id = '', $password = ''
if(!$user->display_name || $user->display_name === $user->user_login)
{
if($custom_reg_display_name === 'full' && $name)
wp_update_user(array('ID' => $user_id, 'display_name' => $name));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $name)));
else if($custom_reg_display_name === 'first' && $fname)
wp_update_user(array('ID' => $user_id, 'display_name' => $fname));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $fname)));
else if($custom_reg_display_name === 'last' && $lname)
wp_update_user(array('ID' => $user_id, 'display_name' => $lname));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $lname)));
else if($custom_reg_display_name === 'login' && $login)
wp_update_user(array('ID' => $user_id, 'display_name' => $login));
wp_update_user(wp_slash(array('ID' => $user_id, 'display_name' => $login)));
}
if(is_multisite()) // Should we handle Main Site permissions and Originating Blog ID#?
{
Expand Down