Hi,
i extended the checkLogon-function in the lib-auth.php to realize an LDAP-authentication.
The LDAP-properties (ServerIP,Port,Group,dc,ou,zenphoto-group cn) are supplied by an LDAP Zenphoto plugin (that i also wrote).
The autentication itself is done via LDAP, but all user properties are stored in the zenphoto-DB To distinguish between a local and a ldap-user i used the 'other-credentials' DB-field with the value 'ldap'.
At the moment i'm struggling with two issues:
- The replacement in the plugins/alt/ folder: When i take the original lib-auth.php script and change the require_once-statment at the beginning, i'm getting this error: "PHP Fatal error: Call to a member function checkCookieCredentials() on a non-object in /var/www/zen/zp-core/auth_zp.php on line 71" so i modified the original lib-auth.php.
- The second one is that the zp-core/zp-extensions/user-expiry.php at Line 161 overwrites the 'other-credentials'-field in the db after every successfull login and logout. It seems that the getCredentials-function (lib-auth.php) doesn't provide the correct value from the db-field, so i comment the line out at the moment.
The LDAP-authentication works fine, but what is missing is the ldap-user registration part on the admin->users page. I tried to modify the page, but my php-knowlegde is not as good as i wish.
The plan for the LDAP-user registration is to use normal user registration process/site, but list the users from the zenphoto ldap group on the admin->users page, use the provided name as username and set 'ldap' in the 'other_credentials' db-field.
I thought that a marked "Use LDAP"-Checkbox (that is only visible when the "Enable LDAP Logon"-Checkbox on the ldap-plugin page is marked) will enable the LDAP-userlist and set the original "New User:"- and the Password-Textbox disabled/invisible.
The ldap-plugin also provides a function that returns an array with the ldap-usernames that are in the zenphoto-ldap group.
So my question is, if anybody is interested to do the admin-users-page modification, but addition i have to mention that i also have no github-experience.