--- /dev/null
+<?php
+/*
+ (c) 2005 Joe Presbrey
+*/
+
+require_once('mitsql.cfg.php');
+require_once('mitsql.lib.php');
+
+include 'tpl/error.php';
+
+?>
--- /dev/null
+<?php
+
+function ErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) {
+ $error_halt = true;
+ $error_type = 'Error';
+ $error_msg = " $errstr occured in $errfile on $errline at ".date("D M j G:i:s T Y");
+ $email_to = 'sql@mit.edu';
+ $email_from = 'sql@sql.mit.edu';
+ switch($errno) {
+ case E_USER_NOTICE:
+ case E_NOTICE:
+ $type = 'Notice';
+ $error_halt = false;
+ break;
+ case E_USER_WARNING:
+ case E_COMPILE_WARNING:
+ case E_CORE_WARNING:
+ case E_WARNING:
+ $type = 'Warning';
+ $error_halt = false;
+ break;
+ case E_USER_ERROR:
+ case E_COMPILE_ERROR:
+ case E_CORE_ERROR:
+ case E_ERROR:
+ $type = 'Fatal Error';
+ break;
+ case E_PARSE:
+ $type = 'Parse Error';
+ break;
+ default:
+ $type = 'Unknown Error';
+ break;
+ }
+ $error_bt = ErrorBacktrace(debug_backtrace());
+ $error_msg = $type . ':' . $error_msg . "\n" . $error_bt . "\n\n";
+ if (DEVEL && 0) {
+ echo nl2br($error_msg);
+ } else {
+ $error_msg .= print_r($errcontext,1);
+ error_log($error_msg, 1, $email_to);
+ if ($error_halt) {
+ while(ob_get_level()) { ob_end_clean(); }
+ require_once('security.lib.php');
+ redirect('error');
+ exit -1;
+ }
+ }
+}
+
+function ErrorBacktrace($debug_backtrace) {
+ array_shift($debug_backtrace);
+ $output = '';
+ foreach ($debug_backtrace as $bt) {
+ $args = '';
+ foreach ($bt['args'] as $a) {
+ if (!empty($args)) {
+ $args .= ', ';
+ }
+ switch (gettype($a)) {
+ case 'integer':
+ case 'double':
+ $args .= $a;
+ break;
+ case 'string':
+ $a = htmlspecialchars(substr($a, 0, 64)).((strlen($a) > 64) ? '...' : '');
+ $args .= "\"$a\"";
+ break;
+ case 'array':
+ //$args .= 'Array('.count($a).')';
+ $args .= print_r($a,1);
+ break;
+ case 'object':
+ $args .= 'Object('.get_class($a).')';
+ break;
+ case 'resource':
+ $args .= 'Resource('.strstr($a, '#').')';
+ break;
+ case 'boolean':
+ $args .= $a ? 'True' : 'False';
+ break;
+ case 'NULL':
+ $args .= 'Null';
+ break;
+ default:
+ $args .= 'Unknown';
+ }
+ }
+ empty($bt['class']) && $bt['class'] = '';
+ empty($bt['type']) && $bt['type'] = '';
+ empty($bt['function']) && $bt['function'] = '';
+ $output .= "\n";
+ $output .= "file: {$bt['line']} - {$bt['file']}\n";
+ $output .= "call: {$bt['class']}{$bt['type']}{$bt['function']}($args)\n";
+ }
+ return $output;
+}
+
+set_error_handler('ErrorHandler');
+
+?>
require_once('mitsql.cfg.php');
require_once('security.lib.php');
+require_once('errorhandler.lib.php');
require_once('display.lib.php');
private $dblist;
function User($userId) {
$this->userId = $userId;
- $sql = sprintf("SELECT User.UserId, Username, Password, Name, Email, UL, bEnabled, nBytesSoft, nBytesHard, nBytes, nDatabases, nDatabasesHard, IF(nBytes>nBytesHard,1,0) AS bOverQuota
+ $sql = sprintf("SELECT User.UserId, Username, Name, Email, UL, bEnabled, nBytesSoft, nBytesHard, nBytes, nDatabases, nDatabasesHard, IF(nBytes>nBytesHard,1,0) AS bOverQuota
FROM User
INNER JOIN UserQuota ON User.UserId = UserQuota.UserId
INNER JOIN UserStat ON User.UserId = UserStat.UserId
$r = fetchRows(DBSelect($sql),'UserId');
$this->info = count($r)?array_shift($r):$r;
$this->dblist = $this->getDBList();
-// $this->pass = base64_decode($this->info['Password']);
}
function refresh() {
unset($this->dblist);
$this->User($this->userId);
/*
- $sql = sprintf("SELECT UserId, Username, Password, Name, Email, UL, bEnabled
+ $sql = sprintf("SELECT UserId, Username, Name, Email, UL, bEnabled
FROM User
WHERE UserId = '%s'",
mysql_escape_string($this->userId));
set_time_limit(0);
ignore_user_abort(1);
import_request_variables('cgp', 'i_');
+!DEVEL && ini_set('display_errors', 0);
DEVEL && ini_set('display_errors', 1);
error_reporting(E_ALL);
set_include_path(get_include_path() . PATH_SEPARATOR . $BASE_PATH . 'lib/' . PATH_SEPARATOR . $BASE_PATH);
-display_errors = 0
extension = mysql.so
auto_append_file = "global.done.php"
session.save_path = "/home/sql/tmp/"
+output_buffering = 4096
--- /dev/null
+<?php
+include 'head.php';
+?>
+
+<h2>Page Error</h2>
+
+<p>
+The page you were trying to view experienced an error while loading.
+An email reporting this error has been sent to the Support Team.
+</p>
+<p>
+Please accept our apologies for this inconvenience.
+</p>
+<p>
+Return <a href="do/main">Home</a>.
+</p>
+
+<?php
+include 'foot.php';
+?>