summaryrefslogtreecommitdiffstats
path: root/lib/db.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-01-07 14:15:51 -0500
committerMichael Gapczynski <mtgap@owncloud.com>2013-01-07 14:15:51 -0500
commitd39655e1269494dd1c8cad06c972e8884cace8ea (patch)
tree41cec4ecd5289521a452aab079b0074faac1464f /lib/db.php
parentda7a14e9a6cc5a388ae817a226af7fa262fe6846 (diff)
downloadnextcloud-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.php8
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