Author |
Message |
ring_c
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/c7cb5e9942d4f3e03d0a8.jpg)
Joined: Dec 28, 2003
Posts: 276
Location: Israel
|
Posted:
Thu Jun 16, 2005 6:15 am |
|
After upgrading Sentinel 2.2.1 to 2.3 (on a phpnuke 6.7 system) my sentinel blocks shows:
Code:You can't access this file directly...
|
The only way to fix it, was replacing the new blocks with the old 2.2.1 blocks.
Would appreciate a more elegant way to figure this out... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Jun 16, 2005 6:27 am |
|
You should see a line of code like this in your block fileCode:if(!defined('NUKE_FILE') && !defined('BLOCK_FILE')) { die("You can't access this file directly..."); }
|
This requires that in mainfile.php you have this as the first line of code after the opening <? tagCode:define('NUKE_FILE', true);
| and also in mainfile, in function render_blocks() you haveCode:function render_blocks($side, $blockfile, $title, $content, $bid, $url) {
define('BLOCK_FILE', true);
|
Do you? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
ring_c
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jun 16, 2005 2:56 pm |
|
Raven wrote: | You should see a line of code like this in your block fileCode:if(!defined('NUKE_FILE') && !defined('BLOCK_FILE')) { die("You can't access this file directly..."); }
| |
Correct. Have checked the 2.2.1 version, found you've used PHP_FILE instead. what's the difference?
Raven wrote: | This requires that in mainfile.php you have this as the first line of code after the opening <? tagCode:define('NUKE_FILE', true);
| |
Should be <?php, isnt's it?
Anyway, after adding the above, my mainfile.php now starts like this:
Code:<?php
define('NUKE_FILE', true);
if (defined('FORUM_ADMIN')) {
@include_once("../../../includes/nukesentinel.php");
} elseif (defined('INSIDE_MOD')) {
@include_once("../../includes/nukesentinel.php");
} else {
@include_once("includes/nukesentinel.php");
}
|
Is this ok?
Raven wrote: | and also in mainfile, in function render_blocks() you haveCode:function render_blocks($side, $blockfile, $title, $content, $bid, $url) {
define('BLOCK_FILE', true);
|
Do you? |
I didn't. added them both. actually, adding only the second line alone did the job. then, why do I need the first one for?
Anyway, is there any place you can direct me to, to test sentinel? Is there a post where you define which configuration is the best protection?
Thanks ALOT, Raven!!! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jun 16, 2005 3:10 pm |
|
<?php is for older installations and scripts. Most installations just allow the short form. using <?php will not hurt anything.
PHP_SELF - Use the newer way, it's more secure.
You need both lines. If it worked with only the second one, then chances are that you now haven 2 instances of define('NUKE_FILE', true); |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
ring_c
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jun 16, 2005 4:23 pm |
|
Quote: |
ou need both lines. If it worked with only the second one, then chances are that you now haven 2 instances of define('NUKE_FILE', true);
|
Nope... have rechecked.
Anyway, what about my second question, please?
Here's a reminder:
Quote: |
Anyway, is there any place you can direct me to, to test sentinel? Is there a post where you define which configuration is the best protection?
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|