Skip to content

Authentication

David Janssens edited this page May 30, 2025 · 1 revision
classDiagram
    class icms_auth_Object {
        -_dao : object
        -_errors : array
        +__construct(dao)
        +authenticate(uname, pwd) : bool
        +setErrors(err_no, err_str) : void
        +getErrors() : array
        +getHtmlErrors() : string
    }

    class icms_auth_Xoops {
        +__construct(dao)
        +authenticate(uname, pwd) : icms_member_user_Object
    }

    class icms_auth_Ldap {
        +ldap_server : string
        +ldap_port : string
        +ldap_version : string
        +ldap_base_dn : string
        +ldap_loginname_asdn : string
        +ldap_loginldap_attr : string
        +ldap_mail_attr : string
        +ldap_name_attr : string
        +ldap_surname_attr : string
        +ldap_givenname_attr : string
        +ldap_manager_dn : string
        +ldap_manager_pass : string
        +_ds : resource
        +__construct(dao)
        +cp1252_to_utf8(str) : string
        +authenticate(uname, pwd) : bool
        +getUserDN(uname) : string
        +loadicms_member_user_Object(userdn, uname, pwd) : icms_member_user_Object
    }

    class icms_auth_Ads {
        +__construct(dao)
        +authenticate(uname, pwd) : bool
        +getUPN(uname) : string
    }

    class icms_auth_Factory {
        <<static>>
        +getAuthConnection(uname) : icms_auth_Object
    }

    class icms_auth_Provisionning {
        -_auth_instance : icms_auth_Object
        +default_TZ : string
        +theme_set : string
        +com_mode : string
        +com_order : string
        +__construct(auth_instance)
        +getInstance(auth_instance) : icms_auth_Provisionning
        +sync(datas, uname, pwd) : icms_member_user_Object
        +add(datas, uname, pwd) : icms_member_user_Object
        +change(icmsUser, datas, uname, pwd) : icms_member_user_Object
        +geticms_member_user_Object(uname) : icms_member_user_Object
    }

    %% Inheritance relationships
    icms_auth_Object <|-- icms_auth_Xoops
    icms_auth_Object <|-- icms_auth_Ldap
    icms_auth_Ldap <|-- icms_auth_Ads

    %% Factory pattern
    icms_auth_Factory ..> icms_auth_Object : creates
    icms_auth_Factory ..> icms_auth_Xoops : creates
    icms_auth_Factory ..> icms_auth_Ldap : creates
    icms_auth_Factory ..> icms_auth_Ads : creates

    %% Composition/Usage relationships
    icms_auth_Ldap --> icms_auth_Provisionning : uses
    icms_auth_Provisionning --> icms_auth_Object : references

    %% Notes
    note for icms_auth_Object "Base authentication class\nDefines common interface"
    note for icms_auth_Xoops "Native XOOPS authentication\nUses database for user validation"
    note for icms_auth_Ldap "LDAP authentication\nSupports LDAP v2/v3 servers"
    note for icms_auth_Ads "Active Directory authentication\nExtends LDAP with AD-specific features"
    note for icms_auth_Factory "Factory pattern\nCreates appropriate auth instances"
    note for icms_auth_Provisionning "User synchronization\nManages user data between LDAP and database"
Loading

Here's the class diagram for the authentication classes in the /htdocs/libraries/icms/auth folder. The diagram shows:

Class Hierarchy:

  • icms_auth_Object - The base abstract authentication class that defines the common interface
  • icms_auth_Xoops - Extends the base class for native XOOPS/ImpressCMS database authentication
  • icms_auth_Ldap - Extends the base class for LDAP server authentication
  • icms_auth_Ads - Extends the LDAP class specifically for Active Directory authentication

Key Design Patterns:

  • Factory Pattern: icms_auth_Factory creates appropriate authentication instances based on configuration
  • Template Method Pattern: Base class defines the authentication interface, concrete classes implement specific authentication methods
  • Singleton Pattern: The factory uses static methods to manage authentication instances

Key Relationships:

  • Inheritance: Xoops and Ldap inherit from Object; Ads inherits from Ldap
  • Composition: Ldap uses Provisionning for user synchronization
  • Factory Creation: The factory can create any of the authentication types

Functionality:

  • icms_auth_Object: Base error handling and authentication interface
  • icms_auth_Xoops: Database-based authentication using ImpressCMS member system
  • icms_auth_Ldap: LDAP directory authentication with extensive configuration options
  • icms_auth_Ads: Active Directory authentication using UPN (User Principal Name)
  • icms_auth_Provisionning: Handles user synchronization between LDAP and local database
  • icms_auth_Factory: Creates appropriate authentication instances based on configuration

The system supports multiple authentication methods and can automatically provision users from LDAP/AD into the local database system.

Clone this wiki locally