diff options
author | Serge Martin <edb@sigluy.net> | 2011-08-07 21:06:53 +0200 |
---|---|---|
committer | Serge Martin <edb@sigluy.net> | 2011-08-07 21:06:53 +0200 |
commit | 3e8ae8636cad91877c727c7b1ea77436816e7c3d (patch) | |
tree | 297fb9c5ab82a27d042bad7bc304f020f957a170 /core | |
parent | acf7916e71f1e290aa12eb259d92aa8ab2ffcf23 (diff) | |
download | nextcloud-server-3e8ae8636cad91877c727c7b1ea77436816e7c3d.tar.gz nextcloud-server-3e8ae8636cad91877c727c7b1ea77436816e7c3d.zip |
Add postgresql support
REVIEW: 102101
Diffstat (limited to 'core')
-rw-r--r-- | core/js/setup.js | 14 | ||||
-rw-r--r-- | core/templates/installation.php | 24 |
2 files changed, 34 insertions, 4 deletions
diff --git a/core/js/setup.js b/core/js/setup.js index b4616b8b14c..3025a511c61 100644 --- a/core/js/setup.js +++ b/core/js/setup.js @@ -1,8 +1,13 @@ $(document).ready(function() { // Hide the MySQL config div if needed : - if(!$('#mysql').is(':checked') && $('#hasSQLite').val()=='true') { + if(!$('#mysql').is(':checked')) { $('#use_mysql').hide(); } + + // Hide the PostgreSQL config div if needed: + if(!$('#pgsql').is(':checked')) { + $('#use_postgresql').hide(); + } $('#datadirField').hide(250); if($('#hasSQLite').val()=='true'){ @@ -11,10 +16,17 @@ $(document).ready(function() { $('#sqlite').click(function() { $('#use_mysql').slideUp(250); + $('#use_postgresql').slideUp(250); }); $('#mysql').click(function() { $('#use_mysql').slideDown(250); + $('#use_postgresql').slideUp(250); + }); + + $('#pgsql').click(function() { + $('#use_postgresql').slideDown(250); + $('#use_mysql').slideUp(250); }); $('#showAdvanced').click(function() { diff --git a/core/templates/installation.php b/core/templates/installation.php index 8b36d14bbf5..e2392778bed 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -39,7 +39,7 @@ <legend><?php echo $l->t( 'Configure the database.' ); ?></legend> <?php if($_['hasSQLite']): ?> <input type='hidden' id='hasSQLite' value='true'/> - <?php if(!$_['hasMySQL']): ?> + <?php if(!$_['hasMySQL'] and !$_['hasPostgreSQL']): ?> <p><?php echo $l->t( 'SQLite will be used for the database. You have nothing to do.' ); ?></p> <input type="hidden" id="dbtype" name="dbtype" value="sqlite" /> <?php else: ?> @@ -49,11 +49,11 @@ <?php if($_['hasMySQL']): ?> <input type='hidden' id='hasMySQL' value='true'/> - <?php if(!$_['hasSQLite']): ?> + <?php if(!$_['hasSQLite'] and !$_['hasPostgreSQL']): ?> <p><?php echo $l->t( 'MySQL will be used for the database.' ); ?></p> <input type="hidden" id="dbtype" name="dbtype" value="mysql" /> <?php else: ?> - <p><label class="mysql" for="mysql">MySQL </label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_Helper::init_radio('dbtype', 'mysql', 'sqlite'); ?>/></p> + <p><label class="mysql" for="mysql">MySQL </label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_Helper::init_radio('dbtype','pgsql', 'mysql', 'sqlite'); ?>/></p> <?php endif; ?> <div id="use_mysql"> <p><label for="dbuser"><?php echo $l->t( 'MySQL username:' ); ?></label><input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" /></p> @@ -64,6 +64,24 @@ </div> <?php endif; ?> + + <?php if($_['hasPostgreSQL']): ?> + <input type='hidden' id='hasPostgreSQL' value='true'/> + <?php if(!$_['hasSQLite'] and !$_['hasSQLite']): ?> + <p><?php echo $l->t( 'PostgreSQL will be used for the database.' ); ?></p> + <input type="hidden" id="dbtype" name="dbtype" value="pgsql" /> + <?php else: ?> + <p><label class="pgsql" for="pgsql">PostgreSQL </label><input type="radio" name="dbtype" value='pgsql' id="pgsql" <?php OC_Helper::init_radio('dbtype','pgsql', 'mysql', 'sqlite'); ?>/></p> + <?php endif; ?> + <div id="use_postgresql"> + <p><label for="pg_dbuser"><?php echo $l->t( 'PostgreSQL username:' ); ?></label><input type="text" name="pg_dbuser" id="pg_dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" /></p> + <p><label for="pg_dbpass"><?php echo $l->t( 'PostgreSQL password:' ); ?></label><input type="password" name="pg_dbpass" id="pg_dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" /></p> + <p><label for="pg_dbname"><?php echo $l->t( 'Database name:' ); ?></label><input type="text" name="pg_dbname" id="pg_dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" /></p> + <p><label for="pg_dbhost"><?php echo $l->t( 'Host:' ); ?></label><input type="text" name="pg_dbhost" id="pg_dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" /></p> + <p><label for="pg_dbtableprefix"><?php echo $l->t( 'Table prefix:' ); ?></label><input type="text" name="pg_dbtableprefix" id="pg_dbtableprefix" value="<?php print OC_Helper::init_var('dbtableprefix', 'oc_'); ?>" /></p> + + </div> + <?php endif; ?> </fieldset> <p class="submit"><input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" /></p> |