From 4eaf7a8e28a11a6e9290042855d29c31590a078f Mon Sep 17 00:00:00 2001 From: Pepijn Over Date: Tue, 7 Jan 2014 20:27:21 +0100 Subject: [PATCH] Import of v2.0.1 --- classes/mod/modConfig.class.php | 142 ++++++++++++---------- classes/mod/modCore.class.php | 140 +++++++++++++++++++-- classes/mod/modLog.class.php | 61 ++++++---- classes/mod/modServers.class.php | 110 +++++++++++------ classes/mod/modUsers.class.php | 79 +++++++----- classes/sm/smCore.class.php | 4 +- classes/sm/smDatabase.class.php | 6 +- classes/sm/smTemplate.class.php | 4 +- classes/sm/smUpdaterStatus.class.php | 13 +- classes/txtmsg/txtmsgClickatell.class.php | 63 ++++++++++ classes/txtmsg/txtmsgCore.class.php | 6 +- classes/txtmsg/txtmsgInetworx.class.php | 4 +- classes/txtmsg/txtmsgInterface.class.php | 4 +- classes/txtmsg/txtmsgMollie.class.php | 4 +- classes/txtmsg/txtmsgSpryng.class.php | 4 +- config.inc.php => config.inc.php.sample | 8 +- cron/status.cron.php | 4 +- docs/CHANGELOG | 21 +++- docs/README | 40 +++--- functions.inc.php | 61 ++++++++-- inc/monitor.css | 36 +++++- inc/monitor.js | 22 ++++ inc/tabs.css | 22 ++++ index.php | 68 ++--------- install.php | 10 +- lang/de.lang.php | 139 +++++++++++++++++++++ lang/en.lang.php | 12 +- lang/fr.lang.php | 139 +++++++++++++++++++++ lang/nl.lang.php | 12 +- tpl/config.tpl.html | 7 ++ tpl/main.tpl.html | 9 +- tpl/servers.tpl.html | 12 +- 32 files changed, 970 insertions(+), 296 deletions(-) mode change 100644 => 100755 classes/mod/modConfig.class.php mode change 100644 => 100755 classes/mod/modCore.class.php mode change 100644 => 100755 classes/mod/modLog.class.php mode change 100644 => 100755 classes/mod/modServers.class.php mode change 100644 => 100755 classes/mod/modUsers.class.php mode change 100644 => 100755 classes/sm/smCore.class.php mode change 100644 => 100755 classes/sm/smDatabase.class.php mode change 100644 => 100755 classes/sm/smTemplate.class.php mode change 100644 => 100755 classes/sm/smUpdaterStatus.class.php create mode 100755 classes/txtmsg/txtmsgClickatell.class.php mode change 100644 => 100755 classes/txtmsg/txtmsgCore.class.php mode change 100644 => 100755 classes/txtmsg/txtmsgInetworx.class.php mode change 100644 => 100755 classes/txtmsg/txtmsgInterface.class.php mode change 100644 => 100755 classes/txtmsg/txtmsgMollie.class.php mode change 100644 => 100755 classes/txtmsg/txtmsgSpryng.class.php rename config.inc.php => config.inc.php.sample (93%) mode change 100644 => 100755 mode change 100644 => 100755 cron/status.cron.php mode change 100644 => 100755 docs/README mode change 100644 => 100755 functions.inc.php mode change 100644 => 100755 inc/monitor.css mode change 100644 => 100755 inc/monitor.js mode change 100644 => 100755 inc/tabs.css mode change 100644 => 100755 index.php mode change 100644 => 100755 install.php create mode 100755 lang/de.lang.php mode change 100644 => 100755 lang/en.lang.php create mode 100755 lang/fr.lang.php mode change 100644 => 100755 lang/nl.lang.php mode change 100644 => 100755 tpl/main.tpl.html diff --git a/classes/mod/modConfig.class.php b/classes/mod/modConfig.class.php old mode 100644 new mode 100755 index 1f962b83..f54a04f2 --- a/classes/mod/modConfig.class.php +++ b/classes/mod/modConfig.class.php @@ -1,11 +1,11 @@ setTemplateId('config', 'config.tpl.html'); + + $this->populateFields(); + + return parent::createHTML(); + } + + /** + * Populate all the config fields with values from the database + */ + public function populateFields() { + $config_db = $this->db->select( + SM_DB_PREFIX . 'config', + null, + array('key', 'value') + ); + + $config = array(); + foreach($config_db as $entry) { + $config[$entry['key']] = $entry['value']; + } + + $this->tpl->addTemplateData( + $this->getTemplateId(), + array( + 'language_selected_' . $config['language'] => 'selected="selected"', + 'email_status_checked' => ($config['email_status'] == '1') ? 'checked="checked"' : '', + 'email_from_name' => $config['email_from_name'], + 'email_from_email' => $config['email_from_email'], + 'sms_status_checked' => ($config['sms_status'] == '1') ? 'checked="checked"' : '', + 'sms_selected_' . $config['sms_gateway'] => 'selected="selected"', + 'sms_gateway_username' => $config['sms_gateway_username'], + 'sms_gateway_password' => $config['sms_gateway_password'], + 'sms_from' => $config['sms_from'], + 'alert_type_selected_' . $config['alert_type'] => 'selected="selected"', + 'log_status_checked' => ($config['log_status'] == '1') ? 'checked="checked"' : '', + 'log_email_checked' => ($config['log_email'] == '1') ? 'checked="checked"' : '', + 'log_sms_checked' => ($config['log_sms'] == '1') ? 'checked="checked"' : '', + 'show_update_checked' => ($config['show_update'] == '1') ? 'checked="checked"' : '', + 'auto_refresh_servers' => (isset($config['auto_refresh_servers'])) ? $config['auto_refresh_servers'] : '0', + ) + ); + } + + /** + * If a post has been done, gather all the posted data + * and save it to the database + */ + protected function executeSave() { // save new config $clean = array( 'language' => $_POST['language'], @@ -49,73 +99,38 @@ class modConfig extends modCore { 'log_status' => (isset($_POST['log_status'])) ? '1' : '0', 'log_email' => (isset($_POST['log_email'])) ? '1' : '0', 'log_sms' => (isset($_POST['log_sms'])) ? '1' : '0', + 'auto_refresh_servers' => (isset($_POST['auto_refresh_servers'])) ? intval($_POST['auto_refresh_servers']) : '0', ); // save all values to the database foreach($clean as $key => $value) { - $this->db->save( - SM_DB_PREFIX . 'config', - array('value' => $value), - array('key' => $key) - ); + // check if key already exists, otherwise add it + if(sm_get_conf($key) === null) { + // not yet set, add it + $this->db->save( + SM_DB_PREFIX . 'config', + array( + 'key' => $key, + 'value' => $value, + ) + ); + } else { + // update + $this->db->save( + SM_DB_PREFIX . 'config', + array('value' => $value), + array('key' => $key) + ); + } } $this->message = sm_get_lang('config', 'updated'); } - public function createHTML() { - $this->tpl_id = 'config'; - $this->tpl->newTemplate($this->tpl_id, 'config.tpl.html'); - - $this->createHTMLUpdate(); - $this->createHTMLLabels(); - - $this->populateFields(); - - return parent::createHTML(); - } - - public function createHTMLUpdate() { - // get latest version number - - } - - public function populateFields() { - $config_db = $this->db->select( - SM_DB_PREFIX . 'config', - null, - array('key', 'value') - ); - - $config = array(); - foreach($config_db as $entry) { - $config[$entry['key']] = $entry['value']; - } - + // override parent::createHTMLLabels() + protected function createHTMLLabels() { $this->tpl->addTemplateData( - $this->tpl_id, - array( - 'language_selected_' . $config['language'] => 'selected="selected"', - 'email_status_checked' => ($config['email_status'] == '1') ? 'checked="checked"' : '', - 'email_from_name' => $config['email_from_name'], - 'email_from_email' => $config['email_from_email'], - 'sms_status_checked' => ($config['sms_status'] == '1') ? 'checked="checked"' : '', - 'sms_selected_' . $config['sms_gateway'] => 'selected="selected"', - 'sms_gateway_username' => $config['sms_gateway_username'], - 'sms_gateway_password' => $config['sms_gateway_password'], - 'sms_from' => $config['sms_from'], - 'alert_type_selected_' . $config['alert_type'] => 'selected="selected"', - 'log_status_checked' => ($config['log_status'] == '1') ? 'checked="checked"' : '', - 'log_email_checked' => ($config['log_email'] == '1') ? 'checked="checked"' : '', - 'log_sms_checked' => ($config['log_sms'] == '1') ? 'checked="checked"' : '', - 'show_update_checked' => ($config['show_update'] == '1') ? 'checked="checked"' : '', - ) - ); - } - - public function createHTMLLabels() { - $this->tpl->addTemplateData( - $this->tpl_id, + $this->getTemplateId(), array( 'label_settings_email' => sm_get_lang('config', 'settings_email'), 'label_settings_sms' => sm_get_lang('config', 'settings_sms'), @@ -125,6 +140,8 @@ class modConfig extends modCore { 'label_language' => sm_get_lang('config', 'language'), 'label_language_english' => sm_get_lang('config', 'english'), 'label_language_dutch' => sm_get_lang('config', 'dutch'), + 'label_language_french' => sm_get_lang('config', 'french'), + 'label_language_german' => sm_get_lang('config', 'german'), 'label_show_update' => sm_get_lang('config', 'show_update'), 'label_email_status' => sm_get_lang('config', 'email_status'), 'label_email_from_email' => sm_get_lang('config', 'email_from_email'), @@ -134,6 +151,7 @@ class modConfig extends modCore { '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_inetworx' => sm_get_lang('config', 'sms_gateway_inetworx'), + 'label_sms_gateway_clickatell' => sm_get_lang('config', 'sms_gateway_clickatell'), 'label_sms_gateway_username' => sm_get_lang('config', 'sms_gateway_username'), 'label_sms_gateway_password' => sm_get_lang('config', 'sms_gateway_password'), 'label_sms_from' => sm_get_lang('config', 'sms_from'), @@ -144,9 +162,11 @@ class modConfig extends modCore { 'label_log_status' => sm_get_lang('config', 'log_status'), 'label_log_email' => sm_get_lang('config', 'log_email'), 'label_log_sms' => sm_get_lang('config', 'log_sms'), - 'message' => ($this->message == '') ? ' ' : $this->message, + 'label_auto_refresh_servers' => sm_get_lang('config', 'auto_refresh_servers'), ) ); + + return parent::createHTMLLabels(); } } diff --git a/classes/mod/modCore.class.php b/classes/mod/modCore.class.php old mode 100644 new mode 100755 index cc225638..48ccad98 --- a/classes/mod/modCore.class.php +++ b/classes/mod/modCore.class.php @@ -1,11 +1,11 @@ db = ($db) ? $db : new smDatabase(); - $this->tpl = ($tpl) ? $tpl : new smTemplate(); + $this->tpl = new smTemplate(); + + } + /** + * Create the HTML code for the module. + * First the createHTMLLabels() will be called to add all labels to the template, + * Then the tpl_id set in $this->getTemplateId() will be added to the main template automatically + */ public function createHTML() { - $html = $this->tpl->getTemplate($this->tpl_id); - return $html; + // add JS and CSS files + $this->tpl->addJS('monitor.js'); + $this->tpl->addCSS('monitor.css'); + + if(sm_get_conf('show_update')) { + // user wants updates, lets see what we can do + $this->createHTMLUpdateAvailable(); + } + $this->createHTMLLabels(); + + // add the module's custom template to the main template to get some content + $this->tpl->addTemplatedata( + 'main', + array( + 'content' => $this->tpl->getTemplate($this->getTemplateId()), + 'message' => ($this->message == '') ? ' ' : $this->message, + ) + ); + + // display main template + echo $this->tpl->display('main'); + } + + /** + * First check if an update is available, if there is add a message + * to the main template + */ + protected function createHTMLUpdateAvailable() { + // check for updates? + + if(sm_check_updates()) { + // yay, new update available =D + $this->tpl->addTemplateData( + 'main', + array( + 'update_available' => '
'.sm_get_lang('system', 'update_available').'
', + ) + ); + } + } + + /** + * Use this to add language specific labels to template + * + * @see createHTML() + */ + protected function createHTMLLabels() { + global $type; + + $this->tpl->addTemplateData( + 'main', + array( + 'title' => strtoupper(sm_get_lang('system', 'title')), + 'subtitle' => sm_get_lang('system', $type), + 'active_' . $type => 'active', + 'label_servers' => sm_get_lang('system', 'servers'), + 'label_users' => sm_get_lang('system', 'users'), + 'label_log' => sm_get_lang('system', 'log'), + 'label_config' => sm_get_lang('system', 'config'), + 'label_update' => sm_get_lang('system', 'update'), + 'label_help' => sm_get_lang('system', 'help'), + ) + ); + } + + /** + * Set a template id that will be added to the main template automatically + * once you call the parent::createHTML() + * + * @param string $tpl_id + * @param string $tpl_file if given, the tpl_id will be created automatically from this file + * @see getTemplateId() createHTML() + */ + public function setTemplateId($tpl_id, $tpl_file = null) { + $this->tpl_id = $tpl_id; + + if($tpl_file != null) { + // tpl_file given, try to load the template.. + $this->tpl->newTemplate($tpl_id, $tpl_file); + } + } + + /** + * Get the mpalte id that will be added to the main template + * + * @return string + * @see setTemplateId() + */ + public function getTemplateId() { + return $this->tpl_id; } } diff --git a/classes/mod/modLog.class.php b/classes/mod/modLog.class.php old mode 100644 new mode 100755 index fc294e20..dfe4b0b2 --- a/classes/mod/modLog.class.php +++ b/classes/mod/modLog.class.php @@ -1,11 +1,11 @@ . */ +/** + * Log module. Create the page to view previous log messages + */ class modLog extends modCore { function __construct() { parent::__construct(); } + // override parent::createHTML() public function createHTML() { - $this->createHTMLList(); - $this->tpl->addCSS('tabs.css', 'main'); - $this->tpl->addTemplateData( - $this->tpl_id, - array( - 'label_status' => sm_get_lang('log', 'status'), - 'label_email' => sm_get_lang('log', 'email'), - 'label_sms' => sm_get_lang('log', 'sms'), - 'label_title' => sm_get_lang('log', 'title'), - 'label_server' => sm_get_lang('servers', 'server'), - 'label_type' => sm_get_lang('log', 'type'), - 'label_message' => sm_get_lang('system', 'message'), - 'label_date' => sm_get_lang('system', 'date'), - 'label_users' => ucfirst(sm_get_lang('system', 'users')), - ) - ); + $this->createHTMLList(); return parent::createHTML(); } - public function createHTMLList() { - $this->tpl_id = 'log_list'; - - $this->tpl->newTemplate($this->tpl_id, 'log.tpl.html'); + /** + * Prepare the template with a list of all log entries + */ + protected function createHTMLList() { + $this->setTemplateId('log_list', 'log.tpl.html'); $entries = array(); $entries['status'] = $this->getEntries('status'); @@ -98,7 +88,7 @@ class modLog extends modCore { ) ); $this->tpl->addTemplateData( - $this->tpl_id, + $this->getTemplateId(), array( 'content_' . $key => $this->tpl->getTemplate('log_entries'), ) @@ -107,6 +97,12 @@ class modLog extends modCore { } + /** + * Get all the log entries for a specific $type + * + * @param string $type status/email/sms + * @return array + */ public function getEntries($type) { $entries = $this->db->query( 'SELECT '. @@ -132,6 +128,25 @@ class modLog extends modCore { return $entries; } + // override parent::createHTMLLabels() + protected function createHTMLLabels() { + $this->tpl->addTemplateData( + $this->getTemplateId(), + array( + 'label_status' => sm_get_lang('log', 'status'), + 'label_email' => sm_get_lang('log', 'email'), + 'label_sms' => sm_get_lang('log', 'sms'), + 'label_title' => sm_get_lang('log', 'title'), + 'label_server' => sm_get_lang('servers', 'server'), + 'label_type' => sm_get_lang('log', 'type'), + 'label_message' => sm_get_lang('system', 'message'), + 'label_date' => sm_get_lang('system', 'date'), + 'label_users' => ucfirst(sm_get_lang('system', 'users')), + ) + ); + + return parent::createHTMLLabels(); + } } ?> \ No newline at end of file diff --git a/classes/mod/modServers.class.php b/classes/mod/modServers.class.php old mode 100644 new mode 100755 index 20ee7e04..c5791794 --- a/classes/mod/modServers.class.php +++ b/classes/mod/modServers.class.php @@ -1,11 +1,11 @@ . */ +/** + * Server module. Add/edit/delete servers, show a list of all servers etc. + */ class modServers extends modCore { function __construct() { @@ -43,6 +46,7 @@ class modServers extends modCore { } } + // override parent::createHTML() public function createHTML() { switch($this->mode) { case 'list': @@ -53,44 +57,20 @@ class modServers extends modCore { break; } - // add labels - $this->tpl->addTemplateData( - $this->tpl_id, - array( - 'label_label' => sm_get_lang('servers', 'label'), - 'label_domain' => sm_get_lang('servers', 'domain'), - 'label_port' => sm_get_lang('servers', 'port'), - 'label_type' => sm_get_lang('servers', 'type'), - 'label_last_check' => sm_get_lang('servers', 'last_check'), - 'label_rtime' => sm_get_lang('servers', 'rtime'), - 'label_last_online' => sm_get_lang('servers', 'last_online'), - 'label_monitoring' => sm_get_lang('servers', 'monitoring'), - 'label_send_email' => sm_get_lang('servers', 'send_email'), - 'label_send_sms' => sm_get_lang('servers', 'send_sms'), - 'label_action' => sm_get_lang('system', 'action'), - 'label_save' => sm_get_lang('system', 'save'), - 'label_edit' => sm_get_lang('system', 'edit') . ' ' . sm_get_lang('servers', 'server'), - 'label_delete' => sm_get_lang('system', 'delete') . ' ' . sm_get_lang('servers', 'server'), - 'label_yes' => sm_get_lang('system', 'yes'), - 'label_no' => sm_get_lang('system', 'no'), - 'label_add_new' => sm_get_lang('system', 'add_new'), - 'message' => ($this->message == '') ? ' ' : $this->message, - ) - ); - return parent::createHTML(); } - - public function createHTMLUpdate() { - $this->tpl_id = 'servers_update'; - $this->tpl->newTemplate($this->tpl_id, 'servers.tpl.html'); + /** + * Prepare the template to show the update screen for a single server + */ + protected function createHTMLUpdate() { + $this->setTemplateId('servers_update', 'servers.tpl.html'); $server_id = $_GET['edit']; $tpl_data = array(); - switch((int) $server_id) { + switch(intval($server_id)) { case 0: // insert mode $tpl_data['titlemode'] = sm_get_lang('system', 'insert'); @@ -125,14 +105,16 @@ class modServers extends modCore { } $this->tpl->addTemplateData( - $this->tpl_id, + $this->getTemplateId(), $tpl_data ); } - public function createHTMLList() { - $this->tpl_id = 'servers_list'; - $this->tpl->newTemplate($this->tpl_id, 'servers.tpl.html'); + /** + * Prepare the template to show a list of all servers + */ + protected function createHTMLList() { + $this->setTemplateId('servers_list', 'servers.tpl.html'); // get servers from database $servers = $this->db->query( @@ -159,7 +141,7 @@ class modServers extends modCore { '`email`, '. '`sms` '. 'FROM `'.SM_DB_PREFIX.'servers` '. - 'ORDER BY `type` ASC, `label` ASC' + 'ORDER BY `active` ASC, `status` DESC, `type` ASC, `label` ASC' ); $server_count = count($servers); @@ -167,13 +149,30 @@ class modServers extends modCore { for ($x = 0; $x < $server_count; $x++) { $servers[$x]['class'] = ($x & 1) ? 'odd' : 'even'; $servers[$x]['rtime'] = round((float) $servers[$x]['rtime'], 4); + + if($servers[$x]['type'] == 'website') { + // add link to label + $servers[$x]['ip'] = ''.$servers[$x]['ip'].''; + } } // add servers to template - $this->tpl->addTemplateDataRepeat($this->tpl_id, 'servers', $servers); + $this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers', $servers); + + // check if we need to add the auto refresh + $auto_refresh = sm_get_conf('auto_refresh_servers'); + if(intval($auto_refresh) > 0) { + // add it + $this->tpl->newTemplate('main_auto_refresh', 'main.tpl.html'); + $this->tpl->addTemplateData('main_auto_refresh', array('seconds' => $auto_refresh)); + $this->tpl->addTemplateData('main', array('auto_refresh' => $this->tpl->getTemplate('main_auto_refresh'))); + } } - public function executeSave() { + /** + * Executes the saving of one of the servers + */ + protected function executeSave() { // check for add/edit mode if (isset($_POST['label']) && isset($_POST['ip']) && isset($_POST['port'])) { $clean = array( @@ -204,7 +203,10 @@ class modServers extends modCore { } } - public function executeDelete() { + /** + * Executes the deletion of one of the servers + */ + protected function executeDelete() { // do delete $this->db->delete( SM_DB_PREFIX . 'servers', @@ -214,6 +216,34 @@ class modServers extends modCore { ); $this->message = sm_get_lang('system', 'deleted'); } + + // override parent::createHTMLLabels() + protected function createHTMLLabels() { + $this->tpl->addTemplateData( + $this->getTemplateId(), + array( + 'label_label' => sm_get_lang('servers', 'label'), + 'label_domain' => sm_get_lang('servers', 'domain'), + 'label_port' => sm_get_lang('servers', 'port'), + 'label_type' => sm_get_lang('servers', 'type'), + 'label_last_check' => sm_get_lang('servers', 'last_check'), + 'label_rtime' => sm_get_lang('servers', 'rtime'), + 'label_last_online' => sm_get_lang('servers', 'last_online'), + 'label_monitoring' => sm_get_lang('servers', 'monitoring'), + 'label_send_email' => sm_get_lang('servers', 'send_email'), + 'label_send_sms' => sm_get_lang('servers', 'send_sms'), + 'label_action' => sm_get_lang('system', 'action'), + 'label_save' => sm_get_lang('system', 'save'), + 'label_edit' => sm_get_lang('system', 'edit') . ' ' . sm_get_lang('servers', 'server'), + 'label_delete' => sm_get_lang('system', 'delete') . ' ' . sm_get_lang('servers', 'server'), + 'label_yes' => sm_get_lang('system', 'yes'), + 'label_no' => sm_get_lang('system', 'no'), + 'label_add_new' => sm_get_lang('system', 'add_new'), + ) + ); + + return parent::createHTMLLabels(); + } } ?> \ No newline at end of file diff --git a/classes/mod/modUsers.class.php b/classes/mod/modUsers.class.php old mode 100644 new mode 100755 index e9494fee..e8a27b0d --- a/classes/mod/modUsers.class.php +++ b/classes/mod/modUsers.class.php @@ -1,11 +1,11 @@ . */ +/** + * User module. Add, edit and delete users, or assign + * servers to users. + */ class modUsers extends modCore { public $servers; @@ -46,6 +50,7 @@ class modUsers extends modCore { $this->servers = $this->db->select(SM_DB_PREFIX.'servers', null, array('server_id', 'label')); } + // override parent::createHTML() public function createHTML() { switch($this->mode) { case 'list': @@ -56,31 +61,14 @@ class modUsers extends modCore { break; } - // add labels - $this->tpl->addTemplateData( - $this->tpl_id, - array( - 'label_users' => sm_get_lang('system', 'users'), - 'label_name' => sm_get_lang('users', 'name'), - 'label_mobile' => sm_get_lang('users', 'mobile'), - 'label_email' => sm_get_lang('users', 'email'), - 'label_servers' => sm_get_lang('system', 'servers'), - 'label_action' => sm_get_lang('system', 'action'), - 'label_save' => sm_get_lang('system', 'save'), - 'label_edit' => sm_get_lang('system', 'edit') . ' ' . sm_get_lang('users', 'user'), - 'label_delete' => sm_get_lang('system', 'delete') . ' ' . sm_get_lang('users', 'user'), - 'label_add_new' => sm_get_lang('system', 'add_new'), - 'message' => ($this->message == '') ? ' ' : $this->message, - ) - ); - return parent::createHTML(); } - - public function createHTMLUpdate() { - $this->tpl_id = 'users_update'; - $this->tpl->newTemplate($this->tpl_id, 'users.tpl.html'); + /** + * Prepare the template to show the update screen for a user + */ + protected function createHTMLUpdate() { + $this->setTemplateId('users_update', 'users.tpl.html'); $user_id = $_GET['edit']; @@ -134,16 +122,18 @@ class modUsers extends modCore { } $this->tpl->addTemplateData( - $this->tpl_id, + $this->getTemplateId(), $tpl_data ); // add servers to template for the edit form $this->tpl->addTemplateDataRepeat('users_update', 'servers', $this->servers); } - public function createHTMLList() { - $this->tpl_id = 'users_list'; - $this->tpl->newTemplate($this->tpl_id, 'users.tpl.html'); + /** + * Prepare the template to show a list of all users + */ + protected function createHTMLList() { + $this->setTemplateId('users_list', 'users.tpl.html'); // build label array for the next loop $servers_labels = array(); @@ -178,11 +168,14 @@ class modUsers extends modCore { $users[$x]['emp_servers'] = substr($users[$x]['emp_servers'], 0, -5); } // add servers to template - $this->tpl->addTemplateDataRepeat($this->tpl_id, 'users', $users); + $this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'users', $users); } - public function executeSave() { + /** + * Executes the saving of a user + */ + protected function executeSave() { // check for add/edit mode if (isset($_POST['name']) && isset($_POST['mobile']) && isset($_POST['email'])) { @@ -210,7 +203,10 @@ class modUsers extends modCore { } } - public function executeDelete() { + /** + * Executes the deletion of a user + */ + protected function executeDelete() { // do delete $this->db->delete( SM_DB_PREFIX . 'users', @@ -220,6 +216,27 @@ class modUsers extends modCore { ); $this->message = sm_get_lang('system', 'deleted'); } + + // override parent::createHTMLLabels() + protected function createHTMLLabels() { + $this->tpl->addTemplateData( + $this->getTemplateId(), + array( + 'label_users' => sm_get_lang('system', 'users'), + 'label_name' => sm_get_lang('users', 'name'), + 'label_mobile' => sm_get_lang('users', 'mobile'), + 'label_email' => sm_get_lang('users', 'email'), + 'label_servers' => sm_get_lang('system', 'servers'), + 'label_action' => sm_get_lang('system', 'action'), + 'label_save' => sm_get_lang('system', 'save'), + 'label_edit' => sm_get_lang('system', 'edit') . ' ' . sm_get_lang('users', 'user'), + 'label_delete' => sm_get_lang('system', 'delete') . ' ' . sm_get_lang('users', 'user'), + 'label_add_new' => sm_get_lang('system', 'add_new'), + ) + ); + + return parent::createHTMLLabels(); + } } ?> \ No newline at end of file diff --git a/classes/sm/smCore.class.php b/classes/sm/smCore.class.php old mode 100644 new mode 100755 index 71809ae6..72e1b03d --- a/classes/sm/smCore.class.php +++ b/classes/sm/smCore.class.php @@ -1,11 +1,11 @@ +?> \ No newline at end of file diff --git a/classes/sm/smTemplate.class.php b/classes/sm/smTemplate.class.php old mode 100644 new mode 100755 index 332f0c7d..1394b355 --- a/classes/sm/smTemplate.class.php +++ b/classes/sm/smTemplate.class.php @@ -1,11 +1,11 @@ = '4') { $this->server['error'] = $this->error = $code . ' ' . $msg; $this->status_new = 'off'; } else { @@ -298,6 +298,9 @@ class smUpdaterStatus extends smCore { case 'spryng': $sms = new txtmsgSpryng(); break; + case 'clickatell': + $sms = new txtmsgClickatell(); + break; } // copy login information from the config file diff --git a/classes/txtmsg/txtmsgClickatell.class.php b/classes/txtmsg/txtmsgClickatell.class.php new file mode 100755 index 00000000..7fe3e5d8 --- /dev/null +++ b/classes/txtmsg/txtmsgClickatell.class.php @@ -0,0 +1,63 @@ +. + */ + +class txtmsgClickatell extends txtmsgCore { + // ========================================================================= + // [ Fields ] + // ========================================================================= + public $gateway = 1; + public $resultcode = null; + public $resultmessage = null; + public $success = false; + public $successcount = 0; + + // ========================================================================= + // [ Methods ] + // ========================================================================= + public function setGateway($gateway) { + $this->gateway = $gateway; + } + + public function sendSMS($message) { + //$message MUST BE urlencode or it will send only part message (first word in most cases) + $recipients = implode(',', $this->recipients); + //example: https://api.clickatell.com/http/sendmsg?user=XXXXXX&password=PASSWORD&api_id=111111&to=11111111&text=Message + //YOU MUST MANUALLY CHANGE THE VALUE OF 'api_id' EX: '&api_id=' . '1234567' + $result = $this->_auth_https_post('api.clickatell.com', '/http/sendmsg', + '?user=' . $this->username . + '&password=' . $this->password . + '&to=' . $recipients . + '&api_id=' . 'XXXXXX' . + '&text=' . substr(urlencode($message), 0, 153) + ); + return $result; + } + + protected function _auth_https_post($host, $path, $data) { + $url = $host . $path . $data; + return sm_curl_get($url); + } +} + +?> \ No newline at end of file diff --git a/classes/txtmsg/txtmsgCore.class.php b/classes/txtmsg/txtmsgCore.class.php old mode 100644 new mode 100755 index 2bc09edd..9e1e65d6 --- a/classes/txtmsg/txtmsgCore.class.php +++ b/classes/txtmsg/txtmsgCore.class.php @@ -1,11 +1,11 @@ +?> \ No newline at end of file diff --git a/classes/txtmsg/txtmsgInetworx.class.php b/classes/txtmsg/txtmsgInetworx.class.php old mode 100644 new mode 100755 index fd922b11..8819904c --- a/classes/txtmsg/txtmsgInetworx.class.php +++ b/classes/txtmsg/txtmsgInetworx.class.php @@ -1,11 +1,11 @@ \ No newline at end of file +?> diff --git a/cron/status.cron.php b/cron/status.cron.php old mode 100644 new mode 100755 index 8b930fd1..eb20de2f --- a/cron/status.cron.php +++ b/cron/status.cron.php @@ -1,11 +1,11 @@ + Copyright (c) 2008-2011 Pepijn Over 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 @@ -16,9 +16,9 @@ along with PHP Server Monitor. If not, see . ################# -# # +# # # SUMMARY # -# # +# # ################# PHP Server Monitor is a script that checks whether the servers on your list are up @@ -58,29 +58,30 @@ I'd appreciate any feedback you might have regarding this script. Please leave i project page (tracker), or send me an email (see top of file for link). ################# -# # +# # # DOWNLOAD # -# # +# # ################# The latest version can be found at http://phpservermon.sourceforge.net ################# -# # +# # # REQUIREMENTS # -# # +# # ################# 1. php 5 - 2. MySQL Database - 3. FTP access + 2. php packages: cURL + 3. MySQL Database + 4. FTP access ################# -# # +# # # INSTALL # -# # +# # ################# By default the PHP Server Monitor does not come with any security methods. After uploading these files to @@ -90,7 +91,8 @@ be found in the example/ dir. To create your own username and password for the . http://www.htaccesstools.com/htpasswd-generator/ 1. Configuration - Open the config.php file with a plain text editor such as Notepad. + Rename the config.inc.php.sample file to config.inc.php, then open the + config.inc.php file with a plain text editor such as Notepad. The first thing to do now in order to get started, is to get your database login information right. The information is stored using php's define() function. To change these values correctly, only update the second parameter of the function. @@ -130,9 +132,9 @@ http://www.htaccesstools.com/htpasswd-generator/ ################# -# # +# # # CUSTOMIZING # -# # +# # ################# 1. Language @@ -168,9 +170,11 @@ http://www.htaccesstools.com/htpasswd-generator/ - Send a copy to ipdope[at]users.sourceforge.net so I can add it to the next release :) ################# -# # +# # # CREDITS # -# # +# # ################# -1. classes/phpmailer.class.php - Brent R. Matzelle \ No newline at end of file +1. classes/phpmailer.class.php - Brent R. Matzelle +2. german translation - Brunbaur Herbert +3. french translation - David Ribeiro diff --git a/functions.inc.php b/functions.inc.php old mode 100644 new mode 100755 index fc9662f9..f7620d6e --- a/functions.inc.php +++ b/functions.inc.php @@ -1,11 +1,11 @@ $last_update) { + // been more than a week since update, lets go + // update "update-date" + $db->save(SM_DB_PREFIX . 'config', array('value' => time()), array('key' => 'last_update_check')); + $latest = sm_curl_get('http://phpservermon.neanderthal-technology.com/version'); + $current = sm_get_conf('version'); + + if((int) $current < (int) $latest) { + // new update available + return true; + } } return false; } @@ -210,6 +252,9 @@ function pre($arr = null) { echo ""; } +/** + * Send headers to the browser to avoid caching + */ function sm_no_cache() { header("Expires: Mon, 20 Dec 1998 01:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); diff --git a/inc/monitor.css b/inc/monitor.css old mode 100644 new mode 100755 index 22c3ba40..154699b8 --- a/inc/monitor.css +++ b/inc/monitor.css @@ -1,4 +1,26 @@ -body { +/* + * PHP Server Monitor v2.0.1 + * Monitor your servers with error notification + * http://phpservermon.sourceforge.net/ + * + * Copyright (c) 2008-2011 Pepijn Over (ipdope@users.sourceforge.net) + * + * 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 . + */ + + body { color: #000000; background-color: #FFFFFF; font-family: Arial; @@ -77,6 +99,18 @@ a:active { width: 860px; } +.container table a, +.container table a:visited { + color: #000000; + text-decoration: none; +} +.container table a:hover, +.container table a:active { + color: #000000; + text-decoration: underline; + mouse: pointer; +} + .footer { color: #666666; background-color: #B3B3B3; diff --git a/inc/monitor.js b/inc/monitor.js old mode 100644 new mode 100755 index 439b36e5..d6587dfc --- a/inc/monitor.js +++ b/inc/monitor.js @@ -1,3 +1,25 @@ +/* + * PHP Server Monitor v2.0.1 + * Monitor your servers with error notification + * http://phpservermon.sourceforge.net/ + * + * Copyright (c) 2008-2011 Pepijn Over (ipdope@users.sourceforge.net) + * + * 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 . + */ + function sm_delete(id, type) { var del = confirm("Are you sure you want to delete this record?"); if (del == true) { diff --git a/inc/tabs.css b/inc/tabs.css old mode 100644 new mode 100755 index d36301f1..0b8ad250 --- a/inc/tabs.css +++ b/inc/tabs.css @@ -1,3 +1,25 @@ +/* + * PHP Server Monitor v2.0.1 + * Monitor your servers with error notification + * http://phpservermon.sourceforge.net/ + * + * Copyright (c) 2008-2011 Pepijn Over (ipdope@users.sourceforge.net) + * + * 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 . + */ + .tabs ul { list-style: none; padding: 0; diff --git a/index.php b/index.php old mode 100644 new mode 100755 index 74535506..50f35d28 --- a/index.php +++ b/index.php @@ -1,11 +1,11 @@ . */ +if(!file_exists('config.inc.php')) { + die('Failed to locate config file. Please read docs/README for more information on how to setup PHP Server Monitor.'); +} require_once 'config.inc.php'; sm_no_cache(); @@ -31,67 +34,16 @@ if(isset($_GET['action']) && $_GET['action'] == 'check') { header('Location: index.php'); } -$tpl = new smTemplate(); - -$tpl->addJS('monitor.js'); -$tpl->addCSS('monitor.css'); - -// check for updates? -if(sm_get_conf('show_update')) { - $last_update = sm_get_conf('last_update_check'); - - if((time() - (7 * 24 * 60 * 60)) > $last_update) { - // been more than a week since update, lets go - $need_upd = sm_check_updates(); - // update "update-date" - $db->save(SM_DB_PREFIX . 'config', array('value' => time()), array('key' => 'last_update_check')); - - if($need_upd) { - // yay, new update available =D - $tpl->addTemplateData( - 'main', - array( - 'update_available' => '
'.sm_get_lang('system', 'update_available').'
', - ) - ); - } - } -} - - $type = (!isset($_GET['type'])) ? 'servers' : $_GET['type']; $allowed_types = array('servers', 'users', 'log', 'config'); -// add some default vars -$tpl->addTemplateData( - 'main', - array( - 'title' => strtoupper(sm_get_lang('system', 'title')), - 'subtitle' => sm_get_lang('system', $type), - 'label_servers' => sm_get_lang('system', 'servers'), - 'label_users' => sm_get_lang('system', 'users'), - 'label_log' => sm_get_lang('system', 'log'), - 'label_config' => sm_get_lang('system', 'config'), - 'label_update' => sm_get_lang('system', 'update'), - 'label_help' => sm_get_lang('system', 'help'), - 'active_' . $type => 'active', - ) -); - // make sure user selected a valid type. if so, include the file and add to template -if(in_array($type, $allowed_types)) { - eval('$mod = new mod'.ucfirst($type).'();'); - - $html = $mod->createHTML(); - - $tpl->addTemplatedata( - 'main', - array( - 'content' => $html, - ) - ); +if(!in_array($type, $allowed_types)) { + $type = $allowed_types[0]; } -echo $tpl->display('main'); +eval('$mod = new mod'.ucfirst($type).'();'); +// let the module prepare it's HTML code +$mod->createHTML(); ?> \ No newline at end of file diff --git a/install.php b/install.php old mode 100644 new mode 100755 index 14a9394c..c0209bde --- a/install.php +++ b/install.php @@ -1,11 +1,11 @@ addCSS('monitor.css', 'install'); @@ -111,6 +116,7 @@ $tables = array( (null, 'log_email', '1'), (null, 'log_sms', '1'), (null, 'version', '200'), + (null, 'auto_refresh_servers', '0'), (null, 'show_update', '1'), (null, 'last_update_check', '0');", ) diff --git a/lang/de.lang.php b/lang/de.lang.php new file mode 100755 index 00000000..b40bd269 --- /dev/null +++ b/lang/de.lang.php @@ -0,0 +1,139 @@ +. + */ + +$sm_lang = array( + 'system' => array( + 'title' => 'Server Monitor', + 'servers' => 'Server', + 'users' => 'Benutzer', + 'log' => 'Log', + 'update' => 'Updates', + 'config' => 'Einstellungen', + 'help' => 'Hilfe', + 'action' => 'Aktion', + 'save' => 'Speichern', + 'edit' => 'Bearbeiten', + 'delete' => 'Löschen', + 'deleted' => 'Eintrag wurde gelöscht', + 'date' => 'Datum', + 'message' => 'Meldung', + 'yes' => 'Ja', + 'no' => 'Nein', + 'edit' => 'Bearbeiten', + 'insert' => 'Einfügen', + 'add_new' => 'Neuen Eintrag erstellen?', + 'update_available' => 'Ein neues Update ist verfügbar auf http://phpservermon.sourceforge.net.', + ), + 'users' => array( + 'user' => 'Benutzer', + 'name' => 'Name', + 'mobile' => 'Mobil', + 'email' => 'Email', + 'updated' => 'Benutzer bearbeitet.', + 'inserted' => 'Benutzer eingetragen.', + ), + 'log' => array( + 'title' => 'Log Einträge', + 'type' => 'Type', + 'status' => 'Status', + 'email' => 'Email', + 'sms' => 'SMS', + ), + 'servers' => array( + 'server' => 'Server', + 'label' => 'Beschriftung', + 'domain' => 'Domain/IP', + 'port' => 'Port', + 'type' => 'Type', + 'last_check' => 'Letzter Check', + 'last_online' => 'Letztes mal Online', + 'monitoring' => 'Monitoring', + 'send_email' => 'Email', + 'send_sms' => 'SMS', + 'updated' => 'Server aktualisiert.', + 'inserted' => 'Server eingetragen.', + 'rtime' => 'Antwortzeit', + ), + 'config' => array( + 'general' => 'General', + 'language' => 'Sprache', + 'show_update' => 'Updats wöchentlich prüfen?', + 'english' => 'English', + 'dutch' => 'Dutch', + 'french' => 'French', + 'german' => 'German', + 'email_status' => 'Email senden erlauben?', + 'email_from_email' => 'Email from address', + 'email_from_name' => 'Email from name', + 'sms_status' => 'SMS Nachricht senden erlauben?', + 'sms_gateway' => 'SMS Gateway', + 'sms_gateway_mollie' => 'Mollie', + 'sms_gateway_spryng' => 'Spryng', + 'sms_gateway_inetworx' => 'Inetworx', + 'sms_gateway_clickatell' => 'Clickatell', + 'sms_gateway_username' => 'Gateway Benutzername', + 'sms_gateway_password' => 'Gateway Passwort', + 'sms_from' => 'SMS Sendernummer', + 'alert_type' => + 'Wann möchten Sie benachrichtig werden?
'. + '
'. + '1) ... wenn sich der Status ändert
'. + 'z.B. online -> offline oder offline -> online.
'. + '2) Offline
'. + 'Sie bekommen eine Benachrichtigung, wenn ein Server Offline ist.
'. + 'Es wird nur eine Mitteilung versendet.
'. + '3) Immer
'. + 'Sie werden jedesmal wenn der CronJob oder das Script ausgeführt wird benachrichtigt,
'. + 'auch wenn der Dienst mehreres Stunden offline ist'. + '
', + + 'alert_type_status' => 'Status geändert', + 'alert_type_offline' => 'Offline', + 'alert_type_always' => 'Immer', + 'log_status' => 'Log Status
Ist der Log Status auf TRUE (ein Hacken) gesetzt, wird jeder Status protokolliert
', + 'log_email' => 'Email Log per Script senden?', + 'log_sms' => 'SMS Log per Script senden?', + 'updated' => 'Die Einstellungen wurden gespeichert.', + 'settings_email' => 'Email', + 'settings_sms' => 'SMS Nachricht', + 'settings_notification' => 'Benachrichtigung', + 'settings_log' => 'Log', + 'auto_refresh_servers' => + 'Auto-refresh servers page
'. + '
'. + 'Time in seconds, if 0 the page won\'t refresh.'. + '
', + ), + // for newlines in the email messages use
+ 'notifications' => array( + 'off_sms' => 'Server \'%LABEL%\' ist Offline: ip=%IP%, port=%PORT%. Fehler=%ERROR%', + 'off_email_subject' => 'Wichtig: Server \'%LABEL%\' ist Offline', + 'off_email_body' => "Kann keine Verbindung zum Server aufbauen:

Server: %LABEL%
IP: %IP%
Port: %PORT%
Fehler: %ERROR%
Datum: %DATE%", + 'on_sms' => 'Server \'%LABEL%\' ist wieder Online: ip=%IP%, port=%PORT%', + 'on_email_subject' => 'Wichtig: Server \'%LABEL%\' ist wieder Online', + 'on_email_body' => "Server '%LABEL%' läuft wieder:

Server: %LABEL%
IP: %IP%
Port: %PORT%
Datum: %DATE%", + ), +); + +?> \ No newline at end of file diff --git a/lang/en.lang.php b/lang/en.lang.php old mode 100644 new mode 100755 index 98ebb31a..921987fb --- a/lang/en.lang.php +++ b/lang/en.lang.php @@ -1,11 +1,11 @@ 'Check for new updates weekly?', 'english' => 'English', 'dutch' => 'Dutch', + 'french' => 'French', + 'german' => 'German', 'email_status' => 'Allow sending email?', 'email_from_email' => 'Email from address', 'email_from_name' => 'Email from name', @@ -89,6 +91,7 @@ $sm_lang = array( 'sms_gateway_mollie' => 'Mollie', 'sms_gateway_spryng' => 'Spryng', 'sms_gateway_inetworx' => 'Inetworx', + 'sms_gateway_clickatell' => 'Clickatell', 'sms_gateway_username' => 'Gateway username', 'sms_gateway_password' => 'Gateway password', 'sms_from' => 'Sender\'s phone number', @@ -117,6 +120,11 @@ $sm_lang = array( 'settings_sms' => 'Text message settings', 'settings_notification' => 'Notification settings', 'settings_log' => 'Log settings', + 'auto_refresh_servers' => + 'Auto-refresh servers page
'. + '
'. + 'Time in seconds, if 0 the page won\'t refresh.'. + '
', ), // for newlines in the email messages use
'notifications' => array( diff --git a/lang/fr.lang.php b/lang/fr.lang.php new file mode 100755 index 00000000..0665917e --- /dev/null +++ b/lang/fr.lang.php @@ -0,0 +1,139 @@ +. + */ + +$sm_lang = array( + 'system' => array( + 'title' => 'Serveur de Supervision', + 'servers' => 'Serveurs', + 'users' => 'Utilisateurs', + 'log' => 'Evenements', + 'update' => 'Mise à jour', + 'config' => 'Configuration', + 'help' => 'Aide', + 'action' => 'Action', + 'save' => 'Enregistrer', + 'edit' => 'Editer', + 'delete' => 'Effacer', + 'deleted' => 'L enregistrement a ete effacé', + 'date' => 'Date', + 'message' => 'Message', + 'yes' => 'Oui', + 'no' => 'Non', + 'edit' => 'Editer', + 'insert' => 'Inserer', + 'add_new' => 'Rajouter un nouveau serveur?', + 'update_available' => 'Une nouvelle version est disponible à l adresse http://phpservermon.sourceforge.net.', + ), + 'users' => array( + 'user' => 'Utilisateur', + 'name' => 'Nom', + 'mobile' => 'Mobile', + 'email' => 'Email', + 'updated' => 'Utilisateur mis à jour.', + 'inserted' => 'Utilisateur ajouté.', + ), + 'log' => array( + 'title' => 'Evenements', + 'type' => 'Type', + 'status' => 'Etat', + 'email' => 'Email', + 'sms' => 'SMS', + ), + 'servers' => array( + 'server' => 'Serveur', + 'label' => 'Description', + 'domain' => 'Domaine/IP', + 'port' => 'Port', + 'type' => 'Type', + 'last_check' => 'Dernière vérification', + 'last_online' => 'Dernière fois OK', + 'monitoring' => 'Supervision', + 'send_email' => 'Envoyer un Email', + 'send_sms' => 'Envoyer un SMS', + 'updated' => 'Serveur mis à jour.', + 'inserted' => 'Serveur ajouté.', + 'rtime' => 'Temps de r´ponse', + ), + 'config' => array( + 'general' => 'General', + 'language' => 'Langue', + 'show_update' => 'Vérifier les nouvelles mis à jour hebdomadairement?', + 'english' => 'English', + 'dutch' => 'Dutch', + 'french' => 'Francais', + 'german' => 'German', + 'email_status' => 'Autoriser l envoi de mail?', + 'email_from_email' => 'Expéditeur', + 'email_from_name' => 'Nom de l expéditeur', + 'sms_status' => 'Autoriser l envoi de SMS?', + 'sms_gateway' => 'Passerelle à utiliser pour l envoi de SMS', + 'sms_gateway_mollie' => 'Mollie', + 'sms_gateway_spryng' => 'Spryng', + 'sms_gateway_inetworx' => 'Inetworx', + 'sms_gateway_clickatell' => 'Clickatell', + 'sms_gateway_username' => 'Utilisateur sur la passerelle', + 'sms_gateway_password' => 'Mot de passe sur la passerelle', + 'sms_from' => 'SMS de l expéditeur', + 'alert_type' => + 'Choisissez quand vous souhaitez etre notifié.
'. + '
'. + '1) Changement de statut
'. + 'Vous recevrez une notification quand le serveur changera de statut. Cest-à-dire de l etat OK vers NOK ou NOK vers OK.
'. + '2) Eteint
'. + 'Vous recevrez une notification quand le serveur passera au statut ETEINT *uniquement la première fois*. Par exemple, '. + 'Votre tache planifiée s execute toute les 15 minutes et votre serveur entre dans le statut ETEINT à 1 heure du matin et il le reste jusqu à 6 heures du matin. '. + 'Vous recevrez une seule notification à 1 heure du matin et uniquement celle-ci.
'. + '3) Toujours
'. + 'Vous recevrez une notification à chaque passage de la tache planifiée si le site est en statut ETEINT '. + '
', + + 'alert_type_status' => 'Changement de statut', + 'alert_type_offline' => 'Eteint', + 'alert_type_always' => 'Toujours', + 'log_status' => 'Etat des évenements
Si l etat des evenements est paramétré à VRAI, tous les enregistrements seront enregistrés jusqu au changement d etat
', + 'log_email' => 'Enregistrer tout les emails envoyés par la tache planifiée?', + 'log_sms' => 'Enregistrer tout les SMS envoyés par la tache planifiée?', + 'updated' => 'La configuration a bien eété mis à jour.', + 'settings_email' => 'Configuration mail', + 'settings_sms' => 'Configuration SMS', + 'settings_notification' => 'Configuration des notifications', + 'settings_log' => 'Configuration des évenements', + 'auto_refresh_servers' => + 'Auto-refresh servers page
'. + '
'. + 'Time in seconds, if 0 the page won\'t refresh.'. + '
', + ), + // for newlines in the email messages use
+ 'notifications' => array( + 'off_sms' => 'Le Serveur \'%LABEL%\' est ETEINT: IP=%IP%, Port=%PORT%. Erreur=%ERROR%', + 'off_email_subject' => 'IMPORTANT: Le Serveur \'%LABEL%\' est ETEINT', + 'off_email_body' => "Impossible de vérifier le serveur suivant:

Serveur: %LABEL%
IP: %IP%
Port: %PORT%
Erreur: %ERROR%
Date: %DATE%", + 'on_sms' => 'Le Serveur \'%LABEL%\' est OK: IP=%IP%, Port=%PORT%', + 'on_email_subject' => 'IMPORTANT: Le Serveur \'%LABEL%\' est OK', + 'on_email_body' => "Le Serveur '%LABEL%' est de nouveau OK:

Serveur: %LABEL%
IP: %IP%
Port: %PORT%
Date: %DATE%", + ), +); + +?> \ No newline at end of file diff --git a/lang/nl.lang.php b/lang/nl.lang.php old mode 100644 new mode 100755 index f38fcb26..f27a4823 --- a/lang/nl.lang.php +++ b/lang/nl.lang.php @@ -1,11 +1,11 @@ 'Check for new updates weekly?', 'english' => 'Engels', 'dutch' => 'Nederlands', + 'french' => 'Frans', + 'german' => 'Duits', 'email_status' => 'Sta email berichten toe?', 'email_from_email' => 'Email van adres', 'email_from_name' => 'Email van naam', @@ -89,6 +91,7 @@ $sm_lang = array( 'sms_gateway_mollie' => 'Mollie', 'sms_gateway_spryng' => 'Spryng', 'sms_gateway_inetworx' => 'Inetworx', + 'sms_gateway_clickatell' => 'Clickatell', 'sms_gateway_username' => 'Gateway gebruikersnaam', 'sms_gateway_password' => 'Gateway wachtwoord', 'sms_from' => 'Telefoonnummer afzender', @@ -116,6 +119,11 @@ $sm_lang = array( 'settings_sms' => 'SMS instellingen', 'settings_notification' => 'Notificatie instellingen', 'settings_log' => 'Log instellingen', + 'auto_refresh_servers' => + 'Auto-refresh servers pagina
'. + '
'. + 'Tijd in seconden, als de tijd 0 is wordt de pagina niet ververst.'. + '
', ), // for newlines in the email messages use
'notifications' => array( diff --git a/tpl/config.tpl.html b/tpl/config.tpl.html index e07da956..c33e77f4 100644 --- a/tpl/config.tpl.html +++ b/tpl/config.tpl.html @@ -18,6 +18,8 @@ @@ -25,6 +27,10 @@ {label_show_update} + + {label_auto_refresh_servers} +  seconds + {label_settings_email} @@ -58,6 +64,7 @@ + diff --git a/tpl/main.tpl.html b/tpl/main.tpl.html old mode 100644 new mode 100755 index bf7c0f3b..b91d154d --- a/tpl/main.tpl.html +++ b/tpl/main.tpl.html @@ -3,6 +3,7 @@ + {auto_refresh} PHP Server Monitor @@ -27,10 +28,12 @@ {update_available} - \ No newline at end of file + + + \ No newline at end of file diff --git a/tpl/servers.tpl.html b/tpl/servers.tpl.html index 8f5bcd05..dea1ea0b 100644 --- a/tpl/servers.tpl.html +++ b/tpl/servers.tpl.html @@ -73,8 +73,8 @@ {label_monitoring} @@ -82,8 +82,8 @@ {label_send_email} @@ -91,8 +91,8 @@ {label_send_sms}