From 8a7004e61e0bfcab3947f00bc3c831c5ff11c9a5 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 19 Jan 2011 11:18:55 +0000 Subject: bug 2018: now when a user gets an "admin" or "webmaster" status he automatically gets the "admin" privacy level. git-svn-id: http://piwigo.org/svn/trunk@8758 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/user_list.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'admin/user_list.php') diff --git a/admin/user_list.php b/admin/user_list.php index 2b9cac509..af76a291f 100644 --- a/admin/user_list.php +++ b/admin/user_list.php @@ -432,6 +432,21 @@ DELETE FROM '.USER_GROUP_TABLE.' } } + // if the status is getting greater or equal to "admin", then level + // automatically switches to "admin" (8), unless the level is also + // defined in the same batch action. + if (isset($data['status']) and in_array($data['status'], array('webmaster', 'admin'))) + { + if (!isset($data['level'])) + { + $data['level'] = 8; + if (!in_array('level', $dbfields['update'])) + { + array_push($dbfields['update'], 'level'); + } + } + } + // special users checks if ( -- cgit v1.2.3