From: Michael M Slusarz Date: Fri, 19 Feb 2010 18:47:35 +0000 (-0700) Subject: Make these entries optional X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fde496faf2c48ce8f1be186923e3da323f4254c1;p=horde.git Make these entries optional --- diff --git a/turba/scripts/upgrades/2.1_to_2.2_sql_schema.php b/turba/scripts/upgrades/2.1_to_2.2_sql_schema.php index dba6aa234..e4f040e28 100755 --- a/turba/scripts/upgrades/2.1_to_2.2_sql_schema.php +++ b/turba/scripts/upgrades/2.1_to_2.2_sql_schema.php @@ -18,9 +18,11 @@ /* Set this variable to 'true' to activate the script. */ $for_real = false; -/* You must set these to an appropriate user/pass/table for your server. */ -$db_user = 'root'; -$db_pass = ''; +/* If not null, these values overwrite those in the Horde SQL config. */ +$db_user = null; +$db_pass = null; + +/* Default table name. */ $db_table = 'turba_objects'; /* Allow skipping of parsing certain fields. @@ -42,8 +44,12 @@ require_once HORDE_BASE . '/config/conf.php'; require_once 'Horde/Form.php'; $config = $GLOBALS['conf']['sql']; -$config['username'] = $db_user; -$config['password'] = $db_pass; +if (!is_null($db_user)) { + $config['username'] = $db_user; +} +if (!is_null($db_pass)) { + $config['password'] = $db_pass; +} unset($config['charset']); $db = DB::connect($config); if (is_a($db, 'PEAR_Error')) {