Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117758359
D5592.1775209470.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
8 KB
Referenced Files
None
Subscribers
None
D5592.1775209470.diff
View Options
diff --git a/src/app/Backends/LDAP.php b/src/app/Backends/LDAP.php
--- a/src/app/Backends/LDAP.php
+++ b/src/app/Backends/LDAP.php
@@ -24,7 +24,7 @@
public static function connect(): void
{
if (empty(self::$ldap)) {
- $config = self::getConfig('admin');
+ $config = self::getConfig();
self::$ldap = self::initLDAP($config);
}
}
@@ -47,7 +47,7 @@
*/
public static function healthcheck(): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$mgmtRootDN = \config('services.ldap.admin.root_dn');
@@ -73,7 +73,7 @@
*/
public static function createDomain(Domain $domain): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$mgmtRootDN = \config('services.ldap.admin.root_dn');
@@ -234,7 +234,7 @@
*/
public static function createGroup(Group $group): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$domainName = explode('@', $group->email, 2)[1];
@@ -275,7 +275,7 @@
*/
public static function createResource(Resource $resource): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$domainName = explode('@', $resource->email, 2)[1];
@@ -318,7 +318,7 @@
*/
public static function createSharedFolder(SharedFolder $folder): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$domainName = explode('@', $folder->email, 2)[1];
@@ -374,7 +374,7 @@
*/
public static function createUser(User $user): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$entry = [
@@ -420,7 +420,7 @@
*/
public static function deleteDomain(Domain $domain): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$domainBaseDN = self::baseDN($ldap, $domain->namespace);
@@ -463,7 +463,7 @@
*/
public static function deleteGroup(Group $group): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
if (self::getGroupEntry($ldap, $group->email, $dn)) {
@@ -491,7 +491,7 @@
*/
public static function deleteResource(Resource $resource): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
if (self::getResourceEntry($ldap, $resource->email, $dn)) {
@@ -519,7 +519,7 @@
*/
public static function deleteSharedFolder(SharedFolder $folder): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
if (self::getSharedFolderEntry($ldap, $folder->email, $dn)) {
@@ -547,7 +547,7 @@
*/
public static function deleteUser(User $user): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
if (self::getUserEntry($ldap, $user->email, $dn)) {
@@ -577,7 +577,7 @@
*/
public static function getDomain(string $namespace)
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$ldapDomain = $ldap->find_domain($namespace);
@@ -604,7 +604,7 @@
*/
public static function getGroup(string $email)
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$group = self::getGroupEntry($ldap, $email, $dn);
@@ -627,7 +627,7 @@
*/
public static function getResource(string $email)
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$resource = self::getResourceEntry($ldap, $email, $dn);
@@ -650,7 +650,7 @@
*/
public static function getSharedFolder(string $email)
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$folder = self::getSharedFolderEntry($ldap, $email, $dn);
@@ -673,7 +673,7 @@
*/
public static function getUser(string $email)
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$user = self::getUserEntry($ldap, $email, $dn, true);
@@ -694,7 +694,7 @@
*/
public static function updateDomain(Domain $domain): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$ldapDomain = $ldap->find_domain($domain->namespace);
@@ -738,7 +738,7 @@
*/
public static function updateGroup(Group $group): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$newEntry = $oldEntry = self::getGroupEntry($ldap, $group->email, $dn);
@@ -775,7 +775,7 @@
*/
public static function updateResource(Resource $resource): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$newEntry = $oldEntry = self::getResourceEntry($ldap, $resource->email, $dn);
@@ -812,7 +812,7 @@
*/
public static function updateSharedFolder(SharedFolder $folder): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$newEntry = $oldEntry = self::getSharedFolderEntry($ldap, $folder->email, $dn);
@@ -849,7 +849,7 @@
*/
public static function updateUser(User $user): void
{
- $config = self::getConfig('admin');
+ $config = self::getConfig();
$ldap = self::initLDAP($config);
$newEntry = $oldEntry = self::getUserEntry($ldap, $user->email, $dn, true);
@@ -894,7 +894,7 @@
/**
* Initialize connection to LDAP
*/
- private static function initLDAP(array $config, string $privilege = 'admin')
+ private static function initLDAP(array $config)
{
if (self::$ldap) {
return self::$ldap;
@@ -909,8 +909,8 @@
}
$bound = $ldap->bind(
- \config("services.ldap.{$privilege}.bind_dn"),
- \config("services.ldap.{$privilege}.bind_pw")
+ \config("services.ldap.admin.bind_dn"),
+ \config("services.ldap.admin.bind_pw")
);
if (!$bound) {
@@ -1134,7 +1134,7 @@
/**
* Get LDAP configuration for specified access level
*/
- private static function getConfig(string $privilege)
+ private static function getConfig()
{
$config = [
'domain_base_dn' => \config('services.ldap.domain_base_dn'),
diff --git a/src/config/services.php b/src/config/services.php
--- a/src/config/services.php
+++ b/src/config/services.php
@@ -89,20 +89,9 @@
],
'hosted' => [
- 'bind_dn' => env('LDAP_HOSTED_BIND_DN', null),
- 'bind_pw' => env('LDAP_HOSTED_BIND_PW', null),
'root_dn' => env('LDAP_HOSTED_ROOT_DN', null),
],
- 'domain_owner' => [
- // probably proxy credentials?
- ],
-
- 'root_dn' => env('LDAP_ROOT_DN', null),
- 'service_bind_dn' => env('LDAP_SERVICE_BIND_DN', null),
- 'service_bind_pw' => env('LDAP_SERVICE_BIND_PW', null),
- 'login_filter' => env('LDAP_LOGIN_FILTER', '(&(objectclass=kolabinetorgperson)(uid=%s))'),
- 'filter' => env('LDAP_FILTER', '(&(objectclass=kolabinetorgperson)(uid=%s))'),
'domain_name_attribute' => env('LDAP_DOMAIN_NAME_ATTRIBUTE', 'associateddomain'),
'domain_base_dn' => env('LDAP_DOMAIN_BASE_DN', null),
'domain_filter' => env('LDAP_DOMAIN_FILTER', '(associateddomain=%s)'),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 9:44 AM (8 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18823521
Default Alt Text
D5592.1775209470.diff (8 KB)
Attached To
Mode
D5592: Remove flexibility that we don't need from LDAP
Attached
Detach File
Event Timeline