diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1b36b517 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ + +.idea/scopes/scope_settings.xml + +.idea/workspace.xml + +.idea/workspace.xml + +.idea/encodings.xml + +.idea/misc.xml + +.idea/phpservermon.iml + +.idea/modules.xml + +.idea/vcs.xml + +.idea/* \ No newline at end of file diff --git a/README.md b/README.md index f42b3210..87fc67c7 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ whether it is a "service" or a "website": This function takes care of that. You can enter a link to a website (for example ), it will use cURL to open the website and check the HTTP status code (see for details). - If the HTTP status code is in the 4xx range, it means an error occured and the website is not accesible to the public. + If the HTTP status code is in the 4xx range, it means an error occurred and the website is not accessible to the public. In that case the script will return a "status offline", and will start sending out notifications. Each server has it's own settings regarding notification. @@ -79,7 +79,7 @@ For example: define('SM_DB_USER', 'db_user'); To change your username you should ONLY change the 'db\_user' part. -Do NOT remove the quotes aroundyour username as that will result in an error. +Do NOT remove the quotes around your username as that will result in an error. ### 2. Upload files @@ -109,7 +109,7 @@ If it is your own server or you have shell access and permission to open the cro */15 * * * * root /usr/bin/php /var/www/html/phpservermon/cron/status.cron.php As you can see, this line will run the status.cron.php script every 15 minutes. Change the line to suit your needs. -If you do not have shell access, ask your webhosting to set it up for you. +If you do not have shell access, ask your web hosting provider to set it up for you. ### 6. Voila! @@ -119,7 +119,7 @@ If you do not have shell access, ask your webhosting to set it up for you. ### Language The server monitor uses language files. That means that any regular text you see on the screen can easily be -changed without having to digg through the code. These language files are stored in the directory "lang". +changed without having to dig through the code. These language files are stored in the directory "lang". The language that's being used by the monitor is defined in the config table. If you like you can make changes to the language file or even add a new one. diff --git a/src/includes/config.inc.php.sample b/src/includes/config.inc.php.sample index 40cdca56..6b740bcd 100755 --- a/src/includes/config.inc.php.sample +++ b/src/includes/config.inc.php.sample @@ -25,16 +25,16 @@ * @link http://phpservermon.neanderthal-technology.com/ **/ -define('SM_CONFIG', true); +define('PSM_CONFIG', true); // Prefix used for tables -define('SM_DB_PREFIX', 'monitor_'); +define('PSM_DB_PREFIX', 'monitor_'); // Database username -define('SM_DB_USER', 'db_user'); +define('PSM_DB_USER', 'db_user'); // Database password -define('SM_DB_PASS', 'db_pass'); +define('PSM_DB_PASS', 'db_pass'); // Database name -define('SM_DB_NAME', 'db_name'); +define('PSM_DB_NAME', 'db_name'); // Database host -define('SM_DB_HOST', 'localhost'); +define('PSM_DB_HOST', 'localhost'); ?> \ No newline at end of file diff --git a/src/lang/de.lang.php b/src/lang/de.lang.php index 6b24e33a..cecdffae 100755 --- a/src/lang/de.lang.php +++ b/src/lang/de.lang.php @@ -97,7 +97,8 @@ $sm_lang = array( 'sms_gateway_mollie' => 'Mollie', 'sms_gateway_spryng' => 'Spryng', 'sms_gateway_inetworx' => 'Inetworx', - 'sms_gateway_clickatell' => 'Clickatell', + 'sms_gateway_clickatell' => 'Clickatell', + 'sms_gateway_textmarketer' => 'Textmarketer', 'sms_gateway_username' => 'Gateway Benutzername', 'sms_gateway_password' => 'Gateway Passwort', 'sms_from' => 'SMS Sendernummer', diff --git a/src/lang/en.lang.php b/src/lang/en.lang.php index 36680ed4..f7cc61df 100755 --- a/src/lang/en.lang.php +++ b/src/lang/en.lang.php @@ -98,6 +98,7 @@ $sm_lang = array( 'sms_gateway_spryng' => 'Spryng', 'sms_gateway_inetworx' => 'Inetworx', 'sms_gateway_clickatell' => 'Clickatell', + 'sms_gateway_textmarketer' => 'Textmarketer', 'sms_gateway_username' => 'Gateway username', 'sms_gateway_password' => 'Gateway password', 'sms_from' => 'Sender\'s phone number', diff --git a/src/lang/fr.lang.php b/src/lang/fr.lang.php index b0371b84..74be5b9a 100755 --- a/src/lang/fr.lang.php +++ b/src/lang/fr.lang.php @@ -98,6 +98,7 @@ $sm_lang = array( 'sms_gateway_spryng' => 'Spryng', 'sms_gateway_inetworx' => 'Inetworx', 'sms_gateway_clickatell' => 'Clickatell', + 'sms_gateway_textmarketer' => 'Textmarketer', 'sms_gateway_username' => 'Utilisateur sur la passerelle', 'sms_gateway_password' => 'Mot de passe sur la passerelle', 'sms_from' => 'SMS de l expéditeur', diff --git a/src/lang/kr.lang.php b/src/lang/kr.lang.php index 120f1485..8427bac2 100755 --- a/src/lang/kr.lang.php +++ b/src/lang/kr.lang.php @@ -99,6 +99,7 @@ $sm_lang = array( 'sms_gateway_spryng' => 'Spryng', 'sms_gateway_inetworx' => 'Inetworx', 'sms_gateway_clickatell' => 'Clickatell', + 'sms_gateway_textmarketer' => 'Textmarketer', 'sms_gateway_username' => 'Gateway username', 'sms_gateway_password' => 'Gateway password', 'sms_from' => 'Sender\'s phone number', diff --git a/src/lang/nl.lang.php b/src/lang/nl.lang.php index 4fb3d767..3c87f4e8 100755 --- a/src/lang/nl.lang.php +++ b/src/lang/nl.lang.php @@ -98,6 +98,7 @@ $sm_lang = array( 'sms_gateway_spryng' => 'Spryng', 'sms_gateway_inetworx' => 'Inetworx', 'sms_gateway_clickatell' => 'Clickatell', + 'sms_gateway_textmarketer' => 'Textmarketer', 'sms_gateway_username' => 'Gateway gebruikersnaam', 'sms_gateway_password' => 'Gateway wachtwoord', 'sms_from' => 'Telefoonnummer afzender', diff --git a/src/psm/Module/Config.class.php b/src/psm/Module/Config.class.php index cbc0ee93..66bb9fab 100755 --- a/src/psm/Module/Config.class.php +++ b/src/psm/Module/Config.class.php @@ -175,7 +175,8 @@ class Config extends Core { 'label_sms_gateway_mollie' => psm_get_lang('config', 'sms_gateway_mollie'), 'label_sms_gateway_spryng' => psm_get_lang('config', 'sms_gateway_spryng'), 'label_sms_gateway_inetworx' => psm_get_lang('config', 'sms_gateway_inetworx'), - 'label_sms_gateway_clickatell' => psm_get_lang('config', 'sms_gateway_clickatell'), + '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_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'), diff --git a/src/psm/Module/Servers.class.php b/src/psm/Module/Servers.class.php index c1114e31..ac27c2ab 100755 --- a/src/psm/Module/Servers.class.php +++ b/src/psm/Module/Servers.class.php @@ -181,9 +181,9 @@ class Servers extends Core { // check for add/edit mode if (isset($_POST['label']) && isset($_POST['ip']) && isset($_POST['port'])) { $clean = array( - 'label' => $_POST['label'], - 'ip' => $_POST['ip'], - 'port' => $_POST['port'], + 'label' => strip_tags($_POST['label']), + 'ip' => strip_tags($_POST['ip']), + 'port' => strip_tags($_POST['port']), 'type' => $_POST['type'], 'active' => $_POST['active'], 'email' => $_POST['email'], diff --git a/src/psm/Txtmsg/Textmarketer.php b/src/psm/Txtmsg/Textmarketer.php new file mode 100644 index 00000000..0b7bf8c9 --- /dev/null +++ b/src/psm/Txtmsg/Textmarketer.php @@ -0,0 +1,60 @@ +. + * + * @package phpservermon + * @author Perri Vardy-Mason + * @copyright Copyright (c) 2008-2014 Pepijn Over + * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 + * @version Release: @package_version@ + * @link http://phpservermon.neanderthal-technology.com/ + **/ + +namespace psm\Txtmsg; + +class Textmarketer extends Core { + // ========================================================================= + // [ Fields ] + // ========================================================================= + public $gateway = 1; + public $resultcode = null; + public $resultmessage = null; + public $success = false; + public $successcount = 0; + + public function sendSMS($message) { + + $textmarketer_url = "https://api.textmarketer.co.uk/gateway/"; + $textmarketer_data = urlencode( $message ); + $textmarketer_origin = urlencode( 'SERVERALERT' ); + + + foreach( $this->recipients as $phone ){ + + $URL = $textmarketer_url."?username=" . $this->username . "&password=" . $this->password . "&to=" . $phone . "&message=" . $textmarketer_data . "&orig=" . $textmarketer_origin; + + $result = file_get_contents( $URL ); + + } + + return $result; + } + +} + +?> diff --git a/src/psm/UpdaterStatus.class.php b/src/psm/UpdaterStatus.class.php index 3b1e2711..db573cd2 100755 --- a/src/psm/UpdaterStatus.class.php +++ b/src/psm/UpdaterStatus.class.php @@ -317,6 +317,9 @@ class UpdaterStatus { case 'clickatell': $sms = new \psm\Txtmsg\Clickatell(); break; + case 'textmarketer': + $sms = new \psm\Txtmsg\Textmarketer(); + break; } // copy login information from the config file diff --git a/src/templates/config.tpl.html b/src/templates/config.tpl.html index 9b574c93..b1850e93 100755 --- a/src/templates/config.tpl.html +++ b/src/templates/config.tpl.html @@ -62,6 +62,7 @@ +