company logo

DatabaseContext :: checkLogin - Check user's login

The Login function can be overloaded in the application database context. The default implementation checks the extent passed in sUserExtent (ADM_User is default) for the given user name. The default order for this extent must be the user's login name.

When the user's name passed in sUserName can be located in the users extent, the password is checked comparing the password passed in sPassword with the content of the property value in the property with the name sPasswordName. When an empty name has been passed, password is assumed as property name for the password.

When the password check completed successfully, the function returns the user identification, which is the value stored in the property with the name passed in sUserName. When the property name for the user identification is empty, __GUID is supposed to contain the user's identification.

User's name and user's identification are stored in options __USER_NAME and __USER_ID and can be retrieved by Option::toString().

Return value:  User identification ( odaba::String & )

Implementation details

  1. Check user's login
    odaba::String DatabaseContext  :: checkLogin ( odaba::String &sUserName, odaba::String &sPassword, odaba::String &sUserExtent, odaba::String &sPasswordName, odaba::String &sUserIdName )

    The function allows passing an extent name for the user collection (sUserExtent), the attribute name for the password attribute (sPasswordName) and the user attribute name for locating the user in the collection (sUserIdName).

    • sUserName - User name

      The user name is the user's login name. In order not to pass any user name, an empty string ( String() )may be passed.

    • sPassword - User's password
    • sUserExtent - Extent name for user administration

      The extent name for user administration can be chosen differently in an application.

      When no or an empty user extent name is passed, the default extent ADM_User is used.

    • sPasswordName - Field containing user's password information

      The field can be defined differently in an application depending on the defined data type for user administration.

    • sUserIdName - Property name for internal user identification

      The internal user id property can be defined differently in an application depending on the defined data type for user administration.

  2. to list
  3. Check user's login
    odaba::String DatabaseContext  :: checkLogin ( odaba::String &sUserName, odaba::String &sPassword )

    When the user's name passed in sUserName can be located in the default extent (ADM_User), the password is checked comparing the password passed in sPassword with is compared with the password attribute value for the selected user.


    • sUserName - User name

      The user name is the user's login name. In order not to pass any user name, an empty string ( String() )may be passed.

    • sPassword - User's password
  4. to list