Код |
---|
function makDelUserToGroup($uid, $gid) { if($uid > 0) { $makUserGroups = CUser::GetUserGroup($uid); if(!empty($gid)) { foreach($makUserGroups as $key=>$gid) if($gid == 42) { unset($makUserGroups[$key]); break; } $gid = array_merge($makUserGroups, $gid); CUser::SetUserGroup($uid, $gid); return true; } tpk_print_r($makUserGroups,'sdf','28751'); } return false; } |