Merge 7db0144647
into 9c4191949b
commit
a3a3a44009
|
@ -10,6 +10,7 @@ not yet released
|
|||
* #169: Increased server ip char limit to 500.
|
||||
* #164: Added support for FreeVoipDeal SMS gateway <http://www.freevoipdeal.com>.
|
||||
* #181: Added blank index files to prevent directory listing.
|
||||
* #245: Added support for CarrierSMS SMS gateway
|
||||
|
||||
|
||||
v3.1.1 (released November 6, 2014)
|
||||
|
|
|
@ -50,6 +50,10 @@ The following SMS gateways are currently available:
|
|||
|
||||
Please note: for these gateways you will need an account with sufficient credits.
|
||||
|
||||
* CarrierSMS - <http://www.CanadianDomainRegistry.ca>
|
||||
|
||||
CarrierSMS is free sms messaging using your Mobile Carrier's text messaging gateway.
|
||||
|
||||
|
||||
Download
|
||||
--------
|
||||
|
@ -78,6 +82,10 @@ To be able to run an installation from the repo, you need to run the following c
|
|||
|
||||
php composer.phar install
|
||||
|
||||
If you get "Fatal error: Uncaught exception 'PharException'..." run this and try again:
|
||||
|
||||
curl -s http://getcomposer.org/installer | php
|
||||
|
||||
If you are familiar with Vagrant (https://www.vagrantup.com)::
|
||||
|
||||
vagrant up
|
||||
|
|
|
@ -14,7 +14,7 @@ The following people have contributed to the development of PHP Server Monitor:
|
|||
|
||||
* Creator and project maintainer
|
||||
|
||||
* Jérôme Cabanis - https://github.com/Abawell
|
||||
* Jérôme Cabanis - https://github.com/Abawell
|
||||
|
||||
* History graphs
|
||||
* Date localization
|
||||
|
@ -67,6 +67,10 @@ The following people have contributed to the development of PHP Server Monitor:
|
|||
|
||||
* FreeVoipDeal SMS gateway
|
||||
|
||||
* Glen Arason - http://CanadianDomainRegistry.ca
|
||||
|
||||
* CarrierSMS SMS gateway
|
||||
|
||||
|
||||
Translators
|
||||
+++++++++++
|
||||
|
@ -96,7 +100,7 @@ The following people have contributed to the translation of PHP Server Monitor:
|
|||
* French
|
||||
|
||||
* David Ribeiro
|
||||
* Jérôme Cabanis
|
||||
* Jérôme Cabanis
|
||||
|
||||
* German
|
||||
|
||||
|
@ -126,7 +130,7 @@ The following people have contributed to the translation of PHP Server Monitor:
|
|||
|
||||
* Spanish
|
||||
|
||||
* Klemens Häckel - http://clickdimension.wordpress.com
|
||||
* Klemens Häckel - http://clickdimension.wordpress.com
|
||||
* Luis Rodriguez - https://github.com/ldrrp
|
||||
|
||||
* Swedish
|
||||
|
|
|
@ -59,8 +59,12 @@ The following SMS gateways are currently available:
|
|||
|
||||
Please note: for these gateways you will need an account with sufficient credits.
|
||||
|
||||
* CarrierSMS - <http://www.CanadianDomainRegistry.ca>
|
||||
|
||||
CarrierSMS is free sms messaging using your Mobile Carrier's text messaging gateway.
|
||||
|
||||
|
||||
Download
|
||||
++++++++
|
||||
|
||||
The latest version can be downloaded from http://www.phpservermonitor.org/.
|
||||
The latest version can be downloaded from http://www.phpservermonitor.org/.
|
||||
|
|
|
@ -442,6 +442,9 @@ function psm_build_sms() {
|
|||
// open the right class
|
||||
// not making this any more dynamic, because perhaps some gateways need custom settings (like Mollie)
|
||||
switch(strtolower(psm_get_conf('sms_gateway'))) {
|
||||
case 'carriersms':
|
||||
$sms = new \psm\Txtmsg\CarrierSMS();
|
||||
break;
|
||||
case 'mosms':
|
||||
$sms = new \psm\Txtmsg\Mosms();
|
||||
break;
|
||||
|
|
|
@ -102,6 +102,12 @@ $sm_lang = array(
|
|||
'error_user_no_match' => 'The user could not be found in the database.',
|
||||
'error_user_password_invalid' => 'The entered password is invalid.',
|
||||
'error_user_password_no_match' => 'The entered passwords do not match.',
|
||||
'error_carriersms_from_email_invalid' => 'No valid "From" email address, sending notifications failed.',
|
||||
'error_carriersms_to_email_invalid' => 'No valid "To" email address, sending notifications failed.',
|
||||
'error_carriersms_not_unique' => 'The "To" and "From" email addresses can not be the same, sending notifications failed.',
|
||||
'carriersms_description_user' => 'Receive real-time sms notifications using your "Mobile Carrier\'s SMS Gateway".<br /><strong>CarrierSMS Email</strong> addresses usually look like: <span style="color:navy;"><10DigitNumber>@<host.MobileCarrier.dom>',
|
||||
'carriersms_description_help' => 'A well maintained "Email-To-SMS Database" of mobile carrier gateways is available at <a href="http://avtech.com/Support/Email/index.htm" target="_blank">AVTECH</a><br />Or, send a text message from your mobile device to an email account.<br />The "From" address in the email should be your device\'s gateway email address.',
|
||||
'carriersms_email' => 'CarrierSMS Email',
|
||||
),
|
||||
'log' => array(
|
||||
'title' => 'Log entries',
|
||||
|
@ -256,6 +262,11 @@ $sm_lang = array(
|
|||
'log_retention_period' => 'Log retention period',
|
||||
'log_retention_period_description' => 'Number of days to keep logs of notifications and archives of server uptime. Enter 0 to disable log cleanup.',
|
||||
'log_retention_days' => 'days',
|
||||
'sms_gateway_carriersms' => 'CarrierSMS',
|
||||
'sms_gateway_carriersms_select' => 'For CarrierSMS, the Email settings must be configured correctly even if Email is not being used.',
|
||||
'sms_gateway_carriersms_option' => 'For CarrierSMS, you can enter an alternate "From:" email address or leave blank to use the "Email from address".',
|
||||
'test_carriersms' => 'An SMS will be sent to the CarrierSMS Email specified in your user profile.',
|
||||
'sms_error_nomobile_carriersms' => 'Testing SMS failed: No assinged "CarrierSMS Email" in your profile.',
|
||||
),
|
||||
// for newlines in the email messages use <br/>
|
||||
'notifications' => array(
|
||||
|
@ -269,6 +280,12 @@ $sm_lang = array(
|
|||
'on_email_body' => "Server '%LABEL%' is running again:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%",
|
||||
'on_pushover_title' => 'Server \'%LABEL%\' is RUNNING',
|
||||
'on_pushover_message' => 'Server \'%LABEL%\' is running again:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%',
|
||||
'on_carrier' => '<br />%IP%:%PORT%',
|
||||
'off_carrier' => '<br />%IP%:%PORT%<br />%ERROR%',
|
||||
'on_carrier_subject' => '%LABEL% is UP',
|
||||
'off_carrier_subject' => '%LABEL% is DOWN',
|
||||
'on_carrier_log' => '[%LABEL% was UP] %IP%:%PORT%',
|
||||
'off_carrier_log' => '[%LABEL% was Down] %IP%:%PORT% ( %ERROR% )',
|
||||
),
|
||||
'login' => array(
|
||||
'welcome_usermenu' => 'Welcome, %user_name%',
|
||||
|
|
|
@ -134,7 +134,9 @@ class ConfigController extends AbstractController {
|
|||
$modal = new \psm\Util\Module\Modal($this->twig, 'test' . ucfirst($modal_id), \psm\Util\Module\Modal::MODAL_TYPE_OKCANCEL);
|
||||
$this->addModal($modal);
|
||||
$modal->setTitle(psm_get_lang('servers', 'send_' . $modal_id));
|
||||
$modal->setMessage(psm_get_lang('config', 'test_' . $modal_id));
|
||||
if($modal_id == "sms" && $GLOBALS['sm_config']['sms_gateway'] == 'carriersms'){
|
||||
$modal->setMessage(psm_get_lang('config', 'test_carriersms'));
|
||||
}else{ $modal->setMessage(psm_get_lang('config', 'test_' . $modal_id)); }
|
||||
$modal->setOKButtonLabel(psm_get_lang('config', 'send'));
|
||||
}
|
||||
|
||||
|
@ -229,8 +231,14 @@ class ConfigController extends AbstractController {
|
|||
$sms = psm_build_sms();
|
||||
if($sms) {
|
||||
$user = $this->getUser()->getUser();
|
||||
|
||||
if($GLOBALS['sm_config']['sms_gateway'] == 'carriersms') {
|
||||
$user->mobile = $user->carriersms;
|
||||
$smserr = '_carriersms';
|
||||
} else { $smserr = ''; }
|
||||
|
||||
if(empty($user->mobile)) {
|
||||
$this->addMessage(psm_get_lang('config', 'sms_error_nomobile'), 'error');
|
||||
$this->addMessage(psm_get_lang('config', 'sms_error_nomobile'.$smserr), 'error');
|
||||
} else {
|
||||
$sms->addRecipients($user->mobile);
|
||||
if($sms->sendSMS(psm_get_lang('config', 'test_message'))) {
|
||||
|
@ -306,6 +314,9 @@ class ConfigController extends AbstractController {
|
|||
'label_email_smtp_noauth' => psm_get_lang('config', 'email_smtp_noauth'),
|
||||
'label_sms_status' => psm_get_lang('config', 'sms_status'),
|
||||
'label_sms_gateway' => psm_get_lang('config', 'sms_gateway'),
|
||||
'label_sms_gateway_carriersms' => psm_get_lang('config', 'sms_gateway_carriersms'),
|
||||
'label_sms_gateway_carriersms_select' => psm_get_lang('config', 'sms_gateway_carriersms_select'),
|
||||
'label_sms_gateway_carriersms_option' => psm_get_lang('config', 'sms_gateway_carriersms_option'),
|
||||
'label_sms_gateway_mosms' => psm_get_lang('config', 'sms_gateway_mosms'),
|
||||
'label_sms_gateway_mollie' => psm_get_lang('config', 'sms_gateway_mollie'),
|
||||
'label_sms_gateway_spryng' => psm_get_lang('config', 'sms_gateway_spryng'),
|
||||
|
|
|
@ -210,6 +210,7 @@ class InstallController extends AbstractController {
|
|||
'level' => PSM_USER_ADMIN,
|
||||
'pushover_key' => '',
|
||||
'pushover_device' => '',
|
||||
'carriersms' => '',
|
||||
);
|
||||
|
||||
$validator = $this->container->get('util.user.validator');
|
||||
|
|
|
@ -35,7 +35,7 @@ class ProfileController extends AbstractController {
|
|||
* Editable fields for the profile
|
||||
* @var array $profile_fields
|
||||
*/
|
||||
protected $profile_fields = array('name', 'user_name', 'mobile', 'pushover_key', 'pushover_device', 'email');
|
||||
protected $profile_fields = array('name', 'user_name', 'mobile', 'pushover_key', 'pushover_device', 'carriersms', 'email');
|
||||
|
||||
function __construct(Database $db, \Twig_Environment $twig) {
|
||||
parent::__construct($db, $twig);
|
||||
|
@ -65,6 +65,10 @@ class ProfileController extends AbstractController {
|
|||
'label_pushover_key' => psm_get_lang('users', 'pushover_key'),
|
||||
'label_pushover_device' => psm_get_lang('users', 'pushover_device'),
|
||||
'label_pushover_device_description' => psm_get_lang('users', 'pushover_device_description'),
|
||||
'label_carriersms' => psm_get_lang('config', 'sms_gateway_carriersms'),
|
||||
'label_carriersms_email' => psm_get_lang('users', 'carriersms_email'),
|
||||
'label_carriersms_description' => psm_get_lang('users', 'carriersms_description_user'),
|
||||
'label_carriersms_help' => psm_get_lang('users', 'carriersms_description_help'),
|
||||
'label_email' => psm_get_lang('users', 'email'),
|
||||
'label_save' => psm_get_lang('system', 'save'),
|
||||
'form_action' => psm_build_url(array(
|
||||
|
@ -134,4 +138,4 @@ class ProfileController extends AbstractController {
|
|||
|
||||
return $this->executeIndex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class UserController extends AbstractController {
|
|||
$users = $this->db->select(
|
||||
PSM_DB_PREFIX.'users',
|
||||
null,
|
||||
array('user_id', 'user_name', 'level', 'name', 'mobile', 'pushover_key', 'pushover_device', 'email'),
|
||||
array('user_id', 'user_name', 'level', 'name', 'mobile', 'pushover_key', 'pushover_device', 'carriersms', 'email'),
|
||||
null,
|
||||
array('name')
|
||||
);
|
||||
|
@ -132,7 +132,7 @@ class UserController extends AbstractController {
|
|||
*/
|
||||
protected function executeEdit() {
|
||||
$user_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
|
||||
$fields_prefill = array('name', 'user_name', 'mobile', 'pushover_key', 'pushover_device', 'email');
|
||||
$fields_prefill = array('name', 'user_name', 'mobile', 'pushover_key', 'pushover_device', 'carriersms', 'email');
|
||||
|
||||
if($user_id == 0) {
|
||||
// insert mode
|
||||
|
@ -214,7 +214,7 @@ class UserController extends AbstractController {
|
|||
}
|
||||
$user_id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
|
||||
|
||||
$fields = array('name', 'user_name', 'password', 'password_repeat', 'level', 'mobile', 'pushover_key', 'pushover_device', 'email');
|
||||
$fields = array('name', 'user_name', 'password', 'password_repeat', 'level', 'mobile', 'pushover_key', 'pushover_device', 'carriersms', 'email');
|
||||
$clean = array();
|
||||
foreach($fields as $field) {
|
||||
if(isset($_POST[$field])) {
|
||||
|
@ -332,6 +332,10 @@ class UserController extends AbstractController {
|
|||
'label_pushover_key' => psm_get_lang('users', 'pushover_key'),
|
||||
'label_pushover_device' => psm_get_lang('users', 'pushover_device'),
|
||||
'label_pushover_device_description' => psm_get_lang('users', 'pushover_device_description'),
|
||||
'label_carriersms' => psm_get_lang('config', 'sms_gateway_carriersms'),
|
||||
'label_carriersms_email' => psm_get_lang('users', 'carriersms_email'),
|
||||
'label_carriersms_description' => psm_get_lang('users', 'carriersms_description_user'),
|
||||
'label_carriersms_help' => psm_get_lang('users', 'carriersms_description_help'),
|
||||
'label_email' => psm_get_lang('users', 'email'),
|
||||
'label_servers' => psm_get_lang('menu', 'server'),
|
||||
'label_action' => psm_get_lang('system', 'action'),
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
/**
|
||||
* Mobile Carrier SMS gateway Add-On for PHP Server Monitor
|
||||
*
|
||||
* This file is an Add-On for PHP Server Monitor.
|
||||
* http://www.phpservermonitor.org/
|
||||
*
|
||||
* This Add-On 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.
|
||||
*
|
||||
* This Add-On is 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 review a copy of the GNU General Public License here:
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Determining your mobile device email address:
|
||||
* 1. Send a text message from your mobile device to an email account.
|
||||
* The "From" address in the email should be your device's gateway email address.
|
||||
*
|
||||
* 2. A well maintained "Email-To-SMS Database" of mobile carrier gateways is
|
||||
* available at "http://avtech.com/Support/Email/index.htm"
|
||||
*
|
||||
* @author Glen Arason
|
||||
* @copyright Copyright (c) 2015 ITIStudios
|
||||
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
|
||||
* @version Release: v2.0.0
|
||||
* @link http://www.canadiandomainregistry.ca
|
||||
*
|
||||
*/
|
||||
|
||||
namespace psm\Txtmsg;
|
||||
|
||||
class CarrierSMS extends Core {
|
||||
// =========================================================================
|
||||
// [ Fields ]
|
||||
// =========================================================================
|
||||
public $gateway = 0;
|
||||
public $resultcode = 0;
|
||||
public $resultmessage = "";
|
||||
public $success = false;
|
||||
public $successcount = 0;
|
||||
|
||||
public function sendSMS($status,$server='') {
|
||||
// Create new mail object
|
||||
$mailObj = psm_build_mail();
|
||||
|
||||
// Set some email headers
|
||||
$mailObj->XMailer = "SMS";
|
||||
$mailObj->AltBody = null; // if not null a multi-part message is created.
|
||||
|
||||
// Check and assign From address.
|
||||
// "$this->originator" is any valid email address entered in the SMS "Sender's phone number"
|
||||
// field and can be used as the "From:" email address for the sms text message.
|
||||
// Rem: phpmailer ValidateAddress() is buggy so I'm using php's filter_var() instead.
|
||||
$from = filter_var(strtolower($this->originator), FILTER_VALIDATE_EMAIL);
|
||||
if( $from === false ) { // Get "Email From" address
|
||||
$from = filter_var(strtolower(psm_get_conf('email_from_email')), FILTER_VALIDATE_EMAIL);
|
||||
}
|
||||
|
||||
if(is_bool($status) && is_array($server)){ // If Not a "Test" message.
|
||||
$br = array('<br />','<br/>'); $nl = "\n";
|
||||
// Available message length = +/- 155 minus (from email address length) minus (subject length)
|
||||
$Body = psm_parse_msg($status, "carrier", $server);
|
||||
$Subject = psm_parse_msg($status, "carrier_subject", $server);
|
||||
|
||||
// The txt message must have new lines not line breaks.
|
||||
$Body = str_replace($br,$nl, $Body);
|
||||
$Subject = str_replace($br,$nl, $Subject);
|
||||
|
||||
// User configureable log entries
|
||||
$logMsg = psm_parse_msg($status, "carrier_log", $server);
|
||||
$this->resultmessage = $logMsg;
|
||||
|
||||
$mailObj->Body = $Body;
|
||||
$mailObj->Subject = $Subject;
|
||||
|
||||
foreach($this->recipients as $value) {
|
||||
$to = filter_var(strtolower($value), FILTER_VALIDATE_EMAIL);
|
||||
// XOR result codes for potential future use.
|
||||
if(!$from) $this->resultcode = 1;
|
||||
if(!$to) $this->resultcode = 2;
|
||||
if($from == $to) $this->resultcode = 4;
|
||||
|
||||
if(!$this->resultcode) {
|
||||
if( !$mailObj->SetFrom($from,"",false) ){ $this->resultcode = 8; }
|
||||
else if( !$mailObj->AddAddress($to) ){ $this->resultcode = 16; }
|
||||
else{
|
||||
if(!$mailObj->Send()){ $this->resultcode = 32; }
|
||||
$mailObj->ClearAddresses();
|
||||
}
|
||||
}
|
||||
switch ($this->resultcode) {
|
||||
case 0: $this->success = true; $this->successcount +=1; break;
|
||||
case 1:
|
||||
case 8: $this->resultmessage = psm_get_lang('users', 'error_carriersms_from_email_invalid') . $logMsg; break;
|
||||
case 2: $this->resultmessage = psm_get_lang('users', 'error_carriersms_to_email_invalid') . " ($to) " . $logMsg; break;
|
||||
case 4: $this->resultmessage = psm_get_lang('users', 'error_carriersms_not_unique') . " ($to) = ($from) " . $logMsg; break;
|
||||
case 16: $this->resultmessage = psm_get_lang('users', 'error_carriersms_to_email_invalid') . " ($to) " . $logMsg; break;
|
||||
case 32: $this->resultmessage = psm_get_lang('config', 'sms_error') . " : " . $mailObj->ErrorInfo . $logMsg; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}else{ // A test message is being sent/tested
|
||||
$mailObj->Body = $status;
|
||||
if($from !== false){
|
||||
$mailObj->SetFrom($from,"",false);
|
||||
$mailObj->AddAddress($this->recipients[0]);
|
||||
$this->success = $mailObj->Send();
|
||||
if(!$this->success && $mailObj->ErrorInfo != ""){
|
||||
$GLOBALS['sm_lang']['config']['sms_error']=$mailObj->ErrorInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->success;
|
||||
}
|
||||
}
|
|
@ -184,6 +184,7 @@ class Installer {
|
|||
`mobile` varchar(15) NOT NULL,
|
||||
`pushover_key` varchar(255) NOT NULL,
|
||||
`pushover_device` varchar(255) NOT NULL,
|
||||
`carriersms` varchar(255) NOT NULL,
|
||||
`email` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`user_id`),
|
||||
UNIQUE KEY `unique_username` (`user_name`)
|
||||
|
@ -408,6 +409,8 @@ class Installer {
|
|||
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "users` ADD `pushover_key` VARCHAR( 255 ) NOT NULL AFTER `mobile`;";
|
||||
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "users` ADD `pushover_device` VARCHAR( 255 ) NOT NULL AFTER `pushover_key`;";
|
||||
|
||||
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "users` ADD `carriersms` VARCHAR( 255 ) NOT NULL AFTER `pushover_device`;";
|
||||
|
||||
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` ADD `pushover` ENUM( 'yes','no' ) NOT NULL DEFAULT 'yes' AFTER `sms`;";
|
||||
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "log` CHANGE `type` `type` ENUM( 'status', 'email', 'sms', 'pushover' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;";
|
||||
|
||||
|
|
|
@ -280,17 +280,33 @@ class StatusNotifier {
|
|||
// we have to build an userlist for the log table..
|
||||
$userlist = array();
|
||||
|
||||
// add all users to the recipients list
|
||||
foreach ($users as $user) {
|
||||
$userlist[] = $user['user_id'];
|
||||
$sms->addRecipients($user['mobile']);
|
||||
// CarrierSMS sends plain/text "email" so pass vars to CarrierSMS class.
|
||||
if($GLOBALS['sm_config']['sms_gateway'] == 'carriersms') {
|
||||
// add all users to the recipients list
|
||||
foreach ($users as $user) {
|
||||
if($user['carriersms'] != ""){
|
||||
// only log users configured with a mobile email address
|
||||
$userlist[] = $user['user_id'];
|
||||
$sms->addRecipients($user['carriersms']);
|
||||
}
|
||||
}
|
||||
|
||||
// Send sms, CarrierSMS class will handle messaging
|
||||
$result = $sms->sendSMS($this->status_new, $this->server);
|
||||
$message = $sms->resultmessage;
|
||||
}else{
|
||||
// add all users to the recipients list
|
||||
foreach ($users as $user) {
|
||||
$userlist[] = $user['user_id'];
|
||||
$sms->addRecipients($user['mobile']);
|
||||
}
|
||||
|
||||
$message = psm_parse_msg($this->status_new, 'sms', $this->server);
|
||||
|
||||
// Send sms
|
||||
$result = $sms->sendSMS($message);
|
||||
}
|
||||
|
||||
$message = psm_parse_msg($this->status_new, 'sms', $this->server);
|
||||
|
||||
// Send sms
|
||||
$result = $sms->sendSMS($message);
|
||||
|
||||
if(psm_get_conf('log_sms')) {
|
||||
// save to log
|
||||
psm_add_log($this->server_id, 'sms', $message, implode(',', $userlist));
|
||||
|
@ -306,7 +322,7 @@ class StatusNotifier {
|
|||
public function getUsers($server_id) {
|
||||
// find all the users with this server listed
|
||||
$users = $this->db->query("
|
||||
SELECT `u`.`user_id`, `u`.`name`,`u`.`email`, `u`.`mobile`, `u`.`pushover_key`, `u`.`pushover_device`
|
||||
SELECT `u`.`user_id`, `u`.`name`,`u`.`email`, `u`.`mobile`, `u`.`pushover_key`, `u`.`pushover_device`, `u`.`carriersms`
|
||||
FROM `".PSM_DB_PREFIX."users` AS `u`
|
||||
JOIN `".PSM_DB_PREFIX."users_servers` AS `us` ON (
|
||||
`us`.`user_id`=`u`.`user_id`
|
||||
|
@ -315,4 +331,4 @@ class StatusNotifier {
|
|||
");
|
||||
return $users;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,6 +150,7 @@
|
|||
<label class="control-label" for="sms_gateway">{{ label_sms_gateway }}</label>
|
||||
<div class="controls">
|
||||
<select id="sms_gateway" name="sms_gateway">
|
||||
<option value="carriersms" {{ sms_selected_carriersms|raw }}>{{ label_sms_gateway_carriersms }}</option>
|
||||
<option value="mosms" {{ sms_selected_mosms|raw }}>{{ label_sms_gateway_mosms }}</option>
|
||||
<option value="mollie" {{ sms_selected_mollie|raw }}>{{ label_sms_gateway_mollie }}</option>
|
||||
<option value="spryng" {{ sms_selected_spryng|raw }}>{{ label_sms_gateway_spryng }}</option>
|
||||
|
@ -160,6 +161,7 @@
|
|||
<option value="smsit" {{ sms_selected_smsit|raw }}>{{ label_sms_gateway_smsit }}</option>
|
||||
<option value="freevoipdeal" {{ sms_selected_freevoipdeal|raw }}>{{ label_sms_gateway_freevoipdeal }}</option>
|
||||
</select>
|
||||
<p class="help-block">{{ label_sms_gateway_carriersms_select|raw }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
@ -178,6 +180,7 @@
|
|||
<label class="control-label" for="sms_from">{{ label_sms_from }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="sms_from" name="sms_from" value="{{ sms_from }}" maxlength="255" />
|
||||
<p class="help-block">{{ label_sms_gateway_carriersms_option|raw }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
@ -225,4 +228,4 @@
|
|||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
@ -42,11 +42,21 @@
|
|||
<input type="text" id="mobile" name="mobile" value="{{ mobile }}" maxlength="15" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ label_carriersms }}</label>
|
||||
<div class="controls" style="padding-top:5px">{{ label_carriersms_description|raw }}<p class="help-block">{{ label_carriersms_help|raw }}</p></div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="carriersms">{{ label_carriersms_email }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="carriersms" name="carriersms" value="{{ carriersms }}" maxlength="255" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span6">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ label_pushover }}</label>
|
||||
<div class="controls">{{ label_pushover_description|raw }} </div>
|
||||
<div class="controls" style="padding-top:5px">{{ label_pushover_description|raw }} </div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="mobile">{{ label_pushover_key }}</label>
|
||||
|
@ -68,4 +78,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<th class="visible-desktop">{{ label_level }}</th>
|
||||
<th class="hidden-phone">{{ label_email }}</th>
|
||||
<th class="hidden-phone">{{ label_mobile }}</th>
|
||||
<th class="hidden-phone">{{ label_carriersms }}</th>
|
||||
<th class="hidden-phone">{{ label_servers }}</th>
|
||||
<th class="hidden-phone tight">{{ label_action }}</th>
|
||||
</tr>
|
||||
|
@ -43,6 +44,7 @@
|
|||
<div class="table-body">
|
||||
<div class="table-row"><div class="table-cell-details tight">{{ label_email }}: </div><div class="table-cell-details">{{ user.email }}</div></div>
|
||||
<div class="table-row"><div class="table-cell-details tight">{{ label_mobile }}: </div><div class="table-cell-details">{{ user.mobile }}</div></div>
|
||||
<div class="table-row"><div class="table-cell-details tight">{{ label_carriersms }}: </div><div class="table-cell-details">{{ user.carriersms }}</div></div>
|
||||
<div class="table-row"><div class="table-cell-details tight">{{ label_servers }}: </div><div class="table-cell-details">{% for server in user.emp_servers %} {{ server.label }}<br/> {% endfor %}</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -51,6 +53,7 @@
|
|||
<td class="visible-desktop tight"><div class="table-cell-title">{{ user.level_text }}</div></td>
|
||||
<td class="hidden-phone tight"><div class="table-cell-title">{{ user.email }}</div></td>
|
||||
<td class="hidden-phone tight"><div class="table-cell-title">{{ user.mobile }}</div></td>
|
||||
<td class="hidden-phone tight"><div class="table-cell-title">{{ user.carriersms }}</div></td>
|
||||
<td class="hidden-phone"><div class="table-cell-title">{% for server in user.emp_servers %} {{ server.label }}<br/> {% endfor %}</div></td>
|
||||
<td class="hidden-phone tight">
|
||||
<a class="btn btn-small" href="{{ user.url_edit|raw }}" title="{{ label_edit }}">
|
||||
|
@ -63,4 +66,4 @@
|
|||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
|
|
@ -48,9 +48,19 @@
|
|||
<input type="text" id="mobile" name="mobile" value="{{ edit_value_mobile }}" maxlength="15" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ label_carriersms }}</label>
|
||||
<div class="controls" style="padding-top:5px">{{ label_carriersms_description|raw }}<p class="help-block">{{ label_carriersms_help|raw }}</p></div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="carriersms">{{ label_carriersms_email }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="carriersms" name="carriersms" value="{{ edit_value_carriersms }}" maxlength="255" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ label_pushover }}</label>
|
||||
<div class="controls">{{ label_pushover_description|raw }} </div>
|
||||
<div class="controls" style="padding-top:5px">{{ label_pushover_description|raw }} </div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="mobile">{{ label_pushover_key }}</label>
|
||||
|
@ -79,4 +89,4 @@
|
|||
<button class="btn" onclick="history.back();return false;" >{{ label_go_back }}</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue