Merge branch 'victormacko-develop' into develop

This commit is contained in:
Pepijn Over 2014-07-28 09:38:39 +02:00
commit 5ba71af367
18 changed files with 102 additions and 0 deletions

View File

@ -16,6 +16,7 @@ not yet released
* #105: Fixing check for websites with unverified SSL certificates.
* #107: Fixing update job for Synology DSM Task Scheduler.
* #111: Generated urls for non-default ports included the port twice.
* #110: Support for SMSGlobal SMS gateway <https://www.smsglobal.com/>.
* Support for Danish SMS provider Smsit <http://www.smsit.dk/>
* Composer added for dependencies.

View File

@ -46,6 +46,10 @@ The following people have contributed to the development of PHP Server Monitor:
* Smsit SMS gateway
* Victor Macko <https://github.com/victormacko>
* SMSGlobal SMS gateway
Translators
+++++++++++

View File

@ -444,6 +444,9 @@ function psm_build_sms() {
case 'textmarketer':
$sms = new \psm\Txtmsg\Textmarketer();
break;
case 'smsglobal':
$sms = new \psm\Txtmsg\Smsglobal();
break;
}
// copy login information from the config file

View File

@ -179,6 +179,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_username' => 'Потребител',
'sms_gateway_password' => 'Парола',
'sms_from' => 'Номер на изпращача',

View File

@ -178,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway brugernavn/apikey',
'sms_gateway_password' => 'Gateway adgangskode',

View File

@ -178,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway Benutzername',
'sms_gateway_password' => 'Gateway Passwort',

View File

@ -178,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',

View File

@ -177,6 +177,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',

View File

@ -178,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Nom utilisateur de la passerelle',
'sms_gateway_password' => 'Mot de passe de la passerelle',

View File

@ -177,6 +177,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Nome Utente Gateway',
'sms_gateway_password' => 'Password Gateway',

View File

@ -179,6 +179,7 @@ $sm_lang = array(
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Sender\'s phone number',

View File

@ -178,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Gateway gebruikersnaam',
'sms_gateway_password' => 'Gateway wachtwoord',

View File

@ -178,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Usuário do Gateway',
'sms_gateway_password' => 'Senha do Gateway',

View File

@ -178,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'Пользователь',
'sms_gateway_password' => 'Пароль',

View File

@ -178,6 +178,7 @@ $sm_lang = array(
'sms_gateway_inetworx' => 'Inetworx',
'sms_gateway_clickatell' => 'Clickatell',
'sms_gateway_textmarketer' => 'Textmarketer',
'sms_gateway_smsglobal' => 'SMSGlobal',
'sms_gateway_smsit' => 'Smsit',
'sms_gateway_username' => 'SMS网关用户名',
'sms_gateway_password' => 'SMS网关密码',

View File

@ -271,6 +271,7 @@ class ConfigController extends AbstractController {
'label_sms_gateway_clickatell' => psm_get_lang('config', 'sms_gateway_clickatell'),
'label_sms_gateway_textmarketer' => psm_get_lang('config', 'sms_gateway_textmarketer'),
'label_sms_gateway_smsit' => psm_get_lang('config', 'sms_gateway_smsit'),
'label_sms_gateway_smsglobal' => psm_get_lang('config', 'sms_gateway_smsglobal'),
'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'),

View File

@ -0,0 +1,80 @@
<?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 Victor Macko
* @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://www.phpservermonitor.org/
* @since phpservermon 3.1
**/
namespace psm\Txtmsg;
class Smsglobal extends Core {
// =========================================================================
// [ Fields ]
// =========================================================================
public $gateway = 1;
public $resultcode = null;
public $resultmessage = null;
public $success = false;
public $successcount = 0;
/**
* Send the SMS message
* @param string $message
* @return boolean (true = message was sent successfully, false = there was a problem sending the message)
*/
public function sendSMS($message) {
$recipients = join(',', $this->recipients);
if(count($recipients) == 0) {
return false;
}
/**
* Documentation is here: http://www.smsglobal.com/http-api/
* Recipient numbers should be in the MSIDSN format (eg. 61400111222). The '+' sign should not be included before the country code.
*/
$from = urlencode(substr($this->originator,0 , 11)); // Max 11 Char.
$url = 'http://www.smsglobal.com/http-api.php' .
'?action=sendsms' .
'&user=' . $this->username .
'&password=' . $this->password .
'&from=' . $from .
'&to=' . rawurlencode($recipients) .
'&clientcharset=ISO-8859-1' .
'&text=' . substr(rawurlencode($message), 0, 153);
$returnedData = file_get_contents($url);
$isOk = strpos($returnedData, 'OK: 0') !== false;
$this->success = $isOk;
$this->resultmessage = $returnedData;
if(!$isOk) {
error_log($this->resultmessage, E_USER_NOTICE);
}
return $isOk;
}
}

View File

@ -123,6 +123,7 @@
<option value="inetworx" {sms_selected_inetworx}>{label_sms_gateway_inetworx}</option>
<option value="clickatell" {sms_selected_clickatell}>{label_sms_gateway_clickatell}</option>
<option value="textmarketer" {sms_selected_textmarketer}>{label_sms_gateway_textmarketer}</option>
<option value="smsglobal" {sms_selected_smsglobal}>{label_sms_gateway_smsglobal}</option>
<option value="smsit" {sms_selected_smsit}>{label_sms_gateway_smsit}</option>
</select>
</div>