diff --git a/inc/ip_path_access_admin.inc b/inc/ip_path_access_admin.inc index 4f57bac..9d2b4cc 100644 --- a/inc/ip_path_access_admin.inc +++ b/inc/ip_path_access_admin.inc @@ -23,6 +23,7 @@ $rows = array(); $header = array( + array('data' => t('Title')), array('data' => t('Path Alias')), array('data' => t('Normalized Path'), 'field' => 'path', 'sort' => 'ASC'), array('data' => t('Allowed IP Address'), 'field' => 'ip', 'sort' => 'ASC'), @@ -41,6 +42,7 @@ foreach ($query as $ip) { $rows[] = array( + $ip->title, drupal_get_path_alias($ip->path), $ip->path, $ip->ip, @@ -140,6 +142,12 @@ '#type' => 'markup', '#markup' => '

' . t('Restrict Path on IP') . '

', ); + $form['ip_path_rule'] = array( + '#title' => t('Title'), + '#type' => 'textfield', + '#size' => 60, + '#maxlength' => 128, + ); $form['ip'] = array( '#title' => t('IP address'), '#type' => 'textfield', @@ -221,6 +229,7 @@ variable_set('ip_path_access_og_bypass_enabled', $form_state['values']['og_bypass']); } + $title = trim($form_state['values']['ip_path_rule']); $ip = trim($form_state['values']['ip']); $path = trim($form_state['values']['path']); @@ -228,7 +237,7 @@ if ($ip != '') { $ip = str_replace(' ', '', $ip); db_insert('ip_path_access') - ->fields(array('ip' => $ip, 'path' => drupal_get_normal_path($path))) + ->fields(array('title' => $title, 'ip' => $ip, 'path' => drupal_get_normal_path($path))) ->execute(); drupal_set_message( t( diff --git a/ip_path_access.install b/ip_path_access.install index a2b8ada..3b9c3ec 100644 --- a/ip_path_access.install +++ b/ip_path_access.install @@ -18,6 +18,13 @@ 'unsigned' => TRUE, 'not null' => TRUE, ), + 'title' => array( + 'description' => 'The descriptive title of the IP Path Access rule', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), 'ip' => array( 'description' => 'An IP address', 'type' => 'varchar',