Adding mosms gateway support as created by Andreas Ek (105c734a02
)
parent
2d3cf7825e
commit
b01091ed2e
|
@ -4,6 +4,7 @@
|
||||||
#
|
#
|
||||||
#########################
|
#########################
|
||||||
- merged PHP Server Monitor Plus project by Luiz Alberto S. Ribeiro (https://github.com/madeinnordeste/PHP-Server-Monitor-Plus)
|
- merged PHP Server Monitor Plus project by Luiz Alberto S. Ribeiro (https://github.com/madeinnordeste/PHP-Server-Monitor-Plus)
|
||||||
|
- support for mosms provider by Andreas Ek (https://github.com/EkAndreas/PHP-Server-Monitor-Plus/commit/105c734a02477befc01831e3b9b2b8fefd9b5ca5)
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
#
|
#
|
||||||
|
|
|
@ -34,6 +34,7 @@ available:
|
||||||
* Spryng - <http://www.spryng.nl>
|
* Spryng - <http://www.spryng.nl>
|
||||||
* Inetworx - <http://www.inetworx.ch>
|
* Inetworx - <http://www.inetworx.ch>
|
||||||
* Clickatell - <https://www.clickatell.com>
|
* Clickatell - <https://www.clickatell.com>
|
||||||
|
* Mosms - <http://www.mosms.com>
|
||||||
|
|
||||||
For these gateways you need an account with sufficient credits.
|
For these gateways you need an account with sufficient credits.
|
||||||
|
|
||||||
|
@ -160,6 +161,7 @@ The second part is the actual message. There are a few variables you can use in
|
||||||
* French translation - David Ribeiro
|
* French translation - David Ribeiro
|
||||||
* Korean translation - Ik-Jun
|
* Korean translation - Ik-Jun
|
||||||
* Bootstrap implementation - Luiz Alberto S. Ribeiro
|
* Bootstrap implementation - Luiz Alberto S. Ribeiro
|
||||||
|
* Mosms implementation - Andreas Ek
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
@ -151,6 +151,7 @@ class modConfig extends modCore {
|
||||||
'label_email_from_name' => sm_get_lang('config', 'email_from_name'),
|
'label_email_from_name' => sm_get_lang('config', 'email_from_name'),
|
||||||
'label_sms_status' => sm_get_lang('config', 'sms_status'),
|
'label_sms_status' => sm_get_lang('config', 'sms_status'),
|
||||||
'label_sms_gateway' => sm_get_lang('config', 'sms_gateway'),
|
'label_sms_gateway' => sm_get_lang('config', 'sms_gateway'),
|
||||||
|
'label_sms_gateway_mosms' => sm_get_lang('config', 'sms_gateway_mosms'),
|
||||||
'label_sms_gateway_mollie' => sm_get_lang('config', 'sms_gateway_mollie'),
|
'label_sms_gateway_mollie' => sm_get_lang('config', 'sms_gateway_mollie'),
|
||||||
'label_sms_gateway_spryng' => sm_get_lang('config', 'sms_gateway_spryng'),
|
'label_sms_gateway_spryng' => sm_get_lang('config', 'sms_gateway_spryng'),
|
||||||
'label_sms_gateway_inetworx' => sm_get_lang('config', 'sms_gateway_inetworx'),
|
'label_sms_gateway_inetworx' => sm_get_lang('config', 'sms_gateway_inetworx'),
|
||||||
|
|
|
@ -214,6 +214,7 @@ class smUpdaterStatus extends smCore {
|
||||||
// send email
|
// send email
|
||||||
$this->notifyByEmail();
|
$this->notifyByEmail();
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if sms is enabled for this server
|
// check if sms is enabled for this server
|
||||||
if(sm_get_conf('sms_status') && $this->server['sms'] == 'yes') {
|
if(sm_get_conf('sms_status') && $this->server['sms'] == 'yes') {
|
||||||
// yay lets wake those nerds up!
|
// yay lets wake those nerds up!
|
||||||
|
@ -291,6 +292,9 @@ class smUpdaterStatus extends smCore {
|
||||||
// open the right class
|
// open the right class
|
||||||
// not making this any more dynamic, because perhaps some gateways need custom settings (like Mollie)
|
// not making this any more dynamic, because perhaps some gateways need custom settings (like Mollie)
|
||||||
switch(strtolower(sm_get_conf('sms_gateway'))) {
|
switch(strtolower(sm_get_conf('sms_gateway'))) {
|
||||||
|
case 'mosms':
|
||||||
|
$sms = new txtmsgMosms();
|
||||||
|
break;
|
||||||
case 'inetworx':
|
case 'inetworx':
|
||||||
$sms = new txtmsgInetworx();
|
$sms = new txtmsgInetworx();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?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 Andreas Ek
|
||||||
|
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
|
||||||
|
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
|
||||||
|
* @version Release: @package_version@
|
||||||
|
* @link http://phpservermon.neanderthal-technology.com/
|
||||||
|
* @since phpservermon 2.1
|
||||||
|
**/
|
||||||
|
|
||||||
|
class txtmsgMosms extends txtmsgCore {
|
||||||
|
// =========================================================================
|
||||||
|
// [ Fields ]
|
||||||
|
// =========================================================================
|
||||||
|
public $gateway = 1;
|
||||||
|
public $resultcode = null;
|
||||||
|
public $resultmessage = null;
|
||||||
|
public $success = false;
|
||||||
|
public $successcount = 0;
|
||||||
|
|
||||||
|
public function sendSMS($message) {
|
||||||
|
|
||||||
|
$mosms_url = "https://www.mosms.com/se/sms-send.php";
|
||||||
|
$mosms_data = rawurlencode( $message );
|
||||||
|
|
||||||
|
foreach( $this->recipients as $phone ){
|
||||||
|
|
||||||
|
$result = file_get_contents( $mosms_url . "?username=" . $this->username
|
||||||
|
. "&password=" . $this->password . "&nr=" . $phone . "&type=text"
|
||||||
|
. "&data=" . $mosms_data );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
|
@ -91,6 +91,7 @@ $sm_lang = array(
|
||||||
'email_from_name' => 'Email from name',
|
'email_from_name' => 'Email from name',
|
||||||
'sms_status' => 'SMS Nachricht senden erlauben?',
|
'sms_status' => 'SMS Nachricht senden erlauben?',
|
||||||
'sms_gateway' => 'SMS Gateway',
|
'sms_gateway' => 'SMS Gateway',
|
||||||
|
'sms_gateway_mosms' => 'Mosms',
|
||||||
'sms_gateway_mollie' => 'Mollie',
|
'sms_gateway_mollie' => 'Mollie',
|
||||||
'sms_gateway_spryng' => 'Spryng',
|
'sms_gateway_spryng' => 'Spryng',
|
||||||
'sms_gateway_inetworx' => 'Inetworx',
|
'sms_gateway_inetworx' => 'Inetworx',
|
||||||
|
|
|
@ -91,6 +91,7 @@ $sm_lang = array(
|
||||||
'email_from_name' => 'Email from name',
|
'email_from_name' => 'Email from name',
|
||||||
'sms_status' => 'Allow sending text messages?',
|
'sms_status' => 'Allow sending text messages?',
|
||||||
'sms_gateway' => 'Gateway to use for sending messages',
|
'sms_gateway' => 'Gateway to use for sending messages',
|
||||||
|
'sms_gateway_mosms' => 'Mosms',
|
||||||
'sms_gateway_mollie' => 'Mollie',
|
'sms_gateway_mollie' => 'Mollie',
|
||||||
'sms_gateway_spryng' => 'Spryng',
|
'sms_gateway_spryng' => 'Spryng',
|
||||||
'sms_gateway_inetworx' => 'Inetworx',
|
'sms_gateway_inetworx' => 'Inetworx',
|
||||||
|
|
|
@ -91,6 +91,7 @@ $sm_lang = array(
|
||||||
'email_from_name' => 'Nom de l expéditeur',
|
'email_from_name' => 'Nom de l expéditeur',
|
||||||
'sms_status' => 'Autoriser l envoi de SMS?',
|
'sms_status' => 'Autoriser l envoi de SMS?',
|
||||||
'sms_gateway' => 'Passerelle à utiliser pour l envoi de SMS',
|
'sms_gateway' => 'Passerelle à utiliser pour l envoi de SMS',
|
||||||
|
'sms_gateway_mosms' => 'Mosms',
|
||||||
'sms_gateway_mollie' => 'Mollie',
|
'sms_gateway_mollie' => 'Mollie',
|
||||||
'sms_gateway_spryng' => 'Spryng',
|
'sms_gateway_spryng' => 'Spryng',
|
||||||
'sms_gateway_inetworx' => 'Inetworx',
|
'sms_gateway_inetworx' => 'Inetworx',
|
||||||
|
|
|
@ -91,6 +91,7 @@ $sm_lang = array(
|
||||||
'email_from_name' => 'Email van naam',
|
'email_from_name' => 'Email van naam',
|
||||||
'sms_status' => 'Sta SMS berichten toe?',
|
'sms_status' => 'Sta SMS berichten toe?',
|
||||||
'sms_gateway' => 'Gateway voor het sturen van SMS',
|
'sms_gateway' => 'Gateway voor het sturen van SMS',
|
||||||
|
'sms_gateway_mosms' => 'Mosms',
|
||||||
'sms_gateway_mollie' => 'Mollie',
|
'sms_gateway_mollie' => 'Mollie',
|
||||||
'sms_gateway_spryng' => 'Spryng',
|
'sms_gateway_spryng' => 'Spryng',
|
||||||
'sms_gateway_inetworx' => 'Inetworx',
|
'sms_gateway_inetworx' => 'Inetworx',
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
<label class="control-label" for="sms_gateway">{label_sms_gateway}</label>
|
<label class="control-label" for="sms_gateway">{label_sms_gateway}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select name="sms_gateway">
|
<select name="sms_gateway">
|
||||||
|
<option value="mosms" {sms_selected_mosms}>{label_sms_gateway_mosms}</option>
|
||||||
<option value="mollie" {sms_selected_mollie}>{label_sms_gateway_mollie}</option>
|
<option value="mollie" {sms_selected_mollie}>{label_sms_gateway_mollie}</option>
|
||||||
<option value="spryng" {sms_selected_spryng}>{label_sms_gateway_spryng}</option>
|
<option value="spryng" {sms_selected_spryng}>{label_sms_gateway_spryng}</option>
|
||||||
<option value="inetworx" {sms_selected_inetworx}>{label_sms_gateway_inetworx}</option>
|
<option value="inetworx" {sms_selected_inetworx}>{label_sms_gateway_inetworx}</option>
|
||||||
|
|
Loading…
Reference in New Issue