anklimsk / cakephp-ldap-sync
Synchronizing information and authenticating users by LDAP for CakePHP 2.x
Package info
github.com/anklimsk/cakephp-ldap-sync
Type:cakephp-plugin
pkg:composer/anklimsk/cakephp-ldap-sync
Requires
- php: >=5.4
- anklimsk/cakephp-basic-functions: ^1.0.0
- anklimsk/cakephp-config-plugin: ^1.0.0
- anklimsk/cakephp-extended-test: ^1.0.0
- anklimsk/cakephp2-theme: ^1.0.0
- cakephp/datasources: 2.3.x-dev
- composer/installers: ^1.5.0
- dereuromark/cakephp-queue: ^2.3.0
- dereuromark/cakephp-tools: ^0.12.4
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Synchronizing information with LDAP and authenticating users by membership in the LDAP security group
This plugin provides next features:
- Authenticating users by membership in the LDAP security group;
- Support external authentication, e.g.
kerberos; - Checking user for compliance with roles;
- Synchronizing information from LDAP to database;
- Synchronizing information as a subordination tree of employees;
- Support for a customizable list of fields for synchronization;
- Support for customize binded information for models
EmployeeandDepartment; - Support for customize displaying information of employees.
Installation
-
Install the Plugin using composer:
composer require anklimsk/cakephp-ldap-sync -
Add the next line to the end of the file
app/Config/bootstrap.php:CakePlugin::load('CakeLdap', ['bootstrap' => true, 'routes' => true]);
-
Open file
app/Config/database.phpand add connectionldap, e.g.:public $ldap = [ 'datasource' => 'CakeLdap.LdapExtSource', 'persistent' => false, 'host' => ['ldapsrv01', 'ldapsrv02'], 'port' => 389, 'login' => 'user@fabrikam.com', 'password' => 'pas$w0rd', 'database' => '', 'basedn' => 'dc=fabrikam,dc=com', 'type' => 'ActiveDirectory', 'tls' => false, 'version' => 3, ];
-
Copy configuration file from
app/Plugin/CakeLdap/Config/cakeldap.phptoapp/Config. -
Edit config file and configure plugin See
Example of configuration file -
Create database tables of plugin using the CakePHP console, run the command:
Console/cake schema create -p CakeLdap -
In your file
app\Config\core.phpuncomment modify next line:Configure::write('Routing.prefixes', array('admin')); -
Copy translation files from
app/Plugin/CakeLdap/Locale/rus/LC_MESSAGES/toapp/Locale/rus/LC_MESSAGES:
cake_ldap_field_name.*;cake_ldap_validation_errors.*.
- Get the name of the user that is running the web server, run the command:
ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1. - Configure scripts to run schedule, run the command
crontab -u www-data -ewherewww-data- user name for web server. - Add the following line to the list of cron jobs:
#
# In this example, run the synchronizing script
# will be made every day on 7:10 AM
10 7 * * * cd /var/www/paht_to_app/app && Console/cake CakeLdap.cron sync -q