@anonymous-piwik-user opened this Issue on January 16th 2011

In the "Users" tab of the settings for administrators, the Manage Access section has a menu from which you can select either "All websites" or an individual site for granting access to the list of users that follows the menu.

Selecting "All websites" always returns you to a page with the first (siteID = 1) site selected, not "All websites".

There are 2 problems here. One is easy to fix, the other I haven't investigated.

  1. The issue: UsersManagers/Controller.php (I have v. 3565) contains, on line 33:
$idSiteSelected = Piwik_Common::getRequestVar('idsite', $defaultWebsiteId, 'int');

But the VALUE attribute of the "All websites" option is "all" -- so we cannot attempt to cast it to an integer. If Piwik is going to allow the "magic" keyword "all" to imply "All Websites," we cannot check for an integer value.

FIX: Remove the 3rd parameter "int" and the code works fine. In any case, URL parameters in PHP are always strings, so it's usually more efficient to use "is_numeric" than to do weird double-castings like (int)(string) as Piwik_Common::getRequestVar() does.

  1. The URLs generated by the change handler of the menu seem to repeatedly append "siteID", so that subsequent changes in selection end up passing a URL that contains e.g. "&siteid=1&site=2&siteid=all".

I didn't even attempt to track this down.

PS: Mon francais n'est pas mal, mme si un peu rouill, si a vous convient mieux de repondre en franais. ;-)
Keywords: siteID access

@mattab commented on January 16th 2011 Member

already Fixed in trunk #1979

This Issue was closed on January 16th 2011
Powered by GitHub Issue Mirror