You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 60 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - User can't logoff properly (non-default theme) 7.7 Patch 3.0 [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
sneldown
Nuke Cadet
Nuke Cadet


Joined: Jun 03, 2005
Posts: 7


PostPosted: Fri Jun 03, 2005 5:25 pm Reply with quoteBack to top

Hi,

When I install "Nuke 7.7 Patched 3.0" (on top of original PHP-Nuke 7.7 version of course), users with a non-default theme cannot logoff properly anymore.

For instance default theme = "DeepBlue" and a user chooses another theme "3DFantasy". When the user presses the logoff/exit button, the browser will go and stay blank with the following url in the address bar (http://path-to-nuke/modules.php?name=Your_Account&op=logout).
However, when you hit the refresh button in your browser (with the above url still in there) the user gets logged off after all.

Normally, the screen would refresh automatically and say "you are now logged out" before going to index.php automatically.

When the user switches back to the default theme, logoff works properly again.

Found a site with exactly the same problem here: http://demo.opensourcecms.com/phpnuke/index.php (login:admin pass:demo)

Could this be a bug in function logout() in modules/Your_Account/index.php or in header.php?

Fatal error: Cannot redeclare opentable() (previously declared in C:\path-to-nuke\themes\3D-Fantasy\tables.php:10) in C:\path-to-nuke\themes\DeepBlue\theme.php on line 10


My suggestion would be here, but I'm unsure.

Code:
function logout() {
   global $prefix, $db, $user, $cookie, $redirect;
   cookiedecode($user);
   $r_uid = $cookie[0];
   $r_username = $cookie[1];
   setcookie("user", false);
   $db->sql_query("DELETE FROM ".$prefix."_session WHERE uname='$r_username'");
   $db->sql_query("DELETE FROM ".$prefix."_bbsessions WHERE session_user_id='$r_uid'");
   $user = "";
   include("header.php");
   OpenTable();
   if ($redirect != "") {
      echo "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=modules.php?name=$redirect\">";
   } else {
      echo "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=index.php\">";
   }
   echo "<center><font class=\"option\"><b>"._YOUARELOGGEDOUT."</b></font></center>";
   CloseTable();
   include("footer.php");
}


How can I solve this little bug?

TIA, Anton!

Reproduced in this way:

- Install PHP-Nuke 7.7 and import nuke.sql
- Create admin account (admin)
- Create a user account (test)
- Copy over Nuke 7.7 Patched 3.0 on top and overwrite files
- Run upgrade.php
- Logoff the phpnuke admin account if logged in.
- Logon as a user and change your theme other than the default (in Your Account)
- Logoff user

Now your browser will go and stay blank until you refresh your window (F5)
Find all posts by sneldownView user's profileSend private message
sneldown
Nuke Cadet
Nuke Cadet


Joined: Jun 03, 2005
Posts: 7


PostPosted: Sat Jun 04, 2005 9:55 am Reply with quoteBack to top

Please move this topic to "Bug Reports".
Find all posts by sneldownView user's profileSend private message
Xyberian
Colonel
Colonel


Joined: Mar 14, 2004
Posts: 1921

Location: Behind you

PostPosted: Sat Jun 04, 2005 10:01 am Reply with quoteBack to top

Hm... I fixed the bug... Geezz.... i don't remember how I fixed it. My site is 7.7 and I fixed it. When I remember it, I will post it. the META tag is not the ultimate solution to fix it out.

_________________
NukeKorea Dev. Network.
NukeKorea Laboratories
Find all posts by XyberianView user's profileSend private messageVisit poster's website
sneldown
Nuke Cadet
Nuke Cadet


Joined: Jun 03, 2005
Posts: 7


PostPosted: Sat Jun 04, 2005 2:12 pm Reply with quoteBack to top

If you could post a solution that would be great! Cool

Just let me know if you remember how you fixed this.
Find all posts by sneldownView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12383


PostPosted: Mon Jun 06, 2005 7:34 am Reply with quoteBack to top

Make sure the theme.php file is called only once

Code:

include_once("themes/$themesel/$theme.php");


never just include()

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
sneldown
Nuke Cadet
Nuke Cadet


Joined: Jun 03, 2005
Posts: 7


PostPosted: Mon Jun 06, 2005 8:06 am Reply with quoteBack to top

Hi Evaders99,

I wish it was that simple, but that trick doesn't work.

This is (among other things) inside of my theme.php of 3DFantasy:

Code:
if(file_exists("themes/3D-Fantasy/tables.php")){
include_once("themes/3D-Fantasy/tables.php");
}


This is (among other things) inside of my header.php

Code:
include_once("themes/$ThemeSel/theme.php");


Unluckily it occurs with every theme that is selected other than the default. Even when everything is set to include_once.

Without the Nuke patched version everything works just fine. It really seems a bug within Nuke Patched.

Maybe you have another idea of why this happens?
Find all posts by sneldownView user's profileSend private message
sneldown
Nuke Cadet
Nuke Cadet


Joined: Jun 03, 2005
Posts: 7


PostPosted: Tue Jun 07, 2005 10:51 am Reply with quoteBack to top

Hi,

I think I solved the problem by commenting out
Code:
include_once("themes/$ThemeSel/theme.php");
in header.php.

So, now every theme works in Nuke Patched 3.0 too. Without problems.


Code:
function head() {
   global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
   include("includes/ipban.php");
   $ThemeSel = get_theme();
//   include_once("themes/$ThemeSel/theme.php");
   echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
   echo "<html>\n";
   echo "<head>\n";
   echo "<title>$sitename $pagetitle</title>\n";
   include("includes/meta.php");
   include("includes/javascript.php");

   if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
      echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
   }
   echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"backend.php\">\n";
   echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
   if (file_exists("includes/custom_files/custom_head.php")) {
      include_once("includes/custom_files/custom_head.php");
   }
   echo "\n\n\n</head>\n\n";
   if (file_exists("includes/custom_files/custom_header.php")) {
      include_once("includes/custom_files/custom_header.php");
   }
   themeheader();
}
Find all posts by sneldownView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12383


PostPosted: Wed Jun 08, 2005 4:00 am Reply with quoteBack to top

So weird.. that means head() must be called more than once somewhere?
I'm glad you found a solution, however awkward.

Edit: I see the problem, it is because mainfile.php also tries to include theme.php, twice!
Code:

if(!defined('FORUM_ADMIN')) {
  $ThemeSel = get_theme();
  include_once("themes/$ThemeSel/theme.php");
}


Why the include_once is not working as intended, I have no idea

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
sneldown
Nuke Cadet
Nuke Cadet


Joined: Jun 03, 2005
Posts: 7


PostPosted: Wed Jun 08, 2005 9:08 am Reply with quoteBack to top

I'd also expect include_once to work as intended, but occasionally solutions to problems aren't straightforward (you probably know that better than I do). Cool

I'll see what is the difference between the original mainfile.php (+ header.php) and the Patched ones.

As I can reproduce it over and over (as described above) on different systems, it really seems a little but nasty bug.

Maybe chatserv can have a look at it, so other users won't experience the same problem in the future.

Thanks a million for your info!

Edit: well, I didn't test Evaders99's info yet BobMarion, so please don't blame me for that.


Last edited by sneldown on Thu Jun 09, 2005 12:16 am; edited 3 times in total
Find all posts by sneldownView user's profileSend private message
BobMarion
Nuke Soldier
Nuke Soldier


Joined: Feb 20, 2003
Posts: 17


PostPosted: Wed Jun 08, 2005 4:58 pm Reply with quoteBack to top

You seem to misunderstand what mainfile is doing. It only includes the theme.php file if it isn't already loaded. Like other scripts have uncovered issues in the YA module this seems to be the case and I'm already looking at a solution which will be posted on my site once I find it.

_________________
Bob Marion
http://www.nukescripts.net
Codito Ergo Sum
Find all posts by BobMarionView user's profileSend private messageVisit poster's website
Xyberian
Colonel
Colonel


Joined: Mar 14, 2004
Posts: 1921

Location: Behind you

PostPosted: Wed Jun 08, 2005 5:00 pm Reply with quoteBack to top

Oh, Bob. you traveled too far away from your site. ha ha.

_________________
NukeKorea Dev. Network.
NukeKorea Laboratories
Find all posts by XyberianView user's profileSend private messageVisit poster's website
BobMarion
Nuke Soldier
Nuke Soldier


Joined: Feb 20, 2003
Posts: 17


PostPosted: Wed Jun 08, 2005 5:59 pm Reply with quoteBack to top

As promised:
http://www.nukescripts.net/modules.php?name=News&file=article&sid=1719

_________________
Bob Marion
http://www.nukescripts.net
Codito Ergo Sum
Find all posts by BobMarionView user's profileSend private messageVisit poster's website
sneldown
Nuke Cadet
Nuke Cadet


Joined: Jun 03, 2005
Posts: 7


PostPosted: Thu Jun 09, 2005 12:30 am Reply with quoteBack to top

Bob, my intention was to report this bug and describe it in detail so anybody could reproduce it. Not just "I got this error, help me!"

I sincerely hope to get PHP-Nuke (Patched) better and more pleasant for users to use it. Any posts previously were just speculation on a possible solution and therefore you shouldn't blame me or Evaders99 for our efforts. Sometimes it is just trial-and-error.

However I'm very glad you are participating in this issue and willing to spend your precious time on possible solutions.

Greetings,
Anton
Find all posts by sneldownView user's profileSend private message
Beta3
Private
Private


Joined: Jul 30, 2005
Posts: 35


PostPosted: Wed Aug 10, 2005 5:59 pm Reply with quoteBack to top

hi,
i have the same problem and just looking for more info or solutions . . .


Any News?


Bye, thanx
Find all posts by Beta3View user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12383


PostPosted: Wed Aug 10, 2005 6:10 pm Reply with quoteBack to top

Try this fix
http://www.nukefixes.com/ftopict-1779.html
The latest one at the bottom of the first post

Tell me that works, I've tested and it seems to work for me

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.555 Seconds - 289 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::