Compare commits

..

1 Commits

Author SHA1 Message Date
Jakub Bivoj Kubień 062e3f08db
Merge f3a2f1f55e into 04a4d959fd 2023-02-21 18:52:48 +00:00
3 changed files with 14 additions and 12 deletions

View File

@ -252,7 +252,7 @@ class User
// Delegate the authentication to the PsmLDAPauth module.
// If LDAP auth fails or if library not found, fall back to native auth
include_once($ldaplibpath);
$ldapauthstatus = psmldapauth($user_name, $user_password, $GLOBALS['sm_config'], $this->db_connection, $this->getUserByUsername($user_name));
$ldapauthstatus = psmldapauth($user_name, $user_password, $GLOBALS['sm_config'], $this->db_connection);
}
}

View File

@ -57,16 +57,13 @@ class Octopush extends Core
{
$smsType = "sms_premium"; // Or "sms_low_cost"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.octopush.com/v1/public/sms-campaign/send');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'api-login: '.$this->username,
'api-key: '.$this->password,
'cache-control: no-cache',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$recipients = [];
foreach ($this->recipients as $recipient) {
$recipients[] = ['phone_number' => ((substr($recipient, 0, 1) != '+') ? '+' : '').(string)$recipient];
@ -81,14 +78,19 @@ class Octopush extends Core
'sender' => substr($this->originator, 0, 15),
]));
$response = curl_exec($ch);
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Api-Key: '.$this->password;
$headers[] = 'Api-Login: '.$this->username;
$headers[] = 'Cache-Control: no-cache';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = json_decode(curl_exec($ch), true);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$err = curl_errno($ch);
curl_close($ch);
if ($err != 0 || ($httpcode != 201 && $httpcode != 200)) {
if ($err != 0 || $httpcode != 201) {
return $result['code'] . " - " . $result['message'];
}

View File

@ -64,7 +64,7 @@ class Smsglobal extends Core
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_URL, "https://api.smsglobal.com/http-api.php?" . http_build_query(
curl_setopt($curl, CURLOPT_URL, "https://www.smsglobal.com/http-api.php?" . http_build_query(
array(
"action" => "sendsms",
"user" => $this->username,