diff -r 917dcc6c4ceb -r f088805540ae includes/dbal.php
--- a/includes/dbal.php Sat Nov 17 22:25:37 2007 -0500
+++ b/includes/dbal.php Sun Nov 18 20:37:08 2007 -0500
@@ -121,13 +121,25 @@
return $internal_text;
}
- function connect() {
+ function connect()
+ {
$this->enable_errorhandler();
+
dc_here('dbal: trying to connect....');
- @include(ENANO_ROOT.'/config.php');
- if(isset($crypto_key))
+
+ if ( defined('IN_ENANO_INSTALL') )
+ {
+ @include(ENANO_ROOT.'/config.new.php');
+ }
+ else
+ {
+ @include(ENANO_ROOT.'/config.php');
+ }
+
+ if ( isset($crypto_key) )
unset($crypto_key); // Get this sucker out of memory fast
- if(!defined('ENANO_INSTALLED') && !defined('MIDGET_INSTALLED') && !defined('IN_ENANO_INSTALL') )
+
+ if ( !defined('ENANO_INSTALLED') && !defined('MIDGET_INSTALLED') && !defined('IN_ENANO_INSTALL') )
{
dc_here('dbal: oops, looks like Enano isn\'t set up. Constants ENANO_INSTALLED, MIDGET_INSTALLED, and IN_ENANO_INSTALL are all undefined.');
header('Location: install.php');
@@ -136,46 +148,74 @@
$this->_conn = @mysql_connect($dbhost, $dbuser, $dbpasswd);
unset($dbuser);
unset($dbpasswd); // Security
- if(!$this->_conn) { dc_here('dbal: uhoh!
'.mysql_error()); grinding_halt('Enano is having a problem', '
Error: couldn\'t connect to MySQL.
'.mysql_error().'
Error: couldn\'t connect to MySQL.
'.mysql_error().'
Enano has caught and prevented an SQL injection attempt. Your IP address has been recorded and the administrator has been notified.
Query was:
'.htmlspecialchars($q).''); } + $r = mysql_query($q, $this->_conn); $this->latest_result = $r; $this->disable_errorhandler(); return $r; } - function sql_unbuffered_query($q) { + function sql_unbuffered_query($q) + { $this->enable_errorhandler(); $this->num_queries++; $this->query_backtrace .= '(UNBUFFERED) ' . $q."\n"; $this->latest_query = $q; dc_here('dbal: making SQL query:
Enano has caught and prevented an SQL injection attempt. Your IP address has been recorded and the administrator has been notified.
Query was:
'.htmlspecialchars($q).''); } + $r = mysql_unbuffered_query($q, $this->_conn); $this->latest_result = $r; $this->disable_errorhandler();