diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index b29e53743a352..75c06444f63fe 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -201,6 +201,7 @@ $object->fetch_product(); $manufacturedvalued = ''; if (!empty($object->product)) { + global $mysoc; $tmparray = $object->product->getSellPrice($mysoc, $mysoc); $manufacturedvalued = $tmparray['pu_ht'] * $object->qty; } diff --git a/htdocs/core/login/functions_googleoauth.php b/htdocs/core/login/functions_googleoauth.php index c0a77655f2975..f4e540b7447b6 100644 --- a/htdocs/core/login/functions_googleoauth.php +++ b/htdocs/core/login/functions_googleoauth.php @@ -53,7 +53,7 @@ function check_user_password_googleoauth($usertotest, $passwordtotest, $entityto // We save data of form into a variable $_SESSION['datafromloginform'] = array( - 'entity'=>GETPOSTINT('entity'), + 'entity'=>GETPOST('entity', 'int'), // avoid to return 0 if entity var not exists 'backtopage'=>GETPOST('backtopage'), 'tz'=>GETPOST('tz'), 'tz_string'=>GETPOST('tz_string'), diff --git a/htdocs/core/modules/oauth/generic_oauthcallback.php b/htdocs/core/modules/oauth/generic_oauthcallback.php index 72acdace03084..2b47b7f798e6e 100644 --- a/htdocs/core/modules/oauth/generic_oauthcallback.php +++ b/htdocs/core/modules/oauth/generic_oauthcallback.php @@ -334,7 +334,7 @@ dol_syslog("we received the login/email to log to, it is ".$useremail); $tmparray = (empty($_SESSION['datafromloginform']) ? array() : $_SESSION['datafromloginform']); - $entitytosearchuser = (isset($tmparray['entity']) ? $tmparray['entity'] : -1); + $entitytosearchuser = ((isset($tmparray['entity']) && $tmparray['entity'] != '') ? $tmparray['entity'] : -1); // Delete the old token $storage->clearToken($genericstring); // Delete the token called ("Generic-".$storage->keyforprovider) diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index 474f272484334..924b78bc07fc6 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -324,7 +324,7 @@ dol_syslog("we received the login/email to log to, it is ".$useremail); $tmparray = (empty($_SESSION['datafromloginform']) ? array() : $_SESSION['datafromloginform']); - $entitytosearchuser = (isset($tmparray['entity']) ? $tmparray['entity'] : -1); + $entitytosearchuser = ((isset($tmparray['entity']) && $tmparray['entity'] != '') ? $tmparray['entity'] : -1); // Delete the old token $storage->clearToken('Google'); // Delete the token called ("Google-".$storage->keyforprovider)