diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-01-07 14:15:51 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-01-07 14:15:51 -0500 |
commit | d39655e1269494dd1c8cad06c972e8884cace8ea (patch) | |
tree | 41cec4ecd5289521a452aab079b0074faac1464f /lib/db.php | |
parent | da7a14e9a6cc5a388ae817a226af7fa262fe6846 (diff) | |
download | nextcloud-server-d39655e1269494dd1c8cad06c972e8884cace8ea.tar.gz nextcloud-server-d39655e1269494dd1c8cad06c972e8884cace8ea.zip |
Move template parameters around so database error page is properly rendered
Diffstat (limited to 'lib/db.php')
-rw-r--r-- | lib/db.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/db.php b/lib/db.php index 74e7ca5b0e0..fbefb13a95e 100644 --- a/lib/db.php +++ b/lib/db.php @@ -181,7 +181,9 @@ class OC_DB { try{ self::$PDO=new PDO($dsn, $user, $pass, $opts); }catch(PDOException $e) { - OC_Template::printErrorPage( 'can not connect to database, using '.$type.'. ('.$e->getMessage().')' ); + OC_User::setUserId(null); + OC_Template::printErrorPage('Failed to connect to '.$type.' database. ('.$e->getMessage().')' ); + die(); } // We always, really always want associative arrays self::$PDO->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); @@ -277,7 +279,9 @@ class OC_DB { if( PEAR::isError( self::$MDB2 )) { OC_Log::write('core', self::$MDB2->getUserInfo(), OC_Log::FATAL); OC_Log::write('core', self::$MDB2->getMessage(), OC_Log::FATAL); - OC_Template::printErrorPage( 'can not connect to database, using '.$type.'. ('.self::$MDB2->getUserInfo().')' ); + OC_User::setUserId(null); + OC_Template::printErrorPage('Failed to connect to '.$type.' database. ('.self::$MDB2->getUserInfo().')' ); + die(); } // We always, really always want associative arrays |