Index: swfaddress.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/swfaddress/Attic/swfaddress.admin.inc,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 swfaddress.admin.inc --- swfaddress.admin.inc 11 Nov 2009 16:18:19 -0000 1.1.2.2 +++ swfaddress.admin.inc 7 May 2010 14:55:51 -0000 @@ -19,6 +19,13 @@ function swfaddress_admin_form() { '#default_value' => variable_get('swfaddress_send_aliases', TRUE) ); + $form['swfaddress_admin_disable'] = array( + '#type' => 'checkbox', + '#title' => t('Disable if logged in as superuser'), + '#description' => t('If checked this will turn off Flash replacement if logged as superuser'), + '#default_value' => variable_get('swfaddress_admin_disable', FALSE) + ); + $form['swf_options'] = array( '#type' => 'fieldset', '#title' => t('SWF File Settings'), Index: swfaddress.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/swfaddress/swfaddress.module,v retrieving revision 1.2.4.4 diff -u -p -r1.2.4.4 swfaddress.module --- swfaddress.module 10 Nov 2009 22:34:22 -0000 1.2.4.4 +++ swfaddress.module 7 May 2010 14:55:51 -0000 @@ -37,6 +37,7 @@ module_load_include('inc', 'swfaddress', function swfaddress_init() { $base = _swfaddress_base_path(); $path = $_SERVER['QUERY_STRING']; + global $user; // We must use $_SERVER['QUERY_STRING'] , which will sometimes come back as 'q=aliased_path/&/drupal_base_path/system_path'. // This will let us strip that down to the basic URL that we need to send to SWFAddress. @@ -77,7 +78,9 @@ function swfaddress_init() { // Converted from the old hook_menu($may_cache) by chok. if (variable_get('swfaddress_replacement_enabled', FALSE) && variable_get('clean_url', 0) == 1 - && _swfaddress_path_permitted()) { + && _swfaddress_path_permitted() + && user_access('swfaddress enabled') + && ($user->uid != 1 || !variable_get('swfaddress_admin_disable', FALSE))) { // It is vitally important that swfobject.js be included before SWFAddress! drupal_add_js(drupal_get_path('module', 'swfaddress') .'/swfobject/swfobject.js', 'module'); drupal_add_js(drupal_get_path('module', 'swfaddress') . _swfaddress_optimizer('/swfaddress-2.4/js/swfaddress-optimizer.js?'), 'module', 'header', FALSE, TRUE, FALSE); @@ -152,7 +155,10 @@ function swfaddress_help($path="", $arg= * Implementation of hook_perm(). */ function swfaddress_perm() { - $permissions = array('administer swfaddress'); + $permissions = array( + 'administer swfaddress', + 'swfaddress enabled' + ); return $permissions; }