admin.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. $levelLabels = array(
  8. $l->t( 'Everything (fatal issues, errors, warnings, info, debug)' ),
  9. $l->t( 'Info, warnings, errors and fatal issues' ),
  10. $l->t( 'Warnings, errors and fatal issues' ),
  11. $l->t( 'Errors and fatal issues' ),
  12. $l->t( 'Fatal issues only' ),
  13. );
  14. ?>
  15. <?php
  16. // is htaccess working ?
  17. if (!$_['htaccessworking']) {
  18. ?>
  19. <fieldset class="personalblock">
  20. <h2><?php p($l->t('Security Warning'));?></h2>
  21. <span class="securitywarning">
  22. <?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.')); ?>
  23. </span>
  24. </fieldset>
  25. <?php
  26. }
  27. // is WebDAV working ?
  28. if (!$_['isWebDavWorking']) {
  29. ?>
  30. <fieldset class="personalblock">
  31. <h2><?php p($l->t('Setup Warning'));?></h2>
  32. <span class="securitywarning">
  33. <?php p($l->t('Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.')); ?>
  34. <?php print_unescaped($l->t('Please double check the <a href="%s">installation guides</a>.', link_to_docs('admin-install'))); ?>
  35. </span>
  36. </fieldset>
  37. <?php
  38. }
  39. // if module fileinfo available?
  40. if (!$_['has_fileinfo']) {
  41. ?>
  42. <fieldset class="personalblock">
  43. <h2><?php p($l->t('Module \'fileinfo\' missing'));?></h2>
  44. <span class="connectionwarning">
  45. <?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.')); ?>
  46. </span>
  47. </fieldset>
  48. <?php
  49. }
  50. // is locale working ?
  51. if (!$_['isLocaleWorking']) {
  52. ?>
  53. <fieldset class="personalblock">
  54. <h2><?php p($l->t('Locale not working'));?></h2>
  55. <span class="connectionwarning">
  56. <?php
  57. $locales = 'en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8';
  58. p($l->t('System locale can not be set to a one which supports UTF-8.'));
  59. ?>
  60. <br>
  61. <?php
  62. p($l->t('This means that there might be problems with certain characters in file names.'));
  63. ?>
  64. <br>
  65. <?php
  66. p($l->t('We strongly suggest to install the required packages on your system to support one of the following locales: %s.', array($locales)));
  67. ?>
  68. </span>
  69. </fieldset>
  70. <?php
  71. }
  72. // is internet connection working ?
  73. if (!$_['internetconnectionworking']) {
  74. ?>
  75. <fieldset class="personalblock">
  76. <h2><?php p($l->t('Internet connection not working'));?></h2>
  77. <span class="connectionwarning">
  78. <?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.')); ?>
  79. </span>
  80. </fieldset>
  81. <?php
  82. }
  83. ?>
  84. <?php foreach ($_['forms'] as $form) {
  85. print_unescaped($form);
  86. }
  87. ;?>
  88. <fieldset class="personalblock" id="backgroundjobs">
  89. <h2><?php p($l->t('Cron'));?></h2>
  90. <p>
  91. <input type="radio" name="mode" value="ajax"
  92. id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
  93. print_unescaped('checked="checked"');
  94. } ?>>
  95. <label for="backgroundjobs_ajax">AJAX</label><br/>
  96. <em><?php p($l->t("Execute one task with each page loaded")); ?></em>
  97. </p>
  98. <p>
  99. <input type="radio" name="mode" value="webcron"
  100. id="backgroundjobs_webcron" <?php if ($_['backgroundjobs_mode'] === "webcron") {
  101. print_unescaped('checked="checked"');
  102. } ?>>
  103. <label for="backgroundjobs_webcron">Webcron</label><br/>
  104. <em><?php p($l->t("cron.php is registered at a webcron service to call cron.php every 15 minutes over http.")); ?></em>
  105. </p>
  106. <p>
  107. <input type="radio" name="mode" value="cron"
  108. id="backgroundjobs_cron" <?php if ($_['backgroundjobs_mode'] === "cron") {
  109. print_unescaped('checked="checked"');
  110. } ?>>
  111. <label for="backgroundjobs_cron">Cron</label><br/>
  112. <em><?php p($l->t("Use systems cron service to call the cron.php file every 15 minutes.")); ?></em>
  113. </p>
  114. </fieldset>
  115. <fieldset class="personalblock" id="shareAPI">
  116. <h2><?php p($l->t('Sharing'));?></h2>
  117. <table class="shareAPI">
  118. <tr>
  119. <td id="enable">
  120. <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled"
  121. value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> />
  122. <label for="shareAPIEnabled"><?php p($l->t('Enable Share API'));?></label><br/>
  123. <em><?php p($l->t('Allow apps to use the Share API')); ?></em>
  124. </td>
  125. </tr>
  126. <tr>
  127. <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('class="hidden"');?>>
  128. <input type="checkbox" name="shareapi_allow_links" id="allowLinks"
  129. value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> />
  130. <label for="allowLinks"><?php p($l->t('Allow links'));?></label><br/>
  131. <em><?php p($l->t('Allow users to share items to the public with links')); ?></em>
  132. </td>
  133. </tr>
  134. <?php if (!\OCP\App::isEnabled('files_encryption')) { ?>
  135. <tr>
  136. <td <?php if ($_['shareAPIEnabled'] == 'no') print_unescaped('class="hidden"');?>>
  137. <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload"
  138. value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> />
  139. <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/>
  140. <em><?php p($l->t('Allow users to enable others to upload into their publicly shared folders')); ?></em>
  141. </td>
  142. </tr>
  143. <?php } ?>
  144. <tr>
  145. <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('class="hidden"');?>>
  146. <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing"
  147. value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> />
  148. <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/>
  149. <em><?php p($l->t('Allow users to share items shared with them again')); ?></em>
  150. </td>
  151. </tr>
  152. <tr>
  153. <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('class="hidden"');?>>
  154. <input type="radio" name="shareapi_share_policy" id="sharePolicyGlobal"
  155. value="global" <?php if ($_['sharePolicy'] === 'global') print_unescaped('checked="checked"'); ?> />
  156. <label for="sharePolicyGlobal"><?php p($l->t('Allow users to share with anyone')); ?></label><br/>
  157. <input type="radio" name="shareapi_share_policy" id="sharePolicyGroupsOnly"
  158. value="groups_only" <?php if ($_['sharePolicy'] === 'groups_only') print_unescaped('checked="checked"'); ?> />
  159. <label for="sharePolicyGroupsOnly"><?php p($l->t('Allow users to only share with users in their groups'));?></label><br/>
  160. </td>
  161. </tr>
  162. <tr>
  163. <td <?php if ($_['shareAPIEnabled'] === 'no') print_unescaped('class="hidden"');?>>
  164. <input type="checkbox" name="shareapi_allow_mail_notification" id="allowMailNotification"
  165. value="1" <?php if ($_['allowMailNotification'] === 'yes') print_unescaped('checked="checked"'); ?> />
  166. <label for="allowMailNotification"><?php p($l->t('Allow mail notification'));?></label><br/>
  167. <em><?php p($l->t('Allow user to send mail notification for shared files')); ?></em>
  168. </td>
  169. </tr>
  170. </table>
  171. </fieldset>
  172. <fieldset class="personalblock" id="security">
  173. <h2><?php p($l->t('Security'));?></h2>
  174. <table>
  175. <tr>
  176. <td id="enable">
  177. <input type="checkbox" name="forcessl" id="forcessl"
  178. <?php if ($_['enforceHTTPSEnabled']) {
  179. print_unescaped('checked="checked" ');
  180. print_unescaped('value="false"');
  181. } else {
  182. print_unescaped('value="true"');
  183. }
  184. ?>
  185. <?php if (!$_['isConnectedViaHTTPS']) p('disabled'); ?> />
  186. <label for="forcessl"><?php p($l->t('Enforce HTTPS'));?></label><br/>
  187. <em><?php p($l->t(
  188. 'Forces the clients to connect to %s via an encrypted connection.',
  189. $theme->getName()
  190. )); ?></em>
  191. <?php if (!$_['isConnectedViaHTTPS']) {
  192. print_unescaped("<br/><em>");
  193. p($l->t(
  194. 'Please connect to your %s via HTTPS to enable or disable the SSL enforcement.',
  195. $theme->getName()
  196. ));
  197. print_unescaped("</em>");
  198. }
  199. ?>
  200. </td>
  201. </tr>
  202. </table>
  203. </fieldset>
  204. <fieldset class="personalblock">
  205. <h2><?php p($l->t('Log'));?></h2>
  206. <?php p($l->t('Log level'));?> <select name='loglevel' id='loglevel'>
  207. <?php for ($i = 0; $i < 5; $i++):
  208. $selected = '';
  209. if ($i == $_['loglevel']):
  210. $selected = 'selected="selected"';
  211. endif; ?>
  212. <option value='<?php p($i)?>' <?php p($selected) ?>><?php p($levelLabels[$i])?></option>
  213. <?php endfor;?>
  214. </select>
  215. <table id="log" class="grid">
  216. <?php foreach ($_['entries'] as $entry): ?>
  217. <tr>
  218. <td>
  219. <?php p($levels[$entry->level]);?>
  220. </td>
  221. <td>
  222. <?php p($entry->app);?>
  223. </td>
  224. <td>
  225. <?php p($entry->message);?>
  226. </td>
  227. <td class="date">
  228. <?php if(is_int($entry->time)){
  229. p(OC_Util::formatDate($entry->time));
  230. } else {
  231. p($entry->time);
  232. }?>
  233. </td>
  234. </tr>
  235. <?php endforeach;?>
  236. </table>
  237. <?php if ($_['entriesremain']): ?>
  238. <input id="moreLog" type="button" value="<?php p($l->t('More'));?>...">
  239. <input id="lessLog" type="button" value="<?php p($l->t('Less'));?>...">
  240. <?php endif; ?>
  241. </fieldset>
  242. <fieldset class="personalblock">
  243. <h2><?php p($l->t('Version'));?></h2>
  244. <strong><?php p($theme->getTitle()); ?></strong> <?php p(OC_Util::getVersionString().' ('.OC_Util::getChannel().')'); ?>
  245. <?php if (OC_Util::getEditionString() === ''): ?>
  246. <p>
  247. <?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>.')); ?>
  248. </p>
  249. <?php endif; ?>
  250. </fieldset>
  251. <fieldset class="personalblock credits-footer">
  252. <p>
  253. <?php print_unescaped($theme->getShortFooter()); ?>
  254. </p>
  255. </fieldset>