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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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" rel="noreferrer">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. </p>
  47. <p class="groupbottom">
  48. <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass"
  49. placeholder="<?php p($l->t( 'Password' )); ?>"
  50. value="<?php p($_['adminpass']); ?>"
  51. autocomplete="off" autocapitalize="off" autocorrect="off" required>
  52. <label for="adminpass" class="infield"><?php p($l->t( 'Password' )); ?></label>
  53. <input type="checkbox" id="show" name="show">
  54. <label for="show" class="svg"></label>
  55. <div class="strengthify-wrapper"></div>
  56. </p>
  57. </fieldset>
  58. <?php if(!$_['directoryIsSet'] OR !$_['dbIsSet'] OR count($_['errors']) > 0): ?>
  59. <fieldset id="advancedHeader">
  60. <legend><a id="showAdvanced"><?php p($l->t( 'Storage & database' )); ?> <img class="svg" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend>
  61. </fieldset>
  62. <?php endif; ?>
  63. <?php if(!$_['directoryIsSet'] OR count($_['errors']) > 0): ?>
  64. <fieldset id="datadirField">
  65. <div id="datadirContent">
  66. <label for="directory"><?php p($l->t( 'Data folder' )); ?></label>
  67. <input type="text" name="directory" id="directory"
  68. placeholder="<?php p(OC::$SERVERROOT.'/data'); ?>"
  69. value="<?php p($_['directory']); ?>"
  70. autocomplete="off" autocapitalize="off" autocorrect="off">
  71. </div>
  72. </fieldset>
  73. <?php endif; ?>
  74. <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?>
  75. <fieldset id='databaseBackend'>
  76. <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle'])
  77. $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?>
  78. <legend><?php p($l->t( 'Configure the database' )); ?></legend>
  79. <div id="selectDbType">
  80. <?php foreach($_['databases'] as $type => $label): ?>
  81. <?php if(count($_['databases']) === 1): ?>
  82. <p class="info">
  83. <?php p($l->t( 'Only %s is available.', array($label) )); ?>
  84. <?php p($l->t( 'Install and activate additional PHP modules to choose other database types.' )); ?><br>
  85. <a href="<?php print_unescaped(link_to_docs('admin-source_install')); ?>" target="_blank" rel="noreferrer">
  86. <?php p($l->t( 'For more details check out the documentation.' )); ?> ↗</a>
  87. </p>
  88. <input type="hidden" id="dbtype" name="dbtype" value="<?php p($type) ?>">
  89. <?php else: ?>
  90. <input type="radio" name="dbtype" value="<?php p($type) ?>" id="<?php p($type) ?>"
  91. <?php print_unescaped($_['dbtype'] === $type ? 'checked="checked" ' : '') ?>/>
  92. <label class="<?php p($type) ?>" for="<?php p($type) ?>"><?php p($label) ?></label>
  93. <?php endif; ?>
  94. <?php endforeach; ?>
  95. </div>
  96. </fieldset>
  97. <?php if($hasOtherDB): ?>
  98. <fieldset id='databaseField'>
  99. <div id="use_other_db">
  100. <p class="grouptop">
  101. <label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label>
  102. <input type="text" name="dbuser" id="dbuser"
  103. placeholder="<?php p($l->t( 'Database user' )); ?>"
  104. value="<?php p($_['dbuser']); ?>"
  105. autocomplete="off" autocapitalize="off" autocorrect="off">
  106. </p>
  107. <p class="groupmiddle">
  108. <input type="password" name="dbpass" id="dbpass" data-typetoggle="#dbpassword"
  109. placeholder="<?php p($l->t( 'Database password' )); ?>"
  110. value="<?php p($_['dbpass']); ?>"
  111. autocomplete="off" autocapitalize="off" autocorrect="off">
  112. <label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label>
  113. <input type="checkbox" id="dbpassword" name="dbpassword">
  114. <label for="dbpassword"></label>
  115. </p>
  116. <p class="groupmiddle">
  117. <label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label>
  118. <input type="text" name="dbname" id="dbname"
  119. placeholder="<?php p($l->t( 'Database name' )); ?>"
  120. value="<?php p($_['dbname']); ?>"
  121. autocomplete="off" autocapitalize="off" autocorrect="off"
  122. pattern="[0-9a-zA-Z$_-]+">
  123. </p>
  124. <?php if($_['hasOracle']): ?>
  125. <div id="use_oracle_db">
  126. <p class="groupmiddle">
  127. <label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label>
  128. <input type="text" name="dbtablespace" id="dbtablespace"
  129. placeholder="<?php p($l->t( 'Database tablespace' )); ?>"
  130. value="<?php p($_['dbtablespace']); ?>"
  131. autocomplete="off" autocapitalize="off" autocorrect="off">
  132. </p>
  133. </div>
  134. <?php endif; ?>
  135. <p class="groupbottom">
  136. <label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label>
  137. <input type="text" name="dbhost" id="dbhost"
  138. placeholder="<?php p($l->t( 'Database host' )); ?>"
  139. value="<?php p($_['dbhost']); ?>"
  140. autocomplete="off" autocapitalize="off" autocorrect="off">
  141. </p>
  142. </div>
  143. </fieldset>
  144. <?php endif; ?>
  145. <?php endif; ?>
  146. <div class="icon-loading-dark float-spinner">&nbsp;</div>
  147. <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?>
  148. <fieldset id="sqliteInformation" class="warning">
  149. <legend><?php p($l->t('Performance warning'));?></legend>
  150. <p><?php p($l->t('SQLite will be used as database.'));?></p>
  151. <p><?php p($l->t('For larger installations we recommend to choose a different database backend.'));?></p>
  152. <p><?php p($l->t('Especially when using the desktop client for file syncing the use of SQLite is discouraged.')); ?></p>
  153. </fieldset>
  154. <?php endif ?>
  155. <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t( 'Finish setup' )); ?>" data-finishing="<?php p($l->t( 'Finishing …' )); ?>"></div>
  156. <p class="info">
  157. <span class="icon-info-white svg"></span>
  158. <?php p($l->t('Need help?'));?>
  159. <a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-install')); ?>"><?php p($l->t('See the documentation'));?> ↗</a>
  160. </p>
  161. </form>