|
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)
|
|
|
|
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.
|
|
|
|
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
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
Joined: Aug 2002
Posts: 45 |
Is it easy to make it redirect to the register page ?
|
|
|
|
Joined: Dec 2000
Posts: 1,471
Addict
|
Addict
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
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');
|
|
|
|
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');
|
|
|
|
Joined: Aug 2002
Posts: 45
User
|
User
Joined: Aug 2002
Posts: 45 |
|
|
|
|
Joined: Dec 2000
Posts: 1,471
Addict
|
Addict
Joined: Dec 2000
Posts: 1,471 |
|
|
|
|
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. =]
|
|
|
|
Joined: Aug 2002
Posts: 45
User
|
User
Joined: Aug 2002
Posts: 45 |
Now I get a blank page for search.php 
|
|
|
|
Joined: Dec 2000
Posts: 1,471
Addict
|
Addict
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');
|
|
|
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.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|