diff options
author | rub <rub@piwigo.org> | 2010-03-23 05:56:50 +0000 |
---|---|---|
committer | rub <rub@piwigo.org> | 2010-03-23 05:56:50 +0000 |
commit | a6c771547decb2667c3b9b2cde769dd3fe51bc0c (patch) | |
tree | 98403924fcb74012eb62f913365626a4bb0b239e | |
parent | c0879165c6f3aec6189bb146e41e3f6d40b85314 (diff) |
Add function is_webmaster (like is_admin function)
Add on ignore list the directory local/personal
git-svn-id: http://piwigo.org/svn/trunk@5272 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | include/functions_user.inc.php | 9 | ||||
-rw-r--r-- | plugins/LocalFilesEditor/admin.php | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index f9b31e51c..6a63c83e4 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -1236,6 +1236,15 @@ function check_status($access_type, $user_status = '') } /* + * Return if user is, at least, a webmaster + * @return bool +*/ + function is_webmaster($user_status = '') +{ + return is_autorize_status(ACCESS_WEBMASTER, $user_status); +} + +/* * Return if current user is an adviser * @return bool */ diff --git a/plugins/LocalFilesEditor/admin.php b/plugins/LocalFilesEditor/admin.php index 0b000f2ab..b0837345f 100644 --- a/plugins/LocalFilesEditor/admin.php +++ b/plugins/LocalFilesEditor/admin.php @@ -294,7 +294,7 @@ if (isset($_POST['restore']) and !is_adviser()) // +-----------------------------------------------------------------------+ if (isset($_POST['submit']) and !is_adviser()) { - if ($user['status'] != 'webmaster') + if (!is_webmaster()) { array_push($page['errors'], l10n('locfiledit_webmaster_only')); } |