installation.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <form action="index.php" method="post">
  2. <input type="hidden" name="install" value="true" />
  3. <?php if(count($_['errors']) > 0): ?>
  4. <ul class="errors">
  5. <?php foreach($_['errors'] as $err): ?>
  6. <li>
  7. <?php if(is_array($err)):?>
  8. <?php print $err['error']; ?>
  9. <p class='hint'><?php print $err['hint']; ?></p>
  10. <?php else: ?>
  11. <?php print $err; ?>
  12. <?php endif; ?>
  13. </li>
  14. <?php endforeach; ?>
  15. </ul>
  16. <?php endif; ?>
  17. <fieldset>
  18. <legend><?php echo $l->t( 'Create an <strong>admin account</strong>' ); ?></legend>
  19. <p class="infield">
  20. <label for="adminlogin" class="infield"><?php echo $l->t( 'Username' ); ?></label>
  21. <input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" autocomplete="off" autofocus required />
  22. </p>
  23. <p class="infield">
  24. <label for="adminpass" class="infield"><?php echo $l->t( 'Password' ); ?></label>
  25. <input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" required />
  26. </p>
  27. </fieldset>
  28. <fieldset id="datadirField">
  29. <legend><a id="showAdvanced"><?php echo $l->t( 'Advanced' ); ?> ▾</a></legend>
  30. <div id="datadirContent">
  31. <label for="directory"><?php echo $l->t( 'Data folder' ); ?>:</label><br/>
  32. <input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" />
  33. </div>
  34. </fieldset>
  35. <fieldset id='databaseField'>
  36. <?php if($_['hasMySQL'] or $_['hasPostgreSQL']) $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?>
  37. <legend><?php echo $l->t( 'Configure the database' ); ?></legend>
  38. <div id="selectDbType">
  39. <?php if($_['hasSQLite']): ?>
  40. <input type='hidden' id='hasSQLite' value="true" />
  41. <?php if(!$hasOtherDB): ?>
  42. <p>SQLite <?php echo $l->t( 'will be used' ); ?>.</p>
  43. <input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
  44. <?php else: ?>
  45. <input type="radio" name="dbtype" value="sqlite" id="sqlite" <?php OC_Helper::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/>
  46. <label class="sqlite" for="sqlite">SQLite</label>
  47. <?php endif; ?>
  48. <?php endif; ?>
  49. <?php if($_['hasMySQL']): ?>
  50. <input type='hidden' id='hasMySQL' value='true'/>
  51. <?php if(!$_['hasSQLite'] and !$_['hasPostgreSQL']): ?>
  52. <p>MySQL <?php echo $l->t( 'will be used' ); ?>.</p>
  53. <input type="hidden" id="dbtype" name="dbtype" value="mysql" />
  54. <?php else: ?>
  55. <input type="radio" name="dbtype" value="mysql" id="mysql" <?php OC_Helper::init_radio('dbtype','mysql', 'sqlite'); ?>/>
  56. <label class="mysql" for="mysql">MySQL</label>
  57. <?php endif; ?>
  58. <?php endif; ?>
  59. <?php if($_['hasPostgreSQL']): ?>
  60. <?php if(!$_['hasSQLite'] and !$_['hasMySQL']): ?>
  61. <p>PostgreSQL <?php echo $l->t( 'will be used' ); ?>.</p>
  62. <input type="hidden" id="dbtype" name="dbtype" value="pgsql" />
  63. <?php else: ?>
  64. <label class="pgsql" for="pgsql">PostgreSQL</label>
  65. <input type="radio" name="dbtype" value='pgsql' id="pgsql" <?php OC_Helper::init_radio('dbtype','pgsql', 'sqlite'); ?>/>
  66. <?php endif; ?>
  67. <?php endif; ?>
  68. </div>
  69. <?php if($hasOtherDB): ?>
  70. <div id="use_other_db">
  71. <p class="infield">
  72. <label for="dbuser" class="infield"><?php echo $l->t( 'Database user' ); ?></label>
  73. <input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" autocomplete="off" />
  74. </p>
  75. <p class="infield">
  76. <label for="dbpass" class="infield"><?php echo $l->t( 'Database password' ); ?></label>
  77. <input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" />
  78. </p>
  79. <p class="infield">
  80. <label for="dbname" class="infield"><?php echo $l->t( 'Database name' ); ?></label>
  81. <input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" autocomplete="off" />
  82. </p>
  83. </div>
  84. <?php endif; ?>
  85. <p class="infield">
  86. <label for="dbhost" class="infield"><?php echo $l->t( 'Database host' ); ?></label>
  87. <input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" />
  88. </p>
  89. </fieldset>
  90. <div class="buttons"><input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" /></div>
  91. </form>