ProjectContext :: executeLogin - Execute login
The function may be implemented in order to check user name and password before opening the database. One may implement any kind of login process in the ProjectContext::doBeforeOpen() handler, but when implementing this function, it will be called automatically also, when login is requested for the database by calling the DatabaseContext::login() function in the DatabaseContext::doBeforeOpen() handler.
The function will be called from database context when opening a database in order to verify user's login data. The default implementation opens a dialog for requesting user name and password. The user name is looked up in the collection passed in rProperty. The password is assumed to be stored in the password attribute defined for user instances in rProperty. When no password has been defined so far, the password entered by the user will be stored in the password attribute for the user.
The function can be implemented as function in the project context class in order to provide login procedures for GUI applications. Typically, it will be called in the doBeforeOpen() handler of the project context class.
The property handle passed to the function is usually the property handle for the ADM_User extent. Depending on specific login requirements, however, any other property handle can be passed. When using the default login function (without overloading executeLogin()), user instances passed in rProperty have to be ordered by login name and have to contain a password attribute.
When login was refused, the function returns false and the application terminates.
// calls executeLogin implemented in database context
// for console applications or executeLogin implemented in
// project context for GUI applications
int32 myDBContext::doBeforeOpen() {
return ( login(ADM_User) );
}
// GUI application login, only
int32 myProjectContext::doBeforeOpen() {
return ( executeLogin(ADM_User) );
}
A State true indicates, that the function was executed successfully. Otherwise state is false.
Implementation details
- rProperty - Propery handle