Custom Login Form

From TCAdmin 2.0 Documentation
Jump to: navigation, search

Use this sample form. Make sure you change "http://www.tcadmin.com:8880/Interface/Base/Login.aspx" to your control panel's Login.aspx.

<form method="POST" action="http://www.tcadmin.com:8880/Interface/Base/Login.aspx">
  <table border="0">
    <tr>
        <td>User:</td>
        <td><input type="text" name="USERID" size="20"></td>
    </tr>
    <tr>
        <td>Password:</td>
        <td><input type="password" name="PASSWORD" size="20"></td>
    </tr>
  </table>
  <input type="submit" value="Login"><input type="reset" value="Reset">
</form>

Validate a password programmatically

If you want to add custom server side code to your login form you can validate the password with this MySQL query. Replace "Admin" with the user that is logging in and "PASSWORD-HERE" with the password entered by the user. If the value of "correct_password" is 1 the password is correct.

SELECT (SHA2(concat('PASSWORD-HERE', password_salt), 512) = password_hash) as is_valid FROM tc_users WHERE user_name='Admin';