installation.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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="infield grouptop">
  50. <input type="text" name="adminlogin" id="adminlogin" placeholder=""
  51. value="<?php p(OC_Helper::init_var('adminlogin')); ?>" autocomplete="off" autofocus required />
  52. <label for="adminlogin" class="infield"><?php p($l->t( 'Username' )); ?></label>
  53. <img class="svg" src="<?php p(image_path('', 'actions/user.svg')); ?>" alt="" />
  54. </p>
  55. <p class="infield groupbottom">
  56. <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass" placeholder=""
  57. value="<?php p(OC_Helper::init_var('adminpass')); ?>" />
  58. <label for="adminpass" class="infield"><?php p($l->t( 'Password' )); ?></label>
  59. <img class="svg" id="adminpass-icon" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt="" />
  60. <input type="checkbox" id="show" name="show" />
  61. <label for="show"></label>
  62. </p>
  63. </fieldset>
  64. <?php if(!$_['directoryIsSet'] OR !$_['dbIsSet'] OR count($_['errors']) > 0): ?>
  65. <fieldset id="advancedHeader">
  66. <legend><a id="showAdvanced"><?php p($l->t( 'Advanced' )); ?> <img class="svg" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend>
  67. </fieldset>
  68. <?php endif; ?>
  69. <?php if(!$_['directoryIsSet'] OR count($_['errors']) > 0): ?>
  70. <fieldset id="datadirField">
  71. <div id="datadirContent">
  72. <label for="directory"><?php p($l->t( 'Data folder' )); ?></label>
  73. <input type="text" name="directory" id="directory"
  74. placeholder="<?php p(OC::$SERVERROOT."/data"); ?>"
  75. value="<?php p(OC_Helper::init_var('directory', $_['directory'])); ?>" />
  76. </div>
  77. </fieldset>
  78. <?php endif; ?>
  79. <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?>
  80. <fieldset id='databaseField'>
  81. <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle'] or $_['hasMSSQL'])
  82. $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?>
  83. <legend><?php p($l->t( 'Configure the database' )); ?></legend>
  84. <div id="selectDbType">
  85. <?php if($_['hasSQLite']): ?>
  86. <input type='hidden' id='hasSQLite' value="true" />
  87. <?php if(!$hasOtherDB): ?>
  88. <p>SQLite <?php p($l->t( 'will be used' )); ?>.</p>
  89. <input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
  90. <?php else: ?>
  91. <input type="radio" name="dbtype" value="sqlite" id="sqlite"
  92. <?php OC_Helper::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/>
  93. <label class="sqlite" for="sqlite">SQLite</label>
  94. <?php endif; ?>
  95. <?php endif; ?>
  96. <?php if($_['hasMySQL']): ?>
  97. <input type='hidden' id='hasMySQL' value='true'/>
  98. <?php if(!$_['hasSQLite'] and !$_['hasPostgreSQL'] and !$_['hasOracle'] and !$_['hasMSSQL']): ?>
  99. <p>MySQL <?php p($l->t( 'will be used' )); ?>.</p>
  100. <input type="hidden" id="dbtype" name="dbtype" value="mysql" />
  101. <?php else: ?>
  102. <input type="radio" name="dbtype" value="mysql" id="mysql"
  103. <?php OC_Helper::init_radio('dbtype', 'mysql', 'sqlite'); ?>/>
  104. <label class="mysql" for="mysql">MySQL</label>
  105. <?php endif; ?>
  106. <?php endif; ?>
  107. <?php if($_['hasPostgreSQL']): ?>
  108. <?php if(!$_['hasSQLite'] and !$_['hasMySQL'] and !$_['hasOracle'] and !$_['hasMSSQL']): ?>
  109. <p>PostgreSQL <?php p($l->t( 'will be used' )); ?>.</p>
  110. <input type="hidden" id="dbtype" name="dbtype" value="pgsql" />
  111. <?php else: ?>
  112. <label class="pgsql" for="pgsql">PostgreSQL</label>
  113. <input type="radio" name="dbtype" value='pgsql' id="pgsql"
  114. <?php OC_Helper::init_radio('dbtype', 'pgsql', 'sqlite'); ?>/>
  115. <?php endif; ?>
  116. <?php endif; ?>
  117. <?php if($_['hasOracle']): ?>
  118. <?php if(!$_['hasSQLite'] and !$_['hasMySQL'] and !$_['hasPostgreSQL'] and !$_['hasMSSQL']): ?>
  119. <p>Oracle <?php p($l->t( 'will be used' )); ?>.</p>
  120. <input type="hidden" id="dbtype" name="dbtype" value="oci" />
  121. <?php else: ?>
  122. <label class="oci" for="oci">Oracle</label>
  123. <input type="radio" name="dbtype" value='oci' id="oci"
  124. <?php OC_Helper::init_radio('dbtype', 'oci', 'sqlite'); ?>/>
  125. <?php endif; ?>
  126. <?php endif; ?>
  127. <?php if($_['hasMSSQL']): ?>
  128. <input type='hidden' id='hasMSSQL' value='true'/>
  129. <?php if(!$_['hasSQLite'] and !$_['hasMySQL'] and !$_['hasPostgreSQL'] and !$_['hasOracle']): ?>
  130. <p>MS SQL <?php p($l->t( 'will be used' )); ?>.</p>
  131. <input type="hidden" id="dbtype" name="dbtype" value="mssql" />
  132. <?php else: ?>
  133. <label class="mssql" for="mssql">MS SQL</label>
  134. <input type="radio" name="dbtype" value='mssql' id="mssql" <?php OC_Helper::init_radio('dbtype', 'mssql', 'sqlite'); ?>/>
  135. <?php endif; ?>
  136. <?php endif; ?>
  137. </div>
  138. <?php if($hasOtherDB): ?>
  139. <div id="use_other_db">
  140. <p class="infield grouptop">
  141. <label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label>
  142. <input type="text" name="dbuser" id="dbuser" placeholder=""
  143. value="<?php p(OC_Helper::init_var('dbuser')); ?>" autocomplete="off" />
  144. </p>
  145. <p class="infield groupmiddle">
  146. <input type="password" name="dbpass" id="dbpass" placeholder="" data-typetoggle="#dbpassword"
  147. value="<?php p(OC_Helper::init_var('dbpass')); ?>" />
  148. <label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label>
  149. <input type="checkbox" id="dbpassword" name="dbpassword" />
  150. <label for="dbpassword"></label>
  151. </p>
  152. <p class="infield groupmiddle">
  153. <label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label>
  154. <input type="text" name="dbname" id="dbname" placeholder=""
  155. value="<?php p(OC_Helper::init_var('dbname')); ?>"
  156. autocomplete="off" pattern="[0-9a-zA-Z$_-]+" />
  157. </p>
  158. <?php if($_['hasOracle']): ?>
  159. <div id="use_oracle_db">
  160. <p class="infield groupmiddle">
  161. <label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label>
  162. <input type="text" name="dbtablespace" id="dbtablespace" placeholder=""
  163. value="<?php p(OC_Helper::init_var('dbtablespace')); ?>" autocomplete="off" />
  164. </p>
  165. </div>
  166. <?php endif; ?>
  167. <p class="infield groupbottom">
  168. <label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label>
  169. <input type="text" name="dbhost" id="dbhost" placeholder=""
  170. value="<?php p(OC_Helper::init_var('dbhost')); ?>" />
  171. </p>
  172. </div>
  173. <?php endif; ?>
  174. </fieldset>
  175. <?php endif; ?>
  176. <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t( 'Finish setup' )); ?>" data-finishing="<?php p($l->t( 'Finishing …' )); ?>" /></div>
  177. </form>