admin.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <?php /**
  2. * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
  3. * This file is licensed under the Affero General Public License version 3 or later.
  4. * See the COPYING-README file.
  5. */
  6. $levels = array('Debug', 'Info', 'Warning', 'Error', 'Fatal');
  7. ?>
  8. <?php
  9. // is htaccess working ?
  10. if (!$_['htaccessworking']) {
  11. ?>
  12. <fieldset class="personalblock">
  13. <legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  14. <span class="securitywarning">
  15. <?php p($l->t('Your data directory and your files are probably accessible from the internet. The .htaccess file is not working. We strongly suggest that you configure your webserver in a way that the data directory is no longer accessible or you move the data directory outside the webserver document root.')); ?>
  16. </span>
  17. </fieldset>
  18. <?php
  19. }
  20. // is WebDAV working ?
  21. if (!$_['isWebDavWorking']) {
  22. ?>
  23. <fieldset class="personalblock">
  24. <legend><strong><?php p($l->t('Setup Warning'));?></strong></legend>
  25. <span class="securitywarning">
  26. <?php p($l->t('Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.')); ?>
  27. <?php print_unescaped($l->t('Please double check the <a href="%s">installation guides</a>.', $theme->getDocBaseUrl().'/server/5.0/admin_manual/installation.html')); ?>
  28. </span>
  29. </fieldset>
  30. <?php
  31. }
  32. // if module fileinfo available?
  33. if (!$_['has_fileinfo']) {
  34. ?>
  35. <fieldset class="personalblock">
  36. <legend><strong><?php p($l->t('Module \'fileinfo\' missing'));?></strong></legend>
  37. <span class="connectionwarning">
  38. <?php p($l->t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with mime-type detection.')); ?>
  39. </span>
  40. </fieldset>
  41. <?php
  42. }
  43. // is locale working ?
  44. if (!$_['islocaleworking']) {
  45. ?>
  46. <fieldset class="personalblock">
  47. <legend><strong><?php p($l->t('Locale not working'));?></strong></legend>
  48. <span class="connectionwarning">
  49. <?php
  50. $locales = 'en_US.UTF-8/en_US.UTF8';
  51. p($l->t('System locale can\'t be set to %s. This means that there might be problems with certain characters in file names. We strongly suggest to install the required packages on your system to support %s.', array($locales, $locales)));
  52. ?>
  53. </span>
  54. </fieldset>
  55. <?php
  56. }
  57. // is internet connection working ?
  58. if (!$_['internetconnectionworking']) {
  59. ?>
  60. <fieldset class="personalblock">
  61. <legend><strong><?php p($l->t('Internet connection not working'));?></strong></legend>
  62. <span class="connectionwarning">
  63. <?php p($l->t('This server has no working internet connection. This means that some of the features like mounting of external storage, notifications about updates or installation of 3rd party apps don´t work. Accessing files from remote and sending of notification emails might also not work. We suggest to enable internet connection for this server if you want to have all features.')); ?>
  64. </span>
  65. </fieldset>
  66. <?php
  67. }
  68. ?>
  69. <?php foreach ($_['forms'] as $form) {
  70. print_unescaped($form);
  71. }
  72. ;?>
  73. <fieldset class="personalblock" id="backgroundjobs">
  74. <legend><strong><?php p($l->t('Cron'));?></strong></legend>
  75. <p>
  76. <input type="radio" name="mode" value="ajax"
  77. id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
  78. print_unescaped('checked="checked"');
  79. } ?>>
  80. <label for="backgroundjobs_ajax">AJAX</label><br/>
  81. <em><?php p($l->t("Execute one task with each page loaded")); ?></em>
  82. </p>
  83. <p>
  84. <input type="radio" name="mode" value="webcron"
  85. id="backgroundjobs_webcron" <?php if ($_['backgroundjobs_mode'] === "webcron") {
  86. print_unescaped('checked="checked"');
  87. } ?>>
  88. <label for="backgroundjobs_webcron">Webcron</label><br/>
  89. <em><?php p($l->t("cron.php is registered at a webcron service to call cron.php once a minute over http.")); ?></em>
  90. </p>
  91. <p>
  92. <input type="radio" name="mode" value="cron"
  93. id="backgroundjobs_cron" <?php if ($_['backgroundjobs_mode'] === "cron") {
  94. print_unescaped('checked="checked"');
  95. } ?>>
  96. <label for="backgroundjobs_cron">Cron</label><br/>
  97. <em><?php p($l->t("Use systems cron service to call the cron.php file once a minute.")); ?></em>
  98. </p>
  99. </fieldset>
  100. <fieldset class="personalblock" id="shareAPI">
  101. <legend><strong><?php p($l->t('Sharing'));?></strong></legend>
  102. <table class="shareAPI nostyle">
  103. <tr>
  104. <td id="enable">
  105. <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled"
  106. value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> />
  107. <label for="shareAPIEnabled"><?php p($l->t('Enable Share API'));?></label><br/>
  108. <em><?php p($l->t('Allow apps to use the Share API')); ?></em>
  109. </td>
  110. </tr>
  111. <tr>
  112. <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('style="display:none"');?>>
  113. <input type="checkbox" name="shareapi_allow_links" id="allowLinks"
  114. value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> />
  115. <label for="allowLinks"><?php p($l->t('Allow links'));?></label><br/>
  116. <em><?php p($l->t('Allow users to share items to the public with links')); ?></em>
  117. </td>
  118. </tr>
  119. <?php if (!\OCP\App::isEnabled('files_encryption')) { ?>
  120. <tr>
  121. <td <?php if ($_['shareAPIEnabled'] == 'no') print_unescaped('style="display:none"');?>>
  122. <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload"
  123. value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> />
  124. <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/>
  125. <em><?php p($l->t('Allow users to enable others to upload into their publicly shared folders')); ?></em>
  126. </td>
  127. </tr>
  128. <?php } ?>
  129. <tr>
  130. <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('style="display:none"');?>>
  131. <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing"
  132. value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> />
  133. <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/>
  134. <em><?php p($l->t('Allow users to share items shared with them again')); ?></em>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('style="display:none"');?>>
  139. <input type="radio" name="shareapi_share_policy" id="sharePolicyGlobal"
  140. value="global" <?php if ($_['sharePolicy'] === 'global') print_unescaped('checked="checked"'); ?> />
  141. <label for="sharePolicyGlobal"><?php p($l->t('Allow users to share with anyone')); ?></label><br/>
  142. <input type="radio" name="shareapi_share_policy" id="sharePolicyGroupsOnly"
  143. value="groups_only" <?php if ($_['sharePolicy'] === 'groups_only') print_unescaped('checked="checked"'); ?> />
  144. <label for="sharePolicyGroupsOnly"><?php p($l->t('Allow users to only share with users in their groups'));?></label><br/>
  145. </td>
  146. </tr>
  147. </table>
  148. </fieldset>
  149. <fieldset class="personalblock" id="security">
  150. <legend><strong><?php p($l->t('Security'));?></strong></legend>
  151. <table class="nostyle">
  152. <tr>
  153. <td id="enable">
  154. <input type="checkbox" name="forcessl" id="enforceHTTPSEnabled"
  155. <?php if ($_['enforceHTTPSEnabled']) {
  156. print_unescaped('checked="checked" ');
  157. print_unescaped('value="false"');
  158. } else {
  159. print_unescaped('value="true"');
  160. }
  161. ?>
  162. <?php if (!$_['isConnectedViaHTTPS']) p('disabled'); ?> />
  163. <label for="forcessl"><?php p($l->t('Enforce HTTPS'));?></label><br/>
  164. <em><?php p($l->t(
  165. 'Forces the clients to connect to %s via an encrypted connection.',
  166. $theme->getName()
  167. )); ?></em>
  168. <?php if (!$_['isConnectedViaHTTPS']) {
  169. print_unescaped("<br/><em>");
  170. p($l->t(
  171. 'Please connect to your %s via HTTPS to enable or disable the SSL enforcement.',
  172. $theme->getName()
  173. ));
  174. print_unescaped("</em>");
  175. }
  176. ?>
  177. </td>
  178. </tr>
  179. </table>
  180. </fieldset>
  181. <fieldset class="personalblock">
  182. <legend><strong><?php p($l->t('Log'));?></strong></legend>
  183. <?php p($l->t('Log level'));?> <select name='loglevel' id='loglevel'>
  184. <option value='<?php p($_['loglevel'])?>'><?php p($levels[$_['loglevel']])?></option>
  185. <?php for ($i = 0; $i < 5; $i++):
  186. if ($i !== $_['loglevel']):?>
  187. <option value='<?php p($i)?>'><?php p($levels[$i])?></option>
  188. <?php endif;
  189. endfor;?>
  190. </select>
  191. <table id="log">
  192. <?php foreach ($_['entries'] as $entry): ?>
  193. <tr>
  194. <td>
  195. <?php p($levels[$entry->level]);?>
  196. </td>
  197. <td>
  198. <?php p($entry->app);?>
  199. </td>
  200. <td>
  201. <?php p($entry->message);?>
  202. </td>
  203. <td>
  204. <?php if(is_int($entry->time)){
  205. p(OC_Util::formatDate($entry->time));
  206. } else {
  207. p($entry->time);
  208. }?>
  209. </td>
  210. </tr>
  211. <?php endforeach;?>
  212. </table>
  213. <?php if ($_['entriesremain']): ?>
  214. <input id="moreLog" type="button" value="<?php p($l->t('More'));?>...">
  215. <input id="lessLog" type="button" value="<?php p($l->t('Less'));?>...">
  216. <?php endif; ?>
  217. </fieldset>
  218. <fieldset class="personalblock">
  219. <legend><strong><?php p($l->t('Version'));?></strong></legend>
  220. <strong><?php p($theme->getTitle()); ?></strong> <?php p(OC_Util::getVersionString()); ?>
  221. <?php if (OC_Util::getEditionString() === ''): ?>
  222. <p>
  223. <?php print_unescaped($l->t('Developed by the <a href="http://ownCloud.org/contact" target="_blank">ownCloud community</a>, the <a href="https://github.com/owncloud" target="_blank">source code</a> is licensed under the <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank"><abbr title="Affero General Public License">AGPL</abbr></a>.')); ?>
  224. </p>
  225. <?php endif; ?>
  226. </fieldset>
  227. <fieldset class="personalblock credits-footer">
  228. <p>
  229. <?php print_unescaped($theme->getShortFooter()); ?>
  230. </p>
  231. </fieldset>