Index: globalredirect.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/globalredirect/globalredirect.module,v
retrieving revision 1.1.2.4.2.5.2.14
diff -u -r1.1.2.4.2.5.2.14 globalredirect.module
--- globalredirect.module	22 Dec 2008 10:34:32 -0000	1.1.2.4.2.5.2.14
+++ globalredirect.module	13 Feb 2009 19:54:11 -0000
@@ -5,21 +5,9 @@
  * @file
  * The Global Redirect module redirects for all paths which have aliases but are not using the aliases which reduces the risk of duplicate content
  */
-
-
-define('GLOBALREDIRECT_FEATURE_DISABLED', -1);
-
 define('GLOBALREDIRECT_TRAILINGZERO_TAXTERM', 1);
 define('GLOBALREDIRECT_TRAILINGZERO_ALL', 2);
 
-define('GLOBALREDIRECT_NONCLEAN2CLEAN_ENABLED', 1);
-
-define('GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED', 1);
-
-define('GLOBALREDIRECT_DESLASH_ENABLED', 1);
-
-define('GLOBALREDIRECT_MENU_CHECK_ENABLED', 1);
-
 /**
  * Implementation of hook_help().
  */
@@ -52,7 +40,7 @@
   /**
    * Use of menu_get_item should be optional as it appears in some situations it causes WSOD's...
    */
-  $menu_check = variable_get('globalredirect_menu_check', GLOBALREDIRECT_FEATURE_DISABLED);
+  $menu_check = variable_get('globalredirect_menu_check', FALSE);
 
 
   /**
@@ -62,13 +50,10 @@
    *   3) If the $_POST is empty. The problem which arises here is if a form posts to an source path rather than the alias. GlobalRedirect sometimes interrupts the post and redirects to the alias instead.
    */
 
-  if (function_exists('drupal_get_path_alias') &&
-      ($menu_check == GLOBALREDIRECT_FEATURE_DISABLED || ($menu_check == GLOBALREDIRECT_MENU_CHECK_ENABLED && function_exists('menu_get_item'))) &&
-      isset($_REQUEST['q']) &&
-      empty($_POST)) {
+  if (function_exists('drupal_get_path_alias') && isset($_REQUEST['q']) && empty($_POST)) {
 
     // If menu checking is enabled, do the check. Feature disabled by default.
-    if ($menu_check == GLOBALREDIRECT_MENU_CHECK_ENABLED) {
+    if ($menu_check && function_exists('menu_get_item')) {
       // Check the access on the current path, return FALSE if access not allowed. This stops redirection for paths without access permission.
       $item = menu_get_item();
       _menu_check_access($item, $item['map']);
@@ -108,18 +93,18 @@
     }
 
     // Trim any trailing slash off the end (eg, 'node/1/' to 'node/1')
-    $redirect_slash = variable_get('globalredirect_deslash', GLOBALREDIRECT_DESLASH_ENABLED) == GLOBALREDIRECT_DESLASH_ENABLED;
+    $redirect_slash = variable_get('globalredirect_deslash', TRUE);
     $request = $redirect_slash ? trim($_GET['q'], '/') : $_GET['q'];
 
     // Optional stripping of "/0". Defaultly disabled
-    switch (variable_get('globalredirect_trailingzero', GLOBALREDIRECT_FEATURE_DISABLED)) {
-      case GLOBALREDIRECT_TRAILINGZERO_TAXTERM :
+    switch (variable_get('globalredirect_trailingzero', FALSE)) {
+      case GLOBALREDIRECT_TRAILINGZERO_TAXTERM:
         // If 'taxonomy/term/*' only. If not, break out.
         if (drupal_substr($request, 0, 14) != 'taxonomy/term/') {
           break;
         }
         // If it is, fall through to general trailing zero method
-      case GLOBALREDIRECT_TRAILINGZERO_ALL :
+      case GLOBALREDIRECT_TRAILINGZERO_ALL:
         // If last 2 characters of URL are /0 then trim them off
         if (drupal_substr($request, -2) == '/0') {
           $request = rtrim($request, '/0');
@@ -134,7 +119,7 @@
     }
 
     // Alias case sensitivity check. If there is an alias from the previous lookup, do a query to test for case.
-    if ($alias && variable_get('globalredirect_case_sensitive_urls', GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED) == GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED) {
+    if ($alias && variable_get('globalredirect_case_sensitive_urls', TRUE)) {
       $alias_sensitive = db_result(db_query("SELECT dst FROM {url_alias} WHERE dst = '%s'", $alias));
       if ($alias_sensitive && $alias != $alias_sensitive) {
         // There is a match and there is a difference in case.
@@ -151,7 +136,7 @@
     }
 
     // If no alias was returned, the final check is to direct non-clean to clean - if clean is enabled
-    if ((variable_get('globalredirect_nonclean2clean', GLOBALREDIRECT_NONCLEAN2CLEAN_ENABLED) == GLOBALREDIRECT_NONCLEAN2CLEAN_ENABLED) && ((bool)variable_get('clean_url', 0)) && strpos(request_uri(), '?q=')) {
+    if (variable_get('globalredirect_nonclean2clean', TRUE) && ((bool)variable_get('clean_url', 0)) && strpos(request_uri(), '?q=')) {
       drupal_goto($request, $query_string, NULL, 301);
     }
 
Index: globalredirect.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/globalredirect/Attic/globalredirect.admin.inc,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 globalredirect.admin.inc
--- globalredirect.admin.inc	22 Dec 2008 11:43:41 -0000	1.1.2.6
+++ globalredirect.admin.inc	13 Feb 2009 19:54:11 -0000
@@ -13,26 +13,18 @@
   $form = array();
 
   $form['globalredirect_deslash'] = array(
-    '#type' => 'radios',
+    '#type' => 'checkbox',
     '#title' => t('Deslash'),
     '#description' => t('If enabled, this option will remove the trailing slash from requests. This stops requests such as <code>example.com/node/1/</code> failing to match the corresponding alias and can cause duplicate content. On the other hand, if you require certain requests to have a trailing slash, this feature can cause problems so may need to be disabled.'),
-    '#options' => array(
-      GLOBALREDIRECT_FEATURE_DISABLED => t('Off'),
-      GLOBALREDIRECT_DESLASH_ENABLED  => t('On'),
-    ),
-    '#default_value' => variable_get('globalredirect_deslash', GLOBALREDIRECT_DESLASH_ENABLED),
+    '#default_value' => variable_get('globalredirect_deslash', TRUE),
   );
 
 
   $form['globalredirect_nonclean2clean'] = array(
-    '#type' => 'radios',
+    '#type' => 'checkbox',
     '#title' => t('Non-clean to Clean'),
     '#description' => t('If enabled, this option will redirect from non-clean to clean URL (if Clean URL\'s are enabled). This will stop, for example, node 1  existing on both <code>example.com/node/1</code> AND <code>example.com?q=node/1</code>.'),
-    '#options' => array(
-      GLOBALREDIRECT_FEATURE_DISABLED => t('Off'),
-      GLOBALREDIRECT_NONCLEAN2CLEAN_ENABLED  => t('On'),
-    ),
-    '#default_value' => variable_get('globalredirect_nonclean2clean', GLOBALREDIRECT_NONCLEAN2CLEAN_ENABLED),
+    '#default_value' => variable_get('globalredirect_nonclean2clean', TRUE),
   );
 
   $form['globalredirect_trailingzero'] = array(
@@ -40,7 +32,7 @@
     '#title' => t('Remove Trailing Zero Argument'),
     '#description' => t('If enabled, any instance of "/0" will be trimmed from the right of the URL. This stops duplicate pages such as "taxonomy/term/1" and "taxonomy/term/1/0" where 0 is the default depth. There is an option of limiting this feature to taxonomy term pages ONLY or allowing it to effect any page. <strong>By default this feature is disabled to avoid any unexpected behaviour</strong>'),
     '#options' => array(
-      GLOBALREDIRECT_FEATURE_DISABLED => t('Disabled'),
+      FALSE => t('Disabled'),
       GLOBALREDIRECT_TRAILINGZERO_TAXTERM => t('Enabled for taxonomy term pages only'),
       GLOBALREDIRECT_TRAILINGZERO_ALL => t('Enabled for all pages'),
     ),
@@ -48,25 +40,17 @@
   );
 
   $form['globalredirect_menu_check'] = array(
-    '#type' => 'radios',
+    '#type' => 'checkbox',
     '#title' => t('Menu Access Checking'),
     '#description' => t('If enabled, the module will check the user has access to the page before redirecting. This helps to stop redirection on protected pages and avoids giving away <em>secret</em> URL\'s. <strong>By default this feature is disabled to avoid any unexpected behaviour</strong>'),
-    '#options' => array(
-      GLOBALREDIRECT_FEATURE_DISABLED => t('Disabled'),
-      GLOBALREDIRECT_MENU_CHECK_ENABLED => t('Enabled'),
-    ),
-    '#default_value' => variable_get('globalredirect_menu_check', GLOBALREDIRECT_FEATURE_DISABLED),
+    '#default_value' => variable_get('globalredirect_menu_check', FALSE),
   );
 
   $form['globalredirect_case_sensitive_urls'] = array(
-    '#type' => 'radios',
+    '#type' => 'checkbox',
     '#title' => t('Case Sensitive URL Checking'),
     '#description' => t('If enabled, the module will compare the current URL to the alias stored in the system. If there are any differences in case then the user will be redirected to the correct URL.'),
-    '#options' => array(
-      GLOBALREDIRECT_FEATURE_DISABLED => t('Disabled'),
-      GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED => t('Enabled'),
-    ),
-    '#default_value' => variable_get('globalredirect_case_sensitive_urls', GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED),
+    '#default_value' => variable_get('globalredirect_case_sensitive_urls', TRUE),
   );
 
   return system_settings_form($form);
