This article describes the XML structure of a login form.
General description
A login form consists of a logo, copyright notice, "Log in" button, and four fields: a username, password, theme, and langauge.
XML description
The following is an example of COREmanager XML form:
<doc lang="ru" func="logon" binary="/core" host="https://127.0.0.1:1500" stylesheet="login" theme="/manimg/orion/" css="main.css" logo="logo.png" logolink="" favicon="favicon.ico" localdir="default/">
<messages name="login" checked="yes">
<msg name="bg">Български</msg>
<msg name="cn">汉语</msg>
<msg name="cs">Český</msg>
<msg name="de">Deutsch</msg>
<msg name="en">English</msg>
<msg name="es">Español</msg>
<msg name="fi">Suomi</msg>
<msg name="fr">Français</msg>
<msg name="hu">Magyar</msg>
<msg name="jp">日本語</msg>
<msg name="ku">کوردی</msg>
<msg name="kz">kz</msg>
<msg name="nl">Nederlands</msg>
<msg name="pl">Polski</msg>
<msg name="pt">Português</msg>
<msg name="ro">Română</msg>
<msg name="ru">Русский</msg>
<msg name="th">ภาษาไทย</msg>
<msg name="ua">Українська</msg>
<msg name="xx">Developer</msg>
<msg name="zh">中文</msg>
<msg name="badagent">The browser you are using is not supported. Supported browsers are Internet Explorer 5.0, Netscape 6 or Mozilla Firefox</msg>
<msg name="cookie">Please enable cookies and try again </msg>
<msg name="">Log in</msg>
<msg name="error">Error:</msg>
<msg name="expirepass">Your password has expired. Set a new one to continue using the control panel.</msg>
<msg name="expirepassbadconfirm">Passwords do not match.</msg>
<msg name="expirepassbadnew">New password must differ from the old one.</msg>
<msg name="fail">Invalid password</msg>
<msg name="lang">Language</msg>
<msg name="loading">Loading</msg>
<msg name="newconfirm">Confirm</msg>
<msg name="newpasswd">New password</msg>
<msg name="noproject">Please, login to the billing panel from the web-site where you want to place an order.</msg>
<msg name="oldpasswd">Old password</msg>
<msg name="passwd">Password</msg>
<msg name="recovery">Password recovery</msg>
<msg name="registration">Registration</msg>
<msg name="theme">Theme</msg>
<msg name="title">Authentication</msg>
<msg name="user">Login</msg>
<msg name="tutorial" added="lang">Video tutorial</msg>
</doc>
messages contains localized messages
copyright copyright notice
loginform information about fields of the login form
loginform
Attributes of the loginform tag contains information about the current interface theme, language, login and password:
@user user login; it used in case of errors and when changing a theme/language
@pwd user password; it used when changing a theme/language
@lang current language
@theme current interface theme
select with languages is generated from the lang tags. The key is the tag's content, the message is taken from the msg, by the key's name.
select with themes is generated frim the theme tags. The key is the value of the @name attribute, the messages - tag's content.
@project, @welcomfunc, @welcomparam, the redirect tadparameters to pass during authentication
messages
The msg messages contain localized interface messages
title a message for the page title
user a message for the "Login" field
theme a message for the "Theme" field
passwd a message for the "Password" field
lang a message for the "Language" field
a message for the "Log in" button
cookie Error messages indicating that cookies are not enabled on your browser
Logo
The path to logo is generated from the @logo and @localdir attributes of the doc tag
@logo name of the file with logo
@localdir relative path to the directory with logo
Error message
If one or several errors occurred, the the following information will be displayed in the doc tag:
<error type="auth" object="badpassword" lang="ru">
<param name="object" type="msg">badpassword</param>
<param name="value"/>
<stack>
<action level="0" user="">auth</action>
</stack>
<detail>Invalid username or password</detail>
<msg>Invalid username or password</msg>
</error>
The error message that should be displayed is located in the msg tag
Actions
Language/theme change
To change a language, call the logon function with theme, lang parameters (Example: func=logon&theme=orion&lang=ru).
To preserver the login and password that a user already entered, pass them with the username and pwd parameters. Send the post request in this case.
Authentication
Call the auth function with the following parameters: username, password, and project, welcomfunc, welcomparam, redirect (if any).
In case of errors, the resulting XML will contain the error tag. See Errors.
If a user has been authenticated successfully, the XML will contain the auth tag with the session id. The page should be restarted by the main address of the control panel.