Jump to content

Require login for server status page


chomick

Recommended Posts

Hello,

 

How do I require clients to login to view the server status page?

 

Thank you in advance,

Chris

 

Open serverstatus.tpl and put the following code at the top of the file:

 

{if $loggedin}

Then at the bottom of the file add this:

 

{else}
<p>Please <a href="clientarea.php">login to your account</a> to use this function.</p>
{/if}

You should be good to go.

Link to comment
Share on other sites

Hello uberhost,

 

I can't thank you enough for your help. :)

 

I ended doing the following--

 

I opened serverstatus.tpl and added the following code at the top of the file:

 

{if $loggedin}

 

Then at the bottom of the file I added this:

 

{else}
You must login to access this page. These login details differ from your websites control panel username and password.</p>

<form action="dologin.php?goto=serverstatus" method="post">

<table align="center">
<tr><td align="right">Email Address:</td><td><input type="text" name="username" size="40" value="" /></td></tr>
<tr><td align="right">Password:</td><td><input type="password" name="password" size="25" value="" /></td></tr>
</table>

<p align="center"><input type="submit" value="Login" /><br /><input type="checkbox" name="rememberme" /> Remember Me</p>

</form>

<p><strong>Forgotten your password?</strong> <a href="passwordreminder.php">Request a Password Reminder by clicking here</a>.</p><br />
{/if}

 

Works like a charm! :)

 

Thank you again,

Chris

Link to comment
Share on other sites

Hi,

 

I changed your last coding part to support the language files

 

 

{else}

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

 

<form action="dologin.php?goto=serverstatus" method="post">

 

<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"{$rememberme}> {$LANG.loginrememberme}</p>

</form>

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

{/if}

Link to comment
Share on other sites

  • 3 weeks later...

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