Beispiel #1
0
    }
    return false;
}
function force_login($id)
{
    $_SESSION['user'] = $id;
    $user = User::getUser($id);
    $_SESSION['user_level'] = $user->getTheme();
    ActivityLog::log('login', $user, false, array());
    db_do("INSERT INTO activity_log(user_id, action, whenit) VALUES('" . $user->getID() . "', 'login', NOW())");
    return $user;
}
require_once 'database.php';
if (isset($_SESSION['user'])) {
    require_once 'classes/UserObject.php';
    $user = UserObject::getById($_SESSION['user']);
}
$_num_db_queries = 0;
$_queries = array();
function raw_query($q)
{
    global $_num_db_queries;
    $_num_db_queries++;
    global $_queries;
    $start = microtime(true);
    $res = mysql_query($q);
    if (mysql_error()) {
        echo '<pre>';
        print_r(debug_backtrace());
        echo '</pre>';
        die(mysql_error() . ': ' . $q);