diff --git a/settings/js/isadmin.php b/settings/js/isadmin.php new file mode 100644 index 0000000000..8b31f8a7cf --- /dev/null +++ b/settings/js/isadmin.php @@ -0,0 +1,20 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +// Set the content type to Javascript +header("Content-type: text/javascript"); + +// Disallow caching +header("Cache-Control: no-cache, must-revalidate"); +header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); + +if (OC_User::isAdminUser(OC_User::getUser())) { + echo("var isadmin = true;"); +} else { + echo("var isadmin = false;"); +} \ No newline at end of file diff --git a/settings/routes.php b/settings/routes.php index 9b5bf80923..bac1f61fc5 100644 --- a/settings/routes.php +++ b/settings/routes.php @@ -60,3 +60,5 @@ $this->create('settings_ajax_setloglevel', '/settings/ajax/setloglevel.php') ->actionInclude('settings/ajax/setloglevel.php'); $this->create('settings_ajax_setsecurity', '/settings/ajax/setsecurity.php') ->actionInclude('settings/ajax/setsecurity.php'); +$this->create('isadmin', '/settings/js/isadmin.js') + ->actionInclude('settings/js/isadmin.php'); diff --git a/settings/templates/users.php b/settings/templates/users.php index 6cbbca2404..5e588f9ead 100644 --- a/settings/templates/users.php +++ b/settings/templates/users.php @@ -13,9 +13,9 @@ $items = array_flip($_['subadmingroups']); unset($items['admin']); $_['subadmingroups'] = array_flip($items); ?> - + + +