// Check that no user may assign groups he's not allowed to.
foreach($_POST[$item['var']] AS $groupkey => $groupval) {
- if (in_array($group_val, $valid_groups)) {
+ if (in_array($groupval, $valid_groups)) {
+ continue;
+ } elseif ($groupval == 2 && in_array(3, $valid_groups)) {
+ // Admin is allowed to assign users to chief editors
+ continue;
+ } elseif ($groupval == 1 && in_array(2, $valid_groups)) {
+ // Chief is allowed to assign users to editors
continue;
}
if (count($_POST[$item['var']]) < 1) {
echo '<div class="serendipityAdminMsgError">' . WARNING_NO_GROUPS_SELECTED . '</div>';
} else {
- serendipity_updateGroups($_POST[$item['var']], $serendipity['authorid']);
+ serendipity_updateGroups($_POST[$item['var']], $serendipity['authorid'], false);
}
continue;
}
// Void, no fixing neccessarry
} elseif (serendipity_checkPermission('adminUsersMaintainSame')) {
-
// Check that no user may assign groups he's not allowed to.
foreach($_POST[$item['var']] AS $groupkey => $groupval) {
- if (in_array($group_val, $valid_groups)) {
+ if (in_array($groupval, $valid_groups)) {
+ continue;
+ } elseif ($groupval == 2 && in_array(3, $valid_groups)) {
+ // Admin is allowed to assign users to chief editors
+ continue;
+ } elseif ($groupval == 1 && in_array(2, $valid_groups)) {
+ // Chief is allowed to assign users to editors
continue;
}
if (count($_POST[$item['var']]) < 1) {
echo '<div class="serendipityAdminMsgError">' . WARNING_NO_GROUPS_SELECTED . '</div>';
} else {
- serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user']);
+ serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user'], false);
}
continue;
}
// Check that no user may assign groups he's not allowed to.
foreach($_POST[$item['var']] AS $groupkey => $groupval) {
- if (in_array($group_val, $valid_groups)) {
+ if (in_array($groupval, $valid_groups)) {
+ continue;
+ } elseif ($groupval == 2 && in_array(3, $valid_groups)) {
+ // Admin is allowed to assign users to chief editors
+ continue;
+ } elseif ($groupval == 1 && in_array(2, $valid_groups)) {
+ // Chief is allowed to assign users to editors
continue;
}
if (count($_POST[$item['var']]) < 1) {
echo '<div class="serendipityAdminMsgError">' . WARNING_NO_GROUPS_SELECTED . '</div>';
} else {
- serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user']);
+ serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user'], false);
}
continue;
}