# Download Section Restriction

**URL:** <https://forum.phpvms.net/t/download-section-restriction/4396>\
**Category:** phpVMS Legacy Support (v2/v5)\
**Created:** [March 29, 2011, 9:44am UTC](https://forum.phpvms.net/t/download-section-restriction/4396 "2011-03-29T09:44:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaun105](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@shaun105](https://forum.phpvms.net/u/shaun105)\
**Post date:** [March 29, 2011, 9:44am UTC](https://forum.phpvms.net/t/download-section-restriction/4396/1 "2011-03-29T09:44:07Z")

</div>

Hi All,

Am I the only one or do other CEOs get the same problem. Do you find that some people join your VA for the sake of downloading what they can and have no intention of flying?

Is there a way to restrict download section access to pilots unless they have completed a set number of hours say…10hrs. Then this can be lifted so they can gain access to scenery, aircraft ect. Just an idea would be set the initial account to student (without download access) Once 10 hours have been flown, the account is progressed to download section access.

---

<div class="post-metadata">

**Author:** ![James142](https://forum.phpvms.net/user_avatar/forum.phpvms.net/james142/32/92_2.png) [@James142](https://forum.phpvms.net/u/James142)\
**Post date:** [March 29, 2011, 3:11pm UTC](https://forum.phpvms.net/t/download-section-restriction/4396/2 "2011-03-29T15:11:09Z")

</div>

> Hi All,
> 
> Am I the only one or do other CEOs get the same problem. Do you find that some people join your VA for the sake of downloading what they can and have no intention of flying?
> 
> Is there a way to restrict download section access to pilots unless they have completed a set number of hours say…10hrs. Then this can be lifted so they can gain access to scenery, aircraft ect. Just an idea would be set the initial account to student (without download access) Once 10 hours have been flown, the account is progressed to download section access.

I got this code from Lorathon a while back:

```
<?php
if(AUTH::$userinfo->totalhours > 10)
{
   // show-do your stuff here
}
else
{
   echo "You do not have enough hours to view this page";} ?>

```

So maybe add the code in your downloads.tpl file?

---

<div class="post-metadata">

**Author:** ![Tom](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://forum.phpvms.net/u/Tom)\
**Post date:** [March 29, 2011, 3:36pm UTC](https://forum.phpvms.net/t/download-section-restriction/4396/3 "2011-03-29T15:36:12Z")

</div>

In core/modules/Downloads/Downloads.php:

```
public function index()
{
	if(!Auth::LoggedIn())
	{
		echo 'You must be logged in to access this page!';
		return;
	}
	if(Auth::$userinfo->totalhours < 10){
		echo 'You are not permitted access to downloads yet.';
		return;
	}

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

```

Slightly smaller and easier to manage than the above

---

<div class="post-metadata">

**Author:** ![shaun105](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@shaun105](https://forum.phpvms.net/u/shaun105)\
**Post date:** [March 29, 2011, 8:28pm UTC](https://forum.phpvms.net/t/download-section-restriction/4396/4 "2011-03-29T20:28:22Z")

</div>

Cheers Guys much appreciated… with the existence of the code I take it others do have a problem with download file reapers?

Thanks again

---

<div class="post-metadata">

**Author:** ![5SA\_CEO](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/5/ed655f/32.png) [@5SA\_CEO](https://forum.phpvms.net/u/5SA_CEO)\
**Post date:** [March 30, 2011, 12:49pm UTC](https://forum.phpvms.net/t/download-section-restriction/4396/5 "2011-03-30T12:49:04Z")

</div>

HI,

I found that you can link an aircraft to a rank and there fore stop folk downloading an aircraft till they have reached a rank level.

In the admin centre page, Airline operations, add & edit Fleet, at the bottom you can set it up so that you need aminimum rank to fly thus the pilot has to fly hours to get a bigger and better aircraft.

just another way, without having to do do any coding.

hope this helps a little.

---

<div class="post-metadata">

**Author:** ![shaun105](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@shaun105](https://forum.phpvms.net/u/shaun105)\
**Post date:** [March 30, 2011, 9:14pm UTC](https://forum.phpvms.net/t/download-section-restriction/4396/6 "2011-03-30T21:14:15Z")

</div>

Cheer Dean

I knew about that one. It was not just aircraft but all the other downloads.

Cheers
