summaryrefslogtreecommitdiff
path: root/modules/system/system.admin.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-01-18 17:08:20 +0000
committerDries Buytaert <dries@buytaert.net>2010-01-18 17:08:20 +0000
commite7b9ad7676f1aa5fe33e1910bf39f27877a3e9c7 (patch)
tree7e3d4103bc0ae4ca3902d854aa00ffaec78f96cf /modules/system/system.admin.inc
parent36e33b75d5bc991a085755444d20b510b7ff9e1d (diff)
downloadbrdo-e7b9ad7676f1aa5fe33e1910bf39f27877a3e9c7.tar.gz
brdo-e7b9ad7676f1aa5fe33e1910bf39f27877a3e9c7.tar.bz2
- Patch #678504 by heyrocker, David_Rothstein: incorrect menu argument for ip address blocking.
Diffstat (limited to 'modules/system/system.admin.inc')
-rw-r--r--modules/system/system.admin.inc12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 2fe7b5cc5..9e58b25f3 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1390,8 +1390,12 @@ function system_modules_uninstall_submit($form, &$form_state) {
/**
* Menu callback. Display blocked IP addresses.
+ *
+ * @param $default_ip
+ * Optional IP address to be passed on to drupal_get_form() for
+ * use as the default value of the IP address form field.
*/
-function system_ip_blocking() {
+function system_ip_blocking($default_ip = '') {
$output = '';
$rows = array();
$header = array(t('IP address'), t('Operations'));
@@ -1403,7 +1407,7 @@ function system_ip_blocking() {
);
}
- $build['system_ip_blocking_form'] = drupal_get_form('system_ip_blocking_form');
+ $build['system_ip_blocking_form'] = drupal_get_form('system_ip_blocking_form', $default_ip);
$build['system_ip_blocking_table'] = array(
'#theme' => 'table',
@@ -1421,13 +1425,13 @@ function system_ip_blocking() {
* @see system_ip_blocking_form_validate()
* @see system_ip_blocking_form_submit()
*/
-function system_ip_blocking_form($form, $form_state) {
+function system_ip_blocking_form($form, $form_state, $default_ip) {
$form['ip'] = array(
'#title' => t('IP address'),
'#type' => 'textfield',
'#size' => 64,
'#maxlength' => 32,
- '#default_value' => arg(4),
+ '#default_value' => $default_ip,
'#description' => t('Enter a valid IP address.'),
);
$form['submit'] = array(