1
0

some debbuging

This commit is contained in:
2022-01-02 18:14:13 +01:00
parent 2e6b2fe5cb
commit d79463fbd4
11 changed files with 147 additions and 242 deletions

View File

@ -3,12 +3,12 @@ class notificationFreemobile
{
private $url = "https://smsapi.free-mobile.fr/sendmsg?user=32886706&pass=JTGUY6l5OG73zX&msg=";
private $name = "freemobile";
public $active = true;
public $level;
function __construct()
{
global $notificationMethods;
$notificationMethods[$name]->active = true;
$notificationMethods[$name]->level = ALL;
$this->level = WARNING | ERROR;
}
function send($message)
@ -23,7 +23,13 @@ class notificationFreemobile
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
logger(INFO, curl_exec($ch));
if (($result = curl_exec($ch)) === false)
{
logger(ERROR, _(sprintf( "Curl return error: %s when sending notification", curl_error($ch))));
}else
{
logger(INFO, _("Curl return: ") . $result . _(" when sending notification"));
}
// close curl resource to free up system resources
curl_close($ch);
@ -33,6 +39,6 @@ class notificationFreemobile
}
}
$notificationMethods["freemobile"] = new notificationMethod();
$notificationMethods["freemobile"] = new notificationFreemobile();
?>