Skip to content

Commit

Permalink
Update tools.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ptibogxiv committed Nov 13, 2024
1 parent 148d099 commit ab092f0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions functions/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,19 @@ function doliConnect($fonction, $current_user = null, $boolean = false, $refresh
if ( empty($current_user) ) {
global $current_user;
}

if ($fonction == 'thirdparty' && isset($current_user->user_email) && !empty($current_user->user_email)) {
$return = callDoliApi("GET", "/thirdparties/email/".$current_user->user_email, null, dolidelay('doliconnector', $refresh));
if ( doliversion('21.0.0') ) {
$return = callDoliApi("GET", "/thirdparties/accounts/wordpress/".$current_user->ID, null, dolidelay('doliconnector', $refresh));
} else {
$return = callDoliApi("GET", "/thirdparties/email/".$current_user->user_email, null, dolidelay('doliconnector', $refresh));
}
} elseif ($fonction == 'member' && isset($current_user->user_email) && !empty($current_user->user_email)) {
$return = callDoliApi("GET", "/members/thirdparty/email/".$current_user->user_email, null, dolidelay('doliconnector', $refresh));
if ( doliversion('21.0.0') ) {
$return = callDoliApi("GET", "/members/thirdparty/accounts/wordpress/".$current_user->ID, null, dolidelay('doliconnector', $refresh));
} else {
$return = callDoliApi("GET", "/members/thirdparty/email/".$current_user->user_email, null, dolidelay('doliconnector', $refresh));
}
} elseif ($fonction == 'user' && isset($current_user->user_email) && !empty($current_user->user_email)) {
$return = callDoliApi("GET", "/users/email/".$current_user->user_email, null, dolidelay('doliconnector', $refresh));
} elseif ($fonction == 'order' && isset($current_user->user_email) && !empty($current_user->user_email)) {
Expand Down

0 comments on commit ab092f0

Please sign in to comment.