installation.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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"><?php p($l->t( 'Only %s is available.', array($label) )); ?>.</p>
  86. <input type="hidden" id="dbtype" name="dbtype" value="<?php p($type) ?>" />
  87. <?php else: ?>
  88. <input type="radio" name="dbtype" value="<?php p($type) ?>" id="<?php p($type) ?>"
  89. <?php print_unescaped($_['dbtype'] === $type ? 'checked="checked" ' : '') ?>/>
  90. <label class="<?php p($type) ?>" for="<?php p($type) ?>"><?php p($label) ?></label>
  91. <?php endif; ?>
  92. <?php endforeach; ?>
  93. </div>
  94. </fieldset>
  95. <?php if($hasOtherDB): ?>
  96. <fieldset id='databaseField'>
  97. <div id="use_other_db">
  98. <p class="grouptop">
  99. <label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label>
  100. <input type="text" name="dbuser" id="dbuser"
  101. placeholder="<?php p($l->t( 'Database user' )); ?>"
  102. value="<?php p($_['dbuser']); ?>"
  103. autocomplete="off" autocapitalize="off" autocorrect="off" />
  104. </p>
  105. <p class="groupmiddle">
  106. <input type="password" name="dbpass" id="dbpass" data-typetoggle="#dbpassword"
  107. placeholder="<?php p($l->t( 'Database password' )); ?>"
  108. value="<?php p($_['dbpass']); ?>"
  109. autocomplete="off" autocapitalize="off" autocorrect="off" />
  110. <label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label>
  111. <input type="checkbox" id="dbpassword" name="dbpassword" />
  112. <label for="dbpassword"></label>
  113. </p>
  114. <p class="groupmiddle">
  115. <label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label>
  116. <input type="text" name="dbname" id="dbname"
  117. placeholder="<?php p($l->t( 'Database name' )); ?>"
  118. value="<?php p($_['dbname']); ?>"
  119. autocomplete="off" autocapitalize="off" autocorrect="off"
  120. pattern="[0-9a-zA-Z$_-]+" />
  121. </p>
  122. <?php if($_['hasOracle']): ?>
  123. <div id="use_oracle_db">
  124. <p class="groupmiddle">
  125. <label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label>
  126. <input type="text" name="dbtablespace" id="dbtablespace"
  127. placeholder="<?php p($l->t( 'Database tablespace' )); ?>"
  128. value="<?php p($_['dbtablespace']); ?>"
  129. autocomplete="off" autocapitalize="off" autocorrect="off" />
  130. </p>
  131. </div>
  132. <?php endif; ?>
  133. <p class="groupbottom">
  134. <label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label>
  135. <input type="text" name="dbhost" id="dbhost"
  136. placeholder="<?php p($l->t( 'Database host' )); ?>"
  137. value="<?php p($_['dbhost']); ?>"
  138. autocomplete="off" autocapitalize="off" autocorrect="off" />
  139. </p>
  140. </div>
  141. </fieldset>
  142. <?php endif; ?>
  143. <?php endif; ?>
  144. <div class="icon-loading-dark float-spinner">&nbsp;</div>
  145. <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?>
  146. <fieldset id="sqliteInformation" class="warning">
  147. <legend><?php p($l->t('Performance Warning'));?></legend>
  148. <p><?php p($l->t('SQLite will be used as database.'));?></p>
  149. <p><?php p($l->t('For larger installations we recommend to choose a different database backend.'));?></p>
  150. <p><?php p($l->t('Especially when using the desktop client for file syncing the use of SQLite is discouraged.')); ?></p>
  151. </fieldset>
  152. <?php endif ?>
  153. <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t( 'Finish setup' )); ?>" data-finishing="<?php p($l->t( 'Finishing …' )); ?>" /></div>
  154. </form>