From deb1dafd543e66e44dc0cc1790f204c441e52ab6 Mon Sep 17 00:00:00 2001 From: Bob Vincent Date: Thu, 6 Oct 2011 11:57:51 -0400 Subject: [PATCH] Issue #697946 by scor, pillarsdotnet: Deprecate the use of module_load_include() and remove its usage from core. --- includes/form.inc | 6 +++- includes/module.inc | 33 ++++++++++++++++++++++------- modules/dashboard/dashboard.module | 2 +- modules/field/field.module | 2 +- modules/forum/forum.admin.inc | 2 +- modules/image/image.module | 2 +- modules/image/image.test | 2 +- modules/node/node.module | 4 +- modules/openid/openid.module | 16 +++++++------- modules/openid/openid.test | 2 +- modules/openid/tests/openid_test.install | 2 +- modules/openid/tests/openid_test.module | 4 +- modules/simpletest/tests/module.test | 2 +- modules/system/system.updater.inc | 2 +- modules/update/update.fetch.inc | 2 +- modules/update/update.install | 2 +- modules/update/update.manager.inc | 6 ++-- modules/update/update.module | 8 +++--- modules/update/update.report.inc | 2 +- modules/user/user.admin.inc | 2 +- modules/user/user.api.php | 4 +- modules/user/user.module | 4 +- 22 files changed, 65 insertions(+), 46 deletions(-) diff --git a/includes/form.inc b/includes/form.inc index 8c3b14ab4b2329035b4e3a5114d62f69e20c1f3c..d25fdb716e61a3afbf507b9232357dc3849c6ef0 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -498,7 +498,7 @@ function form_get_cache($form_build_id, &$form_state) { foreach ($form_state['build_info']['files'] as $file) { if (is_array($file)) { $file += array('type' => 'inc', 'name' => $file['module']); - module_load_include($file['type'], $file['module'], $file['name']); + require_once(drupal_get_path('module', $file['module']) . '/' . $file['name'] . '.' . $file['type']); } elseif (file_exists($file)) { require_once DRUPAL_ROOT . '/' . $file; @@ -597,7 +597,9 @@ function form_load_include(&$form_state, $type, $module, $name = NULL) { } if (!isset($form_state['build_info']['files']["$module:$name.$type"])) { // Only add successfully included files to the form state. - if ($result = module_load_include($type, $module, $name)) { + $path = drupal_get_path('module', $module) . "/$name.$type"; + if (file_exists($path)) { + require_once($path); $form_state['build_info']['files']["$module:$name.$type"] = array( 'type' => $type, 'module' => $module, diff --git a/includes/module.inc b/includes/module.inc index e20e164a173cd3c1cc1603776f7e986fccd3552c..41124a8dced0a48d5a9935526570267de765aff8 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -260,12 +260,19 @@ function module_load_install($module) { // Make sure the installation API is available include_once DRUPAL_ROOT . '/includes/install.inc'; - return module_load_include('install', $module); + $path = drupal_get_path('module', $module) . "/$module.install"; + if (file_exists($path)) { + require_once($path); + return TRUE; + } + return FALSE; } /** * Load a module include file. * + * This function is deprecated and may be removed in future versions. + * * Examples: * @code * // Load node.admin.inc from the node module. @@ -274,9 +281,9 @@ function module_load_install($module) { * module_load_include('inc', 'node', 'content_types'); * @endcode * - * Do not use this function to load an install file, use module_load_install() + * Do not use this function to load an install file; use module_load_install() * instead. Do not use this function in a global context since it requires - * Drupal to be fully bootstrapped, use require_once DRUPAL_ROOT . '/path/file' + * Drupal to be fully bootstrapped; use require_once DRUPAL_ROOT . '/path/file' * instead. * * @param $type @@ -312,7 +319,7 @@ function module_load_include($type, $module, $name = NULL) { function module_load_all_includes($type, $name = NULL) { $modules = module_list(); foreach ($modules as $module) { - module_load_include($type, $module, $name); + require_once(drupal_get_path('module', $module) . "/$name.$type"); } } @@ -605,7 +612,7 @@ function module_hook($module, $hook) { // optional include file registered via hook_hook_info(). $hook_info = module_hook_info(); if (isset($hook_info[$hook]['group'])) { - module_load_include('inc', $module, $module . '.' . $hook_info[$hook]['group']); + require_once(drupal_get_path('module', $module) . '/' . $module . '.' . $hook_info[$hook]['group'] . '.inc'); if (function_exists($function)) { return TRUE; } @@ -651,14 +658,24 @@ function module_implements($hook, $sort = FALSE) { // implementations, that the cache is updated at the end of the request. $implementations['#write_cache'] = TRUE; $hook_info = module_hook_info(); + $group = isset($hook_info[$hook]['group']) ? $hook_info[$hook]['group'] : FALSE; $implementations[$hook] = array(); $list = module_list(FALSE, FALSE, $sort); foreach ($list as $module) { - $include_file = isset($hook_info[$hook]['group']) && module_load_include('inc', $module, $module . '.' . $hook_info[$hook]['group']); + $include_file = FALSE; + if ($group) { + $include_file = drupal_get_path('module', $module) . "/$module.$group.inc"; + if (file_exists($include_file)) { + require_once($include_file); + } + else { + $include_file = FALSE; + } + } // Since module_hook() may needlessly try to load the include file again, // function_exists() is used directly here. if (function_exists($module . '_' . $hook)) { - $implementations[$hook][$module] = $include_file ? $hook_info[$hook]['group'] : FALSE; + $implementations[$hook][$module] = $include_file ? $hook_group : FALSE; } } // Allow modules to change the weight of specific implementations but avoid @@ -672,7 +689,7 @@ function module_implements($hook, $sort = FALSE) { // If this hook implementation is stored in a lazy-loaded file, so include // that file first. if ($group) { - module_load_include('inc', $module, "$module.$group"); + require_once(drupal_get_path('module', $module) . "/$module.$group.inc"); } // It is possible that a module removed a hook implementation without the // implementations cache being rebuilt yet, so we check whether the diff --git a/modules/dashboard/dashboard.module b/modules/dashboard/dashboard.module index 1216cc00c117f7ff2d3372d4466de6ebb9729ee9..4a72f05c2c5d157c31358994a528edc61add579b 100644 --- a/modules/dashboard/dashboard.module +++ b/modules/dashboard/dashboard.module @@ -311,7 +311,7 @@ function dashboard_admin($launch_customize = FALSE) { function dashboard_admin_blocks() { global $theme_key; drupal_theme_initialize(); - module_load_include('inc', 'block', 'block.admin'); + require_once(drupal_get_path('module', 'block') . '/block.admin.inc'); // Prepare the blocks for the current theme, and remove those that are // currently displayed in non-dashboard regions. diff --git a/modules/field/field.module b/modules/field/field.module index f04c39c0cab95cf1205c4deacb77f05af85e166d..3087688edd228f1cce07715839bec1c713626494 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -372,7 +372,7 @@ function field_cron() { * Implements hook_modules_uninstalled(). */ function field_modules_uninstalled($modules) { - module_load_include('inc', 'field', 'field.crud'); + require_once(drupal_get_path('module', 'field') . '/field.crud.inc'); foreach ($modules as $module) { // TODO D7: field_module_delete is not yet implemented // field_module_delete($module); diff --git a/modules/forum/forum.admin.inc b/modules/forum/forum.admin.inc index 49c71d90a0bf6c572ffec2b2399f9c8cb592c311..7681f0a5ded9ddcd9423bfa96ccd78ac9ca09393 100644 --- a/modules/forum/forum.admin.inc +++ b/modules/forum/forum.admin.inc @@ -235,7 +235,7 @@ function forum_admin_settings($form) { * Returns an overview list of existing forums and containers */ function forum_overview($form, &$form_state) { - module_load_include('inc', 'taxonomy', 'taxonomy.admin'); + require_once(drupal_get_path('module', 'taxonomy', 'taxonomy.admin.inc')); $vid = variable_get('forum_nav_vocabulary', ''); $vocabulary = taxonomy_vocabulary_load($vid); diff --git a/modules/image/image.module b/modules/image/image.module index 9e1c57ead92d8d0b718ceec4ce714bbda1b7fdab..146fe3101d4f65f0b451ecc3d988541e918c7faa 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -1113,7 +1113,7 @@ function image_effect_delete($effect) { * TRUE on success. FALSE if unable to perform the image effect on the image. */ function image_effect_apply($image, $effect) { - module_load_include('inc', 'image', 'image.effects'); + require_once(drupal_get_path('module', 'image') . '/image.effects.inc'); $function = $effect['effect callback']; if (function_exists($function)) { return $function($image, $effect['data']); diff --git a/modules/image/image.test b/modules/image/image.test index 8596d66804048e25b570c77f1964801863e5ad41..61b225363233353c1f1a8aeef68e9e8460e5f1ca 100644 --- a/modules/image/image.test +++ b/modules/image/image.test @@ -229,7 +229,7 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase { function setUp() { parent::setUp('image_test'); - module_load_include('inc', 'image', 'image.effects'); + require_once(drupal_get_path('module', 'image', 'image.effects.inc')); } /** diff --git a/modules/node/node.module b/modules/node/node.module index 0c3cfb7a006279b66b78ff03b76ba42e03477077..9bdb81101f8d76218e72f78cb34bc9d6c194a0f8 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1732,7 +1732,7 @@ function node_user_cancel($edit, $account, $method) { switch ($method) { case 'user_cancel_block_unpublish': // Unpublish nodes (current revisions). - module_load_include('inc', 'node', 'node.admin'); + require_once(drupal_get_path('module', 'node') . '/node.admin.inc'); $nodes = db_select('node', 'n') ->fields('n', array('nid')) ->condition('uid', $account->uid) @@ -1743,7 +1743,7 @@ function node_user_cancel($edit, $account, $method) { case 'user_cancel_reassign': // Anonymize nodes (current revisions). - module_load_include('inc', 'node', 'node.admin'); + require_once(drupal_get_path('module', 'node') . '/node.admin.inc'); $nodes = db_select('node', 'n') ->fields('n', array('nid')) ->condition('uid', $account->uid) diff --git a/modules/openid/openid.module b/modules/openid/openid.module index 2bf891ab69ac116dfa555223c24893e9c5d8d4d0..fd3d65e1fc1687f409bfdb29f99303bc7660fad9 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -181,7 +181,7 @@ function _openid_user_login_form_alter(&$form, &$form_state) { */ function openid_form_user_register_form_alter(&$form, &$form_state) { if (isset($_SESSION['openid']['response'])) { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); $response = $_SESSION['openid']['response']; @@ -254,7 +254,7 @@ function openid_login_validate($form, &$form_state) { * @param $return_to The endpoint to return to from the OpenID Provider */ function openid_begin($claimed_id, $return_to = '', $form_values = array()) { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); $service = NULL; $claimed_id = openid_normalize($claimed_id); @@ -321,7 +321,7 @@ function openid_begin($claimed_id, $return_to = '', $form_values = array()) { * $response['status'] set to one of 'success', 'failed' or 'cancel'. */ function openid_complete($response = array()) { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); if (count($response) == 0) { $response = _openid_response(); @@ -406,7 +406,7 @@ function openid_complete($response = array()) { * found, FALSE is returned. */ function openid_discovery($claimed_id) { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); $methods = module_invoke_all('openid_discovery_method_info'); drupal_alter('openid_discovery_method_info', $methods); @@ -583,7 +583,7 @@ function openid_openid_normalization_method_info() { * @return $assoc_handle The association handle. */ function openid_association($op_endpoint) { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); // Remove Old Associations: db_delete('openid_association') @@ -708,7 +708,7 @@ function openid_authentication($response) { } function openid_association_request($public) { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); $request = array( 'openid.ns' => OPENID_NS_2_0, @@ -728,7 +728,7 @@ function openid_association_request($public) { function openid_authentication_request($claimed_id, $identity, $return_to = '', $assoc_handle = '', $service) { global $base_url; - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); $request = array( 'openid.mode' => 'checkid_setup', @@ -790,7 +790,7 @@ function openid_authentication_request($claimed_id, $identity, $return_to = '', * @see http://openid.net/specs/openid-authentication-2_0.html#rfc.section.11.4 */ function openid_verify_assertion($service, $response) { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); // http://openid.net/specs/openid-authentication-2_0.html#rfc.section.11.3 // Check the Nonce to protect against replay attacks. diff --git a/modules/openid/openid.test b/modules/openid/openid.test index d873c32433747aa377dc6cc10730bedc0842a8ab..6f3a74bbd8e64db0af120350fb2973bc53b7dc28 100644 --- a/modules/openid/openid.test +++ b/modules/openid/openid.test @@ -549,7 +549,7 @@ class OpenIDUnitTest extends DrupalWebTestCase { function setUp() { parent::setUp('openid'); - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); } /** diff --git a/modules/openid/tests/openid_test.install b/modules/openid/tests/openid_test.install index 3bd4978f1a2eeeb0da9331fdeebfb0dc94744abe..3dbf7ce99204cf737ec452b3b7137c7192297a92 100644 --- a/modules/openid/tests/openid_test.install +++ b/modules/openid/tests/openid_test.install @@ -9,7 +9,7 @@ * Implements hook_install(). */ function openid_test_install() { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); // Generate a MAC key (Message Authentication Code) used for signing messages. // The variable is base64-encoded, because variables cannot contain non-UTF-8 // data. diff --git a/modules/openid/tests/openid_test.module b/modules/openid/tests/openid_test.module index 629dcd3356a59023591f2be7518f64e6ba69d65d..325f588f6613f91f3a7968179e4f46592e006b73 100644 --- a/modules/openid/tests/openid_test.module +++ b/modules/openid/tests/openid_test.module @@ -258,7 +258,7 @@ function openid_test_redirected_method($method1, $method2) { * the endpoint using drupal_http_request()). */ function _openid_test_endpoint_associate() { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); // Use default parameters for Diffie-Helmann key exchange. $mod = OPENID_DH_DEFAULT_MOD; @@ -307,7 +307,7 @@ function _openid_test_endpoint_associate() { * identity. */ function _openid_test_endpoint_authenticate() { - module_load_include('inc', 'openid'); + require_once(drupal_get_path('module', 'openid') . '/openid.inc'); $expected_identity = variable_get('openid_test_identity'); if ($expected_identity && $_REQUEST['openid_identity'] != $expected_identity) { diff --git a/modules/simpletest/tests/module.test b/modules/simpletest/tests/module.test index c9601c9b9ab7a0f8b76a706a374c0870bc42db32..fdcad9972f35dec855b76e55792c50a904b50913 100644 --- a/modules/simpletest/tests/module.test +++ b/modules/simpletest/tests/module.test @@ -103,7 +103,7 @@ class ModuleUnitTest extends DrupalWebTestCase { // For that activate the module_test which provides the file to load. module_enable(array('module_test')); - module_load_include('inc', 'module_test', 'module_test.file'); + require_once(drupal_get_path('module', 'module_test', 'module_test.file.inc')); $modules = module_implements('test_hook'); $static = drupal_static('module_implements'); $this->assertTrue(in_array('module_test', $modules), 'Hook found.'); diff --git a/modules/system/system.updater.inc b/modules/system/system.updater.inc index 0df1ad955c8ed6b511f49480ba89be090d9ac629..3bc70c3dcf8e5aed4ef4f5bcd03a1632cd27f19f 100644 --- a/modules/system/system.updater.inc +++ b/modules/system/system.updater.inc @@ -58,7 +58,7 @@ class ModuleUpdater extends Updater implements DrupalUpdaterInterface { if (_update_get_project_type($project) != 'module') { return array(); } - module_load_include('install', $project); + require_once(drupal_get_path('module', $project) . "/$project.install"); if (!$updates = drupal_get_schema_versions($project)) { return array(); diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc index 7ac0dbefbc2bb1555f87736823653fa9ec79b97d..f8e0755e02665b297c7be7a35f9a3c87cbb2b4a0 100644 --- a/modules/update/update.fetch.inc +++ b/modules/update/update.fetch.inc @@ -187,7 +187,7 @@ function _update_process_fetch_task($project) { * Clear out all the cached available update data and initiate re-fetching. */ function _update_refresh() { - module_load_include('inc', 'update', 'update.compare'); + require_once(drupal_get_path('module', 'update') . '/update.compare.inc'); // Since we're fetching new available update data, we want to clear // our cache of both the projects we care about, and the current update diff --git a/modules/update/update.install b/modules/update/update.install index f0d549922a0d66d7995d535f9c6e0b3ab40eadcf..026e9a817d7aec54a2721ce53b6b160adef05f7c 100644 --- a/modules/update/update.install +++ b/modules/update/update.install @@ -30,7 +30,7 @@ function update_requirements($phase) { $requirements = array(); if ($phase == 'runtime') { if ($available = update_get_available(FALSE)) { - module_load_include('inc', 'update', 'update.compare'); + require_once(drupal_get_path('module', 'update') . '/update.compare.inc'); $data = update_calculate_project_data($available); // First, populate the requirements for core: $requirements['update_core'] = _update_requirement_check($data['drupal'], 'core'); diff --git a/modules/update/update.manager.inc b/modules/update/update.manager.inc index 59858ebe810ea6411b15786111653737d08a8804..9c508bf35324ec87b8fbf4b1fab98ae6fcb26729 100644 --- a/modules/update/update.manager.inc +++ b/modules/update/update.manager.inc @@ -85,7 +85,7 @@ function update_manager_update_form($form, $form_state = array(), $context) { // project in the form, regardless of if it's enabled or disabled. $form['project_downloads'] = array('#tree' => TRUE); - module_load_include('inc', 'update', 'update.compare'); + require_once(drupal_get_path('module', 'update') . '/update.compare.inc'); $project_data = update_calculate_project_data($available); foreach ($project_data as $name => $project) { // Filter out projects which are up to date already. @@ -435,7 +435,7 @@ function update_manager_update_ready_form_submit($form, &$form_state) { // credentials. Instead, we instantiate a FileTransferLocal and invoke // update_authorize_run_update() directly. if (fileowner($project_real_location) == fileowner(conf_path())) { - module_load_include('inc', 'update', 'update.authorize'); + require_once(drupal_get_path('module', 'update') . '/update.authorize.inc'); $filetransfer = new FileTransferLocal(DRUPAL_ROOT); update_authorize_run_update($filetransfer, $updates); } @@ -710,7 +710,7 @@ function update_manager_install_form_submit($form, &$form_state) { // credentials. Instead, we instantiate a FileTransferLocal and invoke // update_authorize_run_install() directly. if (fileowner($project_real_location) == fileowner(conf_path())) { - module_load_include('inc', 'update', 'update.authorize'); + require_once(drupal_get_path('module', 'update') . '/update.authorize.inc'); $filetransfer = new FileTransferLocal(DRUPAL_ROOT); call_user_func_array('update_authorize_run_install', array_merge(array($filetransfer), $arguments)); } diff --git a/modules/update/update.module b/modules/update/update.module index a2d705a0eb02bc5eed090c5f254caa85b863b3a0..a876901d6fb058c6f67645b68a67672642445564 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -377,7 +377,7 @@ function _update_no_data() { * @see update_get_projects() */ function update_get_available($refresh = FALSE) { - module_load_include('inc', 'update', 'update.compare'); + require_once(drupal_get_path('module', 'update') . '/update.compare.inc'); $needs_refresh = FALSE; // Grab whatever data we currently have cached in the DB. @@ -433,7 +433,7 @@ function update_get_available($refresh = FALSE) { * @see _update_create_fetch_task() */ function update_create_fetch_task($project) { - module_load_include('inc', 'update', 'update.fetch'); + require_once(drupal_get_path('module', 'update') . '/update.fetch.inc'); return _update_create_fetch_task($project); } @@ -443,7 +443,7 @@ function update_create_fetch_task($project) { * @see _update_refresh() */ function update_refresh() { - module_load_include('inc', 'update', 'update.fetch'); + require_once(drupal_get_path('module', 'update') . '/update.fetch.inc'); return _update_refresh(); } @@ -451,7 +451,7 @@ function update_refresh() { * Wrapper to load the include file and then attempt to fetch update data. */ function update_fetch_data() { - module_load_include('inc', 'update', 'update.fetch'); + require_once(drupal_get_path('module', 'update') . '/update.fetch.inc'); return _update_fetch_data(); } diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc index 3f5933acb1feeb6caf0ed61d823aaf0269d7f852..d8ee680091e1fa549fb636027c019198b8ac92ad 100644 --- a/modules/update/update.report.inc +++ b/modules/update/update.report.inc @@ -10,7 +10,7 @@ */ function update_status() { if ($available = update_get_available(TRUE)) { - module_load_include('inc', 'update', 'update.compare'); + require_once(drupal_get_path('module', 'update') . '/update.compare.inc'); $data = update_calculate_project_data($available); return theme('update_report', array('data' => $data)); } diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index 4789e7e73131b627a85dcc1e3a30b1815f1cbaf8..66dde7b533a0f3cae27e4c095a3d55d12243e781 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -318,7 +318,7 @@ function user_admin_settings() { '#default_value' => variable_get('user_email_verification', TRUE), '#description' => t('New users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. With this setting disabled, users will be logged in immediately upon registering, and may select their own passwords during registration.') ); - module_load_include('inc', 'user', 'user.pages'); + require_once(drupal_get_path('module', 'user') . '/user.pages.inc'); $form['registration_cancellation']['user_cancel_method'] = array( '#type' => 'item', '#title' => t('When cancelling a user account'), diff --git a/modules/user/user.api.php b/modules/user/user.api.php index 0b4f38f054a395d2c172165de76656ae1fe4635f..4f1cbe7fae69264268a4fadef06ee7b5390e5351 100644 --- a/modules/user/user.api.php +++ b/modules/user/user.api.php @@ -79,7 +79,7 @@ function hook_user_cancel($edit, $account, $method) { switch ($method) { case 'user_cancel_block_unpublish': // Unpublish nodes (current revisions). - module_load_include('inc', 'node', 'node.admin'); + require_once(drupal_get_path('module', 'node') . '/node.admin.inc'); $nodes = db_select('node', 'n') ->fields('n', array('nid')) ->condition('uid', $account->uid) @@ -90,7 +90,7 @@ function hook_user_cancel($edit, $account, $method) { case 'user_cancel_reassign': // Anonymize nodes (current revisions). - module_load_include('inc', 'node', 'node.admin'); + require_once(drupal_get_path('module', 'node') . '/node.admin.inc'); $nodes = db_select('node', 'n') ->fields('n', array('nid')) ->condition('uid', $account->uid) diff --git a/modules/user/user.module b/modules/user/user.module index 14e145932f768fa703254f915260c4b4cb6f01a8..eb41f237404355e2c417ca5e26ff4bd33a450ba1 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1753,7 +1753,7 @@ function user_menu_site_status_alter(&$menu_site_status, $path) { if ($menu_site_status == MENU_SITE_OFFLINE) { // If the site is offline, log out unprivileged users. if (user_is_logged_in() && !user_access('access site in maintenance mode')) { - module_load_include('pages.inc', 'user', 'user'); + require_once(drupal_get_path('module', 'user') . '/user.pages.linc'); user_logout(); } @@ -3193,7 +3193,7 @@ function user_multiple_cancel_confirm($form, &$form_state) { $form['operation'] = array('#type' => 'hidden', '#value' => 'cancel'); - module_load_include('inc', 'user', 'user.pages'); + require_once(drupal_get_path('module', 'user') . '/user.pages.inc'); $form['user_cancel_method'] = array( '#type' => 'item', '#title' => t('When cancelling these accounts'), -- 1.7.5.4