Article Contents Related Articles Tags
  • No tags found.
Was This Helpful? Last Updated
  • 2012/07/09

Custom Login Forms

Note that this example is for a traditional form submission model. Click here for information on creating a custom ajax login form that doesn't reload the page.

By default, the program generates a login page using the template system. However if you wish to create your own login page, you can do so by following these simple steps.

Form Components

myForm.php

Note that the form needs to be a ".php" file to take advantage of error codes.
<form action="/members/login.php" method="post">
<?php
if ($_GET['code'] == 'e1') {
	echo "<p class=form_error>Incorrect login credentials.</p>";
}
?>
Username: <input type="text" name="username" value="" />
Password: <input type="password" name="password" value="" />
<input type="hidden" name="action" value="login" />
<input type="submit" value="Login" />
</form>

Required Field Components

Field NamePurposeRequired Value
usernameAccount username.N/A
passwordAccount password.N/A

Optional Field Components

Field NamePurposeRequired Value
ssgCSV (comma separated) list of protected folder IDs to log the user into.N/A. If empty, the system will log the user into all of the protected folders the account has access to.
urlFull URL to which the user will be redirected upon login.N/A
show_member_cpDetermines whether to redirect the user to the member control panel at login, overriding all other login redirection rules.1 or 0
rememberStandard "remember me" feature which will save the user's session for 30 days unless he/she logs out.1 or 0

Error Status Codes

When an error occurs, the program will redirect the user back to your custom login form along with a status error code in a standard "GET" field named "code".

Status CodeMeaning
e1Incorrect login credentials.
e2Username not provided.
e3Account locked due to excessive failed login attempts.
e4Account not valid: registration still pending completion.
e5Account pending email confirmation.
e6Account rejected by administrator.
e7Account pending administrative approval.
e8Account paused by administrator.
e9Account expired.
e10Maximum login limit for this account reached.
e11Concurrent login notice. Someone else with a different IP is logged into this account already.
e12Login rejected because the account has been locked to a different IP address.
e13Trackstat violation.
e14CMS login required.
p01Lost password recovery success (method 1).
p02Lost password recovery success (method 2).

Setting Your Form as The Default Login Form

By default the program will automatically use the template-generated form as the default program's login page. If you wish to use your form instead of the default login form, do the following:

  • From the control panel, click on Settings
  • Under "Login Options", input the full URL to your login form in the Default Login Page option.