admin.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
  4. * This file is licensed under the Affero General Public License version 3 or later.
  5. * See the COPYING-README file.
  6. */
  7. OC_Util::checkAdminUser();
  8. OC_App::loadApps();
  9. OC_Util::addStyle( "settings", "settings" );
  10. OC_Util::addScript( "settings", "admin" );
  11. OC_Util::addScript( "settings", "log" );
  12. OC_App::setActiveNavigationEntry( "admin" );
  13. $tmpl = new OC_Template( 'settings', 'admin', 'user');
  14. $forms=OC_App::getForms('admin');
  15. $htaccessworking=OC_Util::ishtaccessworking();
  16. $entries=OC_Log_Owncloud::getEntries(3);
  17. $entriesremain=(count(OC_Log_Owncloud::getEntries(4)) > 3)?true:false;
  18. function compareEntries($a, $b) {
  19. return $b->time - $a->time;
  20. }
  21. usort($entries, 'compareEntries');
  22. $tmpl->assign('loglevel', OC_Config::getValue( "loglevel", 2 ));
  23. $tmpl->assign('entries', $entries);
  24. $tmpl->assign('entriesremain', $entriesremain);
  25. $tmpl->assign('htaccessworking', $htaccessworking);
  26. $tmpl->assign('internetconnectionworking', OC_Util::isinternetconnectionworking());
  27. $tmpl->assign('islocaleworking', OC_Util::issetlocaleworking());
  28. $tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking());
  29. $tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());
  30. $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
  31. $tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes'));
  32. // Check if connected using HTTPS
  33. if (OC_Request::serverProtocol() == 'https') {
  34. $connectedHTTPS = true;
  35. } else {
  36. $connectedHTTPS = false;
  37. }
  38. $tmpl->assign('isConnectedViaHTTPS', $connectedHTTPS);
  39. $tmpl->assign('enforceHTTPSEnabled', OC_Config::getValue( "forcessl", false));
  40. $tmpl->assign('allowLinks', OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
  41. $tmpl->assign('allowResharing', OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes'));
  42. $tmpl->assign('sharePolicy', OC_Appconfig::getValue('core', 'shareapi_share_policy', 'global'));
  43. $tmpl->assign('forms', array());
  44. foreach($forms as $form) {
  45. $tmpl->append('forms', $form);
  46. }
  47. $tmpl->printPage();