installation.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <input type='hidden' id='hasMySQL' value='<?php p($_['hasMySQL']) ?>'>
  2. <input type='hidden' id='hasSQLite' value='<?php p($_['hasSQLite']) ?>'>
  3. <input type='hidden' id='hasPostgreSQL' value='<?php p($_['hasPostgreSQL']) ?>'>
  4. <input type='hidden' id='hasOracle' value='<?php p($_['hasOracle']) ?>'>
  5. <input type='hidden' id='hasMSSQL' value='<?php p($_['hasMSSQL']) ?>'>
  6. <form action="index.php" method="post">
  7. <input type="hidden" name="install" value="true" />
  8. <?php if(count($_['errors']) > 0): ?>
  9. <fieldset class="warning">
  10. <legend><strong><?php p($l->t('Error'));?></strong></legend>
  11. <?php foreach($_['errors'] as $err): ?>
  12. <p>
  13. <?php if(is_array($err)):?>
  14. <?php print_unescaped($err['error']); ?>
  15. <span class='hint'><?php print_unescaped($err['hint']); ?></span>
  16. <?php else: ?>
  17. <?php print_unescaped($err); ?>
  18. <?php endif; ?>
  19. </p>
  20. <?php endforeach; ?>
  21. </fieldset>
  22. <?php endif; ?>
  23. <?php if($_['vulnerableToNullByte']): ?>
  24. <fieldset class="warning">
  25. <legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  26. <p><?php p($l->t('Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)'));?><br/>
  27. <?php p($l->t('Please update your PHP installation to use %s securely.', $theme->getName() )); ?></p>
  28. </fieldset>
  29. <?php endif; ?>
  30. <?php if(!$_['secureRNG']): ?>
  31. <fieldset class="warning">
  32. <legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  33. <p><?php p($l->t('No secure random number generator is available, please enable the PHP OpenSSL extension.'));?><br/>
  34. <?php p($l->t('Without a secure random number generator an attacker may be able to predict password reset tokens and take over your account.'));?></p>
  35. </fieldset>
  36. <?php endif; ?>
  37. <?php if(!$_['htaccessWorking']): ?>
  38. <fieldset class="warning">
  39. <legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  40. <p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br>
  41. <?php print_unescaped($l->t(
  42. 'For information how to properly configure your server, please see the <a href="%s" target="_blank">documentation</a>.',
  43. link_to_docs('admin-install')
  44. )); ?></p>
  45. </fieldset>
  46. <?php endif; ?>
  47. <fieldset id="adminaccount">
  48. <legend><?php print_unescaped($l->t( 'Create an <strong>admin account</strong>' )); ?></legend>
  49. <p class="grouptop">
  50. <input type="text" name="adminlogin" id="adminlogin"
  51. placeholder="<?php p($l->t( 'Username' )); ?>"
  52. value="<?php p($_['adminlogin']); ?>"
  53. autocomplete="off" autocapitalize="off" autocorrect="off" autofocus required />
  54. <label for="adminlogin" class="infield"><?php p($l->t( 'Username' )); ?></label>
  55. <img class="svg" src="<?php p(image_path('', 'actions/user.svg')); ?>" alt="" />
  56. </p>
  57. <p class="groupbottom">
  58. <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass"
  59. placeholder="<?php p($l->t( 'Password' )); ?>"
  60. value="<?php p($_['adminpass']); ?>"
  61. autocomplete="off" autocapitalize="off" autocorrect="off" required />
  62. <label for="adminpass" class="infield"><?php p($l->t( 'Password' )); ?></label>
  63. <img class="svg" id="adminpass-icon" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt="" />
  64. <input type="checkbox" id="show" name="show" />
  65. <label for="show"></label>
  66. <div class="strengthify-wrapper"></div>
  67. </p>
  68. </fieldset>
  69. <?php if(!$_['directoryIsSet'] OR !$_['dbIsSet'] OR count($_['errors']) > 0): ?>
  70. <fieldset id="advancedHeader">
  71. <legend><a id="showAdvanced"><?php p($l->t( 'Storage & database' )); ?> <img class="svg" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend>
  72. </fieldset>
  73. <?php endif; ?>
  74. <?php if(!$_['directoryIsSet'] OR count($_['errors']) > 0): ?>
  75. <fieldset id="datadirField">
  76. <div id="datadirContent">
  77. <label for="directory"><?php p($l->t( 'Data folder' )); ?></label>
  78. <input type="text" name="directory" id="directory"
  79. placeholder="<?php p(OC::$SERVERROOT.'/data'); ?>"
  80. value="<?php p($_['directory']); ?>"
  81. autocomplete="off" autocapitalize="off" autocorrect="off" />
  82. </div>
  83. </fieldset>
  84. <?php endif; ?>
  85. <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?>
  86. <fieldset id='databaseBackend'>
  87. <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle'] or $_['hasMSSQL'])
  88. $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?>
  89. <legend><?php p($l->t( 'Configure the database' )); ?></legend>
  90. <div id="selectDbType">
  91. <?php foreach($_['databases'] as $type => $label): ?>
  92. <?php if(count($_['databases']) === 1): ?>
  93. <p class="info"><?php p($l->t( 'Only %s is available.', array($label) )); ?>.</p>
  94. <input type="hidden" id="dbtype" name="dbtype" value="<?php p($type) ?>" />
  95. <?php else: ?>
  96. <input type="radio" name="dbtype" value="<?php p($type) ?>" id="<?php p($type) ?>"
  97. <?php print_unescaped($_['dbtype'] === $type ? 'checked="checked" ' : '') ?>/>
  98. <label class="<?php p($type) ?>" for="<?php p($type) ?>"><?php p($label) ?></label>
  99. <?php endif; ?>
  100. <?php endforeach; ?>
  101. </div>
  102. </fieldset>
  103. <?php if($hasOtherDB): ?>
  104. <fieldset id='databaseField'>
  105. <div id="use_other_db">
  106. <p class="grouptop">
  107. <label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label>
  108. <input type="text" name="dbuser" id="dbuser"
  109. placeholder="<?php p($l->t( 'Database user' )); ?>"
  110. value="<?php p($_['dbuser']); ?>"
  111. autocomplete="off" autocapitalize="off" autocorrect="off" />
  112. </p>
  113. <p class="groupmiddle">
  114. <input type="password" name="dbpass" id="dbpass" data-typetoggle="#dbpassword"
  115. placeholder="<?php p($l->t( 'Database password' )); ?>"
  116. value="<?php p($_['dbpass']); ?>"
  117. autocomplete="off" autocapitalize="off" autocorrect="off" />
  118. <label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label>
  119. <input type="checkbox" id="dbpassword" name="dbpassword" />
  120. <label for="dbpassword"></label>
  121. </p>
  122. <p class="groupmiddle">
  123. <label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label>
  124. <input type="text" name="dbname" id="dbname"
  125. placeholder="<?php p($l->t( 'Database name' )); ?>"
  126. value="<?php p($_['dbname']); ?>"
  127. autocomplete="off" autocapitalize="off" autocorrect="off"
  128. pattern="[0-9a-zA-Z$_-]+" />
  129. </p>
  130. <?php if($_['hasOracle']): ?>
  131. <div id="use_oracle_db">
  132. <p class="groupmiddle">
  133. <label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label>
  134. <input type="text" name="dbtablespace" id="dbtablespace"
  135. placeholder="<?php p($l->t( 'Database tablespace' )); ?>"
  136. value="<?php p($_['dbtablespace']); ?>"
  137. autocomplete="off" autocapitalize="off" autocorrect="off" />
  138. </p>
  139. </div>
  140. <?php endif; ?>
  141. <p class="groupbottom">
  142. <label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label>
  143. <input type="text" name="dbhost" id="dbhost"
  144. placeholder="<?php p($l->t( 'Database host' )); ?>"
  145. value="<?php p($_['dbhost']); ?>"
  146. autocomplete="off" autocapitalize="off" autocorrect="off" />
  147. </p>
  148. </div>
  149. </fieldset>
  150. <?php endif; ?>
  151. <?php endif; ?>
  152. <p id="sqliteInformation" class="info"><?php p($l->t('SQLite will be used as database. For larger installations we recommend to change this.'));?></p>
  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>