Merge branch 'master' into develop
commit
aac195e893
|
@ -495,7 +495,9 @@ function psm_build_sms() {
|
|||
case 'nexmo':
|
||||
$sms = new \psm\Txtmsg\Nexmo();
|
||||
break;
|
||||
}
|
||||
case 'octopush':
|
||||
$sms = new \psm\Txtmsg\Octopush();
|
||||
break; }
|
||||
|
||||
// copy login information from the config file
|
||||
if($sms) {
|
||||
|
|
|
@ -198,6 +198,7 @@ $sm_lang = array(
|
|||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
'sms_gateway_username' => 'Потребител',
|
||||
'sms_gateway_password' => 'Парола',
|
||||
|
|
|
@ -201,6 +201,7 @@ $sm_lang = array(
|
|||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_username' => 'Uživatelské jméno brány',
|
||||
|
|
|
@ -194,6 +194,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
'sms_gateway_username' => 'Gateway brugernavn/apikey',
|
||||
|
|
|
@ -196,6 +196,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
|
|
|
@ -199,6 +199,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
|
|
|
@ -198,6 +198,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_username' => 'Usuario',
|
||||
|
|
|
@ -197,6 +197,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
|
|
|
@ -196,6 +196,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
|
|
|
@ -199,6 +199,7 @@ $sm_lang = array(
|
|||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_username' => 'Gateway username',
|
||||
'sms_gateway_password' => 'Gateway password',
|
||||
'sms_from' => 'Sender\'s phone number',
|
||||
|
|
|
@ -196,6 +196,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
|
|
|
@ -196,6 +196,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
|
|
|
@ -196,6 +196,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_username' => 'Usuário do Gateway',
|
||||
|
|
|
@ -196,6 +196,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
|
|
|
@ -196,6 +196,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
|
|
|
@ -196,6 +196,7 @@ $sm_lang = array(
|
|||
'sms_gateway_clickatell' => 'Clickatell',
|
||||
'sms_gateway_textmarketer' => 'Textmarketer',
|
||||
'sms_gateway_smsglobal' => 'SMSGlobal',
|
||||
'sms_gateway_octopush' => 'Octopush',
|
||||
'sms_gateway_smsit' => 'Smsit',
|
||||
'sms_gateway_freevoipdeal' => 'FreeVoipDeal',
|
||||
'sms_gateway_nexmo' => 'Nexmo',
|
||||
|
|
|
@ -317,6 +317,7 @@ class ConfigController extends AbstractController {
|
|||
'label_sms_gateway_freevoipdeal' => psm_get_lang('config', 'sms_gateway_freevoipdeal'),
|
||||
'label_sms_gateway_smsglobal' => psm_get_lang('config', 'sms_gateway_smsglobal'),
|
||||
'label_sms_gateway_nexmo' => psm_get_lang('config', 'sms_gateway_nexmo'),
|
||||
'label_sms_gateway_octopush' => psm_get_lang('config', 'sms_gateway_octopush'),
|
||||
'label_sms_gateway_username' => psm_get_lang('config', 'sms_gateway_username'),
|
||||
'label_sms_gateway_password' => psm_get_lang('config', 'sms_gateway_password'),
|
||||
'label_sms_from' => psm_get_lang('config', 'sms_from'),
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
/**
|
||||
* PHP Server Monitor
|
||||
* Monitor your servers and websites.
|
||||
*
|
||||
* This file is part of PHP Server Monitor.
|
||||
* PHP Server Monitor is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PHP Server Monitor is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package phpservermon
|
||||
* @author Alexis Urien
|
||||
* @copyright Copyright (c) 2016 Alexis Urien <alexis.urien@free.fr>
|
||||
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
|
||||
* @version Release: @package_version@
|
||||
* @link http://www.phpservermonitor.org/
|
||||
* @since phpservermon 2.1
|
||||
**/
|
||||
|
||||
namespace psm\Txtmsg;
|
||||
|
||||
class Octopush extends Core {
|
||||
// =========================================================================
|
||||
// [ Fields ]
|
||||
// =========================================================================
|
||||
public $gateway = 1;
|
||||
public $resultcode = null;
|
||||
public $resultmessage = null;
|
||||
public $success = false;
|
||||
public $successcount = 0;
|
||||
|
||||
public function sendSMS($message) {
|
||||
// Octopush exemple url
|
||||
// french documentation can be found here: http://www.octopush-dm.com/public/docs/envoyer-des-sms-avec-octopush.pdf (need to be logged in)
|
||||
//'http://www.octopush-dm.com/api/sms/?user_login=*****%40******.com&api_key=****************&sms_text=un+exemple+de+texte&sms_recipients=0033601010101&sms_type=FR&sms_sender=UnSender'
|
||||
if(count($this->recipients) == 0)
|
||||
return false;
|
||||
|
||||
$testMode = false;
|
||||
$highPriority = true;
|
||||
|
||||
if ($highPriority) {
|
||||
$sms_type = 'FR';
|
||||
$sms_sender = 'phpServerMon';
|
||||
$sms_more = ' STOP au XXXXX';
|
||||
}
|
||||
else {
|
||||
$sms_type = 'XXX';
|
||||
$sms_more = '';
|
||||
}
|
||||
|
||||
|
||||
$recipients = urlencode(implode(',', $this->recipients));
|
||||
$octopush_url = "https://www.octopush-dm.com/api/sms/";
|
||||
$octopush_data = urlencode( $message . $sms_more );
|
||||
|
||||
$URL = $octopush_url. "?" .
|
||||
"user_login=" . $this->username .
|
||||
"&api_key=" . $this->password .
|
||||
"&sms_recipients=" . $recipients .
|
||||
"&sms_type=" . $sms_type .
|
||||
($testMode ? '&request_mode=simu' : '') .
|
||||
(isset($sms_sender) ? '&sms_sender='.$sms_sender : '') .
|
||||
"&sms_text=" . $octopush_data;
|
||||
|
||||
$result = file_get_contents( $URL );
|
||||
$xmlResults = simplexml_load_string($result);
|
||||
if ($xmlResults === false)
|
||||
return false;
|
||||
|
||||
if ($xmlResults->error_code == '000')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -160,6 +160,7 @@
|
|||
<option value="smsglobal" {{ sms_selected_smsglobal|raw }}>{{ label_sms_gateway_smsglobal }}</option>
|
||||
<option value="smsit" {{ sms_selected_smsit|raw }}>{{ label_sms_gateway_smsit }}</option>
|
||||
<option value="freevoipdeal" {{ sms_selected_freevoipdeal|raw }}>{{ label_sms_gateway_freevoipdeal }}</option>
|
||||
<option value="octopush" {{ sms_selected_octopush|raw }}>{{ label_sms_gateway_octopush }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue