installation.php 7.5 KB

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