Privating Pages

Hi, I was wondering how you can private pages for such as schedules so members only can see it,

Im using obsess blue and i dont which files to put them in for example schedules.

Thanks

Hi, I was wondering how you can private pages for such as schedules so members only can see it,

Im using obsess blue and i dont which files to put them in for example schedules.

Thanks

I know how to. Let me get my coding and i’ll post it here for you. Give me a few mins to make sure it works.

Ok, here the thing. You really need to look and read this careful

This is the part of a code to block non-members to not see the pages.

/* Block non-members to access this page */
	if(!Auth::LoggedIn())
	{
		$this->set('message', 'You are not logged in!');
		$this->render('core_error.tpl');
		return;
	}
	/* End of access denined */

In the modules folder, like for a example, Schedules.php in the Schedules folder. (core/Modules/Schedules/Schedule.php)

Find this line 26 - 35

public function view()
{
	if(isset($this->post->action) && $this->post->action == 'findflight')
	{
		$this->FindFlight();
		return;
	}

	$this->showSchedules();
}

Say this is accessible for non-members. Now you want to add the first code above i posted it…

Now here is the new code that non-members won’t see the page.

public function view()
{
	/* Block non-members to access this page */
	if(!Auth::LoggedIn())
	{
		$this->set('message', 'You are not logged in!');
		$this->render('core_error.tpl');
		return;
	}
	/* End of access denined */

	if(isset($this->post->action) && $this->post->action == 'findflight')
	{
		$this->FindFlight();
		return;
	}


	$this->showSchedules();
}

Then it will block non-members to see the page.

This applies to all skins.

Hope this helps. Just the same as other pages, but put it after public function view just like i posted the code.