You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

installation.php 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?php
  2. script('core', 'dist/install');
  3. ?>
  4. <input type='hidden' id='hasMySQL' value='<?php p($_['hasMySQL']) ?>'>
  5. <input type='hidden' id='hasSQLite' value='<?php p($_['hasSQLite']) ?>'>
  6. <input type='hidden' id='hasPostgreSQL' value='<?php p($_['hasPostgreSQL']) ?>'>
  7. <input type='hidden' id='hasOracle' value='<?php p($_['hasOracle']) ?>'>
  8. <form action="index.php" method="post">
  9. <input type="hidden" name="install" value="true">
  10. <?php if (count($_['errors']) > 0): ?>
  11. <fieldset class="warning">
  12. <legend><strong><?php p($l->t('Error'));?></strong></legend>
  13. <?php foreach ($_['errors'] as $err): ?>
  14. <p>
  15. <?php if (is_array($err)):?>
  16. <?php p($err['error']); ?>
  17. <span class='hint'><?php p($err['hint']); ?></span>
  18. <?php else: ?>
  19. <?php p($err); ?>
  20. <?php endif; ?>
  21. </p>
  22. <?php endforeach; ?>
  23. </fieldset>
  24. <?php endif; ?>
  25. <?php if (!$_['htaccessWorking']): ?>
  26. <fieldset class="warning">
  27. <legend><strong><?php p($l->t('Security warning'));?></strong></legend>
  28. <p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br>
  29. <?php print_unescaped($l->t(
  30. 'For information how to properly configure your server, please see the <a href="%s" target="_blank" rel="noreferrer noopener">documentation</a>.',
  31. [link_to_docs('admin-install')]
  32. )); ?></p>
  33. </fieldset>
  34. <?php endif; ?>
  35. <fieldset id="adminaccount">
  36. <legend><?php print_unescaped($l->t('Create an <strong>admin account</strong>')); ?></legend>
  37. <p class="grouptop">
  38. <input type="text" name="adminlogin" id="adminlogin"
  39. placeholder="<?php p($l->t('Username')); ?>"
  40. value="<?php p($_['adminlogin']); ?>"
  41. autocomplete="off" autocapitalize="none" autocorrect="off" autofocus required>
  42. <label for="adminlogin" class="infield"><?php p($l->t('Username')); ?></label>
  43. </p>
  44. <p class="groupbottom">
  45. <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass"
  46. placeholder="<?php p($l->t('Password')); ?>"
  47. value="<?php p($_['adminpass']); ?>"
  48. autocomplete="off" autocapitalize="none" autocorrect="off" required>
  49. <label for="adminpass" class="infield"><?php p($l->t('Password')); ?></label>
  50. <input type="checkbox" id="show" class="hidden-visually" name="show" aria-label="<?php p($l->t('Show password')); ?>">
  51. <label for="show"></label>
  52. </p>
  53. </fieldset>
  54. <?php if (!$_['directoryIsSet'] or !$_['dbIsSet'] or count($_['errors']) > 0): ?>
  55. <fieldset id="advancedHeader">
  56. <legend><a id="showAdvanced" tabindex="0" href="#"><?php p($l->t('Storage & database')); ?><img src="<?php print_unescaped(image_path('', 'actions/caret-white.svg')); ?>" /></a></legend>
  57. </fieldset>
  58. <?php endif; ?>
  59. <?php if (!$_['directoryIsSet'] or count($_['errors']) > 0): ?>
  60. <fieldset id="datadirField">
  61. <div id="datadirContent">
  62. <label for="directory"><?php p($l->t('Data folder')); ?></label>
  63. <input type="text" name="directory" id="directory"
  64. placeholder="<?php p(OC::$SERVERROOT.'/data'); ?>"
  65. value="<?php p($_['directory']); ?>"
  66. autocomplete="off" autocapitalize="none" autocorrect="off">
  67. </div>
  68. </fieldset>
  69. <?php endif; ?>
  70. <?php if (!$_['dbIsSet'] or count($_['errors']) > 0): ?>
  71. <fieldset id='databaseBackend'>
  72. <?php if ($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle']) {
  73. $hasOtherDB = true;
  74. } else {
  75. $hasOtherDB = false;
  76. } //other than SQLite?>
  77. <legend><?php p($l->t('Configure the database')); ?></legend>
  78. <div id="selectDbType">
  79. <?php foreach ($_['databases'] as $type => $label): ?>
  80. <?php if (count($_['databases']) === 1): ?>
  81. <p class="info">
  82. <?php p($l->t('Only %s is available.', [$label])); ?>
  83. <?php p($l->t('Install and activate additional PHP modules to choose other database types.')); ?><br>
  84. <a href="<?php print_unescaped(link_to_docs('admin-source_install')); ?>" target="_blank" rel="noreferrer noopener">
  85. <?php p($l->t('For more details check out the documentation.')); ?> ↗</a>
  86. </p>
  87. <input type="hidden" id="dbtype" name="dbtype" value="<?php p($type) ?>">
  88. <?php else: ?>
  89. <input type="radio" name="dbtype" value="<?php p($type) ?>" id="<?php p($type) ?>"
  90. <?php print_unescaped($_['dbtype'] === $type ? 'checked="checked" ' : '') ?>/>
  91. <label class="<?php p($type) ?>" for="<?php p($type) ?>"><?php p($label) ?></label>
  92. <?php endif; ?>
  93. <?php endforeach; ?>
  94. </div>
  95. </fieldset>
  96. <?php if ($hasOtherDB): ?>
  97. <fieldset id='databaseField'>
  98. <div id="use_other_db">
  99. <p class="grouptop">
  100. <label for="dbuser" class="infield"><?php p($l->t('Database user')); ?></label>
  101. <input type="text" name="dbuser" id="dbuser"
  102. placeholder="<?php p($l->t('Database user')); ?>"
  103. value="<?php p($_['dbuser']); ?>"
  104. autocomplete="off" autocapitalize="none" autocorrect="off">
  105. </p>
  106. <p class="groupmiddle">
  107. <input type="password" name="dbpass" id="dbpass" data-typetoggle="#dbpassword-toggle"
  108. placeholder="<?php p($l->t('Database password')); ?>"
  109. value="<?php p($_['dbpass']); ?>"
  110. autocomplete="off" autocapitalize="none" autocorrect="off">
  111. <label for="dbpass" class="infield"><?php p($l->t('Database password')); ?></label>
  112. <input type="checkbox" id="dbpassword-toggle" class="hidden-visually" name="dbpassword-toggle" aria-label="<?php p($l->t('Show password')); ?>">
  113. <label for="dbpassword-toggle"></label>
  114. </p>
  115. <p class="groupmiddle">
  116. <label for="dbname" class="infield"><?php p($l->t('Database name')); ?></label>
  117. <input type="text" name="dbname" id="dbname"
  118. placeholder="<?php p($l->t('Database name')); ?>"
  119. value="<?php p($_['dbname']); ?>"
  120. autocomplete="off" autocapitalize="none" autocorrect="off"
  121. pattern="[0-9a-zA-Z$_-]+">
  122. </p>
  123. <?php if ($_['hasOracle']): ?>
  124. <div id="use_oracle_db">
  125. <p class="groupmiddle">
  126. <label for="dbtablespace" class="infield"><?php p($l->t('Database tablespace')); ?></label>
  127. <input type="text" name="dbtablespace" id="dbtablespace"
  128. placeholder="<?php p($l->t('Database tablespace')); ?>"
  129. value="<?php p($_['dbtablespace']); ?>"
  130. autocomplete="off" autocapitalize="none" autocorrect="off">
  131. </p>
  132. </div>
  133. <?php endif; ?>
  134. <p class="groupbottom">
  135. <label for="dbhost" class="infield"><?php p($l->t('Database host')); ?></label>
  136. <input type="text" name="dbhost" id="dbhost"
  137. placeholder="<?php p($l->t('Database host')); ?>"
  138. value="<?php p($_['dbhost']); ?>"
  139. autocomplete="off" autocapitalize="none" autocorrect="off">
  140. </p>
  141. <p class="info">
  142. <?php p($l->t('Please specify the port number along with the host name (e.g., localhost:5432).')); ?>
  143. </p>
  144. </div>
  145. </fieldset>
  146. <?php endif; ?>
  147. <?php endif; ?>
  148. <?php if (!$_['dbIsSet'] or count($_['errors']) > 0): ?>
  149. <fieldset id="sqliteInformation" class="warning">
  150. <legend><?php p($l->t('Performance warning'));?></legend>
  151. <p><?php p($l->t('You chose SQLite as database.'));?></p>
  152. <p><?php p($l->t('SQLite should only be used for minimal and development instances. For production we recommend a different database backend.'));?></p>
  153. <p><?php p($l->t('If you use clients for file syncing, the use of SQLite is highly discouraged.')); ?></p>
  154. </fieldset>
  155. <?php endif ?>
  156. <fieldset>
  157. <p class="info">
  158. <input type="checkbox" id="install-recommended-apps" name="install-recommended-apps" class="checkbox checkbox--white" checked>
  159. <label for="install-recommended-apps">
  160. <?php p($l->t('Install recommended apps')); ?>
  161. <span><?php p($l->t('Calendar, Contacts, Talk, Mail & Collaborative editing')); ?></span>
  162. </label>
  163. </p>
  164. </fieldset>
  165. <div class="icon-loading-dark float-spinner">&nbsp;</div>
  166. <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t('Finish setup')); ?>" data-finishing="<?php p($l->t('Finishing …')); ?>"></div>
  167. <p class="info">
  168. <span class="icon-info-white"></span>
  169. <?php p($l->t('Need help?'));?>
  170. <a target="_blank" rel="noreferrer noopener" href="<?php p(link_to_docs('admin-install')); ?>"><?php p($l->t('See the documentation'));?> ↗</a>
  171. </p>
  172. </form>