1
offside
Protector Module Query
  • 2008/5/19 15:56

  • offside

  • Just popping in

  • Posts: 71

  • Since: 2004/10/7


Hello All,

Trying to install protector module as I am launching my site soon, added the trust path ok, installed module ok. but having a problem in the last step.

when i try adding these lines to the mainfile

define('XOOPS_GROUP_ADMIN', '1');
define('XOOPS_GROUP_USERS', '2');
define('XOOPS_GROUP_ANONYMOUS', '3');

<span style="color: #ff0000;">include( XOOPS_TRUST_PATH . '/modules/protector/include/precheck.inc.php' ) ;</span>
if (!isset($xoopsOption['nocommon']) <span style="color: #0000ff;">&& XOOPS_ROOT_PATH != ''</span> ) {
include XOOPS_ROOT_PATH."/include/common.php";
}
<span style="color: #ff0000;">include( XOOPS_TRUST_PATH . '/modules/protector/include/postcheck.inc.php' ) ;</span>


I get various errors ... like unexpected < on line 90
I am just wondering if its something to do with the code itself or is it just a formatting issue.

would appreciate someone pointing out the code that needs to be added and where?

regards

2
Anonymous
Re: Protector Module Query
  • 2008/5/19 16:13

  • Anonymous

  • Posts: 0

  • Since:


You need to get rid of all the html "span" code, etc, i.e.

define('XOOPS_GROUP_ADMIN''1');
define('XOOPS_GROUP_USERS''2');
define('XOOPS_GROUP_ANONYMOUS''3');

include( 
XOOPS_TRUST_PATH '/modules/protector/include/precheck.inc.php' ) ;
if (!isset(
$xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '' ) {
include 
XOOPS_ROOT_PATH."/include/common.php";
}
include( 
XOOPS_TRUST_PATH '/modules/protector/include/postcheck.inc.php' ) ;


HTH

3
offside
Re: Protector Module Query
  • 2008/5/19 16:43

  • offside

  • Just popping in

  • Posts: 71

  • Since: 2004/10/7


thanks for the quick reply JAvesey, but after adding the code that you provided I am getting a blank page now!

4
Anonymous
Re: Protector Module Query
  • 2008/5/19 17:03

  • Anonymous

  • Posts: 0

  • Since:


Might be a code issue; I hastily edited your code above.

Try this, taken from liones 106-109 of my own mainfile.php:

include XOOPS_TRUST_PATH.'/modules/protector/include/precheck.inc.php' ;
    if (!isset(
$xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
        include 
XOOPS_ROOT_PATH."/include/common.php";
include 
XOOPS_TRUST_PATH.'/modules/protector/include/postcheck.inc.php' ;

5
Anonymous
Re: Protector Module Query
  • 2008/5/19 17:06

  • Anonymous

  • Posts: 0

  • Since:


One thing..... you haven't added those three group defines again have you?

6
offside
Re: Protector Module Query
  • 2008/5/19 20:02

  • offside

  • Just popping in

  • Posts: 71

  • Since: 2004/10/7


Again Thanks Javesey for your help.

here is the code that I have now:


define('XOOPS_GROUP_ADMIN', '1');
define('XOOPS_GROUP_USERS', '2');
define('XOOPS_GROUP_ANONYMOUS', '3');

include XOOPS_TRUST_PATH.'/modules/protector/include/precheck.inc.php' ;
if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
include XOOPS_ROOT_PATH."/include/common.php";
include XOOPS_TRUST_PATH.'/modules/protector/include/postcheck.inc.php' ;



foreach ( array('GLOBALS', '_SESSION', 'HTTP_SESSION_VARS', '_GET', 'HTTP_GET_VARS', '_POST', 'HTTP_POST_VARS', '_COOKIE', 'HTTP_COOKIE_VARS', '_REQUEST', '_SERVER', 'HTTP_SERVER_VARS', '_ENV', 'HTTP_ENV_VARS', '_FILES', 'HTTP_POST_FILES', 'xoopsDB', 'xoopsUser', 'xoopsUserId', 'xoopsUserGroups', 'xoopsUserIsAdmin', 'xoopsConfig', 'xoopsOption', 'xoopsModule', 'xoopsModuleConfig', 'xoopsRequestUri') as $bad_global ) {
if ( isset( $_REQUEST[$bad_global] ) ) {
header( 'Location: '.XOOPS_URL.'/' );
exit();
}
}

if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
include XOOPS_ROOT_PATH."/include/common.php";
}
}
?>

the error that I am getting is: Parse error: syntax error, unexpected $end in mainfile.php on line 116

Thanks again.

7
Anonymous
Re: Protector Module Query
  • 2008/5/19 20:08

  • Anonymous

  • Posts: 0

  • Since:


Quote:
offside wrote:

the error that I am getting is: Parse error: syntax error, unexpected $end in mainfile.php on line 116

Thanks again.


My mainfile.php ends at line 112, and I added a couple of extra lines of comments in mine.

I sent you a PM; my offer still stands

8
offside
Re: Protector Module Query
  • 2008/5/19 20:13

  • offside

  • Just popping in

  • Posts: 71

  • Since: 2004/10/7


your offer is very kind and I do appreciate your wiliness to help mate, but can you not tell what's wrong just by looking at the piece of code that I have just posted... I believe that's the relevant part...

Also the problem occurs only when I add the last bit of code that you have posted.

Regards

9
trabis
Re: Protector Module Query
  • 2008/5/19 21:00

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Javesey, you missed a }

define('XOOPS_GROUP_ADMIN''1');
define('XOOPS_GROUP_USERS''2');
define('XOOPS_GROUP_ANONYMOUS''3');

include 
XOOPS_TRUST_PATH.'/modules/protector/include/precheck.inc.php' ;
if (!isset(
$xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
include 
XOOPS_ROOT_PATH."/include/common.php";
}
include 
XOOPS_TRUST_PATH.'/modules/protector/include/postcheck.inc.php' ;



foreach ( array(
'GLOBALS''_SESSION''HTTP_SESSION_VARS''_GET''HTTP_GET_VARS''_POST''HTTP_POST_VARS''_COOKIE''HTTP_COOKIE_VARS''_REQUEST''_SERVER''HTTP_SERVER_VARS''_ENV''HTTP_ENV_VARS''_FILES''HTTP_POST_FILES''xoopsDB''xoopsUser''xoopsUserId''xoopsUserGroups''xoopsUserIsAdmin''xoopsConfig''xoopsOption''xoopsModule''xoopsModuleConfig''xoopsRequestUri') as $bad_global ) {
if ( isset( 
$_REQUEST[$bad_global] ) ) {
header'Location: '.XOOPS_URL.'/' );
exit();
}
}

if (!isset(
$xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
include 
XOOPS_ROOT_PATH."/include/common.php";
}
}
?>

10
Anonymous
Re: Protector Module Query
  • 2008/5/19 21:45

  • Anonymous

  • Posts: 0

  • Since:


@trabis,

My mainfile.php has a different order, i.e. the groups defines, the pre and postchecks and then the "foreeach" code:

define('XOOPS_GROUP_ADMIN''1');
    
define('XOOPS_GROUP_USERS''2');
    
define('XOOPS_GROUP_ANONYMOUS''3');

    foreach ( array(
'GLOBALS''_SESSION''HTTP_SESSION_VARS''_GET''HTTP_GET_VARS''_POST''HTTP_POST_VARS''_COOKIE''HTTP_COOKIE_VARS''_REQUEST''_SERVER''HTTP_SERVER_VARS''_ENV''HTTP_ENV_VARS''_FILES''HTTP_POST_FILES''xoopsDB''xoopsUser''xoopsUserId''xoopsUserGroups''xoopsUserIsAdmin''xoopsConfig''xoopsOption''xoopsModule''xoopsModuleConfig''xoopsRequestUri') as $bad_global ) {
        if ( isset( 
$_REQUEST[$bad_global] ) ) {
            
header'Location: '.XOOPS_URL.'/' );
            exit();
        }
    }

    include 
XOOPS_TRUST_PATH.'/modules/protector/include/precheck.inc.php' ;
    if (!isset(
$xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
        include 
XOOPS_ROOT_PATH."/include/common.php";
    include 
XOOPS_TRUST_PATH.'/modules/protector/include/postcheck.inc.php' ;
    }
}
?>


The above is pasted from the my mainfile.php and I get no errors; I note that my "postcheck" is placed immediately after the /include/common.php and before the }.

Hopefully between us we've sorted out offside's code

Login

Who's Online

53 user(s) are online (34 user(s) are browsing Support Forums)


Members: 0


Guests: 53


more...

Donat-O-Meter

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

Latest GitHub Commits