/** * Prepare the template with a list of all log entries */ protected function executeIndex() { $this->twig->addGlobal('subtitle', psm_get_lang('menu', 'server_log')); $tpl_data = array('label_status' => psm_get_lang('log', 'status'), 'label_email' => psm_get_lang('log', 'email'), 'label_sms' => psm_get_lang('log', 'sms'), 'label_pushover' => psm_get_lang('log', 'pushover'), 'label_title' => psm_get_lang('log', 'title'), 'label_server' => psm_get_lang('servers', 'server'), 'label_type' => psm_get_lang('log', 'type'), 'label_message' => psm_get_lang('system', 'message'), 'label_date' => psm_get_lang('system', 'date'), 'label_users' => ucfirst(psm_get_lang('menu', 'user')), 'label_no_logs' => psm_get_lang('log', 'no_logs'), 'tabs' => array()); $log_types = array('status', 'email', 'sms', 'pushover'); // get users $users = $this->db->select(PSM_DB_PREFIX . 'users', null, array('user_id', 'name')); $users_labels = array(); foreach ($users as $user) { $users_labels[$user['user_id']] = $user['name']; } foreach ($log_types as $key) { $records = $this->getEntries($key); $log_count = count($records); $tab_data = array('id' => $key, 'has_users' => $key == 'status' ? false : true, 'no_logs' => $log_count == 0 ? true : false, 'tab_active' => $key == 'status' ? 'active' : ''); for ($x = 0; $x < $log_count; $x++) { $record =& $records[$x]; $record['class'] = $x & 1 ? 'odd' : 'even'; $record['users'] = ''; $record['server'] = $record['label']; $record['type_icon'] = $record['server_type'] == 'website' ? 'icon-globe' : 'icon-cog'; $record['type_title'] = psm_get_lang('servers', 'type_' . $record['server_type']); $ip = '(' . $record['ip']; if (!empty($record['port']) && ($record['server_type'] != 'website' || $record['port'] != 80)) { $ip .= ':' . $record['port']; } $ip .= ')'; $record['ip'] = $ip; $record['datetime_format'] = psm_date($record['datetime']); // fix up user list if (!empty($record['user_id'])) { $names = array(); $users = explode(',', $record['user_id']); foreach ($users as $user_id) { if (isset($users_labels[$user_id])) { $names[] = $users_labels[$user_id]; } } sort($names); $record['users'] = implode('<br/>', $names); $record['user_list'] = implode(' • ', $names); } } $tab_data['entries'] = $records; $tpl_data['tabs'][] = $tab_data; } return $this->twig->render('module/server/log.tpl.html', $tpl_data); }
/** * Format server data for display * @param array $server * @return array */ protected function formatServer($server) { $server['rtime'] = round((double) $server['rtime'], 4); $server['last_online'] = psm_timespan($server['last_online']); $server['last_check'] = psm_timespan($server['last_check']); $server['active'] = psm_get_lang('system', $server['active']); $server['email'] = psm_get_lang('system', $server['email']); $server['sms'] = psm_get_lang('system', $server['sms']); $server['pushover'] = psm_get_lang('system', $server['pushover']); if ($server['status'] == 'on' && $server['warning_threshold_counter'] > 0) { $server['status'] = 'warning'; } $server['error'] = htmlentities($server['error']); $server['type'] = psm_get_lang('servers', 'type_' . $server['type']); $server['timeout'] = $server['timeout'] > 0 ? $server['timeout'] : PSM_CURL_TIMEOUT; $url_actions = array('delete', 'edit', 'view'); foreach ($url_actions as $action) { $server['url_' . $action] = psm_build_url(array('mod' => 'server', 'action' => $action, 'id' => $server['server_id'])); } return $server; }
/** * Prepare the template to show a list of all servers * @todo move the background colurs to the config */ protected function executeIndex() { // set background color to black $this->black_background = true; $this->twig->addGlobal('subtitle', psm_get_lang('menu', 'server_status')); // add header accessories $layout = $this->getUser()->getUserPref('status_layout', 0); $layout_data = array('label_last_check' => psm_get_lang('servers', 'last_check'), 'label_last_online' => psm_get_lang('servers', 'last_online'), 'label_rtime' => psm_get_lang('servers', 'latency'), 'block_layout_active' => $layout == 0 ? 'active' : '', 'list_layout_active' => $layout != 0 ? 'active' : ''); $this->setHeaderAccessories($this->twig->render('module/server/status/header.tpl.html', $layout_data)); $this->addFooter(false); // get the active servers from database $servers = $this->getServers(); $layout_data['servers_offline'] = array(); $layout_data['servers_online'] = array(); foreach ($servers as $server) { if ($server['active'] == 'no') { continue; } $server['last_checked_nice'] = psm_timespan($server['last_check']); $server['last_online_nice'] = psm_timespan($server['last_online']); $server['url_view'] = psm_build_url(array('mod' => 'server', 'action' => 'view', 'id' => $server['server_id'], 'back_to' => 'server_status')); if ($server['status'] == "off") { $layout_data['servers_offline'][] = $server; } elseif ($server['warning_threshold_counter'] > 0) { $server['class_warning'] = 'warning'; $layout_data['servers_offline'][] = $server; } else { $layout_data['servers_online'][] = $server; } } $auto_refresh_seconds = psm_get_conf('auto_refresh_servers'); if (intval($auto_refresh_seconds) > 0) { $this->twig->addGlobal('auto_refresh', true); $this->twig->addGlobal('auto_refresh_seconds', $auto_refresh_seconds); } return $this->twig->render('module/server/status/index.tpl.html', $layout_data); }
/** * Get a localised date from MySQL date format * @param string $time * @return string */ function psm_date($time) { if (empty($time) || $time == '0000-00-00 00:00:00') { return psm_get_lang('system', 'never'); } return strftime('%x %X', strtotime($time)); }
/** * This functions performs the pushover notifications * * @param array $users * @return boolean */ protected function notifyByPushover($users) { $userlist = array(); $pushover = psm_build_pushover(); if ($this->status_new === true) { $pushover->setPriority(0); } else { $pushover->setPriority(2); $pushover->setRetry(300); //Used with Priority = 2; Pushover will resend the notification every 60 seconds until the user accepts. $pushover->setExpire(3600); //Used with Priority = 2; Pushover will resend the notification every 60 seconds for 3600 seconds. After that point, it stops sending notifications. } $message = psm_parse_msg($this->status_new, 'pushover_message', $this->server); $pushover->setTitle(psm_parse_msg($this->status_new, 'pushover_title', $this->server)); $pushover->setMessage(str_replace('<br/>', "\n", $message)); $pushover->setUrl(psm_build_url()); $pushover->setUrlTitle(psm_get_lang('system', 'title')); foreach ($users as $user) { if (trim($user['pushover_key']) == '') { continue; } $userlist[] = $user['user_id']; $pushover->setUser($user['pushover_key']); if ($user['pushover_device'] != '') { $pushover->setDevice($user['pushover_device']); } $pushover->send(); } if (psm_get_conf('log_pushover')) { psm_add_log($this->server_id, 'pushover', $message, implode(',', $userlist)); } }
protected function getLabels() { return array('label_label' => psm_get_lang('servers', 'label'), 'label_status' => psm_get_lang('servers', 'status'), 'label_domain' => psm_get_lang('servers', 'domain'), 'label_timeout' => psm_get_lang('servers', 'timeout'), 'label_timeout_description' => psm_get_lang('servers', 'timeout_description'), 'label_authentication_settings' => psm_get_lang('servers', 'authentication_settings'), 'label_website_username' => psm_get_lang('servers', 'website_username'), 'label_website_username_description' => psm_get_lang('servers', 'website_username_description'), 'label_website_password' => psm_get_lang('servers', 'website_password'), 'label_website_password_description' => psm_get_lang('servers', 'website_password_description'), 'label_fieldset_monitoring' => psm_get_lang('servers', 'fieldset_monitoring'), 'label_fieldset_permissions' => psm_get_lang('servers', 'fieldset_permissions'), 'label_port' => psm_get_lang('servers', 'port'), 'label_custom_port' => psm_get_lang('servers', 'custom_port'), 'label_please_select' => psm_get_lang('servers', 'please_select'), 'label_popular_ports' => psm_get_lang('servers', 'popular_ports'), 'label_type' => psm_get_lang('servers', 'type'), 'label_website' => psm_get_lang('servers', 'type_website'), 'label_service' => psm_get_lang('servers', 'type_service'), 'label_pattern' => psm_get_lang('servers', 'pattern'), 'label_pattern_description' => psm_get_lang('servers', 'pattern_description'), 'label_last_check' => psm_get_lang('servers', 'last_check'), 'label_rtime' => psm_get_lang('servers', 'latency'), 'label_last_online' => psm_get_lang('servers', 'last_online'), 'label_monitoring' => psm_get_lang('servers', 'monitoring'), 'label_email' => psm_get_lang('servers', 'email'), 'label_send_email' => psm_get_lang('servers', 'send_email'), 'label_sms' => psm_get_lang('servers', 'sms'), 'label_send_sms' => psm_get_lang('servers', 'send_sms'), 'label_pushover' => psm_get_lang('servers', 'pushover'), 'label_users' => psm_get_lang('servers', 'users'), 'label_warning_threshold' => psm_get_lang('servers', 'warning_threshold'), 'label_warning_threshold_description' => psm_get_lang('servers', 'warning_threshold_description'), 'label_action' => psm_get_lang('system', 'action'), 'label_save' => psm_get_lang('system', 'save'), 'label_go_back' => psm_get_lang('system', 'go_back'), 'label_edit' => psm_get_lang('system', 'edit'), 'label_delete' => psm_get_lang('system', 'delete'), 'label_yes' => psm_get_lang('system', 'yes'), 'label_no' => psm_get_lang('system', 'no'), 'label_add_new' => psm_get_lang('system', 'add_new')); }
/** * Sends the password-reset-email. * @param int $user_id * @param string $user_email * @param string $user_password_reset_hash */ protected function sendPasswordForgotMail($user_id, $user_email, $user_password_reset_hash) { $mail = psm_build_mail(); $mail->Subject = psm_get_lang('login', 'password_reset_email_subject'); $url = psm_build_url(array('action' => 'reset', 'user_id' => $user_id, 'token' => $user_password_reset_hash), true, false); $body = psm_get_lang('login', 'password_reset_email_body'); $body = str_replace('%link%', $url, $body); $mail->Body = $body; $mail->AltBody = str_replace('<br/>', "\n", $body); $mail->AddAddress($user_email); $mail->Send(); }
/** * Generate data arrays for graphs * @param array $records all uptime records to parse, MUST BE SORTED BY DATE IN ASCENDING ORDER * @param array $lines array with keys as line ids to prepare (key must be available in uptime records) * @param callable $cb_if_up function to check if the server is up or down * @param string $latency_avg_key which key from uptime records to use for calculating averages * @param \DateTime $start_time Lowest DateTime of the graph * @param \DateTime $end_time Highest DateTime of the graph * @param boolean $add_uptime add uptime calculation? * @return array */ protected function generateGraphLines($records, $lines, $cb_if_up, $latency_avg_key, $start_time, $end_time, $add_uptime = false) { $data = array(); // PLEASE NOTE: all times are in microseconds! because of javascript. $last_date = 0; $latency_avg = 0; $series = array(); // number of microseconds of downtime $time_down = 0; $down = array(); // Create the list of points and server down zones foreach ($records as $uptime) { $time = strtotime($uptime['date']) * 1000; // use the first line to calculate average latency $latency_avg += (double) $uptime[$latency_avg_key]; if ($cb_if_up($uptime)) { // The server is up foreach ($lines as $key => $value) { // add the value for each of the different lines if (isset($uptime[$key])) { $lines[$key][] = '[' . $time . ',' . round((double) $uptime[$key], 4) . ']'; } } if ($last_date) { // Was down before. // Record the first and last date as a string in the down array $down[] = '[' . $last_date . ',' . $time . ']'; // add the number of microseconds of downtime to counter for % $time_down += $time - $last_date; $last_date = 0; } } else { // The server is down if (!$last_date) { $last_date = $time; } } } $lines_merged = array(); foreach ($lines as $line_key => $line_value) { if (empty($line_value)) { continue; } $lines_merged[] = '[' . implode(',', $line_value) . ']'; $series[] = "{label: '" . psm_get_lang('servers', $line_key) . "'}"; } if ($last_date) { // if last_date is still set, the last check was "down" and we are still in down mode $down[] = '[' . $last_date . ',0]'; $time_down += $end_time->getTimestamp() * 1000 - $last_date; } if ($add_uptime) { $data['uptime'] = 100 - $time_down / ($end_time->getTimestamp() - $start_time->getTimestamp()) / 10; } $data['latency_avg'] = count($records) > 0 ? $latency_avg / count($records) : 0; $data['server_lines'] = sizeof($lines_merged) ? '[' . implode(',', $lines_merged) . ']' : ''; $data['server_down'] = sizeof($down) ? '[' . implode(',', $down) . ']' : ''; $data['series'] = sizeof($series) ? '[' . implode(',', $series) . ']' : ''; $data['end_timestamp'] = $end_time->getTimestamp() * 1000; return $data; }
/** * Prepare twig environment * @return \Twig_Environment */ protected function buildTwigEnvironment() { $twig = $this->container->get('twig'); $session = $this->container->get('user')->getSession(); if (!$session->has('csrf_token')) { $session->set('csrf_token', bin2hex(random_bytes(32))); } if (!$session->has('csrf_token2')) { $session->set('csrf_token2', random_bytes(32)); } $twig->addFunction(new \Twig_SimpleFunction('csrf_token', function ($lock_to = null) use($session) { if (empty($lock_to)) { return $session->get('csrf_token'); } return hash_hmac('sha256', $lock_to, $session->get('csrf_token2')); })); $twig->addGlobal('direction_current', psm_get_lang('locale_dir')); $twig->addGlobal('language_current', psm_get_lang('locale_tag')); return $twig; }
/** * Create HTML code for the menu * @return string */ protected function createHTMLMenu() { $ulvl = $this->getUser()->getUserLevel(); $tpl_data = array('label_help' => psm_get_lang('menu', 'help'), 'label_profile' => psm_get_lang('users', 'profile'), 'label_logout' => psm_get_lang('login', 'logout'), 'url_profile' => psm_build_url(array('mod' => 'user_profile')), 'url_logout' => psm_build_url(array('logout' => 1))); switch ($ulvl) { case PSM_USER_ADMIN: $items = array('server_status', 'server', 'server_log', 'user', 'config', 'server_update'); break; case PSM_USER_USER: $items = array('server_status', 'server', 'server_log', 'server_update'); break; default: $items = array(); break; } $tpl_data['menu'] = array(); foreach ($items as $key) { $tpl_data['menu'][] = array('active' => $key == psm_GET('mod') ? 'active' : '', 'url' => psm_build_url(array('mod' => $key)), 'label' => psm_get_lang('menu', $key)); } if ($ulvl != PSM_USER_ANONYMOUS) { $user = $this->getUser()->getUser(); $tpl_data['label_usermenu'] = str_replace('%user_name%', $user->name, psm_get_lang('login', 'welcome_usermenu')); } return $this->twig->render('main/menu.tpl.html', $tpl_data); }
/** * 401 error page * * @return string */ protected function execute401() { return $this->twig->render('module/error/401.tpl.html', array('label_title' => psm_get_lang('error', '401_unauthorized'), 'label_description' => psm_get_lang('error', '401_unauthorized_description'))); }
/** * Save the profile */ protected function executeSave() { if (empty($_POST)) { // dont process anything if no data has been posted return $this->executeIndex(); } $validator = new \psm\Util\User\UserValidator($this->user); $user = $this->user->getUser(); $fields = $this->profile_fields; $fields[] = 'password'; $fields[] = 'password_repeat'; $clean = array(); foreach ($fields as $field) { if (isset($_POST[$field])) { $clean[$field] = trim(strip_tags($_POST[$field])); } else { $clean[$field] = ''; } } // validate the lot try { $validator->username($clean['user_name'], $this->user->getUserId()); $validator->email($clean['email']); // always validate password for new users, // but only validate it for existing users when they change it. if ($clean['password'] != '') { $validator->password($clean['password'], $clean['password_repeat']); } } catch (\InvalidArgumentException $e) { $this->addMessage(psm_get_lang('users', 'error_' . $e->getMessage()), 'error'); return $this->executeIndex(); } if (!empty($clean['password'])) { $password = $clean['password']; } unset($clean['password']); unset($clean['password_repeat']); $this->db->save(PSM_DB_PREFIX . 'users', $clean, array('user_id' => $this->user->getUserId())); if (isset($password)) { $this->user->changePassword($this->user->getUserId(), $password); } $this->addMessage(psm_get_lang('users', 'profile_updated'), 'success'); return $this->executeIndex(); }
/** * Execute the install and upgrade process to a newer version */ protected function executeInstall() { if (!defined('PSM_DB_PREFIX') || !$this->db->status()) { return $this->executeConfig(); } $add_user = false; // check if user submitted username + password in previous step // this would only be the case for new installs, and install from // before 3.0 $new_user = array('user_name' => psm_POST('username'), 'name' => psm_POST('username'), 'password' => psm_POST('password'), 'password_repeat' => psm_POST('password_repeat'), 'email' => psm_POST('email', ''), 'mobile' => '', 'level' => PSM_USER_ADMIN, 'pushover_key' => '', 'pushover_device' => ''); $validator = new \psm\Util\User\UserValidator($this->user); $logger = array($this, 'addMessage'); $installer = new \psm\Util\Install\Installer($this->db, $logger); if ($this->isUpgrade()) { $this->addMessage('Upgrade process started.', 'info'); $version_from = $this->getPreviousVersion(); if ($version_from === false) { $this->addMessage('Unable to locate your previous version. Please run a fresh install.', 'error'); } else { if (version_compare($version_from, PSM_VERSION, '=')) { $this->addMessage('Your installation is already at the latest version.', 'success'); } elseif (version_compare($version_from, PSM_VERSION, '>')) { $this->addMessage('This installer does not support downgrading, sorry.', 'error'); } else { $this->addMessage('Upgrading from ' . $version_from . ' to ' . PSM_VERSION, 'info'); $installer->upgrade($version_from, PSM_VERSION); } if (version_compare($version_from, '3.0.0', '<')) { $add_user = true; } } } else { // validate the lot try { $validator->email($new_user['email']); $validator->password($new_user['password'], $new_user['password_repeat']); } catch (\InvalidArgumentException $e) { $this->addMessage(psm_get_lang('users', 'error_' . $e->getMessage()), 'error'); return $this->executeConfig(); } $this->addMessage('Installation process started.', 'success'); $installer->install(); // add user $add_user = true; } if ($add_user) { unset($new_user['password_repeat']); $user_id = $this->db->save(PSM_DB_PREFIX . 'users', $new_user); if (intval($user_id) > 0) { $this->user->changePassword($user_id, $new_user['password']); $this->addMessage('User account has been created successfully.', 'success'); } else { $this->addMessage('There was an error adding your user account.', 'error'); } } return $this->twig->render('module/install/success.tpl.html', array('messages' => $this->getMessages())); }
protected function getLabels() { return array('label_label' => psm_get_lang('servers', 'label'), 'label_status' => psm_get_lang('servers', 'status'), 'label_domain' => psm_get_lang('servers', 'domain'), 'label_timeout' => psm_get_lang('servers', 'timeout'), 'label_timeout_description' => psm_get_lang('servers', 'timeout_description'), 'label_port' => psm_get_lang('servers', 'port'), 'label_type' => psm_get_lang('servers', 'type'), 'label_website' => psm_get_lang('servers', 'type_website'), 'label_service' => psm_get_lang('servers', 'type_service'), 'label_type' => psm_get_lang('servers', 'type'), 'label_pattern' => psm_get_lang('servers', 'pattern'), 'label_pattern_description' => psm_get_lang('servers', 'pattern_description'), 'label_last_check' => psm_get_lang('servers', 'last_check'), 'label_rtime' => psm_get_lang('servers', 'latency'), 'label_last_online' => psm_get_lang('servers', 'last_online'), 'label_monitoring' => psm_get_lang('servers', 'monitoring'), 'label_email' => psm_get_lang('servers', 'email'), 'label_send_email' => psm_get_lang('servers', 'send_email'), 'label_sms' => psm_get_lang('servers', 'sms'), 'label_send_sms' => psm_get_lang('servers', 'send_sms'), 'label_pushover' => psm_get_lang('servers', 'pushover'), 'label_users' => psm_get_lang('servers', 'users'), 'label_warning_threshold' => psm_get_lang('servers', 'warning_threshold'), 'label_warning_threshold_description' => psm_get_lang('servers', 'warning_threshold_description'), 'label_action' => psm_get_lang('system', 'action'), 'label_save' => psm_get_lang('system', 'save'), 'label_go_back' => psm_get_lang('system', 'go_back'), 'label_edit' => psm_get_lang('system', 'edit'), 'label_delete' => psm_get_lang('system', 'delete'), 'label_yes' => psm_get_lang('system', 'yes'), 'label_no' => psm_get_lang('system', 'no'), 'label_add_new' => psm_get_lang('system', 'add_new')); }
public function createHTML() { $has_cancel = $this->type == self::MODAL_TYPE_OK ? false : true; $button_type = $this->type == self::MODAL_TYPE_DANGER ? 'danger' : 'primary'; $button_label = empty($this->ok_label) ? psm_get_lang('system', 'ok') : $this->ok_label; $message = !empty($this->message) ? $this->message : ''; $matches = array(); if (preg_match_all('/%(\\d)/', $message, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { $message = str_replace($match[0], '<span class="modalP' . $match[1] . '"></span>', $message); } } $tpl = $this->twig->loadTemplate('util/module/modal.tpl.html'); $html = $tpl->render(array('modal_id' => $this->modal_id, 'modal_title' => !empty($this->title) ? $this->title : psm_get_lang('system', 'title'), 'modal_body' => $message, 'has_cancel' => $has_cancel, 'label_cancel' => psm_get_lang('system', 'cancel'), 'modal_button_type' => $button_type, 'modal_button_label' => $button_label)); return $html; }
protected function getLabels() { return array('label_tab_email' => psm_get_lang('config', 'tab_email'), 'label_tab_sms' => psm_get_lang('config', 'tab_sms'), 'label_tab_pushover' => psm_get_lang('config', 'tab_pushover'), 'label_settings_email' => psm_get_lang('config', 'settings_email'), 'label_settings_sms' => psm_get_lang('config', 'settings_sms'), 'label_settings_pushover' => psm_get_lang('config', 'settings_pushover'), 'label_settings_notification' => psm_get_lang('config', 'settings_notification'), 'label_settings_log' => psm_get_lang('config', 'settings_log'), 'label_general' => psm_get_lang('config', 'general'), 'label_language' => psm_get_lang('config', 'language'), 'label_show_update' => psm_get_lang('config', 'show_update'), 'label_password_encrypt_key' => psm_get_lang('config', 'password_encrypt_key'), 'label_password_encrypt_key_note' => psm_get_lang('config', 'password_encrypt_key_note'), 'label_email_status' => psm_get_lang('config', 'email_status'), 'label_email_from_email' => psm_get_lang('config', 'email_from_email'), 'label_email_from_name' => psm_get_lang('config', 'email_from_name'), 'label_email_smtp' => psm_get_lang('config', 'email_smtp'), 'label_email_smtp_host' => psm_get_lang('config', 'email_smtp_host'), 'label_email_smtp_port' => psm_get_lang('config', 'email_smtp_port'), 'label_email_smtp_security' => psm_get_lang('config', 'email_smtp_security'), 'label_email_smtp_security_none' => psm_get_lang('config', 'email_smtp_security_none'), 'label_email_smtp_username' => psm_get_lang('config', 'email_smtp_username'), 'label_email_smtp_password' => psm_get_lang('config', 'email_smtp_password'), '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_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'), '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_textmarketer' => psm_get_lang('config', 'sms_gateway_textmarketer'), 'label_sms_gateway_smsit' => psm_get_lang('config', 'sms_gateway_smsit'), 'label_sms_gateway_freevoipdeal' => psm_get_lang('config', 'sms_gateway_freevoipdeal'), 'label_sms_gateway_smsglobal' => psm_get_lang('config', 'sms_gateway_smsglobal'), 'label_sms_gateway_nexmo' => psm_get_lang('config', 'sms_gateway_nexmo'), 'label_sms_gateway_octopush' => psm_get_lang('config', 'sms_gateway_octopush'), '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'), 'label_pushover_description' => psm_get_lang('config', 'pushover_description'), 'label_pushover_status' => psm_get_lang('config', 'pushover_status'), 'label_pushover_clone_app' => psm_get_lang('config', 'pushover_clone_app'), 'pushover_clone_url' => PSM_PUSHOVER_CLONE_URL, 'label_pushover_api_token' => psm_get_lang('config', 'pushover_api_token'), 'label_pushover_api_token_description' => sprintf(psm_get_lang('config', 'pushover_api_token_description'), PSM_PUSHOVER_CLONE_URL), 'label_alert_type' => psm_get_lang('config', 'alert_type'), 'label_alert_type_description' => psm_get_lang('config', 'alert_type_description'), 'label_alert_type_status' => psm_get_lang('config', 'alert_type_status'), 'label_alert_type_offline' => psm_get_lang('config', 'alert_type_offline'), 'label_alert_type_always' => psm_get_lang('config', 'alert_type_always'), 'label_log_status' => psm_get_lang('config', 'log_status'), 'label_log_status_description' => psm_get_lang('config', 'log_status_description'), 'label_log_email' => psm_get_lang('config', 'log_email'), 'label_log_sms' => psm_get_lang('config', 'log_sms'), 'label_log_pushover' => psm_get_lang('config', 'log_pushover'), 'label_auto_refresh' => psm_get_lang('config', 'auto_refresh'), 'label_auto_refresh_servers' => psm_get_lang('config', 'auto_refresh_servers'), 'label_seconds' => psm_get_lang('config', 'seconds'), 'label_save' => psm_get_lang('system', 'save'), 'label_test' => psm_get_lang('config', 'test'), 'label_log_retention_period' => psm_get_lang('config', 'log_retention_period'), 'label_log_retention_period_description' => psm_get_lang('config', 'log_retention_period_description'), 'label_log_retention_days' => psm_get_lang('config', 'log_retention_days')); }
protected function getLabels() { return array('label_users' => psm_get_lang('menu', 'users'), 'label_user' => psm_get_lang('users', 'user'), 'label_name' => psm_get_lang('users', 'name'), 'label_user_name' => psm_get_lang('users', 'user_name'), 'label_password' => psm_get_lang('users', 'password'), 'label_password_repeat' => psm_get_lang('users', 'password_repeat'), 'label_level' => psm_get_lang('users', 'level'), 'label_level_description' => psm_get_lang('users', 'level_description'), 'label_mobile' => psm_get_lang('users', 'mobile'), 'label_pushover' => psm_get_lang('users', 'pushover'), 'label_pushover_description' => psm_get_lang('users', 'pushover_description'), '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_email' => psm_get_lang('users', 'email'), 'label_servers' => psm_get_lang('menu', 'server'), 'label_action' => psm_get_lang('system', 'action'), 'label_save' => psm_get_lang('system', 'save'), 'label_go_back' => psm_get_lang('system', 'go_back'), 'label_edit' => psm_get_lang('system', 'edit'), 'label_delete' => psm_get_lang('system', 'delete'), 'label_add_new' => psm_get_lang('system', 'add_new')); }