diff --git a/doliconnect.php b/doliconnect.php index 08927d79..28e6d958 100644 --- a/doliconnect.php +++ b/doliconnect.php @@ -543,7 +543,7 @@ function doliaccount_shortcode() { } if ( isset($_POST['submitted']) ) { -$thirdparty=$_POST['thirdparty']; +$thirdparty=$_POST['thirdparty'];//['0'] if ( email_exists($thirdparty['email']) ) { $emailError = "".__( 'This email address is already linked to an account. You can reactivate your account through this form.', 'doliconnect' ).""; @@ -570,8 +570,7 @@ function doliaccount_shortcode() { $role = 'subscriber'; -if ( is_multisite() ) { -add_user_to_blog($entity,$ID,$role); } +if ( is_multisite() ) { add_user_to_blog($entity,$ID,$role); } wp_update_user( array( 'ID' => $ID, 'user_email' => sanitize_email($thirdparty['email']))); wp_update_user( array( 'ID' => $ID, 'nickname' => sanitize_user($_POST['user_nicename']))); wp_update_user( array( 'ID' => $ID, 'display_name' => ucfirst(strtolower($thirdparty['firstname']))." ".strtoupper($thirdparty['lastname']))); diff --git a/functions/dashboard.php b/functions/dashboard.php index fe162e41..06d16bc0 100644 --- a/functions/dashboard.php +++ b/functions/dashboard.php @@ -20,6 +20,7 @@ function informations_menu($arg) { function informations_module($url) { global $wpdb,$current_user,$doliconnect; + $ID = $current_user->ID; $request = "/thirdparties/".constant("DOLIBARR"); diff --git a/functions/tools.php b/functions/tools.php index 4af4f783..d28eccf4 100644 --- a/functions/tools.php +++ b/functions/tools.php @@ -4,7 +4,8 @@ function doliconnectuserform($object, $delay, $mode) { if ( is_object($object) && $object->id > 0 ) { $idobject="[".$object->id."]"; -} +} +//else { $idobject="[0]"; } echo "