Previous Thread
Next Thread
Print Thread
Rate Thread
#228393 11/26/2002 9:36 PM
Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
Where was this Search restriction for members only hack? I can't seem to find it (at least not for version 6.1.1)

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Just took a quick look.

Didn't test... but this should work. Let me know... I've worked a couple of long days with very little sleep and may have missed something:

code:

In search.php find this:


// -----------------
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Groups");
if (!$user['U_Groups']) {
$user['U_Groups'] = "-4-";
}



Change to this:


// -----------------
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Groups,U_Username");
if (!$user['U_Groups']) {
$user['U_Groups'] = "-4-";
}


// ----------------------
// Block them if they are not registered by JoshPet
if (!$user['U_Username']) {
$html = new html;
$html -> not_right ('You must be registered and logged in to use the Search feature.',$Cat);
}




That should do it for ya. Let me know how it works.

Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
Seems to work. Won't work with the IIP quick search feature on the front page though.

Thanks again.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK - one more place should stop the IIP from being able to do it.

It submits directly to the dosearch.php script.

In dosearch.php

Find this:
code:

// -----------------
// Get the user info
$userob = new user;
$html = new html;
$user = $userob -> authenticate("U_Groups,U_TimeOffset,U_Display");
$Username = $user['U_Username'];



BELOW it ADD this:

code:


// ----------------------
// Block them if they are not registered by JoshPet
if (!$Username) {
$html = new html;
$html -> not_right ('You must be registered and logged in to use the Search feature.',$Cat);
}



That should do it for IIP. Let me know.

Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
I'm begining to understand how this crazyness works.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah the ! before the variable checks "if there is no value".

So if there isn't a value for Username (ie they are not logged in) then they get the "not right" page which is a generic error page function in threads.

In that not right line, we define what the error message says. (ie you must be logged in)

if there is a value for username (ie they are logged in) then it skips that whole step and just goes on as normal.

The search.php page collects the information to search. You could have gotten by with just doing it in dosearch. But then people would fill out the search form, only to THEN find out they can't search. So adding it into search.php stops them before they can enter any info.

The IIP box collects the info and just goes right to dosearch.

I hadn't thought about the IIP box being a backdoor in.

Now I think all search doors are closed.

I think "show all posts by this user" and "last 24 hours" etc... all use the dosearch script. So this same restriction would be on those functions as well.


Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
... the ! before the variable checks "if there is no value" ...

Unless the value happens to be 0 or "0", but the minimum length check and possibly other checks would prevent that from happening.

Joined: Aug 2002
Posts: 45
User
User
Offline
Joined: Aug 2002
Posts: 45
Is it easy to make it redirect to the register page ?

himik #228401 01/21/2003 10:23 AM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
// ----------------------
// Block them if they are not registered by JoshPet
if (!$Username) {
$html = new html;
$html -> send_header($ubbt_lang['TEXT_SEARCH'],$Cat,<meta http-equiv="Refresh" content="5;url={$config['phpurl']}/ubbthreads.php?Cat=$Cat&Board=$Board" />",'0');
$html -> not_right ('You must be registered and logged in to use the Search feature.',$Cat);
}

This will redirect the users to ubbtheads.php after 5 seconds

Joined: Aug 2002
Posts: 45
User
User
Offline
Joined: Aug 2002
Posts: 45
I got an error for this line

$html -> send_header($ubbt_lang['TEXT_SEARCH'],$Cat,<meta http-equiv="Refresh" content="5;url={$config['phpurl']}/ubbthreads.php?Cat=$Cat&Board=$Board" />",'0');

Sponsored Links
himik #228403 01/21/2003 11:44 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Looks like it should be this:

$html -> send_header($ubbt_lang['TEXT_SEARCH'],$Cat,<meta http-equiv="Refresh" content="5" url="{$config['phpurl']}/ubbthreads.php?Cat=$Cat&Board=$Board" />",'0');


Daine #228404 01/21/2003 11:51 AM
Joined: Aug 2002
Posts: 45
User
User
Offline
Joined: Aug 2002
Posts: 45
Same mistake again

himik #228405 01/21/2003 12:04 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
What kind of error?

Daine #228406 01/21/2003 12:05 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
No, the syntax was correct I believe, but there was a missing ". Try this:

$html -> send_header($ubbt_lang['TEXT_SEARCH'],$Cat,"<meta http-equiv="Refresh" content="5;url={$config['phpurl']}/ubbthreads.php?Cat=$Cat&Board=$Board" />",'0');

This is untested, but the missing " should definately be there at least. =]

c0bra #228407 01/21/2003 12:17 PM
Joined: Aug 2002
Posts: 45
User
User
Offline
Joined: Aug 2002
Posts: 45
Now I get a blank page for search.php

himik #228408 01/21/2003 12:37 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Hehe ok, it was a missing ", at the beginning of the meta tag.

This should do it:
$html -> send_header($ubbt_lang['TEXT_SEARCH'],$Cat,"<meta http-equiv="Refresh" content="5;url={$config['phpurl']}/ubbthreads.php?Cat=$Cat&Board=$Board" />",'0');


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)