logging out does not work!

Temporary forum to obtain support while phpBB.com is offline.
Please use the support forum on phpBB.com
Forum rules
Temporary forum to obtain support while phpBB.com is offline.
Please use the support forum on phpBB.com
Locked
demon327
Registered User
Posts: 23
Joined: Wed Nov 08, 2006 10:53 am
Location: belgium

logging out does not work!

Post by demon327 »

Hello all, when my users try to logout on the forum there getting redirected to a 404 not found page on my website, i even uploaded a new overall_header.html file with the mods edits, but the problem stays..

the only mod that uses fucntions_user.php is my drupal bridge:

Code: Select all

/**
* Remove User
*/
if (defined('PHPBB_DRUPAL_MODULE')) 
{
//function user_delete($mode, $user_id, $post_username = false)
function phpbb_user_delete($mode, $user_id, $post_username = false)
{
	global $cache, $config, $db, $user, $auth;
	global $phpbb_root_path, $phpEx;

	$sql = 'SELECT *
		FROM ' . USERS_TABLE . '
		WHERE user_id = ' . $user_id;
	$result = $db->sql_query($sql);
	$user_row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	if (!$user_row)
	{
		return false;
	}

	// Before we begin, we will remove the reports the user issued.
	$sql = 'SELECT r.post_id, p.topic_id
		FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
		WHERE r.user_id = ' . $user_id . '
			AND p.post_id = r.post_id';
	$result = $db->sql_query($sql);

	$report_posts = $report_topics = array();
	while ($row = $db->sql_fetchrow($result))
	{
		$report_posts[] = $row['post_id'];
		$report_topics[] = $row['topic_id'];
	}
	$db->sql_freeresult($result);

	if (sizeof($report_posts))
	{
		$report_posts = array_unique($report_posts);
		$report_topics = array_unique($report_topics);

		// Get a list of topics that still contain reported posts
		$sql = 'SELECT DISTINCT topic_id
			FROM ' . POSTS_TABLE . '
			WHERE ' . $db->sql_in_set('topic_id', $report_topics) . '
				AND post_reported = 1
				AND ' . $db->sql_in_set('post_id', $report_posts, true);
		$result = $db->sql_query($sql);

		$keep_report_topics = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$keep_report_topics[] = $row['topic_id'];
		}
		$db->sql_freeresult($result);

		if (sizeof($keep_report_topics))
		{
			$report_topics = array_diff($report_topics, $keep_report_topics);
		}
		unset($keep_report_topics);

		// Now set the flags back
		$sql = 'UPDATE ' . POSTS_TABLE . '
			SET post_reported = 0
			WHERE ' . $db->sql_in_set('post_id', $report_posts);
		$db->sql_query($sql);

		if (sizeof($report_topics))
		{
			$sql = 'UPDATE ' . TOPICS_TABLE . '
				SET topic_reported = 0
				WHERE ' . $db->sql_in_set('topic_id', $report_topics);
			$db->sql_query($sql);
		}
	}

	// Remove reports
	$db->sql_query('DELETE FROM ' . REPORTS_TABLE . ' WHERE user_id = ' . $user_id);

	if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == AVATAR_UPLOAD)
	{
		avatar_delete('user', $user_row);
	}

	switch ($mode)
	{
		case 'retain':

			$db->sql_transaction('begin');

			if ($post_username === false)
			{
				$post_username = $user->lang['GUEST'];
			}

			// If the user is inactive and newly registered we assume no posts from this user being there...
			if ($user_row['user_type'] == USER_INACTIVE && $user_row['user_inactive_reason'] == INACTIVE_REGISTER && !$user_row['user_posts'])
			{
			}
			else
			{
				$sql = 'UPDATE ' . FORUMS_TABLE . '
					SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = ''
					WHERE forum_last_poster_id = $user_id";
				$db->sql_query($sql);

				$sql = 'UPDATE ' . POSTS_TABLE . '
					SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "'
					WHERE poster_id = $user_id";
				$db->sql_query($sql);

				$sql = 'UPDATE ' . POSTS_TABLE . '
					SET post_edit_user = ' . ANONYMOUS . "
					WHERE post_edit_user = $user_id";
				$db->sql_query($sql);

				$sql = 'UPDATE ' . TOPICS_TABLE . '
					SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = ''
					WHERE topic_poster = $user_id";
				$db->sql_query($sql);

				$sql = 'UPDATE ' . TOPICS_TABLE . '
					SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = ''
					WHERE topic_last_poster_id = $user_id";
				$db->sql_query($sql);

				// Since we change every post by this author, we need to count this amount towards the anonymous user

				// Update the post count for the anonymous user
				if ($user_row['user_posts'])
				{
					$sql = 'UPDATE ' . USERS_TABLE . '
						SET user_posts = user_posts + ' . $user_row['user_posts'] . '
						WHERE user_id = ' . ANONYMOUS;
					$db->sql_query($sql);
				}
			}

			$db->sql_transaction('commit');

		break;
		
				// Start Add User Blog Mod ------------------
		case 'remove_blogs' :
			if (!function_exists('blog_delete_user'))
			{
				include("{$phpbb_root_path}blog/includes/functions_admin.$phpEx");
			}
			blog_delete_user($user_id);
		break;

		case 'remove_blogs_and_posts' :
			if (!function_exists('blog_delete_user'))
			{
				include("{$phpbb_root_path}blog/includes/functions_admin.$phpEx");
			}
			blog_delete_user($user_id);
		// End Add User Blog Mod --------------------

		case 'remove':

			if (!function_exists('delete_posts'))
			{
				include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
			}

			$sql = 'SELECT topic_id, COUNT(post_id) AS total_posts
				FROM ' . POSTS_TABLE . "
				WHERE poster_id = $user_id
				GROUP BY topic_id";
			$result = $db->sql_query($sql);

			$topic_id_ary = array();
			while ($row = $db->sql_fetchrow($result))
			{
				$topic_id_ary[$row['topic_id']] = $row['total_posts'];
			}
			$db->sql_freeresult($result);

			if (sizeof($topic_id_ary))
			{
				$sql = 'SELECT topic_id, topic_replies, topic_replies_real
					FROM ' . TOPICS_TABLE . '
					WHERE ' . $db->sql_in_set('topic_id', array_keys($topic_id_ary));
				$result = $db->sql_query($sql);

				$del_topic_ary = array();
				while ($row = $db->sql_fetchrow($result))
				{
					if (max($row['topic_replies'], $row['topic_replies_real']) + 1 == $topic_id_ary[$row['topic_id']])
					{
						$del_topic_ary[] = $row['topic_id'];
					}
				}
				$db->sql_freeresult($result);

				if (sizeof($del_topic_ary))
				{
					$sql = 'DELETE FROM ' . TOPICS_TABLE . '
						WHERE ' . $db->sql_in_set('topic_id', $del_topic_ary);
					$db->sql_query($sql);
				}
			}

			// Delete posts, attachments, etc.
			delete_posts('poster_id', $user_id);

		break;
	}

	$db->sql_transaction('begin');

	$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE);

	foreach ($table_ary as $table)
	{
		$sql = "DELETE FROM $table
			WHERE user_id = $user_id";
		$db->sql_query($sql);
	}

	$cache->destroy('sql', MODERATOR_CACHE_TABLE);

	// Remove any undelivered mails...
	$sql = 'SELECT msg_id, user_id
		FROM ' . PRIVMSGS_TO_TABLE . '
		WHERE author_id = ' . $user_id . '
			AND folder_id = ' . PRIVMSGS_NO_BOX;
	$result = $db->sql_query($sql);

	$undelivered_msg = $undelivered_user = array();
	while ($row = $db->sql_fetchrow($result))
	{
		$undelivered_msg[] = $row['msg_id'];
		$undelivered_user[$row['user_id']][] = true;
	}
	$db->sql_freeresult($result);

	if (sizeof($undelivered_msg))
	{
		$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
			WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
		$db->sql_query($sql);
	}

	$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
		WHERE author_id = ' . $user_id . '
			AND folder_id = ' . PRIVMSGS_NO_BOX;
	$db->sql_query($sql);

	// Delete all to-information
	$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
		WHERE user_id = ' . $user_id;
	$db->sql_query($sql);

	// Set the remaining author id to anonymous - this way users are still able to read messages from users being removed
	$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
		SET author_id = ' . ANONYMOUS . '
		WHERE author_id = ' . $user_id;
	$db->sql_query($sql);

	$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
		SET author_id = ' . ANONYMOUS . '
		WHERE author_id = ' . $user_id;
	$db->sql_query($sql);

	foreach ($undelivered_user as $_user_id => $ary)
	{
		if ($_user_id == $user_id)
		{
			continue;
		}

		$sql = 'UPDATE ' . USERS_TABLE . '
			SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ',
				user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . '
			WHERE user_id = ' . $_user_id;
		$db->sql_query($sql);
	}

	$db->sql_transaction('commit');

	// Reset newest user info if appropriate
	if ($config['newest_user_id'] == $user_id)
	{
		update_last_username();
	}

	// Decrement number of users if this user is active
	if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE)
	{
		set_config('num_users', $config['num_users'] - 1, true);
	}

	  // PHPBB_DRUPAL_MODULE needs true
  // return false;
	return true;

}

}
else //if (!defined('PHPBB_DRUPAL_MODULE'))
{
/**
* Remove User
*/
<fill in phpbb's code>
but if i disable the module and drupal itself it's still happening so it must be something in phpbb.., probly a mod..

Installed mods:,
user blog mod, shmk user feedback,prime post revision,prime subject check,advertisement mod, user reminder mod(lefty's one),Site Warning, IP search..

i've added the files that are the cause i think.
Attachments
functions_user+ucp.php.zip
Inludes/functions_user.php
rooth/ucp.php
(24.09 KiB) Downloaded 325 times

demon327
Registered User
Posts: 23
Joined: Wed Nov 08, 2006 10:53 am
Location: belgium

Re: logging out does not work!

Post by demon327 »

*bump*

User avatar
Lumpy Burgertushie
Registered User
Posts: 1006
Joined: Tue Feb 28, 2006 5:26 pm

Re: logging out does not work!

Post by Lumpy Burgertushie »

can we have a link to your board please. the one in your sig is not working.

we need to be able to test so we can see where the redirect is happening etc.

create a test user accound and post the username/password . you can delete the account after we have solved your problem.

robert

demon327
Registered User
Posts: 23
Joined: Wed Nov 08, 2006 10:53 am
Location: belgium

Re: logging out does not work!

Post by demon327 »

Lumpy Burgertushie wrote:can we have a link to your board please. the one in your sig is not working.

we need to be able to test so we can see where the redirect is happening etc.

create a test user accound and post the username/password . you can delete the account after we have solved your problem.

robert
Oops, that link is more then three years old.. so here is the new one:

username:aaronmm
pass:123456

board url:
http://ashladan.be/forum/

User avatar
Lumpy Burgertushie
Registered User
Posts: 1006
Joined: Tue Feb 28, 2006 5:26 pm

Re: logging out does not work!

Post by Lumpy Burgertushie »

you need to check your cookie settings in your admin panel.

make sure that your cookie path is set to /forum and that your script path is set to /forum/

change your cookie name to someting else ( add a number to it ) and test again.

also, make sure you do not have http:// in your domain name setting.

robert

demon327
Registered User
Posts: 23
Joined: Wed Nov 08, 2006 10:53 am
Location: belgium

Re: logging out does not work!

Post by demon327 »

Lumpy Burgertushie wrote:you need to check your cookie settings in your admin panel.

make sure that your cookie path is set to /forum and that your script path is set to /forum/

change your cookie name to someting else ( add a number to it ) and test again.

also, make sure you do not have http:// in your domain name setting.

robert
coockie domain:ashladan.be
coockie:phpbb3_6niie
path:/forum/

demon327
Registered User
Posts: 23
Joined: Wed Nov 08, 2006 10:53 am
Location: belgium

Re: logging out does not work!

Post by demon327 »

*bump*

Your board's URL: http://ashladan.be/forum
Version of phpBB3:3.0.4
Was this a fresh install or a(n) update/upgrade/conversion (please be specific)? Old conversion
If update, what package(s) did you use? /
Did you use an automated wizard provided by your host to install phpBB? NO
MODs you have installed:user blog mod, shmk user feedback,prime post revision,prime subject check,advertisement mod, user reminder mod(lefty's one),Site Warning, IP search, anti spam ACP
When the problem started: very long ago?
Your level of expertise (be honest): good

Additionally, you may wish to provide the following (where applicable)
Template(s) used: Prosilver
Language(s) used: Dutch
Version of PHP used:5.2.6
Database and version used:MYSQL(i)5.0.51a
Test account*:
username:aaronmm
pass:123456

Locked