1
chooch220
Problems adding multiple groups w/ admin mod
  • 2005/3/6 8:01

  • chooch220

  • Just popping in

  • Posts: 1

  • Since: 2005/3/3 1


I noticed that when an admin user adds a group through the users admin module, the original code uses the XOOPS_GROUP_USERS in the add group function. I tried changing that to the $groups variable, but it does not accept multiple selections for groups. I added a foreach loop like the one in the updateUser function but it still doesnt not work.

/modules/admin/users/main.php

--original--
if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newuser->getVar('uid'))) {
$adduser_errormsg = _AM_CNRNU2;
} else {
redirect_header("admin.php?fct=users",1,_AM_DBUPDATED);
exit();
}

--my hack--

foreach ($groups as $groupid) {
if (!$member_handler->addUserToGroup($groupid,
$newuser->getVar('uid'))) {
$adduser_errormsg = _AM_CNRNU2;
} else {
redirect_header("admin.php?fct=users",1,_AM_DBUPDATED);
exit();
}
}

Login

Who's Online

144 user(s) are online (88 user(s) are browsing Support Forums)


Members: 0


Guests: 144


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits