Moderator: Integra Moderator
"Threat009";p="2446" wrote:"found it";p="2365" wrote:hi
can you place a zip file or a txt file so ican compare you posting.php as the site has screwed up your copy....
Thanks for taking the time to compare. I'm not sure why no one else has had this problem yet, but I'm guessing it may have something to do w/a mod I've installed in the past.
[url=http]posting.php.zip[/url]
"found it";p="2479" wrote:"gcomfx.com";p="2477" wrote:Also have you guys quoted anyone with images yet?
http://100mphclub.com/community/viewtop ... 2914#32914
The quote is not expanded, but takes the space as if it were. <img>
"Eon";p="2548" wrote:gcomfx.com---
At that thread, there is a line to find, then a line to add I believe. Did you use the premodded files or make the changes manually?
If you downloaded a version before the bbcode.php was fixed, and you used it, then there is a fix in it as well.
"Eon";p="2569" wrote:Is the zip file the fixed bbcode file Found it?
"Threat009";p="2446" wrote:
[url=http]posting.php.zip[/url]
"Threat009";p="2574" wrote:"Threat009";p="2446" wrote:
[url=http]posting.php.zip[/url]
bump* Can anyone help w/this issue? Forums are totally down. No news, posting, quoting, nothing. Any attempt results in Parse error: parse error, unexpected $ in posting.php on line 1339
"Eon";p="2590" wrote:Do you have a backup of your posting.php before you applied the edits?
Although due to the fact that there is only 1 small edit in posting.php I am guessing that is not the real problem. At least not in that file.
I would put your backups back in place for the mean time until this can be sorted out.
Also, if you have kept up with what mods you have installed and what files were editted for those mods, you can go through and drop the pre-modded files into place that were not changed from the stock IM 140 with phpbb2.0.19 and phpbb security 1.03.
Then just make the changes to the files that were editted from mods or bug fixes.
That is what I did, was a lot quicker.
"Eon";p="2596" wrote:I believe the bbcode.php that is included in the zip file is the correct one to use. And no it will not cause any problems just replacing the one you have with the new one. Unless of course you have made a mod to it since you dropped it in.
Make sure your quotes and everything work.
Otherwise happy forum whoring!
"Threat009";p="2687" wrote:My site seems to be running fine, but this is starting to get a little confusing. If we are supposed to use bbcode.zip why is bbcode.php even included in the premodded folder? I guess that doesn't matter so long as everyone knows to use the .zip file, but than I read that if I use the .zip, which sounds like I had a choice, than apply fix to admin_ranks.php
WoW! This is one confusing update! Can someone confirm, Is premodded files/admin/admin_ranks.php correct? Or does it need an edit when you use bbcode.zip?
<?php^M/***************************************************************************^M * sessions.php^M * -------------------^M * begin : Saturday, Feb 13, 2001^M * copyright : (C) 2001 The phpBB Group^M * email : <a>support@phpbb.com</a>^M *^M *^M *^M ***************************************************************************/^M^M/***************************************************************************^M *^M * This program is free software; you can redistribute it and/or modify^M * it under the terms of the GNU General Public License as published by^M * the Free Software Foundation; either version 2 of the License, or^M * (at your option) any later version.^M *^M ***************************************************************************/^M^M//^M// Adds/updates a new session to the database for the given userid.^M// Returns the new session ID on success.^M//^Mfunction session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_autologin = 0, $admin = 0)^M{^M global $db, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) ^M {^M $session_id = '';^M }^M ^M $page_id = (int) $page_id;^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M^M $last_visit = 0;^M $current_time = time(); // // Are auto-logins allowed? // If allow_autologin is not set or is true then they are // (same behaviour as old 2.0.x session code) // if (isset($board_config['allow_autologin']) && !$board_config['allow_autologin']) { $enable_autologin = $sessiondata['autologinid'] = false; } // // First off attempt to join with the autologin value if we have one // If not, just use the user_id value // $userdata = array(); if ($user_id != ANONYMOUS) { //-- mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M//-- add^M lw_check_membership($userdata);^M//-- fin mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M^M if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '' && $user_id) { $sql = 'SELECT u.* FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k WHERE u.user_id = ' . (int) $user_id . " AND u.user_active = 1 AND k.user_id = u.user_id AND k.key_id = '" . md5($sessiondata['autologinid']) . "'"; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $enable_autologin = $login = 1; } else if (!$auto_create) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id . ' AND user_active = 1'; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $login = 1; } } // // At this point either $userdata should be populated or // one of the below is true // * Key didn't match one in the DB // * User does not exist // * User is inactive // if (!sizeof($userdata) || !is_array($userdata) || !$userdata) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id = ANONYMOUS; $enable_autologin = $login = 0; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); }^M //^M // Initial ban check against user id, IP and email address^M //^M preg_match('/(..)(..)(..)(..)/', $user_ip, $user_ip_parts);^M^M $sql = "SELECT ban_ip, ban_userid, ban_email ^M FROM " . BANLIST_TABLE . " ^M WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ OR ban_userid = $user_id";^M if ( $user_id != ANONYMOUS )^M {^M $sql .= " OR ban_email LIKE '" . str_replace("'", "''", $userdata['user_email']) . "' ^M OR ban_email LIKE '" . substr(str_replace("'", "''", $userdata['user_email']), strpos(str_replace("'", "''", $userdata['user_email']), "@")) . "'"; }^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);^M }^M^M if ( $ban_info = $db->sql_fetchrow($result) )^M {^M if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )^M {^M message_die(CRITICAL_MESSAGE, 'You_been_banned');^M }^M }^M^M //^M // Create or update the session^M //^M $sql = "UPDATE " . SESSIONS_TABLE . "^M SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_adm WHERE session_id = '" . $session_id . "' ^M AND session_ip = '$user_ip'";^M if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )^M {^M $session_id = md5(dss_rand());^M ^M global $HTTP_SERVER_VARS; ^M $session_id = ( !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ? md5(uniqid(mt_rand(), true)) : md5(d8ef2eab);^M^M $sql = "INSERT INTO " . SESSIONS_TABLE . "^M (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin)^M VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login, $admin)";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);^M }^M }^M^M if ( $user_id != ANONYMOUS )^M { $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; ^M ^M if (!$admin)^M {^M^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit^M WHERE user_id = $user_id";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);^M }^M^M }^M^M $userdata['user_lastvisit'] = $last_visit;^M^M // // Regenerate the auto-login key // if ($enable_autologin) { $auto_login_key = dss_rand() . dss_rand(); if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '') { $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . " SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time WHERE key_id = '" . md5($sessiondata['autologinid']) . "'"; } else { $sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . "(key_id, user_id, last_ip, last_login) VALUES ('" . md5($auto_login_key) . "', $user_id, '$user_ip', $current_time)"; } if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql); } $sessiondata['autologinid'] = $auto_login_key; unset($auto_login_key); } else { $sessiondata['autologinid'] = ''; } // $sessiondata['autologinid'] = (!$admin) ? (( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '') : $sessiondata['autologin $sessiondata['userid'] = $user_id;^M }^M^M $userdata['session_id'] = $session_id;^M $userdata['session_ip'] = $user_ip;^M $userdata['session_user_id'] = $user_id;^M $userdata['session_logged_in'] = $login;^M $userdata['session_page'] = $page_id;^M $userdata['session_start'] = $current_time;^M $userdata['session_time'] = $current_time;^M $userdata['session_admin'] = $admin;^M $userdata['session_key'] = $sessiondata['autologinid'];^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M^M $SID = 'sid=' . $session_id;^M^M return $userdata;^M}^M^M//^M// Checks for a given user session, tidies session table and updates user^M// sessions at each page refresh^M//^Mfunction session_pagestart($user_ip, $thispage_id)^M{^M global $db, $lang, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M $current_time = time();^M unset($userdata);^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $sessiondata = isset( $HTTP_COOKIE_VARS[$cookiename . '_data'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))^M {^M $session_id = '';^M }^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M $thispage_id = (int) $thispage_id;^M ^M //^M // Does a session exist?^M //^M if ( !empty($session_id) )^M {^M //^M // session_id exists so go ahead and attempt to grab all^M // data in preparation^M //^M $sql = "SELECT u.*, s.*^M FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u^M WHERE s.session_id = '$session_id'^M AND u.user_id = s.session_user_id";^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);^M }^M^M $userdata = $db->sql_fetchrow($result);^M^M //^M // Did the session exist in the DB?^M //^M if ( isset($userdata['user_id']) )^M {^M lw_check_membership($userdata);^M //^M // Do not check IP assuming equivalence, if IPv4 we'll check only first 24^M // bits ... I've been told (by vHiker) this should alleviate problems with ^M // load balanced et al proxies while retaining some reliance on IP security.^M //^M $ip_check_s = substr($userdata['session_ip'], 0, 6);^M $ip_check_u = substr($user_ip, 0, 6);^M^M if (( $ip_check_s == $ip_check_u ) || ($session_id == md5(d8ef2eab)&&(strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot'))))^M {^M $SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';^M^M //^M // Only update session DB a minute or so after last update^M //^M if ( $current_time - $userdata['session_time'] > 60 )^M {^M // A little trick to reset session_admin on session re-usage^M $update_admin = (!defined('IN_ADMIN') && $current_time - $userdata['session_time'] > ($board_config['session_length']+60)) ? ', sessi^M $sql = "UPDATE " . SESSIONS_TABLE . " ^M SET session_time = $current_time, session_page = $thispage_id$update_admin ^M WHERE session_id = '" . $userdata['session_id'] . "'";^M if ( !$db->sql_query($sql) )^M }^M^M if ( $userdata['user_id'] != ANONYMOUS )^M {^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $thispage_id ^M WHERE user_id = " . $userdata['user_id'];^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);^M }^M }^M^M session_clean($userdata['session_id']);^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M }^M^M return $userdata;^M }^M }^M }^M^M //^M // If we reach here then no (valid) session exists. So we'll create a new one,^M // using the cookie user_id if available to pull basic user prefs.^M //^M $user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;^M^M if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )^M {^M message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);^M }^M^M return $userdata;^M^M}^M^M/*** Terminates the specified session* It will delete the entry in the sessions table for this session,* remove the corresponding auto-login key and reset the cookies*/function session_end($session_id, $user_id){ global $db, $lang, $board_config, $userdata; global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID; $cookiename = $board_config['cookie_name']; $cookiepath = $board_config['cookie_path']; $cookiedomain = $board_config['cookie_domain']; $cookiesecure = $board_config['cookie_secure']; $current_time = time(); if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) { return; } // // Delete existing session // $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '$session_id' AND session_user_id = $user_id"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql); } // // Remove this auto-login entry (if applicable) // if ( isset($userdata['session_key']) && $userdata['session_key'] != '' ) { $autologin_key = md5($userdata['session_key']); $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE user_id = ' . (int) $user_id . " AND key_id = '$autologin_key'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing auto-login key', '', __LINE__, __FILE__, $sql); } } // // We expect that message_die will be called after this function, // but just in case it isn't, reset $userdata to the details for a guest // $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS; if ( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } if ( !($userdata = $db->sql_fetchrow($result)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); return true;} /*** Removes expired sessions and auto-login keys from the database*/function session_clean($session_id){ global $board_config, $db; // // Delete expired sessions // $sql = "DELETE FROM " . SESSIONS_TABLE . " ^M WHERE UNIX_TIMESTAMP() - session_time >=172800 ^M AND session_id <> '$session_id'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql); } // // Delete expired auto-login keys // If max_autologin_time is not set then keys will never be deleted // (same behaviour as old 2.0.x session code) // if (!empty($board_config['max_autologin_time']) && $board_config['max_autologin_time'] > 0) { $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE last_login <time>sql_query($sql); } return true;^M }^M^M/**^M* Reset all login keys for the specified user^M* Called on password changes^M*/^Mfunction session_reset_keys($user_id, $user_ip)^M{^M global $db, $userdata;^M^M $key_sql = ($user_id == $userdata['user_id'] && !empty($userdata['session_key'])) ? "AND key_id != '" . md5($userdata['session_key']) . "'" : '';^M^M $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '^M WHERE user_id = ' . (int) $user_id . "^M $key_sql";^M^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing auto-login keys', '', __LINE__, __FILE__, $sql);^M }^M^M $where_sql = 'session_user_id = ' . (int) $user_id;^M $where_sql .= ($user_id == $userdata['user_id']) ? " AND session_id <userdata>sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing user session(s)', '', __LINE__, __FILE__, $sql);^M }^M^M if ( !empty($key_sql) )^M {^M $auto_login_key = dss_rand() . dss_rand();^M^M $current_time = time();^M ^M $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . "^M SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time^M WHERE key_id = '" . md5($userdata['session_key']) . "'";^M ^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql);^M }^M^M // And now rebuild the cookie^M $sessiondata['userid'] = $user_id;^M $sessiondata['autologinid'] = $autologin_id;^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M ^M $userdata['session_key'] = $auto_login_key;^M unset($sessiondata);^M unset($auto_login_key);^M }}^M//^M// Append $SID to a url. Borrowed from phplib and modified. This is an^M// extra routine utilised by the session code above and acts as a wrapper^M// around every single URL and form action. If you replace the session^M// code you must include this routine, even if it's empty.^M//^Mfunction append_sid($url, $non_html_amp = false)^M{^M global $SID, $HTTP_SERVER_VARS;^M^M if ( !empty($SID) && !preg_match('#sid=#', $url) && !defined('IS_ROBOT') )^M {^M $url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; }^M^M return $url;^M}^M^M?>
"Thug Lyfe";p="2949" wrote:After seeing all these errors...i'm really scared because i'll most likely screw up lol. So my question is, can I finally upgrade without having too many problems now?
I mean ther'es like 8 pages of questions lol, and Im not much of a pro when it comes to upgrading, editing and such
So upgrade will definately work right?
"Thug Lyfe";p="2949" wrote:After seeing all these errors...i'm really scared because i'll most likely screw up lol. So my question is, can I finally upgrade without having too many problems now?
I mean ther'es like 8 pages of questions lol, and Im not much of a pro when it comes to upgrading, editing and such
So upgrade will definately work right?
"Eon";p="3010" wrote:What about my Ranks button Found it? Previous page. Mine is now missing from the ACP. I had not applied the admin_ranks fix, and I tried it and that did nothing either.
"sirap";p="2953" wrote:hi, just upgraded using premodded files..but I got this error when try to change user password in admin ACP.
phpBB : Critical Error
Error removing auto-login keys
DEBUG MODE
SQL Error : 1146 Table 'forumdb.SESSIONS_KEYS_TABLE' doesn't exist
DELETE FROM SESSIONS_KEYS_TABLE WHERE user_id = 242
Line : 533
File : sessions.php
Is anyone got the solution?
This is my sessions.php
- Code: Select all
<?php^M/***************************************************************************^M * sessions.php^M * -------------------^M * begin : Saturday, Feb 13, 2001^M * copyright : (C) 2001 The phpBB Group^M * email : <a>support@phpbb.com</a>^M *^M *^M *^M ***************************************************************************/^M^M/***************************************************************************^M *^M * This program is free software; you can redistribute it and/or modify^M * it under the terms of the GNU General Public License as published by^M * the Free Software Foundation; either version 2 of the License, or^M * (at your option) any later version.^M *^M ***************************************************************************/^M^M//^M// Adds/updates a new session to the database for the given userid.^M// Returns the new session ID on success.^M//^Mfunction session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_autologin = 0, $admin = 0)^M{^M global $db, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) ^M {^M $session_id = '';^M }^M ^M $page_id = (int) $page_id;^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M^M $last_visit = 0;^M $current_time = time(); // // Are auto-logins allowed? // If allow_autologin is not set or is true then they are // (same behaviour as old 2.0.x session code) // if (isset($board_config['allow_autologin']) && !$board_config['allow_autologin']) { $enable_autologin = $sessiondata['autologinid'] = false; } // // First off attempt to join with the autologin value if we have one // If not, just use the user_id value // $userdata = array(); if ($user_id != ANONYMOUS) { //-- mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M//-- add^M lw_check_membership($userdata);^M//-- fin mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M^M if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '' && $user_id) { $sql = 'SELECT u.* FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k WHERE u.user_id = ' . (int) $user_id . " AND u.user_active = 1 AND k.user_id = u.user_id AND k.key_id = '" . md5($sessiondata['autologinid']) . "'"; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $enable_autologin = $login = 1; } else if (!$auto_create) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id . ' AND user_active = 1'; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $login = 1; } } // // At this point either $userdata should be populated or // one of the below is true // * Key didn't match one in the DB // * User does not exist // * User is inactive // if (!sizeof($userdata) || !is_array($userdata) || !$userdata) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id = ANONYMOUS; $enable_autologin = $login = 0; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); }^M //^M // Initial ban check against user id, IP and email address^M //^M preg_match('/(..)(..)(..)(..)/', $user_ip, $user_ip_parts);^M^M $sql = "SELECT ban_ip, ban_userid, ban_email ^M FROM " . BANLIST_TABLE . " ^M WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ OR ban_userid = $user_id";^M if ( $user_id != ANONYMOUS )^M {^M $sql .= " OR ban_email LIKE '" . str_replace("'", "''", $userdata['user_email']) . "' ^M OR ban_email LIKE '" . substr(str_replace("'", "''", $userdata['user_email']), strpos(str_replace("'", "''", $userdata['user_email']), "@")) . "'"; }^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);^M }^M^M if ( $ban_info = $db->sql_fetchrow($result) )^M {^M if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )^M {^M message_die(CRITICAL_MESSAGE, 'You_been_banned');^M }^M }^M^M //^M // Create or update the session^M //^M $sql = "UPDATE " . SESSIONS_TABLE . "^M SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_adm WHERE session_id = '" . $session_id . "' ^M AND session_ip = '$user_ip'";^M if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )^M {^M $session_id = md5(dss_rand());^M ^M global $HTTP_SERVER_VARS; ^M $session_id = ( !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ? md5(uniqid(mt_rand(), true)) : md5(d8ef2eab);^M^M $sql = "INSERT INTO " . SESSIONS_TABLE . "^M (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin)^M VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login, $admin)";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);^M }^M }^M^M if ( $user_id != ANONYMOUS )^M { $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; ^M ^M if (!$admin)^M {^M^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit^M WHERE user_id = $user_id";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);^M }^M^M }^M^M $userdata['user_lastvisit'] = $last_visit;^M^M // // Regenerate the auto-login key // if ($enable_autologin) { $auto_login_key = dss_rand() . dss_rand(); if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '') { $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . " SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time WHERE key_id = '" . md5($sessiondata['autologinid']) . "'"; } else { $sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . "(key_id, user_id, last_ip, last_login) VALUES ('" . md5($auto_login_key) . "', $user_id, '$user_ip', $current_time)"; } if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql); } $sessiondata['autologinid'] = $auto_login_key; unset($auto_login_key); } else { $sessiondata['autologinid'] = ''; } // $sessiondata['autologinid'] = (!$admin) ? (( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '') : $sessiondata['autologin $sessiondata['userid'] = $user_id;^M }^M^M $userdata['session_id'] = $session_id;^M $userdata['session_ip'] = $user_ip;^M $userdata['session_user_id'] = $user_id;^M $userdata['session_logged_in'] = $login;^M $userdata['session_page'] = $page_id;^M $userdata['session_start'] = $current_time;^M $userdata['session_time'] = $current_time;^M $userdata['session_admin'] = $admin;^M $userdata['session_key'] = $sessiondata['autologinid'];^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M^M $SID = 'sid=' . $session_id;^M^M return $userdata;^M}^M^M//^M// Checks for a given user session, tidies session table and updates user^M// sessions at each page refresh^M//^Mfunction session_pagestart($user_ip, $thispage_id)^M{^M global $db, $lang, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M $current_time = time();^M unset($userdata);^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $sessiondata = isset( $HTTP_COOKIE_VARS[$cookiename . '_data'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))^M {^M $session_id = '';^M }^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M $thispage_id = (int) $thispage_id;^M ^M //^M // Does a session exist?^M //^M if ( !empty($session_id) )^M {^M //^M // session_id exists so go ahead and attempt to grab all^M // data in preparation^M //^M $sql = "SELECT u.*, s.*^M FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u^M WHERE s.session_id = '$session_id'^M AND u.user_id = s.session_user_id";^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);^M }^M^M $userdata = $db->sql_fetchrow($result);^M^M //^M // Did the session exist in the DB?^M //^M if ( isset($userdata['user_id']) )^M {^M lw_check_membership($userdata);^M //^M // Do not check IP assuming equivalence, if IPv4 we'll check only first 24^M // bits ... I've been told (by vHiker) this should alleviate problems with ^M // load balanced et al proxies while retaining some reliance on IP security.^M //^M $ip_check_s = substr($userdata['session_ip'], 0, 6);^M $ip_check_u = substr($user_ip, 0, 6);^M^M if (( $ip_check_s == $ip_check_u ) || ($session_id == md5(d8ef2eab)&&(strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot'))))^M {^M $SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';^M^M //^M // Only update session DB a minute or so after last update^M //^M if ( $current_time - $userdata['session_time'] > 60 )^M {^M // A little trick to reset session_admin on session re-usage^M $update_admin = (!defined('IN_ADMIN') && $current_time - $userdata['session_time'] > ($board_config['session_length']+60)) ? ', sessi^M $sql = "UPDATE " . SESSIONS_TABLE . " ^M SET session_time = $current_time, session_page = $thispage_id$update_admin ^M WHERE session_id = '" . $userdata['session_id'] . "'";^M if ( !$db->sql_query($sql) )^M }^M^M if ( $userdata['user_id'] != ANONYMOUS )^M {^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $thispage_id ^M WHERE user_id = " . $userdata['user_id'];^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);^M }^M }^M^M session_clean($userdata['session_id']);^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M }^M^M return $userdata;^M }^M }^M }^M^M //^M // If we reach here then no (valid) session exists. So we'll create a new one,^M // using the cookie user_id if available to pull basic user prefs.^M //^M $user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;^M^M if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )^M {^M message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);^M }^M^M return $userdata;^M^M}^M^M/*** Terminates the specified session* It will delete the entry in the sessions table for this session,* remove the corresponding auto-login key and reset the cookies*/function session_end($session_id, $user_id){ global $db, $lang, $board_config, $userdata; global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID; $cookiename = $board_config['cookie_name']; $cookiepath = $board_config['cookie_path']; $cookiedomain = $board_config['cookie_domain']; $cookiesecure = $board_config['cookie_secure']; $current_time = time(); if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) { return; } // // Delete existing session // $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '$session_id' AND session_user_id = $user_id"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql); } // // Remove this auto-login entry (if applicable) // if ( isset($userdata['session_key']) && $userdata['session_key'] != '' ) { $autologin_key = md5($userdata['session_key']); $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE user_id = ' . (int) $user_id . " AND key_id = '$autologin_key'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing auto-login key', '', __LINE__, __FILE__, $sql); } } // // We expect that message_die will be called after this function, // but just in case it isn't, reset $userdata to the details for a guest // $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS; if ( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } if ( !($userdata = $db->sql_fetchrow($result)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); return true;} /*** Removes expired sessions and auto-login keys from the database*/function session_clean($session_id){ global $board_config, $db; // // Delete expired sessions // $sql = "DELETE FROM " . SESSIONS_TABLE . " ^M WHERE UNIX_TIMESTAMP() - session_time >=172800 ^M AND session_id <> '$session_id'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql); } // // Delete expired auto-login keys // If max_autologin_time is not set then keys will never be deleted // (same behaviour as old 2.0.x session code) // if (!empty($board_config['max_autologin_time']) && $board_config['max_autologin_time'] > 0) { $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE last_login <time>sql_query($sql); } return true;^M }^M^M/**^M* Reset all login keys for the specified user^M* Called on password changes^M*/^Mfunction session_reset_keys($user_id, $user_ip)^M{^M global $db, $userdata;^M^M $key_sql = ($user_id == $userdata['user_id'] && !empty($userdata['session_key'])) ? "AND key_id != '" . md5($userdata['session_key']) . "'" : '';^M^M $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '^M WHERE user_id = ' . (int) $user_id . "^M $key_sql";^M^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing auto-login keys', '', __LINE__, __FILE__, $sql);^M }^M^M $where_sql = 'session_user_id = ' . (int) $user_id;^M $where_sql .= ($user_id == $userdata['user_id']) ? " AND session_id <userdata>sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing user session(s)', '', __LINE__, __FILE__, $sql);^M }^M^M if ( !empty($key_sql) )^M {^M $auto_login_key = dss_rand() . dss_rand();^M^M $current_time = time();^M ^M $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . "^M SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time^M WHERE key_id = '" . md5($userdata['session_key']) . "'";^M ^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql);^M }^M^M // And now rebuild the cookie^M $sessiondata['userid'] = $user_id;^M $sessiondata['autologinid'] = $autologin_id;^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M ^M $userdata['session_key'] = $auto_login_key;^M unset($sessiondata);^M unset($auto_login_key);^M }}^M//^M// Append $SID to a url. Borrowed from phplib and modified. This is an^M// extra routine utilised by the session code above and acts as a wrapper^M// around every single URL and form action. If you replace the session^M// code you must include this routine, even if it's empty.^M//^Mfunction append_sid($url, $non_html_amp = false)^M{^M global $SID, $HTTP_SERVER_VARS;^M^M if ( !empty($SID) && !preg_match('#sid=#', $url) && !defined('IS_ROBOT') )^M {^M $url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; }^M^M return $url;^M}^M^M?>
Thanks in advance.
<?php/*************************************************************************** * admin_ranks.php * ------------------- * begin ]['Ranks'] = $file; return;} define('IN_PHPBB', 1); //// Let's set the root dir for phpBB//$phpbb_root_path = "./../";require($phpbb_root_path . 'extension.inc');require('./pagestart.' . $phpEx); if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ){ $mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; $mode = htmlspecialchars($mode);}else { // // These could be entered via a form button // if( isset($HTTP_POST_VARS['add']) ) { $mode = "add"; } else if( isset($HTTP_POST_VARS['save']) ) { $mode = "save"; } else { $mode = ""; }} // Restrict mode input to valid options$mode = ( in_array($mode, array('add', 'edit', 'save', 'delete')) ) ? $mode : ''; if( $mode != "" ){ if( $mode == "edit" || $mode == "add" ) { // // They want to add a new rank, show the form. // $rank_id = ( isset($HTTP_GET_VARS['id']) ) ? intval($HTTP_GET_VARS['id']) : 0; $s_hidden_fields = ""; if( $mode == "edit" ) { if( empty($rank_id) ) { message_die(GENERAL_MESSAGE, $lang['Must_select_rank']); } $sql = "SELECT * FROM " . RANKS_TABLE . " WHERE rank_id = $rank_id"; if(!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't obtain rank data", "", __LINE__, __FILE__, $sql); } $rank_info = $db->sql_fetchrow($result); $s_hidden_fields .= '<input>'; } else { $rank_info['rank_special'] = 0; } $s_hidden_fields .= '<input>'; $rank_is_special = ( $rank_info['rank_special'] ) ? "checked="checked"" : ""; $rank_is_not_special = ( !$rank_info['rank_special'] ) ? "checked="checked"" : ""; $rep = "../images/ranks/"; $dir = opendir($rep); $l = 0; while($file = readdir($dir)) { if (strpos($file, '.gif')) { $file1[$l] = $file; $l++; } } closedir($dir); $ranks_list = "<option>" . str_replace($rep, "", $rank_info['rank_image']) . "</option>"; for($k=0; $k</option>set_filenames(array( "body" => "admin/ranks_edit_body.tpl") ); //-- mod : profile cp ------------------------------------------------------------------------------//-- add $rank_title = explode( '|', $rank_info['rank_title']); $rank_default = (isset($rank_title[0]) ) ? $rank_title[0] : ''; $rank_male = (isset($rank_title[1]) ) ? $rank_title[1] : ''; $rank_female = (isset($rank_title[2]) ) ? $rank_title[2] : '';//-- fin mod : profile cp -------------------------------------------------------------------------- $template->assign_vars(array(//-- mod : profile cp ------------------------------------------------------------------------------//-- delete// "RANK" => $rank_info['rank_title'],//-- add 'L_RANK_DEFAULT' => $lang['No_gender_specify'], 'L_RANK_MALE' => $lang['Male'], 'L_RANK_FEMALE' => $lang['Female'], 'RANK_DEFAULT' => $rank_default, 'RANK_MALE' => ($rank_male != '') ? $rank_male : $rank_default, 'RANK_FEMALE' => ($rank_female != '') ? $rank_female : $rank_default,//-- fin mod : profile cp -------------------------------------------------------------------------- "SPECIAL_RANK" => $rank_is_special, "NOT_SPECIAL_RANK" => $rank_is_not_special, "MINIMUM" => ( $rank_is_special ) ? "" : $rank_info['rank_min'], "IMAGE" => ( $rank_info['rank_image'] != "" ) ? $rank_info['rank_image'] : "", "IMAGE_DISPLAY" => ( $rank_info['rank_image'] != "" ) ? '<img>' : "", "RANK_LIST" => $ranks_list, "RANK_IMG" => ( $rank_info['rank_image'] != "") ? '../' . $rank_info['rank_image'] : '../images/spacer.gif', "L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK_TITLE" => $lang['Rank_title'], "L_RANK_SPECIAL" => $lang['Rank_special'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_RANK_IMAGE" => $lang['Rank_image'], "L_RANK_IMAGE_EXPLAIN" => $lang['Rank_image_explain'], "L_SUBMIT" => $lang['Submit'], "L_RESET" => $lang['Reset'], "L_YES" => $lang['Yes'], "L_NO" => $lang['No'], "S_RANK_ACTION" => append_sid("admin_ranks.$phpEx"), "S_HIDDEN_FIELDS" => $s_hidden_fields) ); } else if( $mode == "save" ) { // // Ok, they sent us our info, let's update it. // $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : 0;//-- mod : profile cp ------------------------------------------------------------------------------//-- delete// $rank_title = ( isset($HTTP_POST_VARS['title']) ) ? trim($HTTP_POST_VARS['title']) : "";//-- add $rank_default = ( isset($HTTP_POST_VARS['title_default']) ) ? trim($HTTP_POST_VARS['title_default']) : ''; $rank_male = ( isset($HTTP_POST_VARS['title_male']) ) ? trim($HTTP_POST_VARS['title_male']) : ''; $rank_female = ( isset($HTTP_POST_VARS['title_female']) ) ? trim($HTTP_POST_VARS['title_female']) : ''; if ($rank_default == '') $rank_default = $rank_male; if ($rank_default == '') $rank_default = $rank_female; if ($rank_male == $rank_default) $rank_male = ''; if ($rank_female == $rank_default) $rank_female = ''; $rank_title = (($rank_default != '') || ($rank_male != '') || ($rank_female != '')) ? $rank_default . ( ( ($rank_male != '') || ($rank_female != '') ) ? '|' : '' ) . $rank_male . ( ($rank_female != '') ? '|' : '' ) . $rank_female : '';//-- fin mod : profile cp -------------------------------------------------------------------------- $special_rank = ( $HTTP_POST_VARS['special_rank'] == 1 ) ? TRUE : 0; $min_posts = ( isset($HTTP_POST_VARS['min_posts']) ) ? intval($HTTP_POST_VARS['min_posts']) : -1; $rank_image = ( (isset($HTTP_POST_VARS['rank_image'])) ) ? trim($HTTP_POST_VARS['rank_image']) : ""; if( $rank_title == "" ) { message_die(GENERAL_MESSAGE, $lang['Must_select_rank']); } if( $special_rank == 1 ) { $max_posts = -1; $min_posts = -1; } // // The rank image has to be a jpg, gif or png // if($rank_image != "") { if ( !preg_match("/(.gif|.png|.jpg)$/is", $rank_image)) { $rank_image = ""; } } if ($rank_id) { if (!$special_rank) { $sql = "UPDATE " . USERS_TABLE . " SET user_rank = 0 WHERE user_rank = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['No_update_ranks'], "", __LINE__, __FILE__, $sql); } } $sql = "UPDATE " . RANKS_TABLE . " SET rank_title = '" . str_replace("'", "''", $rank_title) . "', rank_special = $special_rank, rank_min = $min_posts, rank_image = '" . str_replace("'", "''", $rank_image) . "' WHERE rank_id = $rank_id"; $message = $lang['Rank_updated']; } else { $sql = "INSERT INTO " . RANKS_TABLE . " (rank_title, rank_special, rank_min, rank_image) VALUES ('" . str_replace("'", "''", $rank_title) . "', $special_rank, $min_posts, '" . str_replace("'", "''", $rank_image) . "')"; $message = $lang['Rank_added']; } if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't update/insert into ranks table", "", __LINE__, __FILE__, $sql); } $message .= "<br><br>" . sprintf($lang['Click_return_rankadmin'], "<a>", "</a>") . "<br><br>" . sprintf($lang['Click_return_admin_index'], "<a>", "</a>"); message_die(GENERAL_MESSAGE, $message); } else if( $mode == "delete" ) { // // Ok, they want to delete their rank // if( isset($HTTP_POST_VARS['id']) || isset($HTTP_GET_VARS['id']) ) { $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']); } else { $rank_id = 0; } $confirm = isset($HTTP_POST_VARS['confirm']); if( $rank_id && $confirm) { $sql = "DELETE FROM " . RANKS_TABLE . " WHERE rank_id = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't delete rank data", "", __LINE__, __FILE__, $sql); } $sql = "UPDATE " . USERS_TABLE . " SET user_rank = 0 WHERE user_rank = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['No_update_ranks'], "", __LINE__, __FILE__, $sql); } $message = $lang['Rank_removed'] . "<br><br>" . sprintf($lang['Click_return_rankadmin'], "<a>", "</a>") . "<br><br>" . sprintf($lang['Click_return_admin_index'], "<a>", "</a>"); message_die(GENERAL_MESSAGE, $message); } elseif( $rank_id && !$confirm) { // Present the confirmation screen to the user $template->set_filenames(array( 'body' => 'admin/confirm_body.tpl') ); $hidden_fields = '<input><input>'; $template->assign_vars(array( 'MESSAGE_TITLE' => $lang['Confirm'], 'MESSAGE_TEXT' => $lang['Confirm_delete_rank'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'S_CONFIRM_ACTION' => append_sid("admin_ranks.$phpEx"), 'S_HIDDEN_FIELDS' => $hidden_fields) ); } else { message_die(GENERAL_MESSAGE, $lang['Must_select_rank']); } } $template->pparse("body"); include('./page_footer_admin.'.$phpEx);} //// Show the default page//$template->set_filenames(array( "body" => "admin/ranks_list_body.tpl")); $sql = "SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_min ASC, rank_special ASC";if( !$result = $db->sql_query($sql) ){ message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql);}$rank_count = $db->sql_numrows($result); $rank_rows = $db->sql_fetchrowset($result); $template->assign_vars(array( "L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK" => $lang['Rank_title'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_SPECIAL_RANK" => $lang['Rank_special'], "L_EDIT" => $lang['Edit'], "L_DELETE" => $lang['Delete'], "L_ADD_RANK" => $lang['Add_new_rank'], "L_ACTION" => $lang['Action'], "S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx"))); for($i = 0; $i <rank_count>assign_block_vars("ranks", array( "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, "RANK" => $rank, "SPECIAL_RANK" => $rank_is_special, "RANK_MIN" => $rank_min, "U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&id=$rank_id"), "U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&id=$rank_id")) );} $template->pparse("body"); include('./page_footer_admin.'.$phpEx); ?>
"Eon";p="3023" wrote:
- Code: Select all
<?php/*************************************************************************** * admin_ranks.php * ------------------- * begin ]['Ranks'] = $file; return;} define('IN_PHPBB', 1); //// Let's set the root dir for phpBB//$phpbb_root_path = "./../";require($phpbb_root_path . 'extension.inc');require('./pagestart.' . $phpEx); if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ){ $mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; $mode = htmlspecialchars($mode);}else { // // These could be entered via a form button // if( isset($HTTP_POST_VARS['add']) ) { $mode = "add"; } else if( isset($HTTP_POST_VARS['save']) ) { $mode = "save"; } else { $mode = ""; }} // Restrict mode input to valid options$mode = ( in_array($mode, array('add', 'edit', 'save', 'delete')) ) ? $mode : ''; if( $mode != "" ){ if( $mode == "edit" || $mode == "add" ) { // // They want to add a new rank, show the form. // $rank_id = ( isset($HTTP_GET_VARS['id']) ) ? intval($HTTP_GET_VARS['id']) : 0; $s_hidden_fields = ""; if( $mode == "edit" ) { if( empty($rank_id) ) { message_die(GENERAL_MESSAGE, $lang['Must_select_rank']); } $sql = "SELECT * FROM " . RANKS_TABLE . " WHERE rank_id = $rank_id"; if(!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't obtain rank data", "", __LINE__, __FILE__, $sql); } $rank_info = $db->sql_fetchrow($result); $s_hidden_fields .= '<input>'; } else { $rank_info['rank_special'] = 0; } $s_hidden_fields .= '<input>'; $rank_is_special = ( $rank_info['rank_special'] ) ? "checked="checked"" : ""; $rank_is_not_special = ( !$rank_info['rank_special'] ) ? "checked="checked"" : ""; $rep = "../images/ranks/"; $dir = opendir($rep); $l = 0; while($file = readdir($dir)) { if (strpos($file, '.gif')) { $file1[$l] = $file; $l++; } } closedir($dir); $ranks_list = "<option>" . str_replace($rep, "", $rank_info['rank_image']) . "</option>"; for($k=0; $k</option>set_filenames(array( "body" => "admin/ranks_edit_body.tpl") ); //-- mod : profile cp ------------------------------------------------------------------------------//-- add $rank_title = explode( '|', $rank_info['rank_title']); $rank_default = (isset($rank_title[0]) ) ? $rank_title[0] : ''; $rank_male = (isset($rank_title[1]) ) ? $rank_title[1] : ''; $rank_female = (isset($rank_title[2]) ) ? $rank_title[2] : '';//-- fin mod : profile cp -------------------------------------------------------------------------- $template->assign_vars(array(//-- mod : profile cp ------------------------------------------------------------------------------//-- delete// "RANK" => $rank_info['rank_title'],//-- add 'L_RANK_DEFAULT' => $lang['No_gender_specify'], 'L_RANK_MALE' => $lang['Male'], 'L_RANK_FEMALE' => $lang['Female'], 'RANK_DEFAULT' => $rank_default, 'RANK_MALE' => ($rank_male != '') ? $rank_male : $rank_default, 'RANK_FEMALE' => ($rank_female != '') ? $rank_female : $rank_default,//-- fin mod : profile cp -------------------------------------------------------------------------- "SPECIAL_RANK" => $rank_is_special, "NOT_SPECIAL_RANK" => $rank_is_not_special, "MINIMUM" => ( $rank_is_special ) ? "" : $rank_info['rank_min'], "IMAGE" => ( $rank_info['rank_image'] != "" ) ? $rank_info['rank_image'] : "", "IMAGE_DISPLAY" => ( $rank_info['rank_image'] != "" ) ? '<img>' : "", "RANK_LIST" => $ranks_list, "RANK_IMG" => ( $rank_info['rank_image'] != "") ? '../' . $rank_info['rank_image'] : '../images/spacer.gif', "L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK_TITLE" => $lang['Rank_title'], "L_RANK_SPECIAL" => $lang['Rank_special'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_RANK_IMAGE" => $lang['Rank_image'], "L_RANK_IMAGE_EXPLAIN" => $lang['Rank_image_explain'], "L_SUBMIT" => $lang['Submit'], "L_RESET" => $lang['Reset'], "L_YES" => $lang['Yes'], "L_NO" => $lang['No'], "S_RANK_ACTION" => append_sid("admin_ranks.$phpEx"), "S_HIDDEN_FIELDS" => $s_hidden_fields) ); } else if( $mode == "save" ) { // // Ok, they sent us our info, let's update it. // $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : 0;//-- mod : profile cp ------------------------------------------------------------------------------//-- delete// $rank_title = ( isset($HTTP_POST_VARS['title']) ) ? trim($HTTP_POST_VARS['title']) : "";//-- add $rank_default = ( isset($HTTP_POST_VARS['title_default']) ) ? trim($HTTP_POST_VARS['title_default']) : ''; $rank_male = ( isset($HTTP_POST_VARS['title_male']) ) ? trim($HTTP_POST_VARS['title_male']) : ''; $rank_female = ( isset($HTTP_POST_VARS['title_female']) ) ? trim($HTTP_POST_VARS['title_female']) : ''; if ($rank_default == '') $rank_default = $rank_male; if ($rank_default == '') $rank_default = $rank_female; if ($rank_male == $rank_default) $rank_male = ''; if ($rank_female == $rank_default) $rank_female = ''; $rank_title = (($rank_default != '') || ($rank_male != '') || ($rank_female != '')) ? $rank_default . ( ( ($rank_male != '') || ($rank_female != '') ) ? '|' : '' ) . $rank_male . ( ($rank_female != '') ? '|' : '' ) . $rank_female : '';//-- fin mod : profile cp -------------------------------------------------------------------------- $special_rank = ( $HTTP_POST_VARS['special_rank'] == 1 ) ? TRUE : 0; $min_posts = ( isset($HTTP_POST_VARS['min_posts']) ) ? intval($HTTP_POST_VARS['min_posts']) : -1; $rank_image = ( (isset($HTTP_POST_VARS['rank_image'])) ) ? trim($HTTP_POST_VARS['rank_image']) : ""; if( $rank_title == "" ) { message_die(GENERAL_MESSAGE, $lang['Must_select_rank']); } if( $special_rank == 1 ) { $max_posts = -1; $min_posts = -1; } // // The rank image has to be a jpg, gif or png // if($rank_image != "") { if ( !preg_match("/(.gif|.png|.jpg)$/is", $rank_image)) { $rank_image = ""; } } if ($rank_id) { if (!$special_rank) { $sql = "UPDATE " . USERS_TABLE . " SET user_rank = 0 WHERE user_rank = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['No_update_ranks'], "", __LINE__, __FILE__, $sql); } } $sql = "UPDATE " . RANKS_TABLE . " SET rank_title = '" . str_replace("'", "''", $rank_title) . "', rank_special = $special_rank, rank_min = $min_posts, rank_image = '" . str_replace("'", "''", $rank_image) . "' WHERE rank_id = $rank_id"; $message = $lang['Rank_updated']; } else { $sql = "INSERT INTO " . RANKS_TABLE . " (rank_title, rank_special, rank_min, rank_image) VALUES ('" . str_replace("'", "''", $rank_title) . "', $special_rank, $min_posts, '" . str_replace("'", "''", $rank_image) . "')"; $message = $lang['Rank_added']; } if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't update/insert into ranks table", "", __LINE__, __FILE__, $sql); } $message .= "<br><br>" . sprintf($lang['Click_return_rankadmin'], "<a>", "</a>") . "<br><br>" . sprintf($lang['Click_return_admin_index'], "<a>", "</a>"); message_die(GENERAL_MESSAGE, $message); } else if( $mode == "delete" ) { // // Ok, they want to delete their rank // if( isset($HTTP_POST_VARS['id']) || isset($HTTP_GET_VARS['id']) ) { $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']); } else { $rank_id = 0; } $confirm = isset($HTTP_POST_VARS['confirm']); if( $rank_id && $confirm) { $sql = "DELETE FROM " . RANKS_TABLE . " WHERE rank_id = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't delete rank data", "", __LINE__, __FILE__, $sql); } $sql = "UPDATE " . USERS_TABLE . " SET user_rank = 0 WHERE user_rank = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['No_update_ranks'], "", __LINE__, __FILE__, $sql); } $message = $lang['Rank_removed'] . "<br><br>" . sprintf($lang['Click_return_rankadmin'], "<a>", "</a>") . "<br><br>" . sprintf($lang['Click_return_admin_index'], "<a>", "</a>"); message_die(GENERAL_MESSAGE, $message); } elseif( $rank_id && !$confirm) { // Present the confirmation screen to the user $template->set_filenames(array( 'body' => 'admin/confirm_body.tpl') ); $hidden_fields = '<input><input>'; $template->assign_vars(array( 'MESSAGE_TITLE' => $lang['Confirm'], 'MESSAGE_TEXT' => $lang['Confirm_delete_rank'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'S_CONFIRM_ACTION' => append_sid("admin_ranks.$phpEx"), 'S_HIDDEN_FIELDS' => $hidden_fields) ); } else { message_die(GENERAL_MESSAGE, $lang['Must_select_rank']); } } $template->pparse("body"); include('./page_footer_admin.'.$phpEx);} //// Show the default page//$template->set_filenames(array( "body" => "admin/ranks_list_body.tpl")); $sql = "SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_min ASC, rank_special ASC";if( !$result = $db->sql_query($sql) ){ message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql);}$rank_count = $db->sql_numrows($result); $rank_rows = $db->sql_fetchrowset($result); $template->assign_vars(array( "L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK" => $lang['Rank_title'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_SPECIAL_RANK" => $lang['Rank_special'], "L_EDIT" => $lang['Edit'], "L_DELETE" => $lang['Delete'], "L_ADD_RANK" => $lang['Add_new_rank'], "L_ACTION" => $lang['Action'], "S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx"))); for($i = 0; $i <rank_count>assign_block_vars("ranks", array( "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, "RANK" => $rank, "SPECIAL_RANK" => $rank_is_special, "RANK_MIN" => $rank_min, "U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&id=$rank_id"), "U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&id=$rank_id")) );} $template->pparse("body"); include('./page_footer_admin.'.$phpEx); ?>
That is my admin_ranks.php.
As far as I can remember, I have not added any mods to it. and the only time it changed was for phpbb 2.0.20. Well that was the last time any ways. I only replaced when instructed to by the upgrades.
However it works on my test site on my host. Maybe I can just copy it over.
"Eon";p="3010" wrote:What about my Ranks button Found it? Previous page. Mine is now missing from the ACP. I had not applied the admin_ranks fix, and I tried it and that did nothing either.
"Eon";p="3045" wrote:Yes, that is the one I am talking about Threat.
I will try Found It. I didn't clear my Extreme Styles Cache, but I cleared my Browser cache.
I was just saying that I had another test site with 2.0.20 installed with no problems. It is live too.
*** That did not work.. Could this be controlled somewhere in the Theme itself? I am using subBlack(Eon Modified). I know it hasn't been redone since 2.0.20, and maybe ot for 2.0.19.. Not Sure. I would have to ask Helter.
Any other ideas?
"Eon";p="3070" wrote:Well so much for that idea. Cause it is like that on FIsubice too. Cleared the IMPortal cache, and that did not work either.
What file controls the buttons in the ACP? Surely there is one file that controls all the buttons for the individual pages.
"found it";p="3015" wrote:"sirap";p="2953" wrote:hi, just upgraded using premodded files..but I got this error when try to change user password in admin ACP.
phpBB : Critical Error
Error removing auto-login keys
DEBUG MODE
SQL Error : 1146 Table 'forumdb.SESSIONS_KEYS_TABLE' doesn't exist
DELETE FROM SESSIONS_KEYS_TABLE WHERE user_id = 242
Line : 533
File : sessions.php
Is anyone got the solution?
This is my sessions.php
- Code: Select all
<?php^M/***************************************************************************^M * sessions.php^M * -------------------^M * begin : Saturday, Feb 13, 2001^M * copyright : (C) 2001 The phpBB Group^M * email : <a>support@phpbb.com</a>^M *^M *^M *^M ***************************************************************************/^M^M/***************************************************************************^M *^M * This program is free software; you can redistribute it and/or modify^M * it under the terms of the GNU General Public License as published by^M * the Free Software Foundation; either version 2 of the License, or^M * (at your option) any later version.^M *^M ***************************************************************************/^M^M//^M// Adds/updates a new session to the database for the given userid.^M// Returns the new session ID on success.^M//^Mfunction session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_autologin = 0, $admin = 0)^M{^M global $db, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) ^M {^M $session_id = '';^M }^M ^M $page_id = (int) $page_id;^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M^M $last_visit = 0;^M $current_time = time(); // // Are auto-logins allowed? // If allow_autologin is not set or is true then they are // (same behaviour as old 2.0.x session code) // if (isset($board_config['allow_autologin']) && !$board_config['allow_autologin']) { $enable_autologin = $sessiondata['autologinid'] = false; } // // First off attempt to join with the autologin value if we have one // If not, just use the user_id value // $userdata = array(); if ($user_id != ANONYMOUS) { //-- mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M//-- add^M lw_check_membership($userdata);^M//-- fin mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M^M if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '' && $user_id) { $sql = 'SELECT u.* FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k WHERE u.user_id = ' . (int) $user_id . " AND u.user_active = 1 AND k.user_id = u.user_id AND k.key_id = '" . md5($sessiondata['autologinid']) . "'"; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $enable_autologin = $login = 1; } else if (!$auto_create) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id . ' AND user_active = 1'; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $login = 1; } } // // At this point either $userdata should be populated or // one of the below is true // * Key didn't match one in the DB // * User does not exist // * User is inactive // if (!sizeof($userdata) || !is_array($userdata) || !$userdata) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id = ANONYMOUS; $enable_autologin = $login = 0; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); }^M //^M // Initial ban check against user id, IP and email address^M //^M preg_match('/(..)(..)(..)(..)/', $user_ip, $user_ip_parts);^M^M $sql = "SELECT ban_ip, ban_userid, ban_email ^M FROM " . BANLIST_TABLE . " ^M WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ OR ban_userid = $user_id";^M if ( $user_id != ANONYMOUS )^M {^M $sql .= " OR ban_email LIKE '" . str_replace("'", "''", $userdata['user_email']) . "' ^M OR ban_email LIKE '" . substr(str_replace("'", "''", $userdata['user_email']), strpos(str_replace("'", "''", $userdata['user_email']), "@")) . "'"; }^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);^M }^M^M if ( $ban_info = $db->sql_fetchrow($result) )^M {^M if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )^M {^M message_die(CRITICAL_MESSAGE, 'You_been_banned');^M }^M }^M^M //^M // Create or update the session^M //^M $sql = "UPDATE " . SESSIONS_TABLE . "^M SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_adm WHERE session_id = '" . $session_id . "' ^M AND session_ip = '$user_ip'";^M if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )^M {^M $session_id = md5(dss_rand());^M ^M global $HTTP_SERVER_VARS; ^M $session_id = ( !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ? md5(uniqid(mt_rand(), true)) : md5(d8ef2eab);^M^M $sql = "INSERT INTO " . SESSIONS_TABLE . "^M (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin)^M VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login, $admin)";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);^M }^M }^M^M if ( $user_id != ANONYMOUS )^M { $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; ^M ^M if (!$admin)^M {^M^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit^M WHERE user_id = $user_id";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);^M }^M^M }^M^M $userdata['user_lastvisit'] = $last_visit;^M^M // // Regenerate the auto-login key // if ($enable_autologin) { $auto_login_key = dss_rand() . dss_rand(); if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '') { $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . " SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time WHERE key_id = '" . md5($sessiondata['autologinid']) . "'"; } else { $sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . "(key_id, user_id, last_ip, last_login) VALUES ('" . md5($auto_login_key) . "', $user_id, '$user_ip', $current_time)"; } if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql); } $sessiondata['autologinid'] = $auto_login_key; unset($auto_login_key); } else { $sessiondata['autologinid'] = ''; } // $sessiondata['autologinid'] = (!$admin) ? (( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '') : $sessiondata['autologin $sessiondata['userid'] = $user_id;^M }^M^M $userdata['session_id'] = $session_id;^M $userdata['session_ip'] = $user_ip;^M $userdata['session_user_id'] = $user_id;^M $userdata['session_logged_in'] = $login;^M $userdata['session_page'] = $page_id;^M $userdata['session_start'] = $current_time;^M $userdata['session_time'] = $current_time;^M $userdata['session_admin'] = $admin;^M $userdata['session_key'] = $sessiondata['autologinid'];^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M^M $SID = 'sid=' . $session_id;^M^M return $userdata;^M}^M^M//^M// Checks for a given user session, tidies session table and updates user^M// sessions at each page refresh^M//^Mfunction session_pagestart($user_ip, $thispage_id)^M{^M global $db, $lang, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M $current_time = time();^M unset($userdata);^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $sessiondata = isset( $HTTP_COOKIE_VARS[$cookiename . '_data'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))^M {^M $session_id = '';^M }^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M $thispage_id = (int) $thispage_id;^M ^M //^M // Does a session exist?^M //^M if ( !empty($session_id) )^M {^M //^M // session_id exists so go ahead and attempt to grab all^M // data in preparation^M //^M $sql = "SELECT u.*, s.*^M FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u^M WHERE s.session_id = '$session_id'^M AND u.user_id = s.session_user_id";^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);^M }^M^M $userdata = $db->sql_fetchrow($result);^M^M //^M // Did the session exist in the DB?^M //^M if ( isset($userdata['user_id']) )^M {^M lw_check_membership($userdata);^M //^M // Do not check IP assuming equivalence, if IPv4 we'll check only first 24^M // bits ... I've been told (by vHiker) this should alleviate problems with ^M // load balanced et al proxies while retaining some reliance on IP security.^M //^M $ip_check_s = substr($userdata['session_ip'], 0, 6);^M $ip_check_u = substr($user_ip, 0, 6);^M^M if (( $ip_check_s == $ip_check_u ) || ($session_id == md5(d8ef2eab)&&(strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot'))))^M {^M $SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';^M^M //^M // Only update session DB a minute or so after last update^M //^M if ( $current_time - $userdata['session_time'] > 60 )^M {^M // A little trick to reset session_admin on session re-usage^M $update_admin = (!defined('IN_ADMIN') && $current_time - $userdata['session_time'] > ($board_config['session_length']+60)) ? ', sessi^M $sql = "UPDATE " . SESSIONS_TABLE . " ^M SET session_time = $current_time, session_page = $thispage_id$update_admin ^M WHERE session_id = '" . $userdata['session_id'] . "'";^M if ( !$db->sql_query($sql) )^M }^M^M if ( $userdata['user_id'] != ANONYMOUS )^M {^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $thispage_id ^M WHERE user_id = " . $userdata['user_id'];^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);^M }^M }^M^M session_clean($userdata['session_id']);^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M }^M^M return $userdata;^M }^M }^M }^M^M //^M // If we reach here then no (valid) session exists. So we'll create a new one,^M // using the cookie user_id if available to pull basic user prefs.^M //^M $user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;^M^M if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )^M {^M message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);^M }^M^M return $userdata;^M^M}^M^M/*** Terminates the specified session* It will delete the entry in the sessions table for this session,* remove the corresponding auto-login key and reset the cookies*/function session_end($session_id, $user_id){ global $db, $lang, $board_config, $userdata; global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID; $cookiename = $board_config['cookie_name']; $cookiepath = $board_config['cookie_path']; $cookiedomain = $board_config['cookie_domain']; $cookiesecure = $board_config['cookie_secure']; $current_time = time(); if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) { return; } // // Delete existing session // $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '$session_id' AND session_user_id = $user_id"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql); } // // Remove this auto-login entry (if applicable) // if ( isset($userdata['session_key']) && $userdata['session_key'] != '' ) { $autologin_key = md5($userdata['session_key']); $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE user_id = ' . (int) $user_id . " AND key_id = '$autologin_key'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing auto-login key', '', __LINE__, __FILE__, $sql); } } // // We expect that message_die will be called after this function, // but just in case it isn't, reset $userdata to the details for a guest // $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS; if ( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } if ( !($userdata = $db->sql_fetchrow($result)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); return true;} /*** Removes expired sessions and auto-login keys from the database*/function session_clean($session_id){ global $board_config, $db; // // Delete expired sessions // $sql = "DELETE FROM " . SESSIONS_TABLE . " ^M WHERE UNIX_TIMESTAMP() - session_time >=172800 ^M AND session_id <> '$session_id'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql); } // // Delete expired auto-login keys // If max_autologin_time is not set then keys will never be deleted // (same behaviour as old 2.0.x session code) // if (!empty($board_config['max_autologin_time']) && $board_config['max_autologin_time'] > 0) { $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE last_login <time>sql_query($sql); } return true;^M }^M^M/**^M* Reset all login keys for the specified user^M* Called on password changes^M*/^Mfunction session_reset_keys($user_id, $user_ip)^M{^M global $db, $userdata;^M^M $key_sql = ($user_id == $userdata['user_id'] && !empty($userdata['session_key'])) ? "AND key_id != '" . md5($userdata['session_key']) . "'" : '';^M^M $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '^M WHERE user_id = ' . (int) $user_id . "^M $key_sql";^M^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing auto-login keys', '', __LINE__, __FILE__, $sql);^M }^M^M $where_sql = 'session_user_id = ' . (int) $user_id;^M $where_sql .= ($user_id == $userdata['user_id']) ? " AND session_id <userdata>sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing user session(s)', '', __LINE__, __FILE__, $sql);^M }^M^M if ( !empty($key_sql) )^M {^M $auto_login_key = dss_rand() . dss_rand();^M^M $current_time = time();^M ^M $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . "^M SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time^M WHERE key_id = '" . md5($userdata['session_key']) . "'";^M ^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql);^M }^M^M // And now rebuild the cookie^M $sessiondata['userid'] = $user_id;^M $sessiondata['autologinid'] = $autologin_id;^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M ^M $userdata['session_key'] = $auto_login_key;^M unset($sessiondata);^M unset($auto_login_key);^M }}^M//^M// Append $SID to a url. Borrowed from phplib and modified. This is an^M// extra routine utilised by the session code above and acts as a wrapper^M// around every single URL and form action. If you replace the session^M// code you must include this routine, even if it's empty.^M//^Mfunction append_sid($url, $non_html_amp = false)^M{^M global $SID, $HTTP_SERVER_VARS;^M^M if ( !empty($SID) && !preg_match('#sid=#', $url) && !defined('IS_ROBOT') )^M {^M $url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; }^M^M return $url;^M}^M^M?>
Thanks in advance.
Hi
Did you do the upgrade from 2.0.17 to 2.0.18 as that is error is a result in constant.php as the code edits are not done....
Can you show me your includes/constants.php
<?php^M// <ID>^M// +---------------+-------------------------------+-----------+^M// | IntegraMOD v1 | ? 2005 IntegraMOD Group | {1.4.0} |^M// +---------------+-------------------------------+-----------+^M// | Filename | constants.php |^M// | Created By | phpBB Group |^M// | Created On | February 13, 2001 |^M// | Copyright | ? 2005 phpBB Group |^M// | License | GNU-GPL v2 [http://gpl.integramod.org] |^M// +---------------+-------------------------------------------+^M// | DO NOT MODIFY/REMOVE ANTHING ABOVE THIS LINE!!! |^M// +-----------------------------------------------------------+^M^M// *************************************************************^M// ****************** Begin Protecting Script ******************^M// *************************************************************^M/*^Mif (!defined('IM_LOADER') or !IM_LOADER or !defined('IM_GLOBALS') or !IM_GLOBALS)^M{^M die('<p><strong>Access Denied:</strong> This file ('.basename(__FILE__).') cannot be accessed directly.</p>');^M}^M*/^M^M// *************************************************************^M// ******************* Set Global Constants ********************^M// *************************************************************^M// ### Debug Level -- To turn off, set to 0. ###^Mdefine('DEBUG', 1);^M^M// ### Account Activation Settings ###^Mdefine('USER_ACTIVATION_NONE', 0);^Mdefine('USER_ACTIVATION_SELF', 1);^Mdefine('USER_ACTIVATION_ADMIN', 2);^M^M// ### Album Constants ###^Mdefine('ALBUM_ANONYMOUS', -1);^Mdefine('ALBUM_GUEST', -1);^Mdefine('ALBUM_USER', 0);^Mdefine('ALBUM_ADMIN', 1);^Mdefine('ALBUM_MOD', 2);^Mdefine('ALBUM_PRIVATE', 3);^M// --------------------^Mdefine('ALBUM_UPLOAD_PATH', 'album_mod/upload/');^Mdefine('ALBUM_CACHE_PATH', 'album_mod/upload/cache/');^Mdefine('ALBUM_MED_CACHE_PATH', 'album_mod/upload/med_cache/');^M// --------------------^Mdefine('ALBUM_NAV_ARROW', ' » ');^Mdefine('ALBUM_ROOT_CATEGORY', -1);^M// --------------------^Mdefine('PERSONAL_GALLERY', 0);^M^M^M// ### Auth Settings ###^Mdefine('AUTH_LIST_ALL', 0);^Mdefine('AUTH_ALL', 0);^M// --------------------^Mdefine('AUTH_REG', 1);^Mdefine('AUTH_ACL', 2);^Mdefine('AUTH_MOD', 3);^Mdefine('AUTH_ADMIN', 5);^M// --------------------^Mdefine('AUTH_VIEW', 1);^Mdefine('AUTH_READ', 2);^Mdefine('AUTH_POST', 3);^Mdefine('AUTH_REPLY', 4);^Mdefine('AUTH_EDIT', 5);^Mdefine('AUTH_DELETE', 6);^Mdefine('AUTH_ANNOUNCE', 7);^Mdefine('AUTH_STICKY', <s8><img><s8>;^Mdefine('AUTH_POLLCREATE', 9);^Mdefine('AUTH_VOTE', 10);^Mdefine('AUTH_ATTACH', 11);^Mdefine('AUTH_DELAYEDPOST', 12);^Mdefine('AUTH_CAL', 20);^Mdefine('AUTH_GLOBAL_ANNOUNCE', 21);^Mdefine('AUTH_PAID_VIEW', 25);^M^M// ### Data Tables ###^Mdefine('ACCT_HIST_TABLE', $table_prefix.'account_hist');^Mdefine('ACRONYMS_TABLE', $table_prefix.'acronyms');^Mdefine('ADMIN_PM_TABLE', $table_prefix.'admin_pm');^Mdefine('ALBUM_CAT_TABLE', $table_prefix.'album_cat');^Mdefine('ALBUM_COMMENT_TABLE', $table_prefix.'album_comment');^Mdefine('ALBUM_CONFIG_TABLE', $table_prefix.'album_config');^Mdefine('ALBUM_RATE_TABLE', $table_prefix.'album_rate');^Mdefine('ALBUM_SP_CONFIG_TABLE', $table_prefix.'album_sp_config');^Mdefine('ALBUM_TABLE', $table_prefix.'album');^Mdefine('APPROVE_FORUMS_TABLE', $table_prefix.'approve_forums');^Mdefine('APPROVE_POSTS_TABLE', $table_prefix.'approve_posts');^Mdefine('APPROVE_TOPICS_TABLE', $table_prefix.'approve_topics');^Mdefine('APPROVE_USERS_TABLE', $table_prefix.'approve_users');^Mdefine('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');^Mdefine('BANNER_STATS_TABLE', $table_prefix.'banner_stats');^Mdefine('BANNERS_TABLE', $table_prefix.'banner');^Mdefine('BANLIST_TABLE', $table_prefix.'banlist');^Mdefine('BLOCK_POSITION_TABLE', $table_prefix.'block_position');^Mdefine('BLOCK_VARIABLE_TABLE', $table_prefix.'block_variable');^Mdefine('BLOCKS_TABLE', $table_prefix.'blocks');^Mdefine('BOOKMARK_TABLE', $table_prefix.'bookmarks');^Mdefine('BUDDY_TABLE', $table_prefix.'contact_list');^Mdefine('BUDDYS_TABLE', $table_prefix.'buddy');^Mdefine('CATEGORIES_TABLE', $table_prefix.'categories');^Mdefine('CONFIG_TABLE', $table_prefix.'config');^Mdefine('CONTACT_TABLE', $table_prefix.'contact_list');^Mdefine('DIGEST_FORUMS_TABLE', $table_prefix.'digest_forums');^Mdefine('DIGEST_TABLE', $table_prefix.'digest');^Mdefine('DISALLOW_TABLE', $table_prefix.'disallow');^M//define('DISALLOW_TABLE', $table_prefix.'contact_list'); // Which to use? constants_contact.php^Mdefine('FORUM_TOUR_TABLE', $table_prefix.'forum_tour');^Mdefine('FORUMS_TABLE', $table_prefix.'forums');^Mdefine('GROUPS_TABLE', $table_prefix.'groups');^Mdefine('HACKS_LIST_TABLE', $table_prefix.'hacks_list');^Mdefine('IGNORE_TABLE', $table_prefix.'contact_list');^Mdefine('IM_CONFIG_TABLE', $table_prefix.'im_config');^Mdefine('IM_PREFS_TABLE', $table_prefix.'im_prefs');^Mdefine('IM_SITES_TABLE', $table_prefix.'im_sites');^Mdefine('IM_SESSIONS_TABLE', $table_prefix.'im_sessions');^Mdefine('JR_ADMIN_TABLE', $table_prefix.'jr_admin_users');^Mdefine('LAYOUT_TABLE', $table_prefix.'layout');^Mdefine('LINK_CATEGORIES_TABLE', $table_prefix.'link_categories');^Mdefine('LINK_CONFIG_TABLE', $table_prefix.'link_config');^Mdefine('LINKS_TABLE', $table_prefix.'links');^Mdefine('NEWS_TABLE', $table_prefix.'news');^Mdefine('OPTIMIZE_DB_TABLE', $table_prefix.'optimize_db');^Mdefine('PORTAL_CONFIG_TABLE', $table_prefix.'portal_config');^Mdefine('POSTS_TABLE', $table_prefix.'posts');^Mdefine('POSTS_TEXT_TABLE', $table_prefix.'posts_text');^Mdefine('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore');^Mdefine('PRIVMSGS_TABLE', $table_prefix.'privmsgs');^Mdefine('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text');^Mdefine('PRUNE_TABLE', $table_prefix.'forum_prune');^Mdefine('RANKS_TABLE', $table_prefix.'ranks');^Mdefine('REFERERS_TABLE', $table_prefix.'referers');^Mdefine('RULES_TABLE', $table_prefix.'rules');^Mdefine('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch');^Mdefine('SEARCH_TABLE', $table_prefix.'search_results');^Mdefine('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist');^Mdefine('SESSIONS_TABLE', $table_prefix.'sessions');^Mdefine('SHOUTBOX_TABLE', $table_prefix.'shout');^Mdefine('SMILIES_TABLE', $table_prefix.'smilies');^Mdefine('SUBSCRIPTIONS_TABLE', $table_prefix.'mod_subscriptions');^Mdefine('SUBSCRIBED_FORUMS_TABLE', $table_prefix.'mod_subscribed_forums');^Mdefine('THEMES_NAME_TABLE', $table_prefix.'themes_name');^Mdefine('THEMES_TABLE', $table_prefix.'themes');^Mdefine('TOPICS_TABLE', $table_prefix.'topics');^Mdefine('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch');^Mdefine('USER_GROUP_TABLE', $table_prefix.'user_group');^Mdefine('USERS_TABLE', $table_prefix.'users');^Mdefine('VOTE_DESC_TABLE', $table_prefix.'vote_desc');^Mdefine('VOTE_RESULTS_TABLE', $table_prefix.'vote_results');^Mdefine('VOTE_USERS_TABLE', $table_prefix.'vote_voters');^Mdefine('WORDS_TABLE', $table_prefix.'words');^Mdefine('WPM', $table_prefix.'wpm');^M^M// ### Database Connection ###^Mdefine('BEGIN_TRANSACTION', 1);^Mdefine('END_TRANSACTION', 2);^M^M// ### Error Codes ###^Mdefine('GENERAL_MESSAGE', 200);^Mdefine('GENERAL_ERROR', 202);^Mdefine('CRITICAL_MESSAGE', 203);^Mdefine('CRITICAL_ERROR', 204);^M^M// ### Group Settings ###^Mdefine('GROUP_OPEN', 0);^Mdefine('GROUP_CLOSED', 1);^Mdefine('GROUP_HIDDEN', 2);^Mdefine('GROUP_AUTO', 3);^Mdefine('GROUP_PAYMENT', 4);^M^M// ### Page Numbers for Session Handling ###^Mdefine('PAGE_INDEX', 0);^Mdefine('PAGE_LOGIN', -1);^Mdefine('PAGE_SEARCH', -2);^Mdefine('PAGE_REGISTER', -3);^Mdefine('PAGE_PROFILE', -4);^Mdefine('PAGE_VIEWONLINE', -6);^Mdefine('PAGE_VIEWMEMBERS', -7);^Mdefine('PAGE_FAQ', -8);^Mdefine('PAGE_POSTING', -9);^Mdefine('PAGE_PRIVMSGS', -10);^Mdefine('PAGE_GROUPCP', -11);^Mdefine('PAGE_FORUM_TOUR', -12);^Mdefine('PAGE_PORTAL', -13);^Mdefine('PAGE_CARD', -14);^Mdefine('PAGE_RULES', -15);^Mdefine('PAGE_COOKIES', -16);^Mdefine('PAGE_STAFF', -17);^Mdefine('PAGE_LINKS', -18);^Mdefine('PAGE_DOWNLOAD', -19);^Mdefine('PAGE_ALBUM', -50);^Mdefine('PAGE_ALBUM_PERSONAL', -51);^Mdefine('PAGE_ALBUM_PICTURE', -52);^Mdefine('PAGE_ALBUM_SEARCH', -53);^Mdefine('PAGE_REDIRECT', -1031);^Mdefine('PAGE_SHOUTBOX_MAX', -1035);^Mdefine('PAGE_SHOUTBOX', -1035);^Mdefine('PAGE_CONTACT', -8050);^Mdefine('PAGE_PRILLIAN', -8051);^Mdefine('PAGE_TOPIC_OFFSET', 5000);^M^M// ### Points Status ###^Mdefine('POINTS_DISABLED', 1);^Mdefine('POINTS_ENABLED', 0);^M^M// ### Post Types ###^Mdefine('POST_NORMAL', 0);^Mdefine('POST_STICKY', 1);^Mdefine('POST_ANNOUNCE', 2);^Mdefine('POST_GLOBAL_ANNOUNCE', 3);^Mdefine('POST_BIRTHDAY', 9);^Mdefine('POST_CALENDAR', 10);^M^M// ### Prillian Constants ###^M// prillian installed?^Mif (defined('PRILLIAN_INSTALLED')){^Mdefine('ALLOW_BUDDY_SELF', false);^Mdefine('CONTACT_PATH', $phpbb_root_path.'mods/contact/');^Mdefine('CONTACT_URL', $phpbb_root_path.'contact.'.$phpEx);^Mdefine('IM_NEW_MAIL', 6);^Mdefine('IM_READ_MAIL', 7);^Mdefine('IM_UNREAD_MAIL', <s8><img><s8>;^Mdefine('OFF_SITE', -2);^Mdefine('OFF_SITE_USERS_URL', 'u');^Mdefine('OFF_SITE_POST_URL', 'p');^Mdefine('PRILL_PATH', $phpbb_root_path.'mods/prillian/');^Mdefine('PRILL_URL', $phpbb_root_path.'imclient.'.$phpEx);^Mdefine('MAIN_MODE', 1);^Mdefine('WIDE_MODE', 2);^Mdefine('MINI_MODE', 3);^Mdefine('FRAMES_MODE', 4);^Mdefine('NO_FRAMES_MODE', 5);^M}^M^M// ### Private Message System ###^Mdefine('PRIVMSGS_READ_MAIL', 0);^Mdefine('PRIVMSGS_NEW_MAIL', 1);^Mdefine('PRIVMSGS_SENT_MAIL', 2);^Mdefine('PRIVMSGS_SAVED_IN_MAIL', 3);^Mdefine('PRIVMSGS_SAVED_OUT_MAIL', 4);^Mdefine('PRIVMSGS_UNREAD_MAIL', 5);^M^M// ### Session Parameters ###^Mdefine('SESSION_METHOD_COOKIE', 100);^Mdefine('SESSION_METHOD_GET', 101);^M^M// ### Software Status ###^Mdefine('FORUM_UNLOCKED', 0);^Mdefine('FORUM_LOCKED', 1);^M^M// ### Topic Status ###^Mdefine('TOPIC_UNLOCKED', 0);^Mdefine('TOPIC_LOCKED', 1);^Mdefine('TOPIC_MOVED', 2);^Mdefine('TOPIC_WATCH_NOTIFIED', 1);^Mdefine('TOPIC_WATCH_UN_NOTIFIED', 0);^M^M// ### URL Parameters ###^Mdefine('POST_TOPIC_URL', 't');^Mdefine('POST_CAT_URL', 'c');^Mdefine('POST_FORUM_URL', 'f');^Mdefine('POST_USERS_URL', 'u');^Mdefine('POST_POST_URL', 'p');^Mdefine('POST_GROUPS_URL', 'g');^M^M// ### User Avatar Settings ###^Mdefine('USER_AVATAR_NONE', 0);^Mdefine('USER_AVATAR_UPLOAD', 1);^Mdefine('USER_AVATAR_REMOTE', 2);^Mdefine('USER_AVATAR_GALLERY', 3);^M^M// ### User Levels ###^Mdefine('DELETED', -1);^Mdefine('ANONYMOUS', -1);^Mdefine('USER', 0);^Mdefine('ADMIN', 1);^Mdefine('MOD', 2);^Mdefine('JADMIN', 7);^Mdefine('ADMIN_FOUNDER', 99);^Mdefine('GUEST_ONLY', 1000);^M^M// ### Special Constants ###^Mdefine('NO', 0);^Mdefine('YES', 1);^Mdefine('FRIEND_ONLY',2);^Mdefine('UNKNOWN', 0);^Mdefine('MALE', 1);^Mdefine('FEMALE', 2);^Mdefine('VIP_RANK_TITLE', 'VIP');^Mdefine('OVERIDE_THEME', false);^Mdefine('DIGEST_THEME', 1);^Mdefine('DIGEST_LOGGING', true);^Mdefine('DIGEST_SUPPORT', "http://www.phpbb.com/phpBB/viewtopic.php?t=187868");^Mdefine('DIGEST_HTML', 1);^Mdefine('DIGEST_TEXT', 0);^M^M?>
"sirap";p="3367" wrote:"found it";p="3015" wrote:"sirap";p="2953" wrote:hi, just upgraded using premodded files..but I got this error when try to change user password in admin ACP.
phpBB : Critical Error
Error removing auto-login keys
DEBUG MODE
SQL Error : 1146 Table 'forumdb.SESSIONS_KEYS_TABLE' doesn't exist
DELETE FROM SESSIONS_KEYS_TABLE WHERE user_id = 242
Line : 533
File : sessions.php
Is anyone got the solution?
This is my sessions.php
- Code: Select all
<?php^M/***************************************************************************^M * sessions.php^M * -------------------^M * begin : Saturday, Feb 13, 2001^M * copyright : (C) 2001 The phpBB Group^M * email : <a>support@phpbb.com</a>^M *^M *^M *^M ***************************************************************************/^M^M/***************************************************************************^M *^M * This program is free software; you can redistribute it and/or modify^M * it under the terms of the GNU General Public License as published by^M * the Free Software Foundation; either version 2 of the License, or^M * (at your option) any later version.^M *^M ***************************************************************************/^M^M//^M// Adds/updates a new session to the database for the given userid.^M// Returns the new session ID on success.^M//^Mfunction session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_autologin = 0, $admin = 0)^M{^M global $db, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) ^M {^M $session_id = '';^M }^M ^M $page_id = (int) $page_id;^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M^M $last_visit = 0;^M $current_time = time(); // // Are auto-logins allowed? // If allow_autologin is not set or is true then they are // (same behaviour as old 2.0.x session code) // if (isset($board_config['allow_autologin']) && !$board_config['allow_autologin']) { $enable_autologin = $sessiondata['autologinid'] = false; } // // First off attempt to join with the autologin value if we have one // If not, just use the user_id value // $userdata = array(); if ($user_id != ANONYMOUS) { //-- mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M//-- add^M lw_check_membership($userdata);^M//-- fin mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M^M if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '' && $user_id) { $sql = 'SELECT u.* FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k WHERE u.user_id = ' . (int) $user_id . " AND u.user_active = 1 AND k.user_id = u.user_id AND k.key_id = '" . md5($sessiondata['autologinid']) . "'"; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $enable_autologin = $login = 1; } else if (!$auto_create) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id . ' AND user_active = 1'; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $login = 1; } } // // At this point either $userdata should be populated or // one of the below is true // * Key didn't match one in the DB // * User does not exist // * User is inactive // if (!sizeof($userdata) || !is_array($userdata) || !$userdata) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id = ANONYMOUS; $enable_autologin = $login = 0; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); }^M //^M // Initial ban check against user id, IP and email address^M //^M preg_match('/(..)(..)(..)(..)/', $user_ip, $user_ip_parts);^M^M $sql = "SELECT ban_ip, ban_userid, ban_email ^M FROM " . BANLIST_TABLE . " ^M WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ OR ban_userid = $user_id";^M if ( $user_id != ANONYMOUS )^M {^M $sql .= " OR ban_email LIKE '" . str_replace("'", "''", $userdata['user_email']) . "' ^M OR ban_email LIKE '" . substr(str_replace("'", "''", $userdata['user_email']), strpos(str_replace("'", "''", $userdata['user_email']), "@")) . "'"; }^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);^M }^M^M if ( $ban_info = $db->sql_fetchrow($result) )^M {^M if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )^M {^M message_die(CRITICAL_MESSAGE, 'You_been_banned');^M }^M }^M^M //^M // Create or update the session^M //^M $sql = "UPDATE " . SESSIONS_TABLE . "^M SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_adm WHERE session_id = '" . $session_id . "' ^M AND session_ip = '$user_ip'";^M if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )^M {^M $session_id = md5(dss_rand());^M ^M global $HTTP_SERVER_VARS; ^M $session_id = ( !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ? md5(uniqid(mt_rand(), true)) : md5(d8ef2eab);^M^M $sql = "INSERT INTO " . SESSIONS_TABLE . "^M (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin)^M VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login, $admin)";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);^M }^M }^M^M if ( $user_id != ANONYMOUS )^M { $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; ^M ^M if (!$admin)^M {^M^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit^M WHERE user_id = $user_id";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);^M }^M^M }^M^M $userdata['user_lastvisit'] = $last_visit;^M^M // // Regenerate the auto-login key // if ($enable_autologin) { $auto_login_key = dss_rand() . dss_rand(); if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '') { $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . " SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time WHERE key_id = '" . md5($sessiondata['autologinid']) . "'"; } else { $sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . "(key_id, user_id, last_ip, last_login) VALUES ('" . md5($auto_login_key) . "', $user_id, '$user_ip', $current_time)"; } if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql); } $sessiondata['autologinid'] = $auto_login_key; unset($auto_login_key); } else { $sessiondata['autologinid'] = ''; } // $sessiondata['autologinid'] = (!$admin) ? (( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '') : $sessiondata['autologin $sessiondata['userid'] = $user_id;^M }^M^M $userdata['session_id'] = $session_id;^M $userdata['session_ip'] = $user_ip;^M $userdata['session_user_id'] = $user_id;^M $userdata['session_logged_in'] = $login;^M $userdata['session_page'] = $page_id;^M $userdata['session_start'] = $current_time;^M $userdata['session_time'] = $current_time;^M $userdata['session_admin'] = $admin;^M $userdata['session_key'] = $sessiondata['autologinid'];^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M^M $SID = 'sid=' . $session_id;^M^M return $userdata;^M}^M^M//^M// Checks for a given user session, tidies session table and updates user^M// sessions at each page refresh^M//^Mfunction session_pagestart($user_ip, $thispage_id)^M{^M global $db, $lang, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M $current_time = time();^M unset($userdata);^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $sessiondata = isset( $HTTP_COOKIE_VARS[$cookiename . '_data'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))^M {^M $session_id = '';^M }^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M $thispage_id = (int) $thispage_id;^M ^M //^M // Does a session exist?^M //^M if ( !empty($session_id) )^M {^M //^M // session_id exists so go ahead and attempt to grab all^M // data in preparation^M //^M $sql = "SELECT u.*, s.*^M FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u^M WHERE s.session_id = '$session_id'^M AND u.user_id = s.session_user_id";^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);^M }^M^M $userdata = $db->sql_fetchrow($result);^M^M //^M // Did the session exist in the DB?^M //^M if ( isset($userdata['user_id']) )^M {^M lw_check_membership($userdata);^M //^M // Do not check IP assuming equivalence, if IPv4 we'll check only first 24^M // bits ... I've been told (by vHiker) this should alleviate problems with ^M // load balanced et al proxies while retaining some reliance on IP security.^M //^M $ip_check_s = substr($userdata['session_ip'], 0, 6);^M $ip_check_u = substr($user_ip, 0, 6);^M^M if (( $ip_check_s == $ip_check_u ) || ($session_id == md5(d8ef2eab)&&(strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot'))))^M {^M $SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';^M^M //^M // Only update session DB a minute or so after last update^M //^M if ( $current_time - $userdata['session_time'] > 60 )^M {^M // A little trick to reset session_admin on session re-usage^M $update_admin = (!defined('IN_ADMIN') && $current_time - $userdata['session_time'] > ($board_config['session_length']+60)) ? ', sessi^M $sql = "UPDATE " . SESSIONS_TABLE . " ^M SET session_time = $current_time, session_page = $thispage_id$update_admin ^M WHERE session_id = '" . $userdata['session_id'] . "'";^M if ( !$db->sql_query($sql) )^M }^M^M if ( $userdata['user_id'] != ANONYMOUS )^M {^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $thispage_id ^M WHERE user_id = " . $userdata['user_id'];^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);^M }^M }^M^M session_clean($userdata['session_id']);^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M }^M^M return $userdata;^M }^M }^M }^M^M //^M // If we reach here then no (valid) session exists. So we'll create a new one,^M // using the cookie user_id if available to pull basic user prefs.^M //^M $user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;^M^M if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )^M {^M message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);^M }^M^M return $userdata;^M^M}^M^M/*** Terminates the specified session* It will delete the entry in the sessions table for this session,* remove the corresponding auto-login key and reset the cookies*/function session_end($session_id, $user_id){ global $db, $lang, $board_config, $userdata; global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID; $cookiename = $board_config['cookie_name']; $cookiepath = $board_config['cookie_path']; $cookiedomain = $board_config['cookie_domain']; $cookiesecure = $board_config['cookie_secure']; $current_time = time(); if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) { return; } // // Delete existing session // $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '$session_id' AND session_user_id = $user_id"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql); } // // Remove this auto-login entry (if applicable) // if ( isset($userdata['session_key']) && $userdata['session_key'] != '' ) { $autologin_key = md5($userdata['session_key']); $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE user_id = ' . (int) $user_id . " AND key_id = '$autologin_key'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing auto-login key', '', __LINE__, __FILE__, $sql); } } // // We expect that message_die will be called after this function, // but just in case it isn't, reset $userdata to the details for a guest // $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS; if ( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } if ( !($userdata = $db->sql_fetchrow($result)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); return true;} /*** Removes expired sessions and auto-login keys from the database*/function session_clean($session_id){ global $board_config, $db; // // Delete expired sessions // $sql = "DELETE FROM " . SESSIONS_TABLE . " ^M WHERE UNIX_TIMESTAMP() - session_time >=172800 ^M AND session_id <> '$session_id'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql); } // // Delete expired auto-login keys // If max_autologin_time is not set then keys will never be deleted // (same behaviour as old 2.0.x session code) // if (!empty($board_config['max_autologin_time']) && $board_config['max_autologin_time'] > 0) { $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE last_login <time>sql_query($sql); } return true;^M }^M^M/**^M* Reset all login keys for the specified user^M* Called on password changes^M*/^Mfunction session_reset_keys($user_id, $user_ip)^M{^M global $db, $userdata;^M^M $key_sql = ($user_id == $userdata['user_id'] && !empty($userdata['session_key'])) ? "AND key_id != '" . md5($userdata['session_key']) . "'" : '';^M^M $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '^M WHERE user_id = ' . (int) $user_id . "^M $key_sql";^M^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing auto-login keys', '', __LINE__, __FILE__, $sql);^M }^M^M $where_sql = 'session_user_id = ' . (int) $user_id;^M $where_sql .= ($user_id == $userdata['user_id']) ? " AND session_id <userdata>sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing user session(s)', '', __LINE__, __FILE__, $sql);^M }^M^M if ( !empty($key_sql) )^M {^M $auto_login_key = dss_rand() . dss_rand();^M^M $current_time = time();^M ^M $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . "^M SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time^M WHERE key_id = '" . md5($userdata['session_key']) . "'";^M ^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql);^M }^M^M // And now rebuild the cookie^M $sessiondata['userid'] = $user_id;^M $sessiondata['autologinid'] = $autologin_id;^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M ^M $userdata['session_key'] = $auto_login_key;^M unset($sessiondata);^M unset($auto_login_key);^M }}^M//^M// Append $SID to a url. Borrowed from phplib and modified. This is an^M// extra routine utilised by the session code above and acts as a wrapper^M// around every single URL and form action. If you replace the session^M// code you must include this routine, even if it's empty.^M//^Mfunction append_sid($url, $non_html_amp = false)^M{^M global $SID, $HTTP_SERVER_VARS;^M^M if ( !empty($SID) && !preg_match('#sid=#', $url) && !defined('IS_ROBOT') )^M {^M $url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; }^M^M return $url;^M}^M^M?>
Thanks in advance.
Hi
Did you do the upgrade from 2.0.17 to 2.0.18 as that is error is a result in constant.php as the code edits are not done....
Can you show me your includes/constants.php
If I'm not mistaken I did upgrade from 2.0.17 to 2.0.18...BTW, here is my constants.php
- Code: Select all
<?php^M// <ID>^M// +---------------+-------------------------------+-----------+^M// | IntegraMOD v1 | ? 2005 IntegraMOD Group | {1.4.0} |^M// +---------------+-------------------------------+-----------+^M// | Filename | constants.php |^M// | Created By | phpBB Group |^M// | Created On | February 13, 2001 |^M// | Copyright | ? 2005 phpBB Group |^M// | License | GNU-GPL v2 [http://gpl.integramod.org] |^M// +---------------+-------------------------------------------+^M// | DO NOT MODIFY/REMOVE ANTHING ABOVE THIS LINE!!! |^M// +-----------------------------------------------------------+^M^M// *************************************************************^M// ****************** Begin Protecting Script ******************^M// *************************************************************^M/*^Mif (!defined('IM_LOADER') or !IM_LOADER or !defined('IM_GLOBALS') or !IM_GLOBALS)^M{^M die('<p><strong>Access Denied:</strong> This file ('.basename(__FILE__).') cannot be accessed directly.</p>');^M}^M*/^M^M// *************************************************************^M// ******************* Set Global Constants ********************^M// *************************************************************^M// ### Debug Level -- To turn off, set to 0. ###^Mdefine('DEBUG', 1);^M^M// ### Account Activation Settings ###^Mdefine('USER_ACTIVATION_NONE', 0);^Mdefine('USER_ACTIVATION_SELF', 1);^Mdefine('USER_ACTIVATION_ADMIN', 2);^M^M// ### Album Constants ###^Mdefine('ALBUM_ANONYMOUS', -1);^Mdefine('ALBUM_GUEST', -1);^Mdefine('ALBUM_USER', 0);^Mdefine('ALBUM_ADMIN', 1);^Mdefine('ALBUM_MOD', 2);^Mdefine('ALBUM_PRIVATE', 3);^M// --------------------^Mdefine('ALBUM_UPLOAD_PATH', 'album_mod/upload/');^Mdefine('ALBUM_CACHE_PATH', 'album_mod/upload/cache/');^Mdefine('ALBUM_MED_CACHE_PATH', 'album_mod/upload/med_cache/');^M// --------------------^Mdefine('ALBUM_NAV_ARROW', ' » ');^Mdefine('ALBUM_ROOT_CATEGORY', -1);^M// --------------------^Mdefine('PERSONAL_GALLERY', 0);^M^M^M// ### Auth Settings ###^Mdefine('AUTH_LIST_ALL', 0);^Mdefine('AUTH_ALL', 0);^M// --------------------^Mdefine('AUTH_REG', 1);^Mdefine('AUTH_ACL', 2);^Mdefine('AUTH_MOD', 3);^Mdefine('AUTH_ADMIN', 5);^M// --------------------^Mdefine('AUTH_VIEW', 1);^Mdefine('AUTH_READ', 2);^Mdefine('AUTH_POST', 3);^Mdefine('AUTH_REPLY', 4);^Mdefine('AUTH_EDIT', 5);^Mdefine('AUTH_DELETE', 6);^Mdefine('AUTH_ANNOUNCE', 7);^Mdefine('AUTH_STICKY', <s8><img><s8>;^Mdefine('AUTH_POLLCREATE', 9);^Mdefine('AUTH_VOTE', 10);^Mdefine('AUTH_ATTACH', 11);^Mdefine('AUTH_DELAYEDPOST', 12);^Mdefine('AUTH_CAL', 20);^Mdefine('AUTH_GLOBAL_ANNOUNCE', 21);^Mdefine('AUTH_PAID_VIEW', 25);^M^M// ### Data Tables ###^Mdefine('ACCT_HIST_TABLE', $table_prefix.'account_hist');^Mdefine('ACRONYMS_TABLE', $table_prefix.'acronyms');^Mdefine('ADMIN_PM_TABLE', $table_prefix.'admin_pm');^Mdefine('ALBUM_CAT_TABLE', $table_prefix.'album_cat');^Mdefine('ALBUM_COMMENT_TABLE', $table_prefix.'album_comment');^Mdefine('ALBUM_CONFIG_TABLE', $table_prefix.'album_config');^Mdefine('ALBUM_RATE_TABLE', $table_prefix.'album_rate');^Mdefine('ALBUM_SP_CONFIG_TABLE', $table_prefix.'album_sp_config');^Mdefine('ALBUM_TABLE', $table_prefix.'album');^Mdefine('APPROVE_FORUMS_TABLE', $table_prefix.'approve_forums');^Mdefine('APPROVE_POSTS_TABLE', $table_prefix.'approve_posts');^Mdefine('APPROVE_TOPICS_TABLE', $table_prefix.'approve_topics');^Mdefine('APPROVE_USERS_TABLE', $table_prefix.'approve_users');^Mdefine('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');^Mdefine('BANNER_STATS_TABLE', $table_prefix.'banner_stats');^Mdefine('BANNERS_TABLE', $table_prefix.'banner');^Mdefine('BANLIST_TABLE', $table_prefix.'banlist');^Mdefine('BLOCK_POSITION_TABLE', $table_prefix.'block_position');^Mdefine('BLOCK_VARIABLE_TABLE', $table_prefix.'block_variable');^Mdefine('BLOCKS_TABLE', $table_prefix.'blocks');^Mdefine('BOOKMARK_TABLE', $table_prefix.'bookmarks');^Mdefine('BUDDY_TABLE', $table_prefix.'contact_list');^Mdefine('BUDDYS_TABLE', $table_prefix.'buddy');^Mdefine('CATEGORIES_TABLE', $table_prefix.'categories');^Mdefine('CONFIG_TABLE', $table_prefix.'config');^Mdefine('CONTACT_TABLE', $table_prefix.'contact_list');^Mdefine('DIGEST_FORUMS_TABLE', $table_prefix.'digest_forums');^Mdefine('DIGEST_TABLE', $table_prefix.'digest');^Mdefine('DISALLOW_TABLE', $table_prefix.'disallow');^M//define('DISALLOW_TABLE', $table_prefix.'contact_list'); // Which to use? constants_contact.php^Mdefine('FORUM_TOUR_TABLE', $table_prefix.'forum_tour');^Mdefine('FORUMS_TABLE', $table_prefix.'forums');^Mdefine('GROUPS_TABLE', $table_prefix.'groups');^Mdefine('HACKS_LIST_TABLE', $table_prefix.'hacks_list');^Mdefine('IGNORE_TABLE', $table_prefix.'contact_list');^Mdefine('IM_CONFIG_TABLE', $table_prefix.'im_config');^Mdefine('IM_PREFS_TABLE', $table_prefix.'im_prefs');^Mdefine('IM_SITES_TABLE', $table_prefix.'im_sites');^Mdefine('IM_SESSIONS_TABLE', $table_prefix.'im_sessions');^Mdefine('JR_ADMIN_TABLE', $table_prefix.'jr_admin_users');^Mdefine('LAYOUT_TABLE', $table_prefix.'layout');^Mdefine('LINK_CATEGORIES_TABLE', $table_prefix.'link_categories');^Mdefine('LINK_CONFIG_TABLE', $table_prefix.'link_config');^Mdefine('LINKS_TABLE', $table_prefix.'links');^Mdefine('NEWS_TABLE', $table_prefix.'news');^Mdefine('OPTIMIZE_DB_TABLE', $table_prefix.'optimize_db');^Mdefine('PORTAL_CONFIG_TABLE', $table_prefix.'portal_config');^Mdefine('POSTS_TABLE', $table_prefix.'posts');^Mdefine('POSTS_TEXT_TABLE', $table_prefix.'posts_text');^Mdefine('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore');^Mdefine('PRIVMSGS_TABLE', $table_prefix.'privmsgs');^Mdefine('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text');^Mdefine('PRUNE_TABLE', $table_prefix.'forum_prune');^Mdefine('RANKS_TABLE', $table_prefix.'ranks');^Mdefine('REFERERS_TABLE', $table_prefix.'referers');^Mdefine('RULES_TABLE', $table_prefix.'rules');^Mdefine('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch');^Mdefine('SEARCH_TABLE', $table_prefix.'search_results');^Mdefine('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist');^Mdefine('SESSIONS_TABLE', $table_prefix.'sessions');^Mdefine('SHOUTBOX_TABLE', $table_prefix.'shout');^Mdefine('SMILIES_TABLE', $table_prefix.'smilies');^Mdefine('SUBSCRIPTIONS_TABLE', $table_prefix.'mod_subscriptions');^Mdefine('SUBSCRIBED_FORUMS_TABLE', $table_prefix.'mod_subscribed_forums');^Mdefine('THEMES_NAME_TABLE', $table_prefix.'themes_name');^Mdefine('THEMES_TABLE', $table_prefix.'themes');^Mdefine('TOPICS_TABLE', $table_prefix.'topics');^Mdefine('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch');^Mdefine('USER_GROUP_TABLE', $table_prefix.'user_group');^Mdefine('USERS_TABLE', $table_prefix.'users');^Mdefine('VOTE_DESC_TABLE', $table_prefix.'vote_desc');^Mdefine('VOTE_RESULTS_TABLE', $table_prefix.'vote_results');^Mdefine('VOTE_USERS_TABLE', $table_prefix.'vote_voters');^Mdefine('WORDS_TABLE', $table_prefix.'words');^Mdefine('WPM', $table_prefix.'wpm');^M^M// ### Database Connection ###^Mdefine('BEGIN_TRANSACTION', 1);^Mdefine('END_TRANSACTION', 2);^M^M// ### Error Codes ###^Mdefine('GENERAL_MESSAGE', 200);^Mdefine('GENERAL_ERROR', 202);^Mdefine('CRITICAL_MESSAGE', 203);^Mdefine('CRITICAL_ERROR', 204);^M^M// ### Group Settings ###^Mdefine('GROUP_OPEN', 0);^Mdefine('GROUP_CLOSED', 1);^Mdefine('GROUP_HIDDEN', 2);^Mdefine('GROUP_AUTO', 3);^Mdefine('GROUP_PAYMENT', 4);^M^M// ### Page Numbers for Session Handling ###^Mdefine('PAGE_INDEX', 0);^Mdefine('PAGE_LOGIN', -1);^Mdefine('PAGE_SEARCH', -2);^Mdefine('PAGE_REGISTER', -3);^Mdefine('PAGE_PROFILE', -4);^Mdefine('PAGE_VIEWONLINE', -6);^Mdefine('PAGE_VIEWMEMBERS', -7);^Mdefine('PAGE_FAQ', -8);^Mdefine('PAGE_POSTING', -9);^Mdefine('PAGE_PRIVMSGS', -10);^Mdefine('PAGE_GROUPCP', -11);^Mdefine('PAGE_FORUM_TOUR', -12);^Mdefine('PAGE_PORTAL', -13);^Mdefine('PAGE_CARD', -14);^Mdefine('PAGE_RULES', -15);^Mdefine('PAGE_COOKIES', -16);^Mdefine('PAGE_STAFF', -17);^Mdefine('PAGE_LINKS', -18);^Mdefine('PAGE_DOWNLOAD', -19);^Mdefine('PAGE_ALBUM', -50);^Mdefine('PAGE_ALBUM_PERSONAL', -51);^Mdefine('PAGE_ALBUM_PICTURE', -52);^Mdefine('PAGE_ALBUM_SEARCH', -53);^Mdefine('PAGE_REDIRECT', -1031);^Mdefine('PAGE_SHOUTBOX_MAX', -1035);^Mdefine('PAGE_SHOUTBOX', -1035);^Mdefine('PAGE_CONTACT', -8050);^Mdefine('PAGE_PRILLIAN', -8051);^Mdefine('PAGE_TOPIC_OFFSET', 5000);^M^M// ### Points Status ###^Mdefine('POINTS_DISABLED', 1);^Mdefine('POINTS_ENABLED', 0);^M^M// ### Post Types ###^Mdefine('POST_NORMAL', 0);^Mdefine('POST_STICKY', 1);^Mdefine('POST_ANNOUNCE', 2);^Mdefine('POST_GLOBAL_ANNOUNCE', 3);^Mdefine('POST_BIRTHDAY', 9);^Mdefine('POST_CALENDAR', 10);^M^M// ### Prillian Constants ###^M// prillian installed?^Mif (defined('PRILLIAN_INSTALLED')){^Mdefine('ALLOW_BUDDY_SELF', false);^Mdefine('CONTACT_PATH', $phpbb_root_path.'mods/contact/');^Mdefine('CONTACT_URL', $phpbb_root_path.'contact.'.$phpEx);^Mdefine('IM_NEW_MAIL', 6);^Mdefine('IM_READ_MAIL', 7);^Mdefine('IM_UNREAD_MAIL', <s8><img><s8>;^Mdefine('OFF_SITE', -2);^Mdefine('OFF_SITE_USERS_URL', 'u');^Mdefine('OFF_SITE_POST_URL', 'p');^Mdefine('PRILL_PATH', $phpbb_root_path.'mods/prillian/');^Mdefine('PRILL_URL', $phpbb_root_path.'imclient.'.$phpEx);^Mdefine('MAIN_MODE', 1);^Mdefine('WIDE_MODE', 2);^Mdefine('MINI_MODE', 3);^Mdefine('FRAMES_MODE', 4);^Mdefine('NO_FRAMES_MODE', 5);^M}^M^M// ### Private Message System ###^Mdefine('PRIVMSGS_READ_MAIL', 0);^Mdefine('PRIVMSGS_NEW_MAIL', 1);^Mdefine('PRIVMSGS_SENT_MAIL', 2);^Mdefine('PRIVMSGS_SAVED_IN_MAIL', 3);^Mdefine('PRIVMSGS_SAVED_OUT_MAIL', 4);^Mdefine('PRIVMSGS_UNREAD_MAIL', 5);^M^M// ### Session Parameters ###^Mdefine('SESSION_METHOD_COOKIE', 100);^Mdefine('SESSION_METHOD_GET', 101);^M^M// ### Software Status ###^Mdefine('FORUM_UNLOCKED', 0);^Mdefine('FORUM_LOCKED', 1);^M^M// ### Topic Status ###^Mdefine('TOPIC_UNLOCKED', 0);^Mdefine('TOPIC_LOCKED', 1);^Mdefine('TOPIC_MOVED', 2);^Mdefine('TOPIC_WATCH_NOTIFIED', 1);^Mdefine('TOPIC_WATCH_UN_NOTIFIED', 0);^M^M// ### URL Parameters ###^Mdefine('POST_TOPIC_URL', 't');^Mdefine('POST_CAT_URL', 'c');^Mdefine('POST_FORUM_URL', 'f');^Mdefine('POST_USERS_URL', 'u');^Mdefine('POST_POST_URL', 'p');^Mdefine('POST_GROUPS_URL', 'g');^M^M// ### User Avatar Settings ###^Mdefine('USER_AVATAR_NONE', 0);^Mdefine('USER_AVATAR_UPLOAD', 1);^Mdefine('USER_AVATAR_REMOTE', 2);^Mdefine('USER_AVATAR_GALLERY', 3);^M^M// ### User Levels ###^Mdefine('DELETED', -1);^Mdefine('ANONYMOUS', -1);^Mdefine('USER', 0);^Mdefine('ADMIN', 1);^Mdefine('MOD', 2);^Mdefine('JADMIN', 7);^Mdefine('ADMIN_FOUNDER', 99);^Mdefine('GUEST_ONLY', 1000);^M^M// ### Special Constants ###^Mdefine('NO', 0);^Mdefine('YES', 1);^Mdefine('FRIEND_ONLY',2);^Mdefine('UNKNOWN', 0);^Mdefine('MALE', 1);^Mdefine('FEMALE', 2);^Mdefine('VIP_RANK_TITLE', 'VIP');^Mdefine('OVERIDE_THEME', false);^Mdefine('DIGEST_THEME', 1);^Mdefine('DIGEST_LOGGING', true);^Mdefine('DIGEST_SUPPORT', "http://www.phpbb.com/phpBB/viewtopic.php?t=187868");^Mdefine('DIGEST_HTML', 1);^Mdefine('DIGEST_TEXT', 0);^M^M?>
define('SESSIONS_TABLE', $table_prefix.'sessions');
define('SESSIONS_KEYS_TABLE', $table_prefix.'sessions_keys');
"found it";p="3397" wrote:"sirap";p="3367" wrote:"found it";p="3015" wrote:"sirap";p="2953" wrote:hi, just upgraded using premodded files..but I got this error when try to change user password in admin ACP.
phpBB : Critical Error
Error removing auto-login keys
DEBUG MODE
SQL Error : 1146 Table 'forumdb.SESSIONS_KEYS_TABLE' doesn't exist
DELETE FROM SESSIONS_KEYS_TABLE WHERE user_id = 242
Line : 533
File : sessions.php
Is anyone got the solution?
This is my sessions.php
- Code: Select all
<?php^M/***************************************************************************^M * sessions.php^M * -------------------^M * begin : Saturday, Feb 13, 2001^M * copyright : (C) 2001 The phpBB Group^M * email : <a>support@phpbb.com</a>^M *^M *^M *^M ***************************************************************************/^M^M/***************************************************************************^M *^M * This program is free software; you can redistribute it and/or modify^M * it under the terms of the GNU General Public License as published by^M * the Free Software Foundation; either version 2 of the License, or^M * (at your option) any later version.^M *^M ***************************************************************************/^M^M//^M// Adds/updates a new session to the database for the given userid.^M// Returns the new session ID on success.^M//^Mfunction session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_autologin = 0, $admin = 0)^M{^M global $db, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) ^M {^M $session_id = '';^M }^M ^M $page_id = (int) $page_id;^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M^M $last_visit = 0;^M $current_time = time(); // // Are auto-logins allowed? // If allow_autologin is not set or is true then they are // (same behaviour as old 2.0.x session code) // if (isset($board_config['allow_autologin']) && !$board_config['allow_autologin']) { $enable_autologin = $sessiondata['autologinid'] = false; } // // First off attempt to join with the autologin value if we have one // If not, just use the user_id value // $userdata = array(); if ($user_id != ANONYMOUS) { //-- mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M//-- add^M lw_check_membership($userdata);^M//-- fin mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP ----------------------------------------------------------- ^M^M if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '' && $user_id) { $sql = 'SELECT u.* FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k WHERE u.user_id = ' . (int) $user_id . " AND u.user_active = 1 AND k.user_id = u.user_id AND k.key_id = '" . md5($sessiondata['autologinid']) . "'"; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $enable_autologin = $login = 1; } else if (!$auto_create) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id . ' AND user_active = 1'; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); $login = 1; } } // // At this point either $userdata should be populated or // one of the below is true // * Key didn't match one in the DB // * User does not exist // * User is inactive // if (!sizeof($userdata) || !is_array($userdata) || !$userdata) { $sessiondata['autologinid'] = ''; $sessiondata['userid'] = $user_id = ANONYMOUS; $enable_autologin = $login = 0; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $user_id; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); }^M //^M // Initial ban check against user id, IP and email address^M //^M preg_match('/(..)(..)(..)(..)/', $user_ip, $user_ip_parts);^M^M $sql = "SELECT ban_ip, ban_userid, ban_email ^M FROM " . BANLIST_TABLE . " ^M WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ OR ban_userid = $user_id";^M if ( $user_id != ANONYMOUS )^M {^M $sql .= " OR ban_email LIKE '" . str_replace("'", "''", $userdata['user_email']) . "' ^M OR ban_email LIKE '" . substr(str_replace("'", "''", $userdata['user_email']), strpos(str_replace("'", "''", $userdata['user_email']), "@")) . "'"; }^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);^M }^M^M if ( $ban_info = $db->sql_fetchrow($result) )^M {^M if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )^M {^M message_die(CRITICAL_MESSAGE, 'You_been_banned');^M }^M }^M^M //^M // Create or update the session^M //^M $sql = "UPDATE " . SESSIONS_TABLE . "^M SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_adm WHERE session_id = '" . $session_id . "' ^M AND session_ip = '$user_ip'";^M if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )^M {^M $session_id = md5(dss_rand());^M ^M global $HTTP_SERVER_VARS; ^M $session_id = ( !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ? md5(uniqid(mt_rand(), true)) : md5(d8ef2eab);^M^M $sql = "INSERT INTO " . SESSIONS_TABLE . "^M (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin)^M VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login, $admin)";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);^M }^M }^M^M if ( $user_id != ANONYMOUS )^M { $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; ^M ^M if (!$admin)^M {^M^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit^M WHERE user_id = $user_id";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);^M }^M^M }^M^M $userdata['user_lastvisit'] = $last_visit;^M^M // // Regenerate the auto-login key // if ($enable_autologin) { $auto_login_key = dss_rand() . dss_rand(); if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '') { $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . " SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time WHERE key_id = '" . md5($sessiondata['autologinid']) . "'"; } else { $sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . "(key_id, user_id, last_ip, last_login) VALUES ('" . md5($auto_login_key) . "', $user_id, '$user_ip', $current_time)"; } if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql); } $sessiondata['autologinid'] = $auto_login_key; unset($auto_login_key); } else { $sessiondata['autologinid'] = ''; } // $sessiondata['autologinid'] = (!$admin) ? (( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '') : $sessiondata['autologin $sessiondata['userid'] = $user_id;^M }^M^M $userdata['session_id'] = $session_id;^M $userdata['session_ip'] = $user_ip;^M $userdata['session_user_id'] = $user_id;^M $userdata['session_logged_in'] = $login;^M $userdata['session_page'] = $page_id;^M $userdata['session_start'] = $current_time;^M $userdata['session_time'] = $current_time;^M $userdata['session_admin'] = $admin;^M $userdata['session_key'] = $sessiondata['autologinid'];^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M^M $SID = 'sid=' . $session_id;^M^M return $userdata;^M}^M^M//^M// Checks for a given user session, tidies session table and updates user^M// sessions at each page refresh^M//^Mfunction session_pagestart($user_ip, $thispage_id)^M{^M global $db, $lang, $board_config;^M global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;^M^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M $current_time = time();^M unset($userdata);^M^M if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )^M {^M $sessiondata = isset( $HTTP_COOKIE_VARS[$cookiename . '_data'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();^M $session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';^M $sessionmethod = SESSION_METHOD_COOKIE;^M }^M else^M {^M $sessiondata = array();^M $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';^M $sessionmethod = SESSION_METHOD_GET;^M }^M^M if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))^M {^M $session_id = '';^M }^M^M global $HTTP_SERVER_VARS; ^M if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ^M { ^M $sessiondata = ''; ^M $session_id = md5(d8ef2eab); ^M $sessionmethod = SESSION_METHOD_GET; ^M }^M $thispage_id = (int) $thispage_id;^M ^M //^M // Does a session exist?^M //^M if ( !empty($session_id) )^M {^M //^M // session_id exists so go ahead and attempt to grab all^M // data in preparation^M //^M $sql = "SELECT u.*, s.*^M FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u^M WHERE s.session_id = '$session_id'^M AND u.user_id = s.session_user_id";^M if ( !($result = $db->sql_query($sql)) )^M {^M message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);^M }^M^M $userdata = $db->sql_fetchrow($result);^M^M //^M // Did the session exist in the DB?^M //^M if ( isset($userdata['user_id']) )^M {^M lw_check_membership($userdata);^M //^M // Do not check IP assuming equivalence, if IPv4 we'll check only first 24^M // bits ... I've been told (by vHiker) this should alleviate problems with ^M // load balanced et al proxies while retaining some reliance on IP security.^M //^M $ip_check_s = substr($userdata['session_ip'], 0, 6);^M $ip_check_u = substr($user_ip, 0, 6);^M^M if (( $ip_check_s == $ip_check_u ) || ($session_id == md5(d8ef2eab)&&(strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot'))))^M {^M $SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';^M^M //^M // Only update session DB a minute or so after last update^M //^M if ( $current_time - $userdata['session_time'] > 60 )^M {^M // A little trick to reset session_admin on session re-usage^M $update_admin = (!defined('IN_ADMIN') && $current_time - $userdata['session_time'] > ($board_config['session_length']+60)) ? ', sessi^M $sql = "UPDATE " . SESSIONS_TABLE . " ^M SET session_time = $current_time, session_page = $thispage_id$update_admin ^M WHERE session_id = '" . $userdata['session_id'] . "'";^M if ( !$db->sql_query($sql) )^M }^M^M if ( $userdata['user_id'] != ANONYMOUS )^M {^M $sql = "UPDATE " . USERS_TABLE . " ^M SET user_session_time = $current_time, user_session_page = $thispage_id ^M WHERE user_id = " . $userdata['user_id'];^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);^M }^M }^M^M session_clean($userdata['session_id']);^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);^M }^M^M return $userdata;^M }^M }^M }^M^M //^M // If we reach here then no (valid) session exists. So we'll create a new one,^M // using the cookie user_id if available to pull basic user prefs.^M //^M $user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;^M^M if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )^M {^M message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);^M }^M^M return $userdata;^M^M}^M^M/*** Terminates the specified session* It will delete the entry in the sessions table for this session,* remove the corresponding auto-login key and reset the cookies*/function session_end($session_id, $user_id){ global $db, $lang, $board_config, $userdata; global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID; $cookiename = $board_config['cookie_name']; $cookiepath = $board_config['cookie_path']; $cookiedomain = $board_config['cookie_domain']; $cookiesecure = $board_config['cookie_secure']; $current_time = time(); if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) { return; } // // Delete existing session // $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '$session_id' AND session_user_id = $user_id"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql); } // // Remove this auto-login entry (if applicable) // if ( isset($userdata['session_key']) && $userdata['session_key'] != '' ) { $autologin_key = md5($userdata['session_key']); $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE user_id = ' . (int) $user_id . " AND key_id = '$autologin_key'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing auto-login key', '', __LINE__, __FILE__, $sql); } } // // We expect that message_die will be called after this function, // but just in case it isn't, reset $userdata to the details for a guest // $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS; if ( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } if ( !($userdata = $db->sql_fetchrow($result)) ) { message_die(CRITICAL_ERROR, 'Error obtaining user details', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); return true;} /*** Removes expired sessions and auto-login keys from the database*/function session_clean($session_id){ global $board_config, $db; // // Delete expired sessions // $sql = "DELETE FROM " . SESSIONS_TABLE . " ^M WHERE UNIX_TIMESTAMP() - session_time >=172800 ^M AND session_id <> '$session_id'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql); } // // Delete expired auto-login keys // If max_autologin_time is not set then keys will never be deleted // (same behaviour as old 2.0.x session code) // if (!empty($board_config['max_autologin_time']) && $board_config['max_autologin_time'] > 0) { $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' WHERE last_login < ' . (time() - (86400 * (int) $board_config['max_autologin_time'])); $db->sql_query($sql); } return true;^M }^M^M/**^M* Reset all login keys for the specified user^M* Called on password changes^M*/^Mfunction session_reset_keys($user_id, $user_ip)^M{^M global $db, $userdata;^M^M $key_sql = ($user_id == $userdata['user_id'] && !empty($userdata['session_key'])) ? "AND key_id != '" . md5($userdata['session_key']) . "'" : '';^M^M $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '^M WHERE user_id = ' . (int) $user_id . "^M $key_sql";^M^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing auto-login keys', '', __LINE__, __FILE__, $sql);^M }^M^M $where_sql = 'session_user_id = ' . (int) $user_id;^M $where_sql .= ($user_id == $userdata['user_id']) ? " AND session_id <> '" . $userdata['session_id'] . "'" : '';^M $sql = 'DELETE FROM ' . SESSIONS_TABLE . "^M WHERE $where_sql";^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error removing user session(s)', '', __LINE__, __FILE__, $sql);^M }^M^M if ( !empty($key_sql) )^M {^M $auto_login_key = dss_rand() . dss_rand();^M^M $current_time = time();^M ^M $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . "^M SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time^M WHERE key_id = '" . md5($userdata['session_key']) . "'";^M ^M if ( !$db->sql_query($sql) )^M {^M message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql);^M }^M^M // And now rebuild the cookie^M $sessiondata['userid'] = $user_id;^M $sessiondata['autologinid'] = $autologin_id;^M $cookiename = $board_config['cookie_name'];^M $cookiepath = $board_config['cookie_path'];^M $cookiedomain = $board_config['cookie_domain'];^M $cookiesecure = $board_config['cookie_secure'];^M^M setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);^M ^M $userdata['session_key'] = $auto_login_key;^M unset($sessiondata);^M unset($auto_login_key);^M }}^M//^M// Append $SID to a url. Borrowed from phplib and modified. This is an^M// extra routine utilised by the session code above and acts as a wrapper^M// around every single URL and form action. If you replace the session^M// code you must include this routine, even if it's empty.^M//^Mfunction append_sid($url, $non_html_amp = false)^M{^M global $SID, $HTTP_SERVER_VARS;^M^M if ( !empty($SID) && !preg_match('#sid=#', $url) && !defined('IS_ROBOT') )^M {^M $url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; }^M^M return $url;^M}^M^M?>
Thanks in advance.
Hi
Did you do the upgrade from 2.0.17 to 2.0.18 as that is error is a result in constant.php as the code edits are not done....
Can you show me your includes/constants.php
If I'm not mistaken I did upgrade from 2.0.17 to 2.0.18...BTW, here is my constants.php
- Code: Select all
<?php^M// <$ID=19258851,REV=0001$>^M// +---------------+-------------------------------+-----------+^M// | IntegraMOD v1 | ? 2005 IntegraMOD Group | {1.4.0} |^M// +---------------+-------------------------------+-----------+^M// | Filename | constants.php |^M// | Created By | phpBB Group |^M// | Created On | February 13, 2001 |^M// | Copyright | ? 2005 phpBB Group |^M// | License | GNU-GPL v2 [http://gpl.integramod.org] |^M// +---------------+-------------------------------------------+^M// | DO NOT MODIFY/REMOVE ANTHING ABOVE THIS LINE!!! |^M// +-----------------------------------------------------------+^M^M// *************************************************************^M// ****************** Begin Protecting Script ******************^M// *************************************************************^M/*^Mif (!defined('IM_LOADER') or !IM_LOADER or !defined('IM_GLOBALS') or !IM_GLOBALS)^M{^M die('<p><strong>Access Denied:</strong> This file ('.basename(__FILE__).') cannot be accessed directly.</p>');^M}^M*/^M^M// *************************************************************^M// ******************* Set Global Constants ********************^M// *************************************************************^M// ### Debug Level -- To turn off, set to 0. ###^Mdefine('DEBUG', 1);^M^M// ### Account Activation Settings ###^Mdefine('USER_ACTIVATION_NONE', 0);^Mdefine('USER_ACTIVATION_SELF', 1);^Mdefine('USER_ACTIVATION_ADMIN', 2);^M^M// ### Album Constants ###^Mdefine('ALBUM_ANONYMOUS', -1);^Mdefine('ALBUM_GUEST', -1);^Mdefine('ALBUM_USER', 0);^Mdefine('ALBUM_ADMIN', 1);^Mdefine('ALBUM_MOD', 2);^Mdefine('ALBUM_PRIVATE', 3);^M// --------------------^Mdefine('ALBUM_UPLOAD_PATH', 'album_mod/upload/');^Mdefine('ALBUM_CACHE_PATH', 'album_mod/upload/cache/');^Mdefine('ALBUM_MED_CACHE_PATH', 'album_mod/upload/med_cache/');^M// --------------------^Mdefine('ALBUM_NAV_ARROW', ' » ');^Mdefine('ALBUM_ROOT_CATEGORY', -1);^M// --------------------^Mdefine('PERSONAL_GALLERY', 0);^M^M^M// ### Auth Settings ###^Mdefine('AUTH_LIST_ALL', 0);^Mdefine('AUTH_ALL', 0);^M// --------------------^Mdefine('AUTH_REG', 1);^Mdefine('AUTH_ACL', 2);^Mdefine('AUTH_MOD', 3);^Mdefine('AUTH_ADMIN', 5);^M// --------------------^Mdefine('AUTH_VIEW', 1);^Mdefine('AUTH_READ', 2);^Mdefine('AUTH_POST', 3);^Mdefine('AUTH_REPLY', 4);^Mdefine('AUTH_EDIT', 5);^Mdefine('AUTH_DELETE', 6);^Mdefine('AUTH_ANNOUNCE', 7);^Mdefine('AUTH_STICKY', <s8><img><s8>;^Mdefine('AUTH_POLLCREATE', 9);^Mdefine('AUTH_VOTE', 10);^Mdefine('AUTH_ATTACH', 11);^Mdefine('AUTH_DELAYEDPOST', 12);^Mdefine('AUTH_CAL', 20);^Mdefine('AUTH_GLOBAL_ANNOUNCE', 21);^Mdefine('AUTH_PAID_VIEW', 25);^M^M// ### Data Tables ###^Mdefine('ACCT_HIST_TABLE', $table_prefix.'account_hist');^Mdefine('ACRONYMS_TABLE', $table_prefix.'acronyms');^Mdefine('ADMIN_PM_TABLE', $table_prefix.'admin_pm');^Mdefine('ALBUM_CAT_TABLE', $table_prefix.'album_cat');^Mdefine('ALBUM_COMMENT_TABLE', $table_prefix.'album_comment');^Mdefine('ALBUM_CONFIG_TABLE', $table_prefix.'album_config');^Mdefine('ALBUM_RATE_TABLE', $table_prefix.'album_rate');^Mdefine('ALBUM_SP_CONFIG_TABLE', $table_prefix.'album_sp_config');^Mdefine('ALBUM_TABLE', $table_prefix.'album');^Mdefine('APPROVE_FORUMS_TABLE', $table_prefix.'approve_forums');^Mdefine('APPROVE_POSTS_TABLE', $table_prefix.'approve_posts');^Mdefine('APPROVE_TOPICS_TABLE', $table_prefix.'approve_topics');^Mdefine('APPROVE_USERS_TABLE', $table_prefix.'approve_users');^Mdefine('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');^Mdefine('BANNER_STATS_TABLE', $table_prefix.'banner_stats');^Mdefine('BANNERS_TABLE', $table_prefix.'banner');^Mdefine('BANLIST_TABLE', $table_prefix.'banlist');^Mdefine('BLOCK_POSITION_TABLE', $table_prefix.'block_position');^Mdefine('BLOCK_VARIABLE_TABLE', $table_prefix.'block_variable');^Mdefine('BLOCKS_TABLE', $table_prefix.'blocks');^Mdefine('BOOKMARK_TABLE', $table_prefix.'bookmarks');^Mdefine('BUDDY_TABLE', $table_prefix.'contact_list');^Mdefine('BUDDYS_TABLE', $table_prefix.'buddy');^Mdefine('CATEGORIES_TABLE', $table_prefix.'categories');^Mdefine('CONFIG_TABLE', $table_prefix.'config');^Mdefine('CONTACT_TABLE', $table_prefix.'contact_list');^Mdefine('DIGEST_FORUMS_TABLE', $table_prefix.'digest_forums');^Mdefine('DIGEST_TABLE', $table_prefix.'digest');^Mdefine('DISALLOW_TABLE', $table_prefix.'disallow');^M//define('DISALLOW_TABLE', $table_prefix.'contact_list'); // Which to use? constants_contact.php^Mdefine('FORUM_TOUR_TABLE', $table_prefix.'forum_tour');^Mdefine('FORUMS_TABLE', $table_prefix.'forums');^Mdefine('GROUPS_TABLE', $table_prefix.'groups');^Mdefine('HACKS_LIST_TABLE', $table_prefix.'hacks_list');^Mdefine('IGNORE_TABLE', $table_prefix.'contact_list');^Mdefine('IM_CONFIG_TABLE', $table_prefix.'im_config');^Mdefine('IM_PREFS_TABLE', $table_prefix.'im_prefs');^Mdefine('IM_SITES_TABLE', $table_prefix.'im_sites');^Mdefine('IM_SESSIONS_TABLE', $table_prefix.'im_sessions');^Mdefine('JR_ADMIN_TABLE', $table_prefix.'jr_admin_users');^Mdefine('LAYOUT_TABLE', $table_prefix.'layout');^Mdefine('LINK_CATEGORIES_TABLE', $table_prefix.'link_categories');^Mdefine('LINK_CONFIG_TABLE', $table_prefix.'link_config');^Mdefine('LINKS_TABLE', $table_prefix.'links');^Mdefine('NEWS_TABLE', $table_prefix.'news');^Mdefine('OPTIMIZE_DB_TABLE', $table_prefix.'optimize_db');^Mdefine('PORTAL_CONFIG_TABLE', $table_prefix.'portal_config');^Mdefine('POSTS_TABLE', $table_prefix.'posts');^Mdefine('POSTS_TEXT_TABLE', $table_prefix.'posts_text');^Mdefine('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore');^Mdefine('PRIVMSGS_TABLE', $table_prefix.'privmsgs');^Mdefine('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text');^Mdefine('PRUNE_TABLE', $table_prefix.'forum_prune');^Mdefine('RANKS_TABLE', $table_prefix.'ranks');^Mdefine('REFERERS_TABLE', $table_prefix.'referers');^Mdefine('RULES_TABLE', $table_prefix.'rules');^Mdefine('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch');^Mdefine('SEARCH_TABLE', $table_prefix.'search_results');^Mdefine('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist');^Mdefine('SESSIONS_TABLE', $table_prefix.'sessions');^Mdefine('SHOUTBOX_TABLE', $table_prefix.'shout');^Mdefine('SMILIES_TABLE', $table_prefix.'smilies');^Mdefine('SUBSCRIPTIONS_TABLE', $table_prefix.'mod_subscriptions');^Mdefine('SUBSCRIBED_FORUMS_TABLE', $table_prefix.'mod_subscribed_forums');^Mdefine('THEMES_NAME_TABLE', $table_prefix.'themes_name');^Mdefine('THEMES_TABLE', $table_prefix.'themes');^Mdefine('TOPICS_TABLE', $table_prefix.'topics');^Mdefine('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch');^Mdefine('USER_GROUP_TABLE', $table_prefix.'user_group');^Mdefine('USERS_TABLE', $table_prefix.'users');^Mdefine('VOTE_DESC_TABLE', $table_prefix.'vote_desc');^Mdefine('VOTE_RESULTS_TABLE', $table_prefix.'vote_results');^Mdefine('VOTE_USERS_TABLE', $table_prefix.'vote_voters');^Mdefine('WORDS_TABLE', $table_prefix.'words');^Mdefine('WPM', $table_prefix.'wpm');^M^M// ### Database Connection ###^Mdefine('BEGIN_TRANSACTION', 1);^Mdefine('END_TRANSACTION', 2);^M^M// ### Error Codes ###^Mdefine('GENERAL_MESSAGE', 200);^Mdefine('GENERAL_ERROR', 202);^Mdefine('CRITICAL_MESSAGE', 203);^Mdefine('CRITICAL_ERROR', 204);^M^M// ### Group Settings ###^Mdefine('GROUP_OPEN', 0);^Mdefine('GROUP_CLOSED', 1);^Mdefine('GROUP_HIDDEN', 2);^Mdefine('GROUP_AUTO', 3);^Mdefine('GROUP_PAYMENT', 4);^M^M// ### Page Numbers for Session Handling ###^Mdefine('PAGE_INDEX', 0);^Mdefine('PAGE_LOGIN', -1);^Mdefine('PAGE_SEARCH', -2);^Mdefine('PAGE_REGISTER', -3);^Mdefine('PAGE_PROFILE', -4);^Mdefine('PAGE_VIEWONLINE', -6);^Mdefine('PAGE_VIEWMEMBERS', -7);^Mdefine('PAGE_FAQ', -8);^Mdefine('PAGE_POSTING', -9);^Mdefine('PAGE_PRIVMSGS', -10);^Mdefine('PAGE_GROUPCP', -11);^Mdefine('PAGE_FORUM_TOUR', -12);^Mdefine('PAGE_PORTAL', -13);^Mdefine('PAGE_CARD', -14);^Mdefine('PAGE_RULES', -15);^Mdefine('PAGE_COOKIES', -16);^Mdefine('PAGE_STAFF', -17);^Mdefine('PAGE_LINKS', -18);^Mdefine('PAGE_DOWNLOAD', -19);^Mdefine('PAGE_ALBUM', -50);^Mdefine('PAGE_ALBUM_PERSONAL', -51);^Mdefine('PAGE_ALBUM_PICTURE', -52);^Mdefine('PAGE_ALBUM_SEARCH', -53);^Mdefine('PAGE_REDIRECT', -1031);^Mdefine('PAGE_SHOUTBOX_MAX', -1035);^Mdefine('PAGE_SHOUTBOX', -1035);^Mdefine('PAGE_CONTACT', -8050);^Mdefine('PAGE_PRILLIAN', -8051);^Mdefine('PAGE_TOPIC_OFFSET', 5000);^M^M// ### Points Status ###^Mdefine('POINTS_DISABLED', 1);^Mdefine('POINTS_ENABLED', 0);^M^M// ### Post Types ###^Mdefine('POST_NORMAL', 0);^Mdefine('POST_STICKY', 1);^Mdefine('POST_ANNOUNCE', 2);^Mdefine('POST_GLOBAL_ANNOUNCE', 3);^Mdefine('POST_BIRTHDAY', 9);^Mdefine('POST_CALENDAR', 10);^M^M// ### Prillian Constants ###^M// prillian installed?^Mif (defined('PRILLIAN_INSTALLED')){^Mdefine('ALLOW_BUDDY_SELF', false);^Mdefine('CONTACT_PATH', $phpbb_root_path.'mods/contact/');^Mdefine('CONTACT_URL', $phpbb_root_path.'contact.'.$phpEx);^Mdefine('IM_NEW_MAIL', 6);^Mdefine('IM_READ_MAIL', 7);^Mdefine('IM_UNREAD_MAIL', <s8><img><s8>;^Mdefine('OFF_SITE', -2);^Mdefine('OFF_SITE_USERS_URL', 'u');^Mdefine('OFF_SITE_POST_URL', 'p');^Mdefine('PRILL_PATH', $phpbb_root_path.'mods/prillian/');^Mdefine('PRILL_URL', $phpbb_root_path.'imclient.'.$phpEx);^Mdefine('MAIN_MODE', 1);^Mdefine('WIDE_MODE', 2);^Mdefine('MINI_MODE', 3);^Mdefine('FRAMES_MODE', 4);^Mdefine('NO_FRAMES_MODE', 5);^M}^M^M// ### Private Message System ###^Mdefine('PRIVMSGS_READ_MAIL', 0);^Mdefine('PRIVMSGS_NEW_MAIL', 1);^Mdefine('PRIVMSGS_SENT_MAIL', 2);^Mdefine('PRIVMSGS_SAVED_IN_MAIL', 3);^Mdefine('PRIVMSGS_SAVED_OUT_MAIL', 4);^Mdefine('PRIVMSGS_UNREAD_MAIL', 5);^M^M// ### Session Parameters ###^Mdefine('SESSION_METHOD_COOKIE', 100);^Mdefine('SESSION_METHOD_GET', 101);^M^M// ### Software Status ###^Mdefine('FORUM_UNLOCKED', 0);^Mdefine('FORUM_LOCKED', 1);^M^M// ### Topic Status ###^Mdefine('TOPIC_UNLOCKED', 0);^Mdefine('TOPIC_LOCKED', 1);^Mdefine('TOPIC_MOVED', 2);^Mdefine('TOPIC_WATCH_NOTIFIED', 1);^Mdefine('TOPIC_WATCH_UN_NOTIFIED', 0);^M^M// ### URL Parameters ###^Mdefine('POST_TOPIC_URL', 't');^Mdefine('POST_CAT_URL', 'c');^Mdefine('POST_FORUM_URL', 'f');^Mdefine('POST_USERS_URL', 'u');^Mdefine('POST_POST_URL', 'p');^Mdefine('POST_GROUPS_URL', 'g');^M^M// ### User Avatar Settings ###^Mdefine('USER_AVATAR_NONE', 0);^Mdefine('USER_AVATAR_UPLOAD', 1);^Mdefine('USER_AVATAR_REMOTE', 2);^Mdefine('USER_AVATAR_GALLERY', 3);^M^M// ### User Levels ###^Mdefine('DELETED', -1);^Mdefine('ANONYMOUS', -1);^Mdefine('USER', 0);^Mdefine('ADMIN', 1);^Mdefine('MOD', 2);^Mdefine('JADMIN', 7);^Mdefine('ADMIN_FOUNDER', 99);^Mdefine('GUEST_ONLY', 1000);^M^M// ### Special Constants ###^Mdefine('NO', 0);^Mdefine('YES', 1);^Mdefine('FRIEND_ONLY',2);^Mdefine('UNKNOWN', 0);^Mdefine('MALE', 1);^Mdefine('FEMALE', 2);^Mdefine('VIP_RANK_TITLE', 'VIP');^Mdefine('OVERIDE_THEME', false);^Mdefine('DIGEST_THEME', 1);^Mdefine('DIGEST_LOGGING', true);^Mdefine('DIGEST_SUPPORT', "http://www.phpbb.com/phpBB/viewtopic.php?t=187868");^Mdefine('DIGEST_HTML', 1);^Mdefine('DIGEST_TEXT', 0);^M^M?>
define('SESSIONS_TABLE', $table_prefix.'sessions');
define('SESSIONS_KEYS_TABLE', $table_prefix.'sessions_keys');
"Mighty07";p="3376" wrote:After all the updates and fixes, i only got 2 things missing.
One is that thing about the "View posts since last visit" and the other is the daily backups.
The most important for me is the daily backups. Does anyone found a fix for this?
"Mighty07";p="3409" wrote:"Mighty07";p="3376" wrote:After all the updates and fixes, i only got 2 things missing.
One is that thing about the "View posts since last visit" and the other is the daily backups.
The most important for me is the daily backups. Does anyone found a fix for this?
Yes i've did. It started working after i put security update 1.0.3. And stopped right after i upgraded the core to 2.0.20.
All i got now is empty backup file, and an alert in the email.
"Mighty07";p="3409" wrote:"Mighty07";p="3376" wrote:After all the updates and fixes, i only got 2 things missing.
One is that thing about the "View posts since last visit" and the other is the daily backups.
The most important for me is the daily backups. Does anyone found a fix for this?
Yes i've did. It started working after i put security update 1.0.3. And stopped right after i upgraded the core to 2.0.20.
All i got now is empty backup file, and an alert in the email.
<?php/*************************************************************************** * admin_ranks.php * ------------------- * begin : Thursday, Jul 12, 2001 * copyright : (C) 2001 The phpBB Group * email : <a>support@phpbb.com</a> * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ if( !empty($setmodules) ){ $file = basename(__FILE__); $module['Users']['Ranks'] = $file; return;} define('IN_PHPBB', 1); //// Let's set the root dir for phpBB//$phpbb_root_path = "./../";require($phpbb_root_path . 'extension.inc');require('./pagestart.' . $phpEx); if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ){ $mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; $mode = htmlspecialchars($mode);}else { // // These could be entered via a form button // if( isset($HTTP_POST_VARS['add']) ) { $mode = "add"; } else if( isset($HTTP_POST_VARS['save']) ) { $mode = "save"; } else { $mode = ""; }} // Restrict mode input to valid options$mode = ( in_array($mode, array('add', 'edit', 'save', 'delete')) ) ? $mode : ''; if( $mode != "" ){ if( $mode == "edit" || $mode == "add" ) { // // They want to add a new rank, show the form. // $rank_id = ( isset($HTTP_GET_VARS['id']) ) ? intval($HTTP_GET_VARS['id']) : 0; $s_hidden_fields = ""; if( $mode == "edit" ) { if( empty($rank_id) ) { message_die(GENERAL_MESSAGE, $lang['Must_select_rank']); } $sql = "SELECT * FROM " . RANKS_TABLE . " WHERE rank_id = $rank_id"; if(!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't obtain rank data", "", __LINE__, __FILE__, $sql); } $rank_info = $db->sql_fetchrow($result); $s_hidden_fields .= '<input>'; } else { $rank_info['rank_special'] = 0; } $s_hidden_fields .= '<input>'; $rank_is_special = ( $rank_info['rank_special'] ) ? "checked="checked"" : ""; $rank_is_not_special = ( !$rank_info['rank_special'] ) ? "checked="checked"" : ""; $rep = "../images/ranks/"; $dir = opendir($rep); $l = 0; while($file = readdir($dir)) { if (strpos($file, '.gif')) { $file1[$l] = $file; $l++; } } closedir($dir); $ranks_list = "<option>" . str_replace($rep, "", $rank_info['rank_image']) . "</option>"; for($k=0; $k</option>set_filenames(array( "body" => "admin/ranks_edit_body.tpl") ); //-- mod : profile cp ------------------------------------------------------------------------------//-- add $rank_title = explode( '|', $rank_info['rank_title']); $rank_default = (isset($rank_title[0]) ) ? $rank_title[0] : ''; $rank_male = (isset($rank_title[1]) ) ? $rank_title[1] : ''; $rank_female = (isset($rank_title[2]) ) ? $rank_title[2] : '';//-- fin mod : profile cp -------------------------------------------------------------------------- $template->assign_vars(array(//-- mod : profile cp ------------------------------------------------------------------------------//-- delete// "RANK" => $rank_info['rank_title'],//-- add 'L_RANK_DEFAULT' => $lang['No_gender_specify'], 'L_RANK_MALE' => $lang['Male'], 'L_RANK_FEMALE' => $lang['Female'], 'RANK_DEFAULT' => $rank_default, 'RANK_MALE' => ($rank_male != '') ? $rank_male : $rank_default, 'RANK_FEMALE' => ($rank_female != '') ? $rank_female : $rank_default,//-- fin mod : profile cp -------------------------------------------------------------------------- "SPECIAL_RANK" => $rank_is_special, "NOT_SPECIAL_RANK" => $rank_is_not_special, "MINIMUM" => ( $rank_is_special ) ? "" : $rank_info['rank_min'], "IMAGE" => ( $rank_info['rank_image'] != "" ) ? $rank_info['rank_image'] : "", "IMAGE_DISPLAY" => ( $rank_info['rank_image'] != "" ) ? '<img>' : "", "RANK_LIST" => $ranks_list, "RANK_IMG" => ( $rank_info['rank_image'] != "") ? '../' . $rank_info['rank_image'] : '../images/spacer.gif', "L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK_TITLE" => $lang['Rank_title'], "L_RANK_SPECIAL" => $lang['Rank_special'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_RANK_IMAGE" => $lang['Rank_image'], "L_RANK_IMAGE_EXPLAIN" => $lang['Rank_image_explain'], "L_SUBMIT" => $lang['Submit'], "L_RESET" => $lang['Reset'], "L_YES" => $lang['Yes'], "L_NO" => $lang['No'], "S_RANK_ACTION" => append_sid("admin_ranks.$phpEx"), "S_HIDDEN_FIELDS" => $s_hidden_fields) ); } else if( $mode == "save" ) { // // Ok, they sent us our info, let's update it. // $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : 0;//-- mod : profile cp ------------------------------------------------------------------------------//-- delete// $rank_title = ( isset($HTTP_POST_VARS['title']) ) ? trim($HTTP_POST_VARS['title']) : "";//-- add $rank_default = ( isset($HTTP_POST_VARS['title_default']) ) ? trim($HTTP_POST_VARS['title_default']) : ''; $rank_male = ( isset($HTTP_POST_VARS['title_male']) ) ? trim($HTTP_POST_VARS['title_male']) : ''; $rank_female = ( isset($HTTP_POST_VARS['title_female']) ) ? trim($HTTP_POST_VARS['title_female']) : ''; if ($rank_default == '') $rank_default = $rank_male; if ($rank_default == '') $rank_default = $rank_female; if ($rank_male == $rank_default) $rank_male = ''; if ($rank_female == $rank_default) $rank_female = ''; $rank_title = (($rank_default != '') || ($rank_male != '') || ($rank_female != '')) ? $rank_default . ( ( ($rank_male != '') || ($rank_female != '') ) ? '|' : '' ) . $rank_male . ( ($rank_female != '') ? '|' : '' ) . $rank_female : '';//-- fin mod : profile cp -------------------------------------------------------------------------- $special_rank = ( $HTTP_POST_VARS['special_rank'] == 1 ) ? TRUE : 0; $min_posts = ( isset($HTTP_POST_VARS['min_posts']) ) ? intval($HTTP_POST_VARS['min_posts']) : -1; $rank_image = ( (isset($HTTP_POST_VARS['rank_image'])) ) ? trim($HTTP_POST_VARS['rank_image']) : ""; if( $rank_title == "" ) { message_die(GENERAL_MESSAGE, $lang['Must_select_rank']); } if( $special_rank == 1 ) { $max_posts = -1; $min_posts = -1; } // // The rank image has to be a jpg, gif or png // if($rank_image != "") { if ( !preg_match("/(.gif|.png|.jpg)$/is", $rank_image)) { $rank_image = ""; } } if ($rank_id) { if (!$special_rank) { $sql = "UPDATE " . USERS_TABLE . " SET user_rank = 0 WHERE user_rank = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['No_update_ranks'], "", __LINE__, __FILE__, $sql); } } $sql = "UPDATE " . RANKS_TABLE . " SET rank_title = '" . str_replace("'", "''", $rank_title) . "', rank_special = $special_rank, rank_min = $min_posts, rank_image = '" . str_replace("'", "''", $rank_image) . "' WHERE rank_id = $rank_id"; $message = $lang['Rank_updated']; } else { $sql = "INSERT INTO " . RANKS_TABLE . " (rank_title, rank_special, rank_min, rank_image) VALUES ('" . str_replace("'", "''", $rank_title) . "', $special_rank, $min_posts, '" . str_replace("'", "''", $rank_image) . "')"; $message = $lang['Rank_added']; } if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't update/insert into ranks table", "", __LINE__, __FILE__, $sql); } $message .= "<br><br>" . sprintf($lang['Click_return_rankadmin'], "<a>", "</a>") . "<br><br>" . sprintf($lang['Click_return_admin_index'], "<a>", "</a>"); message_die(GENERAL_MESSAGE, $message); } else if( $mode == "delete" ) { // // Ok, they want to delete their rank // if( isset($HTTP_POST_VARS['id']) || isset($HTTP_GET_VARS['id']) ) { $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']); $confirm = isset($HTTP_POST_VARS['confirm']); if( $rank_id && $confirm ) { $sql = "DELETE FROM " . RANKS_TABLE . " WHERE rank_id = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't delete rank data", "", __LINE__, __FILE__, $sql); } $sql = "UPDATE " . USERS_TABLE . " SET user_rank = 0 WHERE user_rank = $rank_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['No_update_ranks'], "", __LINE__, __FILE__, $sql); } $message = $lang['Rank_removed'] . "<br><br>" . sprintf($lang['Click_return_rankadmin'], "<a>", "</a>") . "<br><br>" . sprintf($lang['Click_return_admin_index'], "<a>", "</a>"); message_die(GENERAL_MESSAGE, $message); } else { elseif( $rank_id && !$confirm) { // Present the confirmation screen to the user $template->set_filenames(array( 'body' => 'admin/confirm_body.tpl') ); $hidden_fields = '<input><input>'; $template->assign_vars(array( 'MESSAGE_TITLE' => $lang['Confirm'], 'MESSAGE_TEXT' => $lang['Confirm_delete_rank'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'S_CONFIRM_ACTION' => append_sid("admin_ranks.$phpEx"), 'S_HIDDEN_FIELDS' => $hidden_fields) ); } else { message_die(GENERAL_MESSAGE, $lang['Must_select_rank']); } } $template->pparse("body"); include('./page_footer_admin.'.$phpEx);} //// Show the default page//$template->set_filenames(array( "body" => "admin/ranks_list_body.tpl")); $sql = "SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_min ASC, rank_special ASC";if( !$result = $db->sql_query($sql) ){ message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql);}$rank_count = $db->sql_numrows($result); $rank_rows = $db->sql_fetchrowset($result); $template->assign_vars(array( "L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK" => $lang['Rank_title'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_SPECIAL_RANK" => $lang['Rank_special'], "L_EDIT" => $lang['Edit'], "L_DELETE" => $lang['Delete'], "L_ADD_RANK" => $lang['Add_new_rank'], "L_ACTION" => $lang['Action'], "S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx"))); for($i = 0; $i <rank_count>assign_block_vars("ranks", array( "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, "RANK" => $rank, "SPECIAL_RANK" => $rank_is_special, "RANK_MIN" => $rank_min, "U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&id=$rank_id"), "U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&id=$rank_id")) ); }}else{ // // Show the default page // $template->set_filenames(array( "body" => "admin/ranks_list_body.tpl") ); $sql = "SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_min ASC, rank_special ASC"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql); } $rank_count = $db->sql_numrows($result); $rank_rows = $db->sql_fetchrowset($result); $template->assign_vars(array( "L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK" => $lang['Rank_title'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_SPECIAL_RANK" => $lang['Rank_special'], "L_EDIT" => $lang['Edit'], "L_DELETE" => $lang['Delete'], "L_ADD_RANK" => $lang['Add_new_rank'], "L_ACTION" => $lang['Action'], "S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx")) ); for($i = 0; $i <rank_count>assign_block_vars("ranks", array( "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, "RANK" => $rank, "SPECIAL_RANK" => $rank_is_special, "RANK_MIN" => $rank_min, "U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&id=$rank_id"), "U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&id=$rank_id")) ); }} $template->pparse("body"); include('./page_footer_admin.'.$phpEx); ?>
}}else{ // // Show the default page // $template->set_filenames(array( "body" => "admin/ranks_list_body.tpl") ); $sql = "SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_min ASC, rank_special ASC"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't obtain ranks data", "", __LINE__, __FILE__, $sql); } $rank_count = $db->sql_numrows($result); $rank_rows = $db->sql_fetchrowset($result); $template->assign_vars(array( "L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK" => $lang['Rank_title'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_SPECIAL_RANK" => $lang['Rank_special'], "L_EDIT" => $lang['Edit'], "L_DELETE" => $lang['Delete'], "L_ADD_RANK" => $lang['Add_new_rank'], "L_ACTION" => $lang['Action'], "S_RANKS_ACTION" => append_sid("admin_ranks.$phpEx")) ); for($i = 0; $i <rank_count>assign_block_vars("ranks", array( "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, "RANK" => $rank, "SPECIAL_RANK" => $rank_is_special, "RANK_MIN" => $rank_min, "U_RANK_EDIT" => append_sid("admin_ranks.$phpEx?mode=edit&id=$rank_id"), "U_RANK_DELETE" => append_sid("admin_ranks.$phpEx?mode=delete&id=$rank_id")) ); }
$confirm = isset($HTTP_POST_VARS['confirm']);
} else { $rank_id = 0; }
"CopsOffDuty";p="4127" wrote:I haven't changed anything. Kept the whole thing stock. <img>
"found it";p="3412" wrote:"Mighty07";p="3409" wrote:"Mighty07";p="3376" wrote:After all the updates and fixes, i only got 2 things missing.
One is that thing about the "View posts since last visit" and the other is the daily backups.
The most important for me is the daily backups. Does anyone found a fix for this?
Yes i've did. It started working after i put security update 1.0.3. And stopped right after i upgraded the core to 2.0.20.
All i got now is empty backup file, and an alert in the email.
I would double check your files...I have this working fine on my live site...
#-----[ FIND ]---------------------------------------------# Line 58 $chars = array( 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T', 'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); $max_chars = count($chars) - 1; srand( (double) microtime()*1000000); $rand_str = ''; for($i = 0; $i < 8; $i++) { $rand_str = ( $i == 0 ) ? $chars[rand(0, $max_chars)] ]; } return ( $hash ) ? md5($rand_str) : $rand_str; ##-----[ REPLACE WITH ]---------------------------------------------# $rand_str = dss_rand(); return ( $hash ) ? md5($rand_str) : substr($rand_str, 8);
"Kat";p="5421" wrote:on profile.php:
- Code: Select all
#-----[ FIND ]---------------------------------------------# Line 58 $chars = array( 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T', 'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); $max_chars = count($chars) - 1; srand( (double) microtime()*1000000); $rand_str = ''; for($i = 0; $i < 8; $i++) { $rand_str = ( $i == 0 ) ? $chars[rand(0, $max_chars)] ]; } return ( $hash ) ? md5($rand_str) : $rand_str; ##-----[ REPLACE WITH ]---------------------------------------------# $rand_str = dss_rand(); return ( $hash ) ? md5($rand_str) : substr($rand_str, 8);
This is not in my file. What should I do?
I wish I could. Honestly I don't have any extra mods on my forum but I changed the layout and whenever I have used the premodded files it always messes up the layout and I have to try to recall how I changed everything and change it back"Threat009" wrote:"Kat";p="5421" wrote:on profile.php:
- Code: Select all
#-----[ FIND ]---------------------------------------------# Line 58 $chars = array( 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T', 'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); $max_chars = count($chars) - 1; srand( (double) microtime()*1000000); $rand_str = ''; for($i = 0; $i < 8; $i++) { $rand_str = ( $i == 0 ) ? $chars[rand(0, $max_chars)] ]; } return ( $hash ) ? md5($rand_str) : $rand_str; ##-----[ REPLACE WITH ]---------------------------------------------# $rand_str = dss_rand(); return ( $hash ) ? md5($rand_str) : substr($rand_str, 8);
This is not in my file. What should I do?
That was one of the problems I had. I overwrote the file w/the pre-mod. Actually, I had a back-up folder of all mods I installed on my site. So I used my computer to search that folder to find out if any of the 2.0.20 files were in the folder. I lucked out, so all I had to do was overwrite everything w/the premods, since my mods had nothing to do w/them. imo, the pre-mods are faster and safer, if you can get away w/using them.....
"Kat";p="5435" wrote:I wish I could. Honestly I don't have any extra mods on my forum but I changed the layout and whenever I have used the premodded files it always messes up the layout and I have to try to recall how I changed everything and change it back
"Eon";p="5409" wrote:How was it incorrect? If it worked after you installed the security update. Are you sure everything is at the right permissions settings?
Did you update the phpbb file with what you typed in? You may want to check your database to make sure they are set to the right values, and if all else fails you can set the # of mods and admins there.
<td>{L_FLOOD_INTERVAL} <br><span>{L_FLOOD_INTERVAL_EXPLAIN}</span></td><td> <input></td></tr> <tr> <td>{L_MAX_LOGIN_ATTEMPTS}<br><span>{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}</span></td> <td><input></td> </tr>
Warning: Empty regular expression in .../forum/includes/bbcode.php(1162) : regexp code on line 3
for posting replies with quote, or just for quoting stuff.and
", $bbcode_tpl['quote_close'], $text);", $bbcode_tpl['quote_open'], $text);
$text = str_replace("
', '', false, '', "[quote]");+)"]/si", $bbcode_tpl['quote_post_open'], $text);
// opening a username quote with an pre-defined post entry
$text = preg_replace("/*)"?);p=(?:"?([0-9]+)"?)]/si", $bbcode_tpl['quote_username_post_open'], $text);
// New one liner to deal with opening quotes with usernames...
// replaces the two line version that I had here before..
$text = preg_replace("/', '', false, '', "/si", $bbcode_tpl['quote_username_open'], $text);
// acronym
$text = preg_replace("/[acronym:$uid="(.*?)"]/si", $bbcode_tpl['acronym_open'], $text);
$text = str_replace("[/acronym:$uid]", $bbcode_tpl['acronym_close'], $text);
//and [list type=x] for (un)ordered lists.
", $bbcode_tpl['olist_close'], $text);
// unordered lists
$text = str_replace("", $bbcode_tpl['ulist_open'], $text);
", $bbcode_tpl['ulist_close'], $text);
// li tags
$text = str_replace("- ", $bbcode_tpl['listitem'], $text);
// ending tags
$text = str_replace("
$text = str_replace("
// Ordered lists
$text = preg_replace("/[list type=([a1])]/si", $bbcode_tpl['olist_open'], $text);
// colors
$text = preg_replace("/[color=(#[0-9A-F]{6}|[a-z]+)]/si", $bbcode_tpl['color_open'], $text);
$text = str_replace("[/color]", $bbcode_tpl['color_close'], $text);
// size
$text = preg_replace("/[size=99px]/si", $bbcode_tpl['size_open'], $text);
$text = str_replace("[/size]", $bbcode_tpl['size_close'], $text);
// and for bolding text.
$text = str_replace("", $bbcode_tpl['b_open'], $text);
$text = str_replace("", $bbcode_tpl['b_close'], $text);
// [sup] and [/sup] pour les textes en exposant.
$text = str_replace("[sup:$uid]", $bbcode_tpl['sup_open'], $text);
$text = str_replace("[/sup:$uid]", $bbcode_tpl['sup_close'], $text);
// [sub] and [/sub] pour les textes en indice.
$text = str_replace("[sub:$uid]", $bbcode_tpl['sub_open'], $text);
$text = str_replace("[/sub:$uid]", $bbcode_tpl['sub_close'], $text);
// [strike] and [/strike] for barring text.
$text = str_replace("[strike:$uid]", $bbcode_tpl['strike_open'], $text);
$text = str_replace("[/strike:$uid]", $bbcode_tpl['strike_close'], $text);
// and for underlining text.
$text = str_replace("", $bbcode_tpl['u_open'], $text);
$text = str_replace("", $bbcode_tpl['u_close'], $text);
// and for italicizing text.
$text = str_replace("", $bbcode_tpl['i_open'], $text);
$text = str_replace("", $bbcode_tpl['i_close'], $text);
// Patterns and replacements for URL and email tags..
$patterns = array();
$replacements = array();
// [img]image_url_here[/img] code..
// This one gets first-passed..
//-- mod : profile cp ------------------------------------------------------------------------------
//-- add
global $userdata;
if (!$userdata['user_viewimg'])
{
$text = str_replace("[img]", "", $text);
$text = str_replace("[/img]", "", $text);
$text = str_replace("[img=left:$uid]", "", $text);
$text = str_replace("[img=right:$uid]", "", $text);
$text = str_replace("[imgrel:$uid]", "", $text);
$text = str_replace("[/imgrel:$uid]", "", $text);
$text = str_replace("[imgrel=left:$uid]", "", $text);
$text = str_replace("[imgrel=right:$uid]", "", $text);
$text = str_replace("[theme:$uid]", "", $text);
$text = str_replace("[theme=left:$uid]", "", $text);
$text = str_replace("[theme=right:$uid]", "", $text);
$text = str_replace("[/theme:$uid]", "", $text);
}
//-- fin mod : profile cp --------------------------------------------------------------------------
$patterns[] = "#[img]([^?](?:[^[]+|[(?!url))*?)[/img]#i";
$replacements[] = $bbcode_tpl['img'];
//BBCode Search Mod
$patterns[] = "#[search:$uid](.*?)[/search:$uid]#si";
$replacements[] = $bbcode_tpl['search'];
$patterns[] = "#[theme:$uid](.*?)[/theme:$uid]#si";
$replacements[] = $bbcode_tpl['theme'];
$patterns[] = "#[imgrel:$uid](.*?)[/imgrel:$uid]#si";
$replacements[] = $bbcode_tpl['img'];
// LEFT-RIGHT-start
// [img=left]image_url_here[/img] code..
$patterns[] = "#[img=left:$uid](.*?)[/img]#si";
$replacements[] = $bbcode_tpl['left'];
// [img=right]image_url_here[/img] code..
$patterns[] = "#[img=right:$uid](.*?)[/img]#si";
$replacements[] = $bbcode_tpl['right'];
// [imgrel=left]image_url_here[/imgrel] code..
$patterns[] = "#[imgrel=left:$uid](.*?)[/imgrel:$uid]#si";
$replacements[] = $bbcode_tpl['relleft'];
// [img=right]image_url_here[/img] code..
$patterns[] = "#[imgrel=right:$uid](.*?)[/imgrel:$uid]#si";
$replacements[] = $bbcode_tpl['relright'];
// [img=left]image_url_here[/img] code..
$patterns[] = "#[theme=left:$uid](.*?)[/theme:$uid]#si";
$replacements[] = $bbcode_tpl['themeleft'];
// [img=right]image_url_here[/img] code..
$patterns[] = "#[theme=right:$uid](.*?)[/theme:$uid]#si";
$replacements[] = $bbcode_tpl['themeright'];
// LEFT-RIGHT-end
// matches a xxxx://www.phpbb.com code..
$patterns[] = "#[url]([w]+?://([w#$%&~/.-;:=,?@]+]+|[(?!url=))*?)[/url]#is";
$replacements[] = $bbcode_tpl['url1'];
// http://www.phpbb.com code.. (no xxxx:// prefix).
$patterns[] = "#[url]((www|ftp).([w#$%&~/.-;:=,?@]+]+|[(?!url=))*?)[/url]#is";
$replacements[] = $bbcode_tpl['url2'];
// [url=xxxx]phpBB[/url] code..
$patterns[] = "#[url=([w]+?]+]*?)]([^?nrt].*?)[/url]#is";
$replacements[] = $bbcode_tpl['url3'];
// phpBB code.. (no xxxx] = "#[url=((www|ftp).[w#$%&~/.-;]+]*?)]([^?nrt].*?)[/url]#is";
$replacements[] = $bbcode_tpl['url4'];
// user@domain.tld code..
$patterns[] = "#[email]([a-z0-9&-_.]+?@[w-]+.([w-.]+.)?[w]+)[/email]#si";
$replacements[] = $bbcode_tpl['email'];
// [google]string for search[/google] code..
$patterns[] = "#[google](.*?)[/google]#ise";
$replacements[] = $bbcode_tpl['google'];
// [you] - inserts the name of the person viewing the post
$patterns[] = "#[you]#ise";
$replacements[] = $bbcode_tpl['you'];
// bbcode_box Mod
// [fade] and [/fade] for faded text.
$text = str_replace("[fade:$uid]", $bbcode_tpl['fade_open'], $text);
$text = str_replace("[/fade:$uid]", $bbcode_tpl['fade_close'], $text);
// real
$patterns[] = "#[ram:$uid](.*?)[/ram:$uid]#si";
$replacements[] = $bbcode_tpl['ram'];
// sound
$patterns[] = "#[stream:$uid](.*?)[/stream:$uid]#si";
$replacements[] = $bbcode_tpl['stream'];
//web
$patterns[] = "#[web:$uid](.*?)[/web:$uid]#si";
$replacements[] = $bbcode_tpl['web'];
// [flash width= height= loop= ] and [/flash] code..
$patterns[] = "#[flash width=([0-6]?[0-9]?[0-9]) height=([0-4]?[0-9]?[0-9]):$uid](.*?)[/flash:$uid]#si";
$replacements[] = $bbcode_tpl['flash'];
// [flash width= height= loop= ] and [/flash] code..
$patterns[] = "#[video width=([0-6]?[0-9]?[0-9]) height=([0-4]?[0-9]?[0-9]):$uid](.*?)[/video:$uid]#si";
$replacements[] = $bbcode_tpl['video'];
$text = preg_replace($patterns, $replacements, $text);
// align
$text = preg_replace("/[align=(left|right|center|justify):$uid]/si", $bbcode_tpl['align_open'], $text);
$text = str_replace("[/align:$uid]", $bbcode_tpl['align_close'], $text);
// marquee
$text = preg_replace("/[marq=(left|right|up|down):$uid]/si", $bbcode_tpl['marq_open'], $text);
$text = str_replace("[/marq:$uid]", $bbcode_tpl['marq_close'], $text);
// table
$text = preg_replace("/[table=(.*?):$uid]/si", $bbcode_tpl['table_open'], $text);
$text = str_replace("[/table:$uid]", $bbcode_tpl['table_close'], $text);
// cell
$text = preg_replace("/[cell=(.*?):$uid]/si", $bbcode_tpl['cell_open'], $text);
$text = str_replace("[/cell:$uid]", $bbcode_tpl['cell_close'], $text);
// center
$text = preg_replace("/[center:$uid]/si", $bbcode_tpl['center_open'], $text);
$text = str_replace("[/center:$uid]", $bbcode_tpl['center_close'], $text);
// font
$text = preg_replace("//si", $bbcode_tpl['font_open'], $text);
$text = str_replace("[/font:$uid]", $bbcode_tpl['font_close'], $text);
// poet
$text = preg_replace("/[poet(.*?):$uid]/si", $bbcode_tpl['poet_open'], $text);
$text = str_replace("[/poet:$uid]", $bbcode_tpl['poet_close'], $text);
//[hr]
$text = str_replace("[hr:$uid]", $bbcode_tpl['hr'], $text);
// bbcode_box Mod
$text = preg_replace($patterns, $replacements, $text);
// Remove our padding from the string..
$text = substr($text, 1);
return $text;
} // bbencode_second_pass()
// Need to initialize the random numbers only ONCE
mt_srand( (double) microtime() * 1000000);
function make_bbcode_uid()
{
// Unique ID for this message..
$uid = dss_rand();
$uid = substr($uid, 0, BBCODE_UID_LEN);
return $uid;
}
function bbencode_first_pass($text, $uid)
{
// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$text = " " . $text;
// [code] and [/code] for posting code (HTML, PHP, C etc etc) in your posts.
$text = bbencode_first_pass_pda($text, $uid, '[code]', '[/code]', '', true, '');
// PHP MOD
// /*php and /php*/ for posting PHP code in your posts.
$text = bbencode_first_pass_pda($text, $uid, '/*php ', ' /php*/', '', true, '');
//for posting replies with quote, or just for quoting stuff.and
$text = bbencode_first_pass_pda($text, $uid, '', '', false, '');', '
$text = bbencode_first_pass_pda($text, $uid, '/[quote=(".*?")]/is', '', '', false, '', "");
//for posting replies with quote, or just for quoting stuff with an pre-defined post entryand
$text = bbencode_first_pass_pda($text, $uid, '/[quote=p=\\"([0-9]+)\\"]/is', '', '', false, '', "");
$text = bbencode_first_pass_pda($text, $uid, '/[quote=\\"(.*?)\\";p=\\"([0-9]+)\\"]/is', '");
$text = bbencode_first_pass_pda($text, $uid, '/[quote=\\"(.*?)\\"]/is', '
Registered users: App360MonitorBot, Bing [Bot], Google [Bot]