Authentication From Database And Ldap

I’m developing a system that needs to authenticate users from LDAP, if the users are not found in LDAP, the system then uses and ActiveRecord to check if the user is store in the db.

When a login from LDAP succeeds, the user must get administrator rights.

When logging in from the database the user gains user rights.

I’ve read up on the CPhpAuthManager but don’t quite understand how I can make a fallback to the CDbAuthManager

How can I define a user as an administrator without needing to store the information in the database?

Thanks in advance!

There is no such term as an administrator user. Auth manager implementation provided by Yii just operate on auth items which you assign to users.

Anyway, you probably want to extend either one of those auth managers to read auth items from two sources or extend CWebUser class to perform checkAccess() using one of two (or more) auth managers.