Can someone tell me what is wrong with this code?
I am trying to use this to remove a user from a group. It is not working.
I will have a similar function to add a person to the group as well.
The $xoopsModuleConfig['ugroup'] line pulls up the right group and I am forcing the UID 1 which is a valid user number. I have some other code to add after I get this working but at the moment when I run this code it returns ok but no actual removal of the user.
If I am reading things right the right format for calling the method is...
removeUsersFromGroup(groupid, array(uid));
where array(uid) can be 1 user or many users.
This method is a little different than the similar method if I am understanding this which is called like this...
addUserToGroup(groupid, uid)
The snippet of code I am using...
$xrosterhMember =& xoops_gethandler('member');
function Members_Delete($id){
global $xrosterhMember, $xoopsModuleConfig;
$result =& $xrosterhMember->removeUsersFromGroup($xoopsModuleConfig['ugroup'], array(1));
}
Another note... I do get this following error...
Quote:
Warning: Database updates are not allowed during processing of a GET request in file /class/database/mysqldatabase.php line 397
This is the LAST thing I need to add to my roster program before I move onto the next thing so I would greatly appreciate any help someone can give me.
I want to thank ghia, iHackCode, zyspec, and tarik for helping me out so far. I didn't expect to do this much with this module because I want to totally rewrite it but the experience was useful.