| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
* @file
|
| 5 |
* Provides the administration page for PHPIDS module.
|
| 6 |
*/
|
| 7 |
|
| 8 |
/*
|
| 9 |
* Callback function to configure PHPIDS
|
| 10 |
*/
|
| 11 |
function phpids_admin_settings() {
|
| 12 |
// general settings
|
| 13 |
$form['general'] = array(
|
| 14 |
'#type' => 'fieldset',
|
| 15 |
'#title' => t('General'),
|
| 16 |
);
|
| 17 |
$form['general']['phpids_path'] = array(
|
| 18 |
'#type' => 'textfield',
|
| 19 |
'#title' => t('PHP-IDS Path'),
|
| 20 |
'#default_value' => variable_get('phpids_path',realpath(dirname(__FILE__))),
|
| 21 |
'#description' => t('Defines path to the PHP-IDS. Excample: /usr/share/php/phpids/lib'),
|
| 22 |
);
|
| 23 |
$form['general']['phpids_tmppath'] = array(
|
| 24 |
'#type' => 'textfield',
|
| 25 |
'#title' => t('PHP-IDS Temp Path'),
|
| 26 |
'#default_value' => variable_get('phpids_tmppath',ini_get('upload_tmp_dir'). 'phpids'),
|
| 27 |
'#description' => t('Defines temp path used by PHP-IDS. Excample: /tmp/phpids'),
|
| 28 |
);
|
| 29 |
$form['general']['phpids_maillevel'] = array(
|
| 30 |
'#type' => 'textfield',
|
| 31 |
'#title' => t('Mail impact'),
|
| 32 |
'#default_value' => variable_get('phpids_maillevel',9),
|
| 33 |
'#description' => t('Sends out mail when this level of impact is reached.'),
|
| 34 |
);
|
| 35 |
$form['general']['phpids_mail'] = array(
|
| 36 |
'#type' => 'textfield',
|
| 37 |
'#title' => t('Email'),
|
| 38 |
'#default_value' => variable_get('phpids_mail',''),
|
| 39 |
'#description' => t("Leave empty if you don't want to send out email"),
|
| 40 |
);
|
| 41 |
$form['general']['phpids_warnlevel'] = array(
|
| 42 |
'#type' => 'textfield',
|
| 43 |
'#title' => t('Warning impact'),
|
| 44 |
'#default_value' => variable_get('phpids_warnlevel',27),
|
| 45 |
'#description' => t('Redirects to a warning page after this level of impact is reached.'),
|
| 46 |
);
|
| 47 |
// finetine filter settings
|
| 48 |
$form['filters'] = array(
|
| 49 |
'#type' => 'fieldset',
|
| 50 |
'#title' => t('Ignore filters'),
|
| 51 |
'#description' => t("Finetune settings when PHPIDS shouldn't take action. Keep in mind that user 1 is always ignored and anonymous users are always monitored!"),
|
| 52 |
);
|
| 53 |
$options_anon = array(1 => t('Log anonymous users without actions'), 2 => t('Log anonymous users and take actions'));
|
| 54 |
$form['filters']['phpids_anonymous'] = array(
|
| 55 |
'#type' => 'select',
|
| 56 |
'#title' => t('Anonymous users'),
|
| 57 |
'#description' => t('Choose a setting for anonymous users.'),
|
| 58 |
'#default_value' => variable_get('phpids_anonymous',1),
|
| 59 |
'#options' => $options_anon,
|
| 60 |
);
|
| 61 |
$options_auth = array(1 => t('Do not log authenticated users'), 2 => t('Log authenticated users without actions'), 3 => t('Log authenticated users and take actions'));
|
| 62 |
$form['filters']['phpids_authenticated'] = array(
|
| 63 |
'#type' => 'select',
|
| 64 |
'#title' => t('Authenticated users'),
|
| 65 |
'#description' => t('Choose a setting for authenticated users.'),
|
| 66 |
'#default_value' => variable_get('phpids_authenticated',2),
|
| 67 |
'#options' => $options_auth,
|
| 68 |
);
|
| 69 |
|
| 70 |
return system_settings_form($form);
|
| 71 |
}
|
| 72 |
|
| 73 |
?>
|