Jump to content

Require client to Login before Downloads Section becomes Available


nick8701

Recommended Posts

http://forum.whmcs.com/showthread.php?t=7738

 

 

No. Do not add or edit anything in the header.tpl for access to the downloads. What you want to do is put at the beginning of the downloads.tpl file

 

{if $loggedin}

 

and at the very bottom put

 

{else}
Please Login to view downloads section.
{/if}

 

You can change the text above for directions to login. What you are telling the template is IF user is logged in display this, ELSE display this. That is what you are looking for.

 

You will also want to do this for the downloadscat.tpl file as well.

Link to comment
Share on other sites

Hi GopherHosts,

 

Thanks for the suggestion. Is there any way that i can display the login details on the page- so the user can log-in straight away to access the Downloads section???

 

As the suggestion above places text saying "Please Login to view downloads section."

 

Thanks in advance for your help, it is much appreciated.

Link to comment
Share on other sites

{if $loggedin}

<!-- THE CONTENTS OF THE KNOWLEDGEBASE OR DOWNLOAD TPL GOES HERE -->

{else}
<p>{$LANG.loginintrotext}</p>

<form action="{$formaction}" method="post" name="frmlogin">

{if $incorrect}<div class="errorbox">{$LANG.loginincorrect}</div><br />{/if}

<table align="center">
<tr><td align="right">{$LANG.loginemail}:</td><td><input type="text" name="username" size="40" value="{$username}" /></td></tr>
<tr><td align="right">{$LANG.loginpassword}:</td><td><input type="password" name="password" size="25" value="{$password}" /></td></tr>
</table>

<p align="center"><input type="submit" value="{$LANG.loginbutton}" /><br /><input type="checkbox" name="rememberme"{if $rememberme} checked="checked"{/if} /> {$LANG.loginrememberme}</p>

</form>

<p><strong>{$LANG.loginforgotten}</strong> <a href="passwordreminder.php">{$LANG.loginforgotteninstructions}</a>.</p>

<script language="javascript">
document.frmlogin.username.focus();
</script>
{/if}

Link to comment
Share on other sites

Thanks for the information. The login box shows up but when i enter the login details, it doesnt work and i cant login to the website. The login works for the other parts of the website in client area, but it doesnt for the downloads section, maybe theres something to do with your php code where i need to edit some information????

 

Any information around this would be really helpfull.

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated