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:
infosave2007
2025-11-10 17:46:27 +03:00
parent 406d3439e7
commit e7e901f6e5
13 changed files with 1141 additions and 3 deletions
+30
View File
@@ -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
*/