diff --git a/lib/punbb/admin_index.php b/lib/punbb/admin_index.php index b5f8f16028accefffb3bb00fb3477b52c46ffd5a..e3df4debdfe899f35aa9c2741fa387c2e73ed4e0 100644 --- a/lib/punbb/admin_index.php +++ b/lib/punbb/admin_index.php @@ -71,7 +71,7 @@ else if ($action == 'phpinfo' && $pun_user['g_id'] == PUN_ADMIN) message('The PHP function phpinfo() has been disabled on this server.'); phpinfo(); - exit; + pun_exit(); } diff --git a/lib/punbb/admin_maintenance.php b/lib/punbb/admin_maintenance.php index 033928f5adf815e435998ca169a7527dfc3074b2..34e43533b057543a28306dea462fc430f4864797 100644 --- a/lib/punbb/admin_maintenance.php +++ b/lib/punbb/admin_maintenance.php @@ -125,7 +125,7 @@ Rebuilding index … This might be a good time to put on some coffee :-)<br $db->end_transaction(); $db->close(); - exit('<script type="text/javascript">window.location="admin_maintenance.php'.$query_str.'"</script><br />JavaScript redirect unsuccessful. Click <a href="admin_maintenance.php'.$query_str.'">here</a> to continue.'); + pun_exit('<script type="text/javascript">window.location="admin_maintenance.php'.$query_str.'"</script><br />JavaScript redirect unsuccessful. Click <a href="admin_maintenance.php'.$query_str.'">here</a> to continue.'); } diff --git a/lib/punbb/extern.php b/lib/punbb/extern.php index 212b752a837043e5face5d6361f2c79317d4479e..908dea22900f8d6c01e7e5ebcb92a44baa8901c7 100644 --- a/lib/punbb/extern.php +++ b/lib/punbb/extern.php @@ -113,7 +113,7 @@ define('PUN_ROOT', './'); // If PUN isn't defined, config.php is missing or corrupt if (!defined('PUN')) - exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.'); + pun_exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.'); // Make sure PHP reports all errors except E_NOTICE @@ -141,20 +141,20 @@ if (!defined('PUN_CONFIG_LOADED')) // Make sure we (guests) have permission to read the forums $result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error()); if ($db->result($result) == '0') - exit('No permission'); + pun_exit('No permission'); // Attempt to load the common language file @include PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/common.php'; if (!isset($lang_common)) - exit('There is no valid language pack \''.$pun_config['o_default_lang'].'\' installed. Please reinstall a language of that name.'); + pun_exit('There is no valid language pack \''.$pun_config['o_default_lang'].'\' installed. Please reinstall a language of that name.'); // Check if we are to display a maintenance message if ($pun_config['o_maintenance'] && !defined('PUN_TURN_OFF_MAINT')) maintenance_message(); if (!isset($_GET['action'])) - exit('No parameters supplied. See extern.php for instructions.'); + pun_exit('No parameters supplied. See extern.php for instructions.'); // @@ -327,4 +327,4 @@ else if ($_GET['action'] == 'stats') else - exit('Bad request'); + pun_exit('Bad request'); diff --git a/lib/punbb/footer.php b/lib/punbb/footer.php index 858dd1885e1b81f75146c36f21ce174585c4ad2e..d1d8a52d1bfa65c1b632d7a9885c4e26c16535bd 100644 --- a/lib/punbb/footer.php +++ b/lib/punbb/footer.php @@ -25,7 +25,7 @@ // Make sure no one attempts to run this script "directly" if (!defined('PUN')) - exit; + pun_exit(); $tpl_temp = trim(ob_get_contents()); $tpl_main = str_replace('<pun_main>', $tpl_temp, $tpl_main); @@ -143,4 +143,4 @@ ob_end_clean(); $db->close(); // Spit out the page -exit($tpl_main); +pun_exit($tpl_main); diff --git a/lib/punbb/header.php b/lib/punbb/header.php index e8225c8d275de7498b604765f6a2315887096923..add4cd060600e73515c0edbf1b27130257e0253a 100644 --- a/lib/punbb/header.php +++ b/lib/punbb/header.php @@ -25,7 +25,7 @@ // Make sure no one attempts to run this script "directly" if (!defined('PUN')) - exit; + pun_exit(); // Send no-cache headers header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :) diff --git a/lib/punbb/include/cache.php b/lib/punbb/include/cache.php index e8114a873da7a16ac970ba7c35c1f3b2c4dee7e9..12bb1c13659169167b79a689fb79b589d73df492 100644 --- a/lib/punbb/include/cache.php +++ b/lib/punbb/include/cache.php @@ -25,7 +25,7 @@ // Make sure no one attempts to run this script "directly" if (!defined('PUN')) - exit; + pun_exit(); // diff --git a/lib/punbb/include/common.php b/lib/punbb/include/common.php index 8d0a5ebf1752364e2fac5f3b950c652451d68b3c..1a1292fcf27b564c23d0a7cbc633cc02ace0642d 100644 --- a/lib/punbb/include/common.php +++ b/lib/punbb/include/common.php @@ -30,7 +30,7 @@ //define('PUN_SHOW_QUERIES', 1); if (!defined('PUN_ROOT')) - exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.'); + pun_exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.'); // Load the functions script @@ -44,7 +44,7 @@ unregister_globals(); // If PUN isn't defined, config.php is missing or corrupt if (!defined('PUN')) - exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run <a href="install.php">install.php</a> to install PunBB first.'); + pun_exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run <a href="install.php">install.php</a> to install PunBB first.'); // Record the start time (will be used to calculate the generation time for the page) @@ -117,12 +117,13 @@ if (!defined('PUN_DISABLE_BUFFERING')) // Check/update/set cookie and fetch user info $pun_user = array(); -check_cookie($pun_user); +//check_cookie($pun_user); +auth_user($pun_user); // Attempt to load the common language file @include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php'; if (!isset($lang_common)) - exit('There is no valid language pack \''.pun_htmlspecialchars($pun_user['language']).'\' installed. Please reinstall a language of that name.'); + pun_exit('There is no valid language pack \''.pun_htmlspecialchars($pun_user['language']).'\' installed. Please reinstall a language of that name.'); // Check if we are to display a maintenance message if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT')) diff --git a/lib/punbb/include/dblayer/pgsql.php b/lib/punbb/include/dblayer/pgsql.php index cd1c1a985fded2684140e58610058e89ae0269ed..90783a2dac094ffff86621261fa8576960e574b8 100644 --- a/lib/punbb/include/dblayer/pgsql.php +++ b/lib/punbb/include/dblayer/pgsql.php @@ -25,7 +25,7 @@ // Make sure we have built in support for PostgreSQL if (!function_exists('pg_connect')) - exit('This PHP environment doesn\'t have PostgreSQL support built in. PostgreSQL support is required if you want to use a PostgreSQL database to run this forum. Consult the PHP documentation for further assistance.'); + pun_exit('This PHP environment doesn\'t have PostgreSQL support built in. PostgreSQL support is required if you want to use a PostgreSQL database to run this forum. Consult the PHP documentation for further assistance.'); class DBLayer diff --git a/lib/punbb/include/email.php b/lib/punbb/include/email.php index 425956e4bc66656ae57bb18c81f8b32078f8589d..a8586d70dea597f932bafa192042f436a0830e37 100644 --- a/lib/punbb/include/email.php +++ b/lib/punbb/include/email.php @@ -25,7 +25,7 @@ // Make sure no one attempts to run this script "directly" if (!defined('PUN')) - exit; + pun_exit(); // diff --git a/lib/punbb/include/functions.php b/lib/punbb/include/functions.php index fd6cd01936a10545c27e2a0af126255681b81321..7f402e6b625eaa1c737ab5e1b41fbff65540e6dc 100644 --- a/lib/punbb/include/functions.php +++ b/lib/punbb/include/functions.php @@ -22,6 +22,79 @@ ************************************************************************/ +// +// SUCS specific functions +// + +// because killing off PHP is a little inconsiderate +function pun_exit($spew="") +{ + echo $spew; + throw new Exception("pun_exit"); +} + +function auth_user(&$pun_user) +{ + global $db, $pun_config, $session; + + if ($session->loggedin) { + $query = 'SELECT u.*, g.*, o.logged, o.idle FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE u.username=\''.$session->username.'\''; + + $result = $db->query($query) or error('Unable to fetch user information', __FILE__, __LINE__, $db->error()); + $pun_user = $db->fetch_assoc($result); + $now = time(); + + if (!isset($pun_user['id'])) { + //Logged in, first-time visitor + $initial_group_id = $pun_config['o_default_user_group']; + $password_hash = pun_hash(random_pass($len)); + $email1 = $session->username."@sucs.org"; + // default to hide e-mail address, allow form e-mail + $email_setting = "1"; + $save_pass = "0"; + $timezone = "0"; + $language = $pun_config['o_default_lang']; + + $db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES (\''.$session->username.'\', '.$initial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.' , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Unable to create user', __FILE__, __LINE__, $db->error()); + + // fetch newly-inserted details + $result = $db->query($query) or error('Unable to fetch user information', __FILE__, __LINE__, $db->error()); + $pun_user = $db->fetch_assoc($result); + } + + // either the data was there all along, or it should be there now, so let's say we're logged in + $pun_user['is_guest'] = false; + if (!$pun_user['disp_topics']) + $pun_user['disp_topics'] = $pun_config['o_disp_topics_default']; + if (!$pun_user['disp_posts']) + $pun_user['disp_posts'] = $pun_config['o_disp_posts_default']; + + // Define this if you want this visit to affect the online list and the users last visit data + if (!defined('PUN_QUIET_VISIT')) + { + // Update the online list + if (!$pun_user['logged']) + $db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$now.')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error()); + else + { + // Special case: We've timed out, but no other user has browsed the forums since we timed out + if ($pun_user['logged'] < ($now-$pun_config['o_timeout_visit'])) + { + $db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Unable to update user visit data', __FILE__, __LINE__, $db->error()); + $pun_user['last_visit'] = $pun_user['logged']; + } + + $idle_sql = ($pun_user['idle'] == '1') ? ', idle=0' : ''; + $db->query('UPDATE '.$db->prefix.'online SET logged='.$now.$idle_sql.' WHERE user_id='.$pun_user['id']) or error('Unable to update online list', __FILE__, __LINE__, $db->error()); + } + } + + } else { + //Not logged in + set_default_user(); + } +} + // // Cookie stuff! // @@ -124,7 +197,7 @@ function set_default_user() // Fetch guest user $result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error()); if (!$db->num_rows($result)) - exit('Unable to fetch guest information. The table \''.$db->prefix.'users\' must contain an entry with id = 1 that represents anonymous users.'); + pun_exit('Unable to fetch guest information. The table \''.$db->prefix.'users\' must contain an entry with id = 1 that represents anonymous users.'); $pun_user = $db->fetch_assoc($result); @@ -282,8 +355,8 @@ function generate_navlinks() if ($pun_user['g_search'] == '1') $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; - $links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>'; - $links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>'; +// $links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>'; +// $links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>'; $info = $lang_common['Not logged in']; } @@ -295,14 +368,14 @@ function generate_navlinks() $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; - $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; +// $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; } else { $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; $links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>'; - $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; +// $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; } } @@ -838,7 +911,7 @@ function maintenance_message() // Close the db connection (and free up any result data) $db->close(); - exit($tpl_maint); + pun_exit($tpl_maint); } @@ -935,7 +1008,7 @@ function redirect($destination_url, $message) // Close the db connection (and free up any result data) $db->close(); - exit($tpl_redir); + pun_exit($tpl_redir); } @@ -1006,7 +1079,7 @@ H2 {MARGIN: 0; COLOR: #FFFFFF; BACKGROUND-COLOR: #B84623; FONT-SIZE: 1.1em; PADD if ($db_error) $GLOBALS['db']->close(); - exit; + pun_exit(); } // DEBUG FUNCTIONS BELOW @@ -1076,7 +1149,7 @@ function unregister_globals() // Prevent script.php?GLOBALS[foo]=bar if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) - exit('I\'ll have a steak sandwich and... a steak sandwich.'); + pun_exit('I\'ll have a steak sandwich and... a steak sandwich.'); // Variables that shouldn't be unset $no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'); @@ -1110,5 +1183,5 @@ function dump() } echo '</pre>'; - exit; + pun_exit(); } diff --git a/lib/punbb/include/parser.php b/lib/punbb/include/parser.php index 4c4a778226770c6376c519fe9238f5df5e0f91f9..7b8d5244c861eea209dd49fbd8fdf27a239cd847 100644 --- a/lib/punbb/include/parser.php +++ b/lib/punbb/include/parser.php @@ -24,7 +24,7 @@ // Make sure no one attempts to run this script "directly" if (!defined('PUN')) - exit; + pun_exit(); // Here you can add additional smilies if you like (please note that you must escape singlequote and backslash) diff --git a/lib/punbb/include/search_idx.php b/lib/punbb/include/search_idx.php index 34c279d76267cd8b3d0e31231a571b8cc8f4fb4b..5b12cdaa460e083ab45b4207874d4da80c0d8493 100644 --- a/lib/punbb/include/search_idx.php +++ b/lib/punbb/include/search_idx.php @@ -29,7 +29,7 @@ // Make sure no one attempts to run this script "directly" if (!defined('PUN')) - exit; + pun_exit(); // diff --git a/lib/punbb/include/template/admin.tpl b/lib/punbb/include/template/admin.tpl index 74233426ccdb0b9411299a2fe7351f4aab770cd4..0af20ea6c8bc3882eabdde7f0cd91b332c8113bf 100644 --- a/lib/punbb/include/template/admin.tpl +++ b/lib/punbb/include/template/admin.tpl @@ -1,12 +1,3 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" dir="<pun_content_direction>"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" /> -<pun_head> -</head> -<body> - <div id="punwrap"> <div id="punadmin" class="pun"> @@ -29,6 +20,3 @@ </div> </div> - -</body> -</html> diff --git a/lib/punbb/include/template/help.tpl b/lib/punbb/include/template/help.tpl index 03f3c260670dab680e9338a15944d653072557d4..92a13bd60ef7c8a0bcddbe38e0e21c9f3af42264 100644 --- a/lib/punbb/include/template/help.tpl +++ b/lib/punbb/include/template/help.tpl @@ -1,12 +1,3 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" dir="<pun_content_direction>"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" /> -<pun_head> -</head> -<body> - <div id="punwrap"> <div id="helpfile" class="pun"> @@ -14,6 +5,3 @@ </div> </div> - -</body> -</html> diff --git a/lib/punbb/include/template/main.tpl b/lib/punbb/include/template/main.tpl index 380b4a4fecc3f89b56936a6b991a674530a1630a..a848a83526f5c189d385e0980a573389d957d1b2 100644 --- a/lib/punbb/include/template/main.tpl +++ b/lib/punbb/include/template/main.tpl @@ -1,12 +1,3 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" dir="<pun_content_direction>"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" /> -<pun_head> -</head> -<body> - <div id="punwrap"> <div id="pun<pun_page>" class="pun"> @@ -30,5 +21,3 @@ </div> </div> -</body> -</html> diff --git a/lib/punbb/include/template/maintenance.tpl b/lib/punbb/include/template/maintenance.tpl index d40f90322fd593b5c79a6f4bca1b8e35beb68b5c..8d9ddf4efb3991bff4d0a3eba2b8ee40f308cf76 100644 --- a/lib/punbb/include/template/maintenance.tpl +++ b/lib/punbb/include/template/maintenance.tpl @@ -1,12 +1,3 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" dir="<pun_content_direction>"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" /> -<pun_head> -</head> -<body> - <div id="punwrap"> <div id="punmaint" class="pun"> @@ -21,6 +12,3 @@ </div> </div> - -</body> -</html> diff --git a/lib/punbb/include/template/redirect.tpl b/lib/punbb/include/template/redirect.tpl index f5995291c423c042d0e3a8f926867cdce80c38f5..45fa58f946e1e437dee234f5f5c389ebe2c6b74c 100644 --- a/lib/punbb/include/template/redirect.tpl +++ b/lib/punbb/include/template/redirect.tpl @@ -1,12 +1,3 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" dir="<pun_content_direction>"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" /> -<pun_head> -</head> -<body> - <div id="punwrap"> <div id="punredirect" class="pun"> @@ -23,6 +14,3 @@ </div> </div> - -</body> -</html> diff --git a/lib/punbb/install.php b/lib/punbb/install.php index c13df9a72ff4aacea33d4f4954fd078bbeff40df..277a79c447a5850c16f567b861c160fcbd470888 100644 --- a/lib/punbb/install.php +++ b/lib/punbb/install.php @@ -29,12 +29,12 @@ $punbb_version = '1.2.16'; define('PUN_ROOT', './'); if (file_exists(PUN_ROOT.'config.php')) - exit('The file \'config.php\' already exists which would mean that PunBB is already installed. You should go <a href="index.php">here</a> instead.'); + pun_exit('The file \'config.php\' already exists which would mean that PunBB is already installed. You should go <a href="index.php">here</a> instead.'); // Make sure we are running at least PHP 4.1.0 if (intval(str_replace('.', '', phpversion())) < 410) - exit('You are running PHP version '.PHP_VERSION.'. PunBB requires at least PHP 4.1.0 to run properly. You must upgrade your PHP installation before you can continue.'); + pun_exit('You are running PHP version '.PHP_VERSION.'. PunBB requires at least PHP 4.1.0 to run properly. You must upgrade your PHP installation before you can continue.'); // Disable error reporting for uninitialized variables error_reporting(E_ALL); @@ -63,7 +63,7 @@ if (!isset($_POST['form_sent'])) $db_extensions[] = array('pgsql', 'PostgreSQL'); if (empty($db_extensions)) - exit('This PHP environment does not have support for any of the databases that PunBB supports. PHP needs to have support for either MySQL, PostgreSQL or SQLite in order for PunBB to be installed.'); + pun_exit('This PHP environment does not have support for any of the databases that PunBB supports. PHP needs to have support for either MySQL, PostgreSQL or SQLite in order for PunBB to be installed.'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -287,7 +287,7 @@ else if ($db_error !== false) echo '<strong>Database reported:</strong> '.htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : ''); - exit; + pun_exit(); } diff --git a/lib/punbb/login.php b/lib/punbb/login.php index 88ca63854dcd01c1c55ea699746577b17fad01ea..cc6fc8a8b27c4a4573f504c7eb538a7dd6c208eb 100644 --- a/lib/punbb/login.php +++ b/lib/punbb/login.php @@ -87,7 +87,7 @@ else if ($action == 'out') if ($pun_user['is_guest'] || !isset($_GET['id']) || $_GET['id'] != $pun_user['id']) { header('Location: index.php'); - exit; + pun_exit(); } // Remove user from "users online" list. diff --git a/lib/punbb/profile.php b/lib/punbb/profile.php index e578364844faec9caaa182df72a58876a5ffae90..3e8c5686d7894bb478ca6ddaa0dddcc0653af914 100644 --- a/lib/punbb/profile.php +++ b/lib/punbb/profile.php @@ -51,7 +51,7 @@ if ($action == 'change_pass') if (!$pun_user['is_guest']) { header('Location: index.php'); - exit; + pun_exit(); } $key = $_GET['key']; diff --git a/lib/punbb/register.php b/lib/punbb/register.php index 24c0bca334dae324d5b3dc1d099e7cbfd8975f8a..82fa300a30390d49714698965db65f0c4b409e41 100644 --- a/lib/punbb/register.php +++ b/lib/punbb/register.php @@ -31,7 +31,7 @@ require PUN_ROOT.'include/common.php'; if (!$pun_user['is_guest']) { header('Location: index.php'); - exit; + pun_exit(); } // Load the register.php language file diff --git a/lib/punbb/search.php b/lib/punbb/search.php index 13f1ddd75617502fe29cdf7078ed11d997f103d3..bcba0df7c8bd0bb88d5f95767c43639cd2c97ef2 100644 --- a/lib/punbb/search.php +++ b/lib/punbb/search.php @@ -422,7 +422,7 @@ if (isset($_GET['action']) || isset($_GET['search_id'])) // Redirect the user to the cached result page header('Location: search.php?search_id='.$search_id); - exit; + pun_exit(); } } diff --git a/lib/punbb/viewforum.php b/lib/punbb/viewforum.php index f8d6bed50fd8207157be906d0e73eec090de6e40..eb8fe344ecff3b112ef17f4cdf8ddd83bd793a9d 100644 --- a/lib/punbb/viewforum.php +++ b/lib/punbb/viewforum.php @@ -49,7 +49,7 @@ $cur_forum = $db->fetch_assoc($result); if ($cur_forum['redirect_url'] != '') { header('Location: '.$cur_forum['redirect_url']); - exit; + pun_exit(); } // Sort out who the moderators are and if we are currently a moderator (or an admin) diff --git a/lib/punbb/viewtopic.php b/lib/punbb/viewtopic.php index 2f968085e1e3b5eb6a26ef9e0e6f9afcc8cf2504..cf0fcc4de2a5ca67b55cc092d59e9d8380fdad1c 100644 --- a/lib/punbb/viewtopic.php +++ b/lib/punbb/viewtopic.php @@ -76,7 +76,7 @@ else if ($action == 'new' && !$pun_user['is_guest']) else // If there is no new post, we go to the last post header('Location: viewtopic.php?id='.$id.'&action=last'); - exit; + pun_exit(); } // If action=last, we redirect to the last post @@ -88,7 +88,7 @@ else if ($action == 'last') if ($last_post_id) { header('Location: viewtopic.php?pid='.$last_post_id.'#p'.$last_post_id); - exit; + pun_exit(); } }