Only in .: globalredirect-6.x-1.2-304025.patch Only in .: globalredirect-6.x-1.2-304025.path diff -urp ../globalredirect.old/globalredirect.admin.inc ./globalredirect.admin.inc --- ../globalredirect.old/globalredirect.admin.inc 2008-12-22 10:42:06.000000000 +0000 +++ ./globalredirect.admin.inc 2010-03-22 11:44:44.000000000 +0000 @@ -61,7 +61,7 @@ function globalredirect_settings() { $form['globalredirect_case_sensitive_urls'] = array( '#type' => 'radios', '#title' => t('Case Sensitive URL Checking'), - '#description' => t('If enabled, the module will compae 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.'), + '#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'), @@ -69,6 +69,14 @@ function globalredirect_settings() { '#default_value' => variable_get('globalredirect_case_sensitive_urls', GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED), ); + $form['globalredirect_base_path'] = array( + '#type' => 'textfield', + '#title' => t('Drupal Base Path'), + '#description' => t('If Drupal is installed in a subdirectory beneath the web server document root, specify that directory here. Value should start and end with a forward slash, e.g /drupal/, except in the default installation / (a single slash)'), + '#default_value' => variable_get('globalredirect_base_path', (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '/' : dirname($_SERVER['SCRIPT_NAME']) . '/' )), + '#size' => 30, + ); + return system_settings_form($form); } diff -urp ../globalredirect.old/globalredirect.install ./globalredirect.install --- ../globalredirect.old/globalredirect.install 2008-12-22 10:34:32.000000000 +0000 +++ ./globalredirect.install 2010-03-22 11:41:42.000000000 +0000 @@ -11,9 +11,18 @@ function globalredirect_uninstall() { variable_del('globalredirect_trailingzero'); variable_del('globalredirect_nonclean2clean'); variable_del('globalredirect_case_sensitive_urls'); + variable_del('globalredirect_base_path'); } +/** + * If Drupal is installed in the document root of the web server, set base path to /, else to directory of installation, e.g. /drupal/ + */ +function globalredirect_install() { + // dirname will return "/" in most cases (if Drupal installed in document root, otherwise, a slash is needed on the end) + variable_set('globalredirect_base_path', (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '/' : dirname($_SERVER['SCRIPT_NAME']) . '/' )); +} + function globalredirect_update_6100() { $deslash = variable_get('globalredirect_deslah', NULL); $ret = array(); diff -urp ../globalredirect.old/globalredirect.module ./globalredirect.module --- ../globalredirect.old/globalredirect.module 2008-12-22 10:34:32.000000000 +0000 +++ ./globalredirect.module 2010-03-22 11:40:13.000000000 +0000 @@ -42,7 +42,9 @@ function globalredirect_init() { * the Ad Module which had its own script in its folder doing a bootstrap which invoked hook_init and caused some banners to get "cleaned up" * See issues: http://drupal.org/node/205810 and http://drupal.org/node/278615 */ - if ($_SERVER['SCRIPT_NAME'] != $GLOBALS['base_path'] .'index.php') return FALSE; +// if ($_SERVER['SCRIPT_NAME'] != $GLOBALS['base_path'] .'cms/index.php') return FALSE; + $base_path = variable_get('globalredirect_base_path', $GLOBALS['base_path']); + if ($_SERVER['SCRIPT_NAME'] != $base_path.'index.php') return false; /** * If the site is in offline mode there is little point doing any of this as you might end up redirecting to a 503.