installation.php 7.5 KB

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