Compare commits

...

10 Commits

Author SHA1 Message Date
Thomas Kristensen 7ce34505f7
Merge d56b2856e5 into fccc264107 2023-09-01 20:21:10 -06:00
Tim Zandbergen fccc264107
Merge pull request #1183 from viharm/fix/DBUserDetailRetention-LDAP
Retain user data in DB for existing users
2023-08-14 21:31:43 +02:00
Viharm 61afb81554
Cleanup 2023-08-14 05:43:24 +00:00
Viharm 537b17ac01
Merge branch 'phpservermon:develop' into fix/DBUserDetailRetention-LDAP 2023-08-14 06:34:37 +01:00
Tim Zandbergen 5f65f92678
Merge pull request #1255 from RaphaelBergmann/develop
Updated SMSGlobal API URL
2023-08-13 21:59:07 +02:00
Marc Farré 850f0eac8d
Update Octopush.php (#1259)
Update Octopush.php. Now accepting 200 as a valid response code.
2023-08-13 21:55:17 +02:00
Viharm 59966c6cd2
Signed commit 2023-08-13 18:52:19 +00:00
Viharm c81a4a426c
Merge branch 'phpservermon:develop' into fix/DBUserDetailRetention-LDAP 2023-08-10 15:01:35 +01:00
Raphael.Bergmann 7245f65873
Updated SMSGlobal API URL 2023-05-31 15:45:17 +02:00
viharm 9643ef3f6f
Added additional parameter passed to LDAP auth module for checking existing user data in DB 2022-03-14 17:11:51 +00:00
3 changed files with 12 additions and 14 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);
$ldapauthstatus = psmldapauth($user_name, $user_password, $GLOBALS['sm_config'], $this->db_connection, $this->getUserByUsername($user_name));
}
}

View File

@ -57,13 +57,16 @@ 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, 1);
curl_setopt($ch, CURLOPT_POST, 1);
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',
]);
$recipients = [];
foreach ($this->recipients as $recipient) {
$recipients[] = ['phone_number' => ((substr($recipient, 0, 1) != '+') ? '+' : '').(string)$recipient];
@ -78,19 +81,14 @@ class Octopush extends Core
'sender' => substr($this->originator, 0, 15),
]));
$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);
$response = curl_exec($ch);
$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) {
if ($err != 0 || ($httpcode != 201 && $httpcode != 200)) {
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://www.smsglobal.com/http-api.php?" . http_build_query(
curl_setopt($curl, CURLOPT_URL, "https://api.smsglobal.com/http-api.php?" . http_build_query(
array(
"action" => "sendsms",
"user" => $this->username,