|
|
|
@ -33,10 +33,11 @@ function smsfactor($message,$destinataire,$arg){
|
|
|
|
|
$username = lire_config('sms/login_smsfactor'); |
|
|
|
|
$password = lire_config('sms/mdp_smsfactor'); |
|
|
|
|
$sender = ($arg['sender']) ? $arg['sender'] : lire_config('sms/expediteur_smsfactor'); |
|
|
|
|
$message = nettoyer_xml($message); |
|
|
|
|
|
|
|
|
|
require_once('classes/smsfactor/sendSMSclass.php'); |
|
|
|
|
$SENDSMS = new SendSMSclass(); |
|
|
|
|
$retour = $SENDSMS->SendSMS($username,$password,$sender,$message,$destinataire); |
|
|
|
|
$retour = $SENDSMS->SendSMS($username,$password,$sender,$message,$destinataire); |
|
|
|
|
|
|
|
|
|
$reponse = new SimpleXMLElement($retour); |
|
|
|
|
if ( $reponse->message == "OK" ){ |
|
|
|
@ -45,3 +46,13 @@ function smsfactor($message,$destinataire,$arg){
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function nettoyer_xml($texte){ |
|
|
|
|
$texte = str_replace('&', '&', $texte); |
|
|
|
|
$texte = str_replace('<', '<', $texte); |
|
|
|
|
$texte = str_replace('>', '>', $texte); |
|
|
|
|
$texte = str_replace('"', '"', $texte); |
|
|
|
|
$texte = str_replace("'", "'", $texte); |
|
|
|
|
|
|
|
|
|
return $texte; |
|
|
|
|
} |
|
|
|
|