feat: Add LDAP/Active Directory integration with group-based access control
- Add PHP LDAP extension to Docker container - Implement LdapSync class for authentication and user synchronization - Add automatic user sync via cron (every 30 minutes) - Create role-based access control system (admin, manager, viewer) - Add LDAP configuration UI in settings - Support for both Active Directory and OpenLDAP - Group-to-role mapping with flexible configuration - Add 50+ translations (EN + RU) for LDAP features - Include comprehensive setup documentation - Enhance Auth::login() with LDAP fallback - Add LDAP settings page with connection testing
This commit is contained in:
@@ -1798,6 +1798,36 @@ Router::post('/settings/delete-user/{id}', function ($params) {
|
||||
$controller->deleteUser($params['id']);
|
||||
});
|
||||
|
||||
// LDAP settings page
|
||||
Router::get('/settings/ldap', function () {
|
||||
requireAdmin();
|
||||
|
||||
require_once __DIR__ . '/../controllers/SettingsController.php';
|
||||
require_once __DIR__ . '/../inc/LdapSync.php';
|
||||
$controller = new SettingsController();
|
||||
$controller->ldapSettings();
|
||||
});
|
||||
|
||||
// Save LDAP settings
|
||||
Router::post('/settings/ldap/save', function () {
|
||||
requireAdmin();
|
||||
|
||||
require_once __DIR__ . '/../controllers/SettingsController.php';
|
||||
require_once __DIR__ . '/../inc/LdapSync.php';
|
||||
$controller = new SettingsController();
|
||||
$controller->saveLdapSettings();
|
||||
});
|
||||
|
||||
// Test LDAP connection
|
||||
Router::post('/settings/ldap/test', function () {
|
||||
requireAdmin();
|
||||
|
||||
require_once __DIR__ . '/../controllers/SettingsController.php';
|
||||
require_once __DIR__ . '/../inc/LdapSync.php';
|
||||
$controller = new SettingsController();
|
||||
$controller->testLdapConnection();
|
||||
});
|
||||
|
||||
/**
|
||||
* LANGUAGE ROUTES
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user