* 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:38:17 +00:00
parent 871508bb0d
commit e5bb587e94

View File

@ -459,7 +459,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)
{