installation.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. <ul class="errors">
  10. <?php foreach($_['errors'] as $err): ?>
  11. <li>
  12. <?php if(is_array($err)):?>
  13. <?php print_unescaped($err['error']); ?>
  14. <p class='hint'><?php print_unescaped($err['hint']); ?></p>
  15. <?php else: ?>
  16. <?php print_unescaped($err); ?>
  17. <?php endif; ?>
  18. </li>
  19. <?php endforeach; ?>
  20. </ul>
  21. <?php endif; ?>
  22. <?php if($_['vulnerableToNullByte']): ?>
  23. <fieldset class="warning">
  24. <legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  25. <p><?php p($l->t('Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)'));?><br/>
  26. <?php p($l->t('Please update your PHP installation to use %s securely.', $theme->getName() )); ?></p>
  27. </fieldset>
  28. <?php endif; ?>
  29. <?php if(!$_['secureRNG']): ?>
  30. <fieldset class="warning">
  31. <legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  32. <p><?php p($l->t('No secure random number generator is available, please enable the PHP OpenSSL extension.'));?><br/>
  33. <?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>
  34. </fieldset>
  35. <?php endif; ?>
  36. <?php if(!$_['htaccessWorking']): ?>
  37. <fieldset class="warning">
  38. <legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  39. <p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br>
  40. <?php print_unescaped($l->t(
  41. 'For information how to properly configure your server, please see the <a href="%s" target="_blank">documentation</a>.',
  42. $theme->getDocBaseUrl().'/server/5.0/admin_manual/installation.html'
  43. )); ?></p>
  44. </fieldset>
  45. <?php endif; ?>
  46. <fieldset id="adminaccount">
  47. <legend><?php print_unescaped($l->t( 'Create an <strong>admin account</strong>' )); ?></legend>
  48. <p class="infield grouptop">
  49. <input type="text" name="adminlogin" id="adminlogin" placeholder=""
  50. value="<?php p(OC_Helper::init_var('adminlogin')); ?>" autocomplete="off" autofocus required />
  51. <label for="adminlogin" class="infield"><?php p($l->t( 'Username' )); ?></label>
  52. <img class="svg" src="<?php p(image_path('', 'actions/user.svg')); ?>" alt="" />
  53. </p>
  54. <p class="infield groupbottom">
  55. <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass" placeholder=""
  56. value="<?php p(OC_Helper::init_var('adminpass')); ?>" />
  57. <label for="adminpass" class="infield"><?php p($l->t( 'Password' )); ?></label>
  58. <img class="svg" id="adminpass-icon" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt="" />
  59. <input type="checkbox" id="show" name="show" />
  60. <label for="show"></label>
  61. </p>
  62. </fieldset>
  63. <fieldset id="datadirField">
  64. <legend><a id="showAdvanced"><?php p($l->t( 'Advanced' )); ?> <img class="svg" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend>
  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(OC_Helper::init_var('directory', $_['directory'])); ?>" />
  70. </div>
  71. </fieldset>
  72. <fieldset id='databaseField'>
  73. <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle'] or $_['hasMSSQL'])
  74. $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?>
  75. <legend><?php p($l->t( 'Configure the database' )); ?></legend>
  76. <div id="selectDbType">
  77. <?php if($_['hasSQLite']): ?>
  78. <input type='hidden' id='hasSQLite' value="true" />
  79. <?php if(!$hasOtherDB): ?>
  80. <p>SQLite <?php p($l->t( 'will be used' )); ?>.</p>
  81. <input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
  82. <?php else: ?>
  83. <input type="radio" name="dbtype" value="sqlite" id="sqlite"
  84. <?php OC_Helper::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/>
  85. <label class="sqlite" for="sqlite">SQLite</label>
  86. <?php endif; ?>
  87. <?php endif; ?>
  88. <?php if($_['hasMySQL']): ?>
  89. <input type='hidden' id='hasMySQL' value='true'/>
  90. <?php if(!$_['hasSQLite'] and !$_['hasPostgreSQL'] and !$_['hasOracle'] and !$_['hasMSSQL']): ?>
  91. <p>MySQL <?php p($l->t( 'will be used' )); ?>.</p>
  92. <input type="hidden" id="dbtype" name="dbtype" value="mysql" />
  93. <?php else: ?>
  94. <input type="radio" name="dbtype" value="mysql" id="mysql"
  95. <?php OC_Helper::init_radio('dbtype', 'mysql', 'sqlite'); ?>/>
  96. <label class="mysql" for="mysql">MySQL</label>
  97. <?php endif; ?>
  98. <?php endif; ?>
  99. <?php if($_['hasPostgreSQL']): ?>
  100. <?php if(!$_['hasSQLite'] and !$_['hasMySQL'] and !$_['hasOracle'] and !$_['hasMSSQL']): ?>
  101. <p>PostgreSQL <?php p($l->t( 'will be used' )); ?>.</p>
  102. <input type="hidden" id="dbtype" name="dbtype" value="pgsql" />
  103. <?php else: ?>
  104. <label class="pgsql" for="pgsql">PostgreSQL</label>
  105. <input type="radio" name="dbtype" value='pgsql' id="pgsql"
  106. <?php OC_Helper::init_radio('dbtype', 'pgsql', 'sqlite'); ?>/>
  107. <?php endif; ?>
  108. <?php endif; ?>
  109. <?php if($_['hasOracle']): ?>
  110. <?php if(!$_['hasSQLite'] and !$_['hasMySQL'] and !$_['hasPostgreSQL'] and !$_['hasMSSQL']): ?>
  111. <p>Oracle <?php p($l->t( 'will be used' )); ?>.</p>
  112. <input type="hidden" id="dbtype" name="dbtype" value="oci" />
  113. <?php else: ?>
  114. <label class="oci" for="oci">Oracle</label>
  115. <input type="radio" name="dbtype" value='oci' id="oci"
  116. <?php OC_Helper::init_radio('dbtype', 'oci', 'sqlite'); ?>/>
  117. <?php endif; ?>
  118. <?php endif; ?>
  119. <?php if($_['hasMSSQL']): ?>
  120. <input type='hidden' id='hasMSSQL' value='true'/>
  121. <?php if(!$_['hasSQLite'] and !$_['hasMySQL'] and !$_['hasPostgreSQL'] and !$_['hasOracle']): ?>
  122. <p>MS SQL <?php p($l->t( 'will be used' )); ?>.</p>
  123. <input type="hidden" id="dbtype" name="dbtype" value="mssql" />
  124. <?php else: ?>
  125. <label class="mssql" for="mssql">MS SQL</label>
  126. <input type="radio" name="dbtype" value='mssql' id="mssql" <?php OC_Helper::init_radio('dbtype', 'mssql', 'sqlite'); ?>/>
  127. <?php endif; ?>
  128. <?php endif; ?>
  129. </div>
  130. <?php if($hasOtherDB): ?>
  131. <div id="use_other_db">
  132. <p class="infield grouptop">
  133. <label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label>
  134. <input type="text" name="dbuser" id="dbuser" placeholder=""
  135. value="<?php p(OC_Helper::init_var('dbuser')); ?>" autocomplete="off" />
  136. </p>
  137. <p class="infield groupmiddle">
  138. <input type="password" name="dbpass" id="dbpass" placeholder="" data-typetoggle="#dbpassword"
  139. value="<?php p(OC_Helper::init_var('dbpass')); ?>" />
  140. <label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label>
  141. <input type="checkbox" id="dbpassword" name="dbpassword" />
  142. <label for="dbpassword"></label>
  143. </p>
  144. <p class="infield groupmiddle">
  145. <label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label>
  146. <input type="text" name="dbname" id="dbname" placeholder=""
  147. value="<?php p(OC_Helper::init_var('dbname')); ?>"
  148. autocomplete="off" pattern="[0-9a-zA-Z$_-]+" />
  149. </p>
  150. <?php if($_['hasOracle']): ?>
  151. <div id="use_oracle_db">
  152. <p class="infield groupmiddle">
  153. <label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label>
  154. <input type="text" name="dbtablespace" id="dbtablespace" placeholder=""
  155. value="<?php p(OC_Helper::init_var('dbtablespace')); ?>" autocomplete="off" />
  156. </p>
  157. </div>
  158. <?php endif; ?>
  159. <p class="infield groupbottom">
  160. <label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label>
  161. <input type="text" name="dbhost" id="dbhost" placeholder=""
  162. value="<?php p(OC_Helper::init_var('dbhost')); ?>" />
  163. </p>
  164. </div>
  165. <?php endif; ?>
  166. </fieldset>
  167. <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t( 'Finish setup' )); ?>" /></div>
  168. </form>