From: garvinhicking Date: Thu, 9 Mar 2006 10:25:51 +0000 (+0000) Subject: * Fixed chief-editor not being able to create editors (garvinhicking) X-Git-Tag: 1.0~73 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bfd8a6a19a014cc2f2381dc51f8d433fe2239fb6;p=s9y.git * Fixed chief-editor not being able to create editors (garvinhicking) --- diff --git a/docs/NEWS b/docs/NEWS index 726956a..f093684 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,8 @@ Version 1.0-beta2 () ------------------------------------------------------------------------ + * Fixed chief-editor not being able to create editors (garvinhicking) + * Added turkish language by Ahmet Usal * Fix also deleting thumbnail when removing an image (garvinhicking) diff --git a/include/admin/personal.inc.php b/include/admin/personal.inc.php index 9274641..be329a0 100644 --- a/include/admin/personal.inc.php +++ b/include/admin/personal.inc.php @@ -33,7 +33,13 @@ if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken() // 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; } @@ -47,7 +53,7 @@ if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken() if (count($_POST[$item['var']]) < 1) { echo '
' . WARNING_NO_GROUPS_SELECTED . '
'; } else { - serendipity_updateGroups($_POST[$item['var']], $serendipity['authorid']); + serendipity_updateGroups($_POST[$item['var']], $serendipity['authorid'], false); } continue; } diff --git a/include/admin/users.inc.php b/include/admin/users.inc.php index f634211..e4e610e 100644 --- a/include/admin/users.inc.php +++ b/include/admin/users.inc.php @@ -52,10 +52,15 @@ if (isset($_POST['SAVE_NEW']) && serendipity_checkFormToken()) { // 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; } @@ -69,7 +74,7 @@ if (isset($_POST['SAVE_NEW']) && serendipity_checkFormToken()) { if (count($_POST[$item['var']]) < 1) { echo '
' . WARNING_NO_GROUPS_SELECTED . '
'; } else { - serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user']); + serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user'], false); } continue; } @@ -111,7 +116,13 @@ if (isset($_POST['SAVE_EDIT']) && serendipity_checkFormToken()) { // 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; } @@ -125,7 +136,7 @@ if (isset($_POST['SAVE_EDIT']) && serendipity_checkFormToken()) { if (count($_POST[$item['var']]) < 1) { echo '
' . WARNING_NO_GROUPS_SELECTED . '
'; } else { - serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user']); + serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user'], false); } continue; }