SmartFAQ is developed by The SmartFactory (https://www.smartfactory.ca), a division of InBox Solutions (https://www.inboxsolutions.net)

How do you disable the check for referrer information?
If you have users on your own site who cannot post in forums or add other information to the site due to their firewall or some other software that is blocking the referrer information, then you may want to turn off the referrer check in the XOOPS code.

For more info about the referrer information problem, check out this question:

https://xoops.org/modules/smartfaq/faq.php?faqid=9

[There is a comment with detailed instructions for fixing the problem from the firewall end, but that requires all your users with the problem to successfully follow those steps, which chances are they will not all do, hence the need to be able to turn off the check in your XOOPS site.]

To turn off the referrer check, add a line to the function xoops_refcheck() in include/functions.php file, around line 137:

function xoops_refcheck($docheck=1)
{
   [
color=ff0000]return true;#*#DISABLE_REFERER_CHECK#[/color]
   
$ref xoops_getenv('HTTP_REFERER');
   if (
$docheck == 0) {
      return 
true;
   }
   if (
$ref == '') {
      return 
false;
   }
   if (
strpos($refXOOPS_URL) !== ) {
      return 
false;
   }
   return 
true;
}


This information applies to XOOPS 2.0.7, and possibly earlier and later versions too. (Hopefully a system configuration option will be added in the future to turn this off without a hack).

Thanks to Mithrandir for this information, found in his post in the following thread:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=25989


The comments are owned by the author. We aren't responsible for their content.
Author
Thread
user

 this FAQ is too dangerous, isn't this?


Well, I'm not a professional. But, as far as I know, it is very risky to disable "referrer-check" because turning off the check makes the web sites more vulnerable to CSRF attacks.

function xoops_refcheck($docheck=1)
{
$ref xoops_getenv('HTTP_REFERER');
if (
$docheck == 0) {
return 
true;
}
if (
$ref == '') {
[
d]return false;[/d]//the very original
[b][color=ff0000]return [u]true[/u];[/color][/b]//hacked code
}
if (
strpos($refXOOPS_URL) !== ) {
return 
false;
}
return 
true;
}


Instead, the code above is rather safer than the one on FAQ. Bear in mind, ALL the webmaster MUST turn on "referrer" so as to protect your site.

Last but not least, all the thanks goes to GIJOE since this hack is originally introduced by him.

EDITED:
Well...the original code returns "FALSE" when referrer information is empty. On the other hand, the hacked code returns "TRUE". As a result, it disables referrer-check for those who doesn't send referrer.

So this hack in introduced for the convenience of USERS who don't know what referrer is and what their firewall does.

 
Replies
Author
Published
02/12/2005 15:14
05/16/2005 3:01
05/16/2005 3:21
                Re: this FAQ is too dangerous, isn't this?
05/16/2005 7:34
                  Re: this FAQ is too dangerous, isn't this?
11/09/2005 18:38
                    Re: this FAQ is too dangerous, isn't this?
01/06/2006 1:50
                    Re: this FAQ is too dangerous, isn't this?
04/24/2006 13:02
Author
Thread
user

 Cannot Login


If I am not wrong I checked every possible related issue to solve my problem but when I try none of them will work. Here what happen to my site

I cannot login (admin) and none (user) can login. After I login it says :

"Thank you for login in Macsite"

But it will go back to the same page without login to my website.

Can anyone tell me which file or what code need to be modify. Thank you.

 
Replies
Author
Published
10/09/2006 22:50
Author
Thread
user

 Solution - check .htacess


I was having a similar problem and had the .htacess file set to change mysite.com to www.mysite.com. This was preventing me from getting to the admin area on a brand new installation.

 


Login

Who's Online

254 user(s) are online (2 user(s) are browsing XOOPS FAQ)


Members: 0


Guests: 254


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Did you know ?

that you can open your closed site in the database when you canĀ“t login anymore?

Random question

What is a module?