connection) { error(PDNSADMIN_ERROR, 'A connection to the database could not be established and/or the specified database could not be found.', __FILE__, __LINE__); } $settings = $db->fetch('SELECT settings_data FROM settings LIMIT 1'); $set = array_merge($set, unserialize($settings['settings_data'])); if (!isset($_GET['a']) || !in_array($_GET['a'], $modules['public_modules'])) { $module = $modules['default_module']; } else { $module = $_GET['a']; } require './func/' . $module . '.php'; $pdns = new $module($db); $pdns->get['a'] = $module; $pdns->sets = $set; $pdns->modules = $modules; // If zlib isn't available, then trying to use it doesn't make much sense. if (extension_loaded('zlib')) { if ($pdns->sets['output_buffer'] && isset($pdns->server['HTTP_ACCEPT_ENCODING']) && stristr($pdns->server['HTTP_ACCEPT_ENCODING'], 'gzip')) { if( !@ob_start('ob_gzhandler') ) { ob_start(); } } else { ob_start(); } } else { ob_start(); } header( 'P3P: CP="CAO PSA OUR"' ); session_start(); $pdns->user_cl = new $modules['user']($pdns); $pdns->user = $pdns->user_cl->login(); $pdns->lang = $pdns->get_lang($pdns->user['user_language'], $pdns->get['a']); $pdns->session = &$_SESSION; $pdns->session['id'] = session_id(); if( !isset($pdns->session['login']) && $pdns->user['user_id'] != USER_GUEST_UID ) { $pdns->session['login'] = true; $pdns->db->query( "UPDATE users SET user_lastlogon=%d, user_lastlogonip='%s' WHERE user_id=%d", $pdns->time, $pdns->ip, $pdns->user['user_id'] ); } if (!isset($pdns->get['skin'])) { $pdns->skin = $pdns->user['skin_dir']; } else { $pdns->skin = $pdns->get['skin']; } $pdns->init(); $server_load = $pdns->get_load(); $output = $pdns->execute(); $users = $pdns->db->fetch( 'SELECT COUNT(user_id) count FROM users' ); $domains = $pdns->db->fetch( 'SELECT COUNT(id) count FROM domains' ); $users['count'] -= 1; $userheader = eval($pdns->template('MAIN_HEADER_' . ($pdns->perms->is_guest ? 'GUEST' : 'MEMBER'))); $title = isset($pdns->title) ? $pdns->title : $pdns->sets['site_name']; $time_now = explode(' ', microtime()); $time_exec = round($time_now[1] + $time_now[0] - $time_start, 4); if (isset($pdns->get['debug'])) { $output = $pdns->show_debug($server_load, $time_exec); } if (!$pdns->nohtml) { $servertime = $pdns->mbdate( DATE_LONG, $pdns->time, false ); $copyright = eval($pdns->template('MAIN_COPYRIGHT')); $pdnspage = $output; echo eval($pdns->template('MAIN')); } else { echo $output; } @ob_end_flush(); @flush(); // Do post output stuff $pdns->cleanup(); // Close the DB connection. $pdns->db->close(); ?>