Jump to content

Restrict download page only to logged in pilots


Alex

Recommended Posts

how can i restrict access to my downloads page only to logged in pilots.

i tried this

<?php

if(!Auth::LoggedIn())

{

?>

<li><a href="<?php echo SITE_URL ?>/index.php/registration"><strong>Register</strong></a></li>
   <li><a href="<?php echo url('/login'); ?>"><strong>Pilot Log In</strong></a></li>

<?php

}

else

{

?>

<li><a href="<?php echo SITE_URL ?>/index.php/downloads"><strong>Downloads</strong></a></li>




<?php

but that doesnt work

Link to comment
Share on other sites

how can i restrict access to my downloads page only to logged in pilots.

i tried this

<?php

if(!Auth::LoggedIn())

{

?>

<li><a href="<?php echo SITE_URL ?>/index.php/registration"><strong>Register</strong></a></li>
   <li><a href="<?php echo url('/login'); ?>"><strong>Pilot Log In</strong></a></li>

<?php

}

else

{

?>

<li><a href="<?php echo SITE_URL ?>/index.php/downloads"><strong>Downloads</strong></a></li>




<?php

but that doesnt work

Switch the

<li><a href="<?php echo SITE_URL ?>/index.php/registration"><strong>Register</strong></a></li>
<li><a href="<?php echo url('/login'); ?>"><strong>Pilot Log In</strong></a></li>

With the

<li><a href="<?php echo SITE_URL ?>/index.php/downloads"><strong>Downloads</strong></a></li>

?

Link to comment
Share on other sites

Mark is right. Downloads page is, by default, only available to logged in users.

Open up core/modules/Downloads/Downloads.php and check, it should look something like this:

class Downloads extends CodonModule
{

public function index()
{
	if(!Auth::LoggedIn())
	{
		echo 'You must be logged in to access this page!';
		return;
	}

	$this->set('allcategories', DownloadData::GetAllCategories());
	$this->render('downloads_list.tpl');
}

And so on.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...