diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 179d04d96bc..8adb2bb3756 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -108,6 +108,7 @@ ErrUnzipFails=Failed to unzip %s with ZipArchive ErrNoZipEngine=No engine to unzip %s file in this PHP ErrorFileMustBeADolibarrPackage=The file %s must be a Dolibarr zip package ErrorFileRequired=It takes a package Dolibarr file +ErrorPhpCurlNotInstalled=The PHP CURL is not installed, this is essential to talk with Paypal. # Warnings WarningSafeModeOnCheckExecDir=Warning, PHP option safe_mode is on so command must be stored inside a directory declared by php parameter safe_mode_exec_dir. diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 94481394e67..15a13749f67 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -109,6 +109,7 @@ ErrUnzipFails=Impossible de décompresser le fichier %s avec ZipArchive ErrNoZipEngine=Pas de moteur pour décompresser le fichier %s dans ce PHP ErrorFileMustBeADolibarrPackage=Le fichier doit être un package Dolibarr ErrorFileRequired=Il faut un fichier de package Dolibarr +ErrorPhpCurlNotInstalled=L'extension PHP CURL n'est pas installée, ceci est indispensable pour dialoguer avec Paypal. # Warnings WarningSafeModeOnCheckExecDir=Attention, l'option PHP safe_mode est active, la commande doit dont être dans un répertoire déclaré dans le paramètre php safe_mode_exec_dir. diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 896cb6a5be1..249ce46b161 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -36,8 +36,7 @@ $langs->load("other"); $langs->load("paypal"); $langs->load("paybox"); -if (!$user->admin) - accessforbidden(); +if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); @@ -124,6 +123,14 @@ if ($conf->use_javascript_ajax) print ''; } +// Test if php curl exist +$curlversion=@curl_version(); +if (empty($curlversion)) +{ + $langs->load("errors"); + $mesg='
'.$langs->trans("ErrorPhpCurlNotInstalled").'
'; +} + dol_htmloutput_mesg($mesg); print '
';