Jump to content

How to require login to view server status?


Recommended Posts

This might be wrong, but I think it's something like

 

{if $loggedin}
## Status Code ##
{else}
Please login to view this page.
## login box ##
{/if}

 

Obviously you will need to change the text and where the #'s are for your own needs. But edit the status page template and that should work.

Link to comment
Share on other sites

  • 1 month later...
Thanks for that i have just added that to mine, last time i tried to insert my own code it messed up :( lol

 

Dan

 

 

The code above is correct, try the below. Check your code...

 

{if $loggedin}
      <p>{$LANG.serverstatusheadingtext}</p>

    <table class="clientareatable" align="center" cellspacing="1">
      <tr class="clientareatableheading">
       <td>{$LANG.servername}</td>
       <td>HTTP</td>
       <td>FTP</td>
      <td>POP3</td>
      <td>{$LANG.serverstatusphpinfo}</td>
     <td>{$LANG.serverstatusserverload}</td>
    <td>{$LANG.serverstatusuptime}</td>
  </tr>
{foreach key=num item=server from=$servers}
  <tr class="clientareatableactive">
    <td>{$server.name}</td>
    <td>{get_port_status num="$num" port="80"}</td>
    <td>{get_port_status num="$num" port="21"}</td>
    <td>{get_port_status num="$num" port="110"}</td>
    <td><a href="{$server.phpinfourl}" target="_blank">{$LANG.serverstatusphpinfo}   </a></td>
    <td>{$server.serverload}</td>
    <td>{$server.uptime}</td>
  </tr>
{foreachelse}
  <tr class="clientareatableactive">
    <td colspan="7">{$LANG.serverstatusnoservers}</td>
  </tr>
{/foreach}
 </table>
{else}
                              <p>{$LANG.loginintrotext}</p>
                               <table width="100%" border="0" cellpadding="2" cellspacing="1" class="navbar">
                                <tr>
                                 <td class="navbox">
                                  <form method="post" action="dologin.php">
                                   {if $incorrect}<div class="errorbox">{$LANG.loginincorrect}</div>{/if}
                                       <div align="center">
                                        <strong>{$LANG.clientlogin}</strong><br />
                                         <img src="images/spacer.gif" width="1" height="5" /><br />
                                          <table border="0" cellspacing="0" cellpadding="1">
                                           <tr>
                                            <td><div align="right"><span class="smalltext">{$LANG.loginbutton}:</span></div></td>
                                            <td><input name="username" type="text" class="navinput" style="width: 215px" /></td>
                                           </tr>
                                           <tr>
                                            <td>
                                             <div align="right"><span class="smalltext">{$LANG.loginpassword}:</span></div>
                                            </td>
                                            <td> <input name="password" type="password" class="navinput" style="width: 213px" /></td>
                                           </tr>
                                          </table>
                                            <input type="checkbox" name="rememberme" />{$LANG.loginrememberme}  
                                            <input type="submit" value="{$LANG.loginbutton}" />        <br>
                                            <br>
                                            <br>
                                            <p><strong>{$LANG.loginforgotten}</strong>
                                            <a href="passwordreminder.php">{$LANG.loginforgotteninstructions}</a>.</p>
                                       </div>
                                   </form>
                                 </td>
                               </tr>
                            </table>
                         {/if}

Link to comment
Share on other sites

I did it and it worked i was just mentioning when i tried to play with something in the invoice template with the if/else it just messed up.

 

I might use the login code u put tho i didnt bother with that i just put a message to login :)

 

Thanks,

Dan

Link to comment
Share on other sites

  • 1 year 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