Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/plugins/CoreServer/src/Model/Table/LdapServersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public function modReplace(\LDAP\Connection $cxn, string $dn, array $attributes)
* @param \LDAP\Connection $cxn Active LDAP connection (already connected and bound).
* @param string $oldDn Current (full) DN of the entry.
* @param string $newRdn New RDN (relative distinguished name) for the entry.
* @param string|null $newParentDn New parent DN, or null to keep the same parent.
* @param string $newParentDn New parent DN, or an empty string to keep the same parent.
* @param bool $deleteOldRdn Whether to delete the old RDN value from the entry.
* @return void
* @throws \RuntimeException On LDAP rename failure.
Expand All @@ -406,7 +406,7 @@ public function renameEntry(
\LDAP\Connection $cxn,
string $oldDn,
string $newRdn,
?string $newParentDn = null,
string $newParentDn = '',
bool $deleteOldRdn = true
): void {
$currentErrorReporting = error_reporting(0);
Expand Down Expand Up @@ -465,7 +465,7 @@ public function readEntry(\LDAP\Connection $cxn, string $dn, array $attributes =
* @param array $attributes
* @return array{action:string,dn:string}
*/
protected function addOrModifyAt(\LDAP\Connection $cxn, string $dn, array $attributes): array {
public function addOrModifyAt(\LDAP\Connection $cxn, string $dn, array $attributes): array {
try {
$this->modReplace($cxn, $dn, $attributes);
return ['action' => 'modify', 'dn' => $dn];
Expand Down Expand Up @@ -495,7 +495,7 @@ protected function addOrModifyAt(\LDAP\Connection $cxn, string $dn, array $attri
* Performs a case-insensitive suffix match. If $baseDn is empty or not a suffix
* of $newDn, returns $newDn unchanged.
*/
protected function removeBaseDnSuffix(string $newDn, string $baseDn): string {
public function removeBaseDnSuffix(string $newDn, string $baseDn): string {
if ($baseDn === '') {
return $newDn;
}
Expand All @@ -510,6 +510,7 @@ protected function removeBaseDnSuffix(string $newDn, string $baseDn): string {
return $newDn;
}


/**
* Disconnect (unbind) an LDAP connection for a given server ID.
*
Expand Down
340 changes: 340 additions & 0 deletions app/plugins/LdapConnector/config/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,340 @@
{
"types": {
"provisioning_target": [
"LdapProvisioners"
],
"ldap_schema": [
"PersonSchemas",
"OrganizationalPersonSchemas",
"InetOrgPersonSchemas",
"PosixGroupSchemas",
"PosixAccountSchemas",
"LdapPublicKeySchemas",
"GroupOfNamesSchemas",
"VoPosixGroupSchemas",
"VoPosixAccountSchemas",
"EduMemberSchemas",
"EduPersonSchemas",
"VoPersonSchemas"
]
},
"schema": {
"tables": {
"ldap_provisioners": {
"columns": {
"id": {},
"provisioning_target_id": {},
"server_id": { "notnull": false },
"dn_attribute_name": { "type": "string", "size": 32, "notnull": false },
"scope_suffix": { "type": "string", "size": 128 },
"attr_opts": { "type": "boolean", "notnull": false },
"dn_identifier_type_id": {
"type": "integer",
"foreignkey": { "table": "types", "column": "id" },
"notnull": false
}
},
"changelog": true,
"indexes": {
"ldap_provisioners_i1": { "columns": [ "provisioning_target_id" ] },
"ldap_provisioners_i2": { "columns": [ "server_id" ] }
}
},

"ldap_provisioner_dns": {
"columns": {
"id": {},
"ldap_provisioner_id": {
"type": "integer",
"foreignkey": { "table": "ldap_provisioners", "column": "id" },
"notnull": true
},
"person_id": {
"type": "integer",
"foreignkey": { "table": "people", "column": "id" },
"notnull": false
},
"group_id": {
"type": "integer",
"foreignkey": { "table": "groups", "column": "id" },
"notnull": false
},
"dn": { "type": "string", "size": 256, "notnull": true }
},
"indexes": {
"ldap_provisioner_dns_i1": {
"columns": [ "ldap_provisioner_id", "person_id" ]
},
"ldap_provisioner_dns_i2": {
"columns": [ "ldap_provisioner_id", "group_id" ]
}
},
"changelog": true
},

"ldap_schemas": {
"columns": {
"id": {},
"ldap_provisioner_id": { "type": "integer", "foreignkey": { "table": "ldap_provisioners", "column": "id" } },
"plugin": { "type": "string", "size": 128 },
"status": { "type": "enum" },
"description": { "type": "string", "size": 128 }
},
"indexes": {
"ldap_schemas_i1": { "columns": [ "ldap_provisioner_id" ] }
},
"changelog": true
},

"ldap_schema_attributes": {
"comment": "Per LDAP schema instance attribute export configuration (objectclass/attribute-level), including required flags and display ordering.",
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" },
"notnull": true
},
"objectclass": { "type": "string", "size": 64, "notnull": true },
"attribute": { "type": "string", "size": 128, "notnull": true },

"required": { "type": "boolean", "notnull": true },
"multiple": { "type": "boolean", "notnull": true },

"export": { "type": "boolean", "notnull": true },

"ordr": {},

"type_id": { "notnull": false, "comment": "Skeletal row needs to be created without type" },
"use_org_value": { "type": "boolean" }
},

"changelog": true,
"indexes": {
"ldap_schema_attributes_i1": { "columns": [ "ldap_schema_id" ] },
"ldap_schema_attributes_i2": {
"unique": true,
"columns": [
"ldap_schema_id",
"objectclass",
"attribute",
"revision",
"ldap_schema_attribute_id"
]
},
"ldap_schema_attributes_i3": { "needed": false, "columns": [ "ldap_schema_id", "export" ] }
}
},

"person_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"person_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "person_schema_id" ]
}
}
},

"organizational_person_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},

"changelog": true,

"indexes": {
"organizational_person_schemas_i1": {
"columns": [ "ldap_schema_id" ]
},

"organizational_person_schemas_i2": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "organizational_person_schema_id" ]
}
}
},

"inet_org_person_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"inet_org_person_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "inet_org_person_schema_id" ]
}
}
},

"posix_group_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"posix_group_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "posix_group_schema_id" ]
}
}
},

"posix_account_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"posix_account_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "posix_account_schema_id" ]
}
}
},

"ldap_public_key_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"ldap_public_key_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "ldap_public_key_schema_id" ]
}
}
},

"group_of_names_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"group_of_names_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "group_of_names_schema_id" ]
}
}
},

"vo_posix_group_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"vo_posix_group_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "vo_posix_group_schema_id" ]
}
}
},

"vo_posix_account_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"vo_posix_account_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "vo_posix_account_schema_id" ]
}
}
},

"edu_member_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"edu_member_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "edu_member_schema_id" ]
}
}
},

"edu_person_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"edu_person_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "edu_person_schema_id" ]
}
}
},

"vo_person_schemas": {
"columns": {
"id": {},
"ldap_schema_id": {
"type": "integer",
"foreignkey": { "table": "ldap_schemas", "column": "id" }
}
},
"changelog": true,
"indexes": {
"vo_person_schemas_i1": {
"unique": true,
"columns": [ "ldap_schema_id", "revision", "vo_person_schema_id" ]
}
}
}
}
}
}
Loading