Custom Login Form

From TCAdmin 2.0 Documentation
Jump to: navigation, search

Use this sample form. Make sure you change "" to your control panel's Login.aspx.

<form method="POST" action="">
  <table border="0">
        <td><input type="text" name="USERID" size="20"></td>
        <td><input type="password" name="PASSWORD" size="20"></td>
  <input type="submit" value="Login"><input type="reset" value="Reset">

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';