[mapguide-users] Problem programmatically adding users

marfalox mfalossi at hotmail.com
Fri Jul 27 01:44:15 PDT 2012


Hi all,

I have a problem with mapguide 2.2.0 while programmatically creating users. 
What happens is that when a user is created everything works good, he can
acces the site and work on everything. As soon as a second user is created,
the new one works, but previous ones are not recognized. Two different error
are possible:
1- User has no access to the requested resource;
2- User is not recognized.
Going on mapadmin page, all users seem to be ok. Assigning them from here
password and group again thy go working.

PHP script to create users follows the steps contained in adduser.php from
mapadmin folder.
Users are created with

$site->AddUser($userID, $userName, $password, $description);

they are then assigned a group with author role:

$groupMembershipsToGrant = new MgStringCollection();
		foreach ($groupsSelected as $groupToGrant) {
			if ($groupToGrant != MgGroup::Everyone)
				$groupMembershipsToGrant->Add($groupToGrant);
		}
		if ($groupMembershipsToGrant->GetCount() > 0)
			$site->GrantGroupMembershipsToUsers($groupMembershipsToGrant,
$usersToUpdate);

Some resources are then created for the user, copying them from a base
template in the library tree and updating all the referencies.
Even tried to take a brand new machine a installation of mapguide (osgeolive
4.5) and found the same behaviour.

Any idea what can be?

Thanks,
Marco





--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Problem-programmatically-adding-users-tp4991278.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list