Added redirect check (#626)

This commit is contained in:
Tim 2018-09-05 22:58:50 +02:00 committed by GitHub
parent b26f85d975
commit d33c891be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 59 additions and 26 deletions

View File

@ -5,6 +5,7 @@ Changelog
Not yet released Not yet released
---------------- ----------------
* #626: Added redirect check.
* #627: Latest server output, error and output during a failure will be saved and are shown on the server page. * #627: Latest server output, error and output during a failure will be saved and are shown on the server page.
* #631: Added option to specify the request method. * #631: Added option to specify the request method.
* #628: Added the option to mark specific HTTP status codes as online. * #628: Added the option to mark specific HTTP status codes as online.

View File

@ -47,6 +47,7 @@ $sm_lang = array(
'back_to_top' => 'Back to top', 'back_to_top' => 'Back to top',
'go_back' => 'Go back', 'go_back' => 'Go back',
'ok' => 'OK', 'ok' => 'OK',
'bad' => 'bad',
'cancel' => 'Cancel', 'cancel' => 'Cancel',
'none' => 'None', 'none' => 'None',
'activate' => 'Activate', 'activate' => 'Activate',
@ -174,6 +175,8 @@ $sm_lang = array(
'pattern_description' => 'If this pattern is not found on the website, the server will be marked online/offline. Regular expressions are allowed.', 'pattern_description' => 'If this pattern is not found on the website, the server will be marked online/offline. Regular expressions are allowed.',
'pattern_online' => 'Pattern indicates website is', 'pattern_online' => 'Pattern indicates website is',
'pattern_online_description' => 'Online: If this pattern is not found on the website, the server will be marked online. Offline: If this pattern is not found on the website, the server will be marked offline.', 'pattern_online_description' => 'Online: If this pattern is not found on the website, the server will be marked online. Offline: If this pattern is not found on the website, the server will be marked offline.',
'redirect_check' => 'Redirecting to another domain is',
'redirect_check_description' => 'Redirect to another domain is usually a bad sign.',
'allow_http_status' => 'Allow HTTP status code', 'allow_http_status' => 'Allow HTTP status code',
'allow_http_status_description' => 'Mark website as online. HTTP Status codes lower then 400 are marked as online by default. Seperate with |. Example: 401|403.', 'allow_http_status_description' => 'Mark website as online. HTTP Status codes lower then 400 are marked as online by default. Seperate with |. Example: 401|403.',
'header' => 'Header', 'header' => 'Header',

View File

@ -27,7 +27,11 @@
$sm_lang = array( $sm_lang = array(
'name' => 'Nederlands - Dutch', 'name' => 'Nederlands - Dutch',
'locale' => array('nl_NL.UTF-8', 'nl_NL', 'dutch'), 'locale' => array(
'0' => 'nl_NL.UTF-8',
'1' => 'nl_NL',
'2' => 'dutch',
),
'locale_tag' => 'nl', 'locale_tag' => 'nl',
'locale_dir' => 'ltr', 'locale_dir' => 'ltr',
'system' => array( 'system' => array(
@ -47,8 +51,8 @@ $sm_lang = array(
'back_to_top' => 'Terug naar boven', 'back_to_top' => 'Terug naar boven',
'go_back' => 'Terug', 'go_back' => 'Terug',
'ok' => 'OK', 'ok' => 'OK',
'bad' => 'niet goed',
'cancel' => 'Cancel', 'cancel' => 'Cancel',
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
'short_day_format' => '%B %e', 'short_day_format' => '%B %e',
'long_day_format' => '%B %e, %Y', 'long_day_format' => '%B %e, %Y',
'yesterday_format' => 'Gisteren om %k:%M', 'yesterday_format' => 'Gisteren om %k:%M',
@ -142,6 +146,8 @@ $sm_lang = array(
'type_service' => 'Service', 'type_service' => 'Service',
'pattern' => 'Zoek voor tekst/regex', 'pattern' => 'Zoek voor tekst/regex',
'pattern_description' => 'Als dit patroon niet gevonden wordt op de website, zal de server als offline gemarkeerd worden. Regular expressions zijn toegestaan.', 'pattern_description' => 'Als dit patroon niet gevonden wordt op de website, zal de server als offline gemarkeerd worden. Regular expressions zijn toegestaan.',
'redirect_check' => 'Omleiden naar een ander domein is',
'redirect_check_description' => 'Een omleiding naar een ander domein is meestal een slecht teken.',
'allow_http_status' => 'Sta HTTP status code toe', 'allow_http_status' => 'Sta HTTP status code toe',
'allow_http_status_description' => 'Markeer website als online. HTTP status code lager dan 400 worden standaard als online gemarkeerd. Scheiden met |. Bijvoorbeeld: 401|403.', 'allow_http_status_description' => 'Markeer website als online. HTTP status code lager dan 400 worden standaard als online gemarkeerd. Scheiden met |. Bijvoorbeeld: 401|403.',
'last_check' => 'Laatst gecontroleerd', 'last_check' => 'Laatst gecontroleerd',
@ -174,7 +180,6 @@ $sm_lang = array(
'warning_threshold_description' => 'Aantal mislukte pogingen voordat de server als offline gemarkeerd wordt.', 'warning_threshold_description' => 'Aantal mislukte pogingen voordat de server als offline gemarkeerd wordt.',
'chart_last_week' => 'Afgelopen week', 'chart_last_week' => 'Afgelopen week',
'chart_history' => 'Geschiedenis', 'chart_history' => 'Geschiedenis',
// Charts date format according jqPlot date format http://www.jqplot.com/docs/files/plugins/jqplot-dateAxisRenderer-js.html
'chart_day_format' => '%d-%m-%Y', 'chart_day_format' => '%d-%m-%Y',
'chart_long_date_format' => '%d-%m-%Y %H:%M:%S', 'chart_long_date_format' => '%d-%m-%Y %H:%M:%S',
'chart_short_date_format' => '%d-%m %H:%M', 'chart_short_date_format' => '%d-%m %H:%M',
@ -216,14 +221,7 @@ $sm_lang = array(
'pushover_api_token' => 'Pushover App API Token', 'pushover_api_token' => 'Pushover App API Token',
'pushover_api_token_description' => 'Voordat je Pushover kunt gebruiken moet je een <a href="%1$s" target="_blank">App registreren</a> via hun website, en daarvan de App API Token hier invullen.', 'pushover_api_token_description' => 'Voordat je Pushover kunt gebruiken moet je een <a href="%1$s" target="_blank">App registreren</a> via hun website, en daarvan de App API Token hier invullen.',
'alert_type' => 'Selecteer wanneer je een notificatie wilt', 'alert_type' => 'Selecteer wanneer je een notificatie wilt',
'alert_type_description' => '<b>Status verandert:</b> '. 'alert_type_description' => '<b>Status verandert:</b> Je ontvangt alleen bericht wanneer een server van status verandert. Dus van online -> offline of offline -> online.<br/><br /><b>Offline:</b> Je ontvangt bericht wanneer een server offline gaat voor de *EERSTE KEER*. Bijvoorbeeld, je cronjob draait iedere 15 min en je server gaat down om 01:00 en blijft offline tot 06:00. Je krijgt 1 bericht om 01:00 en dat is het.<br/><br/><b>Altijd:</b> Je krijgt een bericht elke keer dat het script draait en een website is down, ook al is de site al een paar uur offline.',
'Je ontvangt alleen bericht wanneer een server van status verandert. Dus van online -> offline of offline -> online.<br/>'.
'<br /><b>Offline:</b> '.
'Je ontvangt bericht wanneer een server offline gaat voor de *EERSTE KEER*. Bijvoorbeeld, '.
'je cronjob draait iedere 15 min en je server gaat down om 01:00 en blijft offline tot 06:00. '.
'Je krijgt 1 bericht om 01:00 en dat is het.<br/>'.
'<br/><b>Altijd:</b> '.
'Je krijgt een bericht elke keer dat het script draait en een website is down, ook al is de site al een paar uur offline.',
'alert_type_status' => 'Status verandering', 'alert_type_status' => 'Status verandering',
'alert_type_offline' => 'Offline', 'alert_type_offline' => 'Offline',
'alert_type_always' => 'Altijd', 'alert_type_always' => 'Altijd',
@ -242,11 +240,7 @@ $sm_lang = array(
'settings_notification' => 'Notificatie instellingen', 'settings_notification' => 'Notificatie instellingen',
'settings_log' => 'Log instellingen', 'settings_log' => 'Log instellingen',
'auto_refresh' => 'Auto-refresh', 'auto_refresh' => 'Auto-refresh',
'auto_refresh_servers' => 'auto_refresh_servers' => 'Auto-herladen servers pagina.<br/><span class="small">Tijd in seconden, als de tijd 0 is wordt de pagina niet ververst.</span>',
'Auto-herladen servers pagina.<br/>'.
'<span class="small">'.
'Tijd in seconden, als de tijd 0 is wordt de pagina niet ververst.'.
'</span>',
'seconds' => 'seconden', 'seconds' => 'seconden',
'test' => 'Test', 'test' => 'Test',
'test_email' => 'Er zal een email verstuurd worden naar het email adres in je profiel.', 'test_email' => 'Er zal een email verstuurd worden naar het email adres in je profiel.',
@ -268,18 +262,17 @@ $sm_lang = array(
'log_retention_period_description' => 'Aantal dagen dat logs van notificaties en archieven van server uptime worden bewaard. Vul 0 in om log opruiming uit te zetten.', 'log_retention_period_description' => 'Aantal dagen dat logs van notificaties en archieven van server uptime worden bewaard. Vul 0 in om log opruiming uit te zetten.',
'log_retention_days' => 'dagen', 'log_retention_days' => 'dagen',
), ),
// for newlines in the email messages use <br/>
'notifications' => array( 'notifications' => array(
'off_sms' => 'Server %LABEL% is DOWN: ip=%IP%, poort=%PORT%. Fout=%ERROR%', 'off_sms' => 'Server %LABEL% is DOWN: ip=%IP%, poort=%PORT%. Fout=%ERROR%',
'off_email_subject' => 'BELANGRIJK: Server %LABEL% is DOWN', 'off_email_subject' => 'BELANGRIJK: Server %LABEL% is DOWN',
'off_email_body' => "De server kon niet worden bereikt:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Fout: %ERROR%<br/>Datum: %DATE%", 'off_email_body' => 'De server kon niet worden bereikt:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Fout: %ERROR%<br/>Datum: %DATE%',
'off_pushover_title' => 'Server %LABEL% is DOWN', 'off_pushover_title' => 'Server %LABEL% is DOWN',
'off_pushover_message' => "De server kon niet worden bereikt:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Fout: %ERROR%<br/>Datum: %DATE%", 'off_pushover_message' => 'De server kon niet worden bereikt:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Fout: %ERROR%<br/>Datum: %DATE%',
'on_sms' => 'Server %LABEL% is RUNNING: ip=%IP%, poort=%PORT%, tijd offline=%LAST_OFFLINE_DURATION%', 'on_sms' => 'Server %LABEL% is RUNNING: ip=%IP%, poort=%PORT%, tijd offline=%LAST_OFFLINE_DURATION%',
'on_email_subject' => 'BELANGRIJK: Server %LABEL% is RUNNING', 'on_email_subject' => 'BELANGRIJK: Server %LABEL% is RUNNING',
'on_email_body' => "Server %LABEL% is na %LAST_OFFLINE_DURATION% weer online:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Datum: %DATE%", 'on_email_body' => 'Server %LABEL% is na %LAST_OFFLINE_DURATION% weer online:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Datum: %DATE%',
'on_pushover_title' => 'Server %LABEL% is RUNNING', 'on_pushover_title' => 'Server %LABEL% is RUNNING',
'on_pushover_message' => "Server %LABEL% is na %LAST_OFFLINE_DURATION% weer online:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Datum: %DATE%", 'on_pushover_message' => 'Server %LABEL% is na %LAST_OFFLINE_DURATION% weer online:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Datum: %DATE%',
), ),
'login' => array( 'login' => array(
'welcome_usermenu' => 'Welkom, %user_name%', 'welcome_usermenu' => 'Welkom, %user_name%',
@ -308,4 +301,4 @@ $sm_lang = array(
'401_unauthorized' => 'Unauthorized', '401_unauthorized' => 'Unauthorized',
'401_unauthorized_description' => 'Je hebt niet de juiste bevoegdheden om deze pagina te bekijken.', '401_unauthorized_description' => 'Je hebt niet de juiste bevoegdheden om deze pagina te bekijken.',
), ),
); );

View File

@ -66,6 +66,7 @@ abstract class AbstractServerController extends AbstractController {
`s`.`label`, `s`.`label`,
`s`.`pattern`, `s`.`pattern`,
`s`.`pattern_online`, `s`.`pattern_online`,
`s`.`redirect_check`,
`s`.`allow_http_status`, `s`.`allow_http_status`,
`s`.`header_name`, `s`.`header_name`,
`s`.`header_value`, `s`.`header_value`,

View File

@ -201,6 +201,7 @@ class ServerController extends AbstractServerController {
'default_value_timeout' => PSM_CURL_TIMEOUT, 'default_value_timeout' => PSM_CURL_TIMEOUT,
'edit_value_pattern' => $edit_server['pattern'], 'edit_value_pattern' => $edit_server['pattern'],
'edit_pattern_selected_'.$edit_server['pattern_online'] => 'selected="selected"', 'edit_pattern_selected_'.$edit_server['pattern_online'] => 'selected="selected"',
'edit_redirect_check_selected_'.$edit_server['redirect_check'] => 'selected="selected"',
'edit_value_allow_http_status' => $edit_server['allow_http_status'], 'edit_value_allow_http_status' => $edit_server['allow_http_status'],
'edit_value_header_name' => $edit_server['header_name'], 'edit_value_header_name' => $edit_server['header_name'],
'edit_value_header_value' => $edit_server['header_value'], 'edit_value_header_value' => $edit_server['header_value'],
@ -270,6 +271,7 @@ class ServerController extends AbstractServerController {
'type' => psm_POST('type', ''), 'type' => psm_POST('type', ''),
'pattern' => psm_POST('pattern', ''), 'pattern' => psm_POST('pattern', ''),
'pattern_online' => in_array($_POST['pattern_online'], array('yes', 'no')) ? $_POST['pattern_online'] : 'yes', 'pattern_online' => in_array($_POST['pattern_online'], array('yes', 'no')) ? $_POST['pattern_online'] : 'yes',
'redirect_check' => in_array($_POST['redirect_check'], array('ok', 'bad')) ? $_POST['redirect_check'] : 'bad',
'allow_http_status' => psm_POST('allow_http_status', ''), 'allow_http_status' => psm_POST('allow_http_status', ''),
'header_name' => psm_POST('header_name', ''), 'header_name' => psm_POST('header_name', ''),
'header_value' => psm_POST('header_value', ''), 'header_value' => psm_POST('header_value', ''),
@ -481,6 +483,8 @@ class ServerController extends AbstractServerController {
'label_pattern_description' => psm_get_lang('servers', 'pattern_description'), 'label_pattern_description' => psm_get_lang('servers', 'pattern_description'),
'label_pattern_online' => psm_get_lang('servers', 'pattern_online'), 'label_pattern_online' => psm_get_lang('servers', 'pattern_online'),
'label_pattern_online_description' => psm_get_lang('servers', 'pattern_online_description'), 'label_pattern_online_description' => psm_get_lang('servers', 'pattern_online_description'),
'label_redirect_check' => psm_get_lang('servers', 'redirect_check'),
'label_redirect_check_description' => psm_get_lang('servers', 'redirect_check_description'),
'label_allow_http_status' => psm_get_lang('servers', 'allow_http_status'), 'label_allow_http_status' => psm_get_lang('servers', 'allow_http_status'),
'label_allow_http_status_description' => psm_get_lang('servers', 'allow_http_status_description'), 'label_allow_http_status_description' => psm_get_lang('servers', 'allow_http_status_description'),
'label_header' => psm_get_lang('servers', 'header'), 'label_header' => psm_get_lang('servers', 'header'),
@ -514,6 +518,8 @@ class ServerController extends AbstractServerController {
'label_advanced' => psm_get_lang('system', 'advanced'), 'label_advanced' => psm_get_lang('system', 'advanced'),
'label_online' => psm_get_lang('system', 'online'), 'label_online' => psm_get_lang('system', 'online'),
'label_offline' => psm_get_lang('system', 'offline'), 'label_offline' => psm_get_lang('system', 'offline'),
'label_ok' => psm_get_lang('system', 'ok'),
'label_bad' => psm_get_lang('system', 'bad'),
); );
} }

View File

@ -126,7 +126,7 @@ class Installer {
$this->log('Populating database...'); $this->log('Populating database...');
$queries = array(); $queries = array();
$queries[] = "INSERT INTO `".PSM_DB_PREFIX."servers` (`ip`, `port`, `label`, `type`, `pattern`, `pattern_online`, `status`, `rtime`, `active`, `email`, `sms`, `pushover`, `telegram`) VALUES ('http://sourceforge.net/index.php', 80, 'SourceForge', 'website', '', 'yes','on', '0.0000000', 'yes', 'yes', 'yes', 'yes', 'yes'), ('smtp.gmail.com', 465, 'Gmail SMTP', 'service', '', 'yes', 'on', '0.0000000', 'yes', 'yes', 'yes', 'yes', 'yes')"; $queries[] = "INSERT INTO `".PSM_DB_PREFIX."servers` (`ip`, `port`, `label`, `type`, `pattern`, `pattern_online`, `redirect_check`, `status`, `rtime`, `active`, `email`, `sms`, `pushover`, `telegram`) VALUES ('http://sourceforge.net/index.php', 80, 'SourceForge', 'website', '', 'yes', 'bad', 'on', '0.0000000', 'yes', 'yes', 'yes', 'yes', 'yes'), ('smtp.gmail.com', 465, 'Gmail SMTP', 'service', '', 'yes', 'bad','on', '0.0000000', 'yes', 'yes', 'yes', 'yes', 'yes')";
$queries[] = "INSERT INTO `".PSM_DB_PREFIX."users_servers` (`user_id`,`server_id`) VALUES (1, 1), (1, 2);"; $queries[] = "INSERT INTO `".PSM_DB_PREFIX."users_servers` (`user_id`,`server_id`) VALUES (1, 1), (1, 2);";
$queries[] = "INSERT INTO `".PSM_DB_PREFIX."config` (`key`, `value`) VALUE $queries[] = "INSERT INTO `".PSM_DB_PREFIX."config` (`key`, `value`) VALUE
('language', 'en_US'), ('language', 'en_US'),
@ -230,6 +230,7 @@ class Installer {
`type` enum('ping','service','website') NOT NULL default 'service', `type` enum('ping','service','website') NOT NULL default 'service',
`pattern` varchar(255) NOT NULL default '', `pattern` varchar(255) NOT NULL default '',
`pattern_online` enum('yes','no') NOT NULL default 'yes', `pattern_online` enum('yes','no') NOT NULL default 'yes',
`redirect_check` enum('ok','bad') NOT NULL default 'bad',
`allow_http_status` varchar(255) NOT NULL default '', `allow_http_status` varchar(255) NOT NULL default '',
`header_name` varchar(255) NOT NULL default '', `header_name` varchar(255) NOT NULL default '',
`header_value` varchar(255) NOT NULL default '', `header_value` varchar(255) NOT NULL default '',
@ -554,11 +555,18 @@ class Installer {
*/ */
protected function upgrade340() { protected function upgrade340() {
$queries = array(); $queries = array();
/**
* Redirect_check is first set to default ok.
* If you have a lot of server that are redirecting,
* this will make sure you're servers stay online.
*/
$queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `allow_http_status` VARCHAR(255) NOT NULL DEFAULT '' AFTER `pattern_online`;";
$queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD `redirect_check` ENUM( 'ok','bad' ) NOT NULL DEFAULT 'ok' AFTER `allow_http_status`;";
$queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` CHANGE `redirect_check` `redirect_check` ENUM('ok','bad') NOT NULL DEFAULT 'bad';";
$queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `last_error` VARCHAR(255) NULL AFTER `website_password`;"; $queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `last_error` VARCHAR(255) NULL AFTER `website_password`;";
$queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `last_error_output` TEXT NULL AFTER `last_error`;"; $queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `last_error_output` TEXT NULL AFTER `last_error`;";
$queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `last_output` TEXT NULL AFTER `last_error_output`;"; $queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `last_output` TEXT NULL AFTER `last_error_output`;";
$queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `request_method` varchar(50) NULL AFTER `port`;"; $queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `request_method` varchar(50) NULL AFTER `port`;";
$queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ADD COLUMN `allow_http_status` VARCHAR(255) NOT NULL DEFAULT '' AFTER `pattern_online`;";
$this->execSQL($queries); $this->execSQL($queries);
} }
} }

View File

@ -88,7 +88,7 @@ class StatusUpdater {
$this->server = $this->db->selectRow(PSM_DB_PREFIX.'servers', array( $this->server = $this->db->selectRow(PSM_DB_PREFIX.'servers', array(
'server_id' => $server_id, 'server_id' => $server_id,
), array( ), array(
'server_id', 'ip', 'port', 'request_method', 'label', 'type', 'pattern', 'pattern_online', 'allow_http_status', 'header_name', 'header_value', 'status', 'active', 'warning_threshold', 'server_id', 'ip', 'port', 'request_method', 'label', 'type', 'pattern', 'pattern_online', 'allow_http_status', 'redirect_check', 'header_name', 'header_value', 'status', 'active', 'warning_threshold',
'warning_threshold_counter', 'timeout', 'website_username', 'website_password', 'last_offline' 'warning_threshold_counter', 'timeout', 'website_username', 'website_password', 'last_offline'
)); ));
if (empty($this->server)) { if (empty($this->server)) {
@ -272,7 +272,7 @@ class StatusUpdater {
} else { } else {
$result = true; $result = true;
//Okay, the HTTP status is good : 2xx or 3xx. Now we have to test the pattern if it's set up // Okay, the HTTP status is good : 2xx or 3xx. Now we have to test the pattern if it's set up
if ($this->server['pattern'] != '') { if ($this->server['pattern'] != '') {
// Check to see if the body should not contain specified pattern // Check to see if the body should not contain specified pattern
// Check to see if the pattern was [not] found. // Check to see if the pattern was [not] found.
@ -284,6 +284,18 @@ class StatusUpdater {
} }
} }
// Check if the website redirects to another domain
if ($this->server['redirect_check'] == 'bad'){
$location_matches = array();
preg_match('/(Location: )(https*:\/\/)([a-zA-Z.:0-9]*)([\/][[:alnum:][:punct:]]*)/', $curl_result, $location_matches);
$ip_matches = array();
preg_match('/(https*:\/\/)([a-zA-Z.:0-9]*)([\/][[:alnum:][:punct:]]*)/', $this->server['ip'], $ip_matches);
if($location_matches[3] !== $ip_matches[2]){
$this->error = "The IP/URL redirects to another domain.";
$result = false;
}
}
// Should we check a header ? // Should we check a header ?
if ($this->server['header_name'] != '' && $this->server['header_value'] != '') { if ($this->server['header_name'] != '' && $this->server['header_value'] != '') {
$header_flag = false; $header_flag = false;

View File

@ -101,6 +101,15 @@
</div> </div>
</div> </div>
<div class="control-group types typeWebsite"> <div class="control-group types typeWebsite">
<label class="control-label" for="redirect_check">{{ label_redirect_check }}</label>
<div class="controls">
<select id="redirect_check" name="redirect_check" data-toggle="tooltip" title="{{ label_redirect_check_description}}">
<option value="ok" {{ edit_redirect_check_selected_ok|raw }}>{{ label_ok }}</option>
<option value="bad" {{ edit_redirect_check_selected_bad|raw }}>{{ label_bad }}</option>
</select>
</div>
</div>
<div class="control-group types typeWebsite">
<label class="control-label" for="allow_http_status">{{ label_allow_http_status }}</label> <label class="control-label" for="allow_http_status">{{ label_allow_http_status }}</label>
<div class="controls"> <div class="controls">
<input type="text" id="allow_http_status" name="allow_http_status" value="{{ edit_value_allow_http_status }}" maxlength="255" data-toggle="tooltip" title="{{ label_allow_http_status_description }}" /> <input type="text" id="allow_http_status" name="allow_http_status" value="{{ edit_value_allow_http_status }}" maxlength="255" data-toggle="tooltip" title="{{ label_allow_http_status_description }}" />