* API: if re-connect to database fails for an existing session, stop execution with an exception, as otherwise eg. preferences can get lost

This commit is contained in:
Ralf Becker 2013-06-20 13:42:19 +00:00
parent ccb65bb2c8
commit 8f6f31dbb3

View File

@ -452,7 +452,12 @@ class egw_db
$this->Link_ID =& $GLOBALS['egw']->ADOdb;
}
}
if (!$this->Link_ID->isConnected()) $this->Link_ID->Connect();
if (!$this->Link_ID->isConnected() && !$this->Link_ID->Connect())
{
$Host = preg_replace('/password=[^ ]+/','password=$Password',$this->Host); // eg. postgres dsn contains password
$this->halt("ADOdb::$connect($Host, $this->User, \$Password, $this->Database) reconnect failed.");
return null; // in case error-reporting = 'no'
}
if ($new_connection)
{