isadmin.php 517 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Lukas Reschke <lukas@statuscode.ch>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. // Set the content type to Javascript
  9. header("Content-type: text/javascript");
  10. // Disallow caching
  11. header("Cache-Control: no-cache, must-revalidate");
  12. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
  13. if (OC_User::isAdminUser(OC_User::getUser())) {
  14. echo("var isadmin = true;");
  15. } else {
  16. echo("var isadmin = false;");
  17. }