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, 121 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 - is_admin($admin) function problems - no data in $admin [ ]
 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
MGCJerry
Elite Nuker
Elite Nuker


Joined: Jun 16, 2003
Posts: 220


PostPosted: Sat Jun 05, 2004 11:01 pm Reply with quoteBack to top

I've decided to see if I can upgrade to the latest version of nuke (7.3), but it appears to have a problem recognizing the is_admin() function.

It appears to work on some pages but not on others. I've scoured the source code and cant seem to figure out why I cannot use is_admin($admin). I've tried echoing $admin, but nothing turns up. When I echo is_admin($admin), it returns 0.

It is imperative that I can get this working or else I cannot go any farther in seeing if I can use the new version of nuke.

In my mainfile, I have a custom hack tracking script that can detect if an admin is trying the attacks, and if it is a non-admin trying them. Heres what I got in my "mainfile.php"...

Code:

//detect hack attempt code... if ereg(blah) {
    hack_buster();
    exit;
}

function hack_buster() {
    global $admin, $user, $ereg;
    if(is_admin($admin)) {
        $admin = explode(":",base64_decode($admin));
        echo "<html>\n\n<head>\n"
            ."<title>What the heck?</title>\n</head>\n\n<body>\n"
            ."<pre>Umm... Excuse me $admin[0], but what the hell are you doing?_</pre>\n"
            ."</body>\n\n</html>";
        exit;
    } else {
        // MESSAGE TO HACKERS
        // Various banning and emailing code...
        exit;
}


The problem is that this function (located in mainfile.php) cannot tell if an admin is testing injections or not. It blindly bans everyone. I have already modified this version of nuke quite a bit, but it did this before my edits. I was hoping that my edits would allow me to use it, but so far I've had no luck.

What do I have to do to get this where I can use this function once again? Why does the $admin variable show up on only a few pages?

PHPNuke 7.3
PHP 4.3.2
Apache 1.3.31
MySQL 3.26.54

Thanks...

_________________
Original creator of
* Fetch Mod
* RPG Races Module
* 2 The Xtreme Theme
Find all posts by MGCJerryView user's profileSend private message
NukeFanatic
Sergeant
Sergeant


Joined: May 20, 2004
Posts: 89


PostPosted: Sun Jun 06, 2004 4:06 pm Reply with quoteBack to top

A few things:

You must of course "include" the file that contains the is_admin() and hack_busters()
function.
Your prolly already doing this though
the good news is that the is_admin() function does work (as far as i know)
I dnt know how attached you are to your current install, perhaps
bring a copy local and debug
Dont forget about "variable scope" when using $admin in a function

Also i have found in debugging problems that is helpfull to restate the problem i
simplest terms. For example is the following another way of stating the problem your
having:

I recently upgraded a nuke site version 6.87 to the versin 7.3 using the included upgrade
script and now some of the custome code i have put in does not work

or

Why does a variable not show up in the membersList module.

basically im asking yu to narrow down you issue and try to be specific and include
lots of info.

1) did you try a fresh install of 7.3
2) what version did you upgrade from
3) did you put in your mods b4 or after the upgrade
4) pick a functin/module/block that does not work and lest focus on it

don
Find all posts by NukeFanaticView user's profileSend private message
MGCJerry
Elite Nuker
Elite Nuker


Joined: Jun 16, 2003
Posts: 220


PostPosted: Sun Jun 06, 2004 7:44 pm Reply with quoteBack to top

Thanks for the response NukeFanatic.

Yes, I include the proper file (mainfile.php) into my scripts. However, the problematic code is *in* mainfile, the same file where is_admin() is located.

Anyways, An hour or so after posting this I ran across something and so far it seems to be working. More on this later...

I always to my "testing" locally before commiting anything online. I presently have 3 versions of nuke on my test site. So far, I'm fairly impressed with 7.3. Now maybe I can get some of my stuff working on 7.3. Smile

1. Yes, I tried it with a fresh install. Didnt work.
2. No upgrade yet. Started from scratch. I may upgrade from 5.6 to 7.3.
3. None. Tested with mods and without. No luck
4. Dont think its necessary now I traced the problem.

Anyways, onto the solution...

I noticed that Union Tap was the culprit. After moving it below the "output buffering" code, it works fine now. Smile

Thanks for the help NukeFanatic.

_________________
Original creator of
* Fetch Mod
* RPG Races Module
* 2 The Xtreme Theme
Find all posts by MGCJerryView user's profileSend private message
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 - TUTTISU E-COMMERCE http://www.tuttisu.it
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.060 Seconds - 274 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::