Because
$items['sitemap.xml'] = array(
'title' => 'Site map index',
'page callback' => 'xmlsitemap_output',
'access callback' => 'xmlsitemap_anonymous_access',
'type' => MENU_CALLBACK,
);
and then this returns FALSE for authenticated users
function xmlsitemap_anonymous_access() {
global $user;
return $user->uid == 0;
}
Changing the above to
function xmlsitemap_anonymous_access() {
return TRUE;
}
allows all to be able to access the sitemap but so will this change
$items['sitemap.xml'] = array(
'title' => 'Site map index',
'page callback' => 'xmlsitemap_output',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
based on the review of the code at http://api.drupal.org/api/function/_menu_check_access/6 and my testing.
Patch is based on the menu change.
| Comment | File | Size | Author |
|---|---|---|---|
| xmlsitemap_anonymous_access_removal.patch | 1.72 KB | Anonymous (not verified) |
Comments
Comment #1
avpadernoSee what reported in the project page; it's not a bug at all. I am setting it like duplicate of an already existing report.
Comment #2
Anonymous (not verified) commentedSorry for wasting your time; I should have looked. I will try to come up with an alternative, something like not creating the map data if the user is authenticated but allowing the authenticated user to visit /sitemap.xml. The other alternative would be to change the global $user->id to 0 before updating the sitemap data and then changing $user->id back to the original value.
Comment #3
avpadernoTo change the global user variable is not adviced.