summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'scire/user.php')
-rwxr-xr-xscire/user.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/scire/user.php b/scire/user.php
index 3088029..154caec 100755
--- a/scire/user.php
+++ b/scire/user.php
@@ -19,14 +19,18 @@ if ($_POST['addgroup_confirm']) {
$userdata = $acl->get_object_data($_POST['userid'], 'ARO');
$newgroups = $_POST['addgroupid'];
#remove first.
- foreach ($ingroups as $ingroup) {
- if (!in_array($ingroup, $newgroups)) {
- $acl->del_group_object($ingroup, $userdata[0][0], $userdata[0][1], 'ARO');
+ if ($ingroups) {
+ foreach ($ingroups as $ingroup) {
+ if (!in_array($ingroup, $newgroups)) {
+ $acl->del_group_object($ingroup, $userdata[0][0], $userdata[0][1], 'ARO');
+ }
}
}
- foreach ($newgroups as $newgroup) {
- print "newgroup: $newgroup";
- $acl->add_group_object($newgroup, $userdata[0][0], $userdata[0][1], 'ARO');
+ if ($newgroups) {
+ foreach ($newgroups as $newgroup) {
+ print "newgroup: $newgroup";
+ $acl->add_group_object($newgroup, $userdata[0][0], $userdata[0][1], 'ARO');
+ }
}
$_GET['Action'] = "edit";
$_GET['userid'] = $_POST['userid'];