Auth

The authentication adapter provides user and group-based rights management with logic similar to Linux systems.

Available adapters

Name

Description

DatabaseAuthAdapter

The database authentication adapter manages users and groups through the database adapter.

HtaccessAuthAdapter

The htaccess authentication adapter manages users and groups through a .htpasswd and .htgroups file.

NullAuthAdapter

The null authentication adapter is a dummy adapter and is used to disable the authentication interface.

The authentication adapter can be used for generic and extendable user management.

The UCMS defines an interface which can be used to manage users and groups. These users and groups have certain predefined properties that are fundamental and always needed, no matter what kind of application you create. For example, a user account in a modern application always has an e-mail address and a password. There are also other account properties for important metadata such as creation time, last login, etc.

It would be annoying, redundant and waste of time to develop such things again and again for each new application. Therefore, the UCMS defines an interface with default properties to allow reusability of the code. As a result, not only the rights management can be reused, but also all account management controllers such as Login, Logout, Signup, Forgot Password, Change E-Mail Address, etc.

The properties of a user account can be easily extended and adapted to the respective needs.

Users are represented by the User model, and groups are represented by the Group model.

For example, if you want that each user account has an invoice address, just create a ucms_yourappname_profiles database table. This table can be used for all application-related properties.

$row=new\Ucms\Lib\ExampleCompany\Customer($this,$row);// if you want that Customer extends Ucms\Model\User you need to modify this a bit

returnTRUE;

}

]);

}

Now, your customer profile data, along with the predefined user properties, will form a customer object, and all of the above management controllers can be easily reused. Of course this only works if you manage users through the database authentication adapter because only this adapter is able to join database tables.

The htaccess authentication adapter is intended for administrative purposes and not to manage a large number of customers. The advantage of this adapter is that it does not require a database connection, so you can work with this adapter completely without a database if you want. Thanks to the database emulator API library of the ucms, this adapter offers exactly the same interface as the database authentication adapter. This means that through a special layer, database logic can be applied to the entries of a .htpasswd and .htgroups file.

For example, the following illustrative template code works with any authentication adapter: