Tutorials Blog
Hosting
Software
Dolphin Tips
Help Forums FREE Mods
Licensing
People
Donate
News
Search
  •  
 
 
Tutorial
07.23.2008 00:00    Categories: Dolphin     
This question gets asked often. How can I prevent a guest or non-member or from accessing a particular page?

This again is a fairly simple modification. You can apply this to most files in your main directory such as:
yoursite.com/viewPhoto.php

First visit the page as a non-member / guest.

Backup the original yoursite.com/viewPhoto.php just in case.

Now add the following code near the top of the page:
if ( !( $logged['admin'] = member_auth( 1, false ) ) )
{
if ( !( $logged['member'] = member_auth( 0, true ) ) )
{
if ( !( $logged['aff'] = member_auth( 2, false ) ) )
{
$logged['moderator'] = member_auth( 3, false );
}
}
}

Like so:
require_once('inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . 'sharing.inc.php');
require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolSharedMediaView.php');
if ( !( $logged['admin'] = member_auth( 1, false ) ) )
{
if ( !( $logged['member'] = member_auth( 0, true ) ) )
{
if ( !( $logged['aff'] = member_auth( 2, false ) ) )
{
$logged['moderator'] = member_auth( 3, false );
}
}
}

Save file and re-upload overwriting the original.

Re-visit the page as a guest and you should be prompted to login or register to view the page.

This can be applied to most pages in the your main dolphin directory. There are a few files that it shouldn't be as a few files are pulling data from other sources that will cause problems.

So be sure to test after you add the code to each file to make sure it is working.

Also a few files already have this code you just need to change the "false" statement to "true"

Hope this helps!! Happy Modding!!
 
Share It