--- gotwo.module
+++ (clipboard)
@@ -52,8 +52,16 @@
  */
 function gotwo_menu($may_cache) {
   $items = array();
-
   if ($may_cache) {
+		$items[] = array(
+	    'path' => 'admin/settings/gotwo',
+	    'title' => t('Go Two'),
+	    'description' => t('Configure how gotwo works.'),
+	    'callback' => 'drupal_get_form',
+	    'callback arguments' => array('gotwo_admin_settings'),
+	    'access' => user_access('administer site configuration'),
+	    'type' => MENU_NORMAL_ITEM,
+	  );
     $items[] = array(
       'path' => 'go', 
       'callback' => '__gotwo_do_redir',
@@ -63,7 +71,8 @@
     $items[] = array(
       'title' => 'Go list',
       'path' => 'admin/build/gotwo', 
-      'callback' => '__gotwo_list',
+      'description' => t('Create new gotwo urls.'),
+			'callback' => '__gotwo_list',
       'access' => user_access('view entry list'),
     );
     $items[] = array(
@@ -98,7 +107,7 @@
 }
 
 function gotwo_perm() {
-  return array('view entry list', 'edit entries');
+  return array('view entry list', 'edit entries', 'administer site configuration');
 }
 
 /**
@@ -108,30 +117,29 @@
   $args = func_get_args();
   $src = implode("/", $args);
 
-  // $src may be an Go ID or a source attribute
+  // $src may be a Go ID or a source attribute
   $res = db_fetch_object(db_query("SELECT * FROM {gotwo} WHERE src = '%s' OR gid = '%d'", $src, intval($src)));
 
   if (!$res) {
     drupal_not_found();
-  }
-  else {
+  } elseif (variable_get('gotwo_disclaimer_boolean','FALSE')) {
     	db_query("UPDATE {gotwo} SET cnt = cnt+1 WHERE gid = '%d'", $res->gid);
-    if (!variable_get('gotwo_disclaimer_boolean','FALSE')) {
+    //if (!variable_get('gotwo_disclaimer_boolean','FALSE')) {
     	//Display the Disclaimer
-	$disclaimer_text = variable_get('gotwo_disclaimer_text','');
-	$find_array = array('%url','%seconds');
-	$replace_array = array($res->dst,variable_get('gotwo_disclaimer_time',0));
-	$page_content = str_replace($find_array, $replace_array,$disclaimer_text);
+			$disclaimer_text = variable_get('gotwo_disclaimer_text','');
+			$find_array = array('%url','%seconds');
+			$replace_array = array($res->dst,variable_get('gotwo_disclaimer_time',0));
+			$page_content = str_replace($find_array, $replace_array,$disclaimer_text);
 	
-	//Should we refresh? 
-	if (variable_get('gotwo_disclaimer_time',0) > 0 ) {
-		drupal_set_html_head('<meta http-equiv="refresh" content="'.variable_get('gotwo_disclaimer_time',0).';url='.$res->dst.'"/>');
-	}
-	return $page_content;
+			//Should we refresh? 
+			if (variable_get('gotwo_disclaimer_time',0) > 0 ) {
+				drupal_set_html_head('<meta http-equiv="refresh" content="'.variable_get('gotwo_disclaimer_time',0).';url=/'.$res->dst.'"/>');
+			}
+			return $page_content;
     } else {
     	drupal_goto($res->dst);
     	exit();
-    }
+   // }
   }
 }
 
@@ -299,7 +307,16 @@
 /**
  * Implementation of hook_settings
  */
+
+
 function gotwo_admin_settings() {
+//	if (!user_access('administer gotwo')) {
+//	  $form["error"] = array('#type' => 'item',
+//	    '#title' => t('You are not authorized to access the gotwo settings.'));
+//	  return system_settings_form($form);
+//	}
+	
+	
   $form['gotwo_numeric'] = array(
     '#type' => 'checkbox',
     '#title' => t('Numerical urls'),
@@ -339,6 +356,8 @@
   return system_settings_form($form);
 }
 
+
+
 /**
  * shows the list of go entries
  */
@@ -362,8 +381,8 @@
     $rows[$i] = array('data' =>
       array(
         $go->gid,
-        $go->src,
-        $go->dst,
+        l($go->src, 'go/'.$go->src),
+        l($go->dst, $go->dst),
         $go->cnt
       )
     );
@@ -404,7 +423,7 @@
   $res = db_fetch_object(db_query('SELECT * FROM {gotwo} WHERE gid = %d', $gid));
   $form['gid'] = array('#type' => 'value', '#value' => $gid);
   return confirm_form( $form,
-    t('Are you sure you want to remove the go entry with the label %label ?', array('%label' => theme('placeholder', $res->src))), 
+    t('Are you sure you want to remove the go entry with the label !label ?', array('!label' => theme('placeholder', $res->src))), 
     'admin/build/gotwo', t('This action cannot be undone. The link will become broken, a new one might be automatically created when a node linking to it is edited.'),
     t('Delete'), t('Cancel'));
 }
@@ -422,9 +441,19 @@
 
 /**
  * Manually add a go entry
+ * Build go add page
  */
 function __gotwo_manual_add() {
   drupal_set_title('Add go entry');
+  return drupal_get_form('__gotwo_manual_add_form', $form);
+}
+
+/**
+ * Manually add a go entry
+ * Build go add form
+ */
+function __gotwo_manual_add_form() {
+  drupal_set_title('Add go entry');
   $form['src'] = array(
     '#type' => 'textfield',
     '#title' => t('Label'),
@@ -441,13 +470,13 @@
     '#type' => 'submit',
     '#value' => t('Add'),
   );
-  return drupal_get_form('__gotwo_manual_add', $form);
+	return $form;
 }
 
 /**
  * Go entry submitted
  */
-function __gotwo_manual_add_submit($form_id, $form_values) {
+function __gotwo_manual_add_form_submit($form_id, $form_values) {
   $res = gotwo_get($form_values['dst'], $form_values['src']);
   return 'admin/build/gotwo';
 }
