Loading .gitignore 0 → 100644 +2 −0 Changes for .gitignore: 2 added lines, 0 removed lines. Original line number Diff line number Diff line .idea vendor No newline at end of file composer.json +9 −9 Changes for composer.json: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -3,17 +3,17 @@ "description": "Module Ldap des applications Unicaen", "require": { "php": "^5.6 || ^7.0", "zendframework/zend-servicemanager": "~2.4 || ^2.7", "zendframework/zend-modulemanager": "~2.4 || ^2.7", "zendframework/zend-config": "~2.4 || ^2.7", "zendframework/zend-serializer": "~2.4 || ^2.7", "zendframework/zend-log": "~2.4 || ^2.7", "zendframework/zend-i18n": "~2.4 || ^2.7", "zendframework/zend-stdlib": "~2.4 || ^2.7", "zendframework/zend-ldap": "~2.4 || ^2.7" "zendframework/zend-config": "^3.2", "zendframework/zend-i18n": "^2.9", "zendframework/zend-ldap": "^2.10", "zendframework/zend-log": "^2.10", "zendframework/zend-modulemanager": "^2.8", "zendframework/zend-serializer": "^2.9", "zendframework/zend-servicemanager": "^3.4", "zendframework/zend-stdlib": "^3.2" }, "require-dev": { "phpunit/PHPUnit": ">=3.7", "phpunit/phpunit": ">=3.7", "zendframework/zend-test": ">=2.2" }, "autoload": { Loading config/module.config.php +58 −1 Changes for config/module.config.php: 58 added lines, 1 removed line. Original line number Diff line number Diff line <?php use UnicaenLdap\LdapFactory; namespace UnicaenLdap; use UnicaenLdap\Entity\Generic; use UnicaenLdap\Entity\Group; use UnicaenLdap\Entity\People; use UnicaenLdap\Entity\Structure; use UnicaenLdap\Entity\System; use UnicaenLdap\Options\ModuleOptionsFactory; use UnicaenLdap\Service\Generic as LdapGenericService; use UnicaenLdap\Service\GenericFactory as GenericServiceFactory; use UnicaenLdap\Service\Group as LdapGroupService; use UnicaenLdap\Service\GroupFactory as GroupServiceFactory; use UnicaenLdap\Service\People as LdapPeopleService; use UnicaenLdap\Service\PeopleFactory as PeopleServiceFactory; use UnicaenLdap\Service\Structure as LdapStructureService; use UnicaenLdap\Service\StructureFactory as StructureServiceFactory; use UnicaenLdap\Service\System as LdapSystemService; use UnicaenLdap\Service\SystemFactory as SystemServiceFactory; use Zend\ServiceManager\Proxy\LazyServiceFactory; ;; return array( 'unicaen-ldap' => [ Loading @@ -23,5 +37,48 @@ return array( 'LdapServiceStructure' => StructureServiceFactory::class, 'LdapServiceSystem' => SystemServiceFactory::class, ], 'aliases' => [ 'ldap' => 'Ldap', 'ldapOptions' => 'LdapOptions', 'ldapServiceGeneric' => 'LdapServiceGeneric', 'ldapServiceGroup' => 'LdapServiceGroup', 'ldapServicePeople' => 'LdapServicePeople', 'ldapServiceStructure' => 'LdapServiceStructure', 'ldapServiceSystem' => 'LdapServiceSystem', LdapGenericService::class => 'LdapServiceGeneric', LdapPeopleService::class => 'LdapServicePeople', LdapGroupService ::class => 'LdapServiceGroup', LdapStructureService::class => 'LdapServiceStructure', LdapSystemService::class => 'LdapServiceSystem', ], 'lazy_services' => [ // Mapping services to their class names is required since the ServiceManager is not a declarative DIC. 'class_map' => [ 'LdapServicePeople' => LdapPeopleService::class, 'LdapServiceGeneric' => LdapGenericService::class, 'LdapServiceGroup' => LdapGroupService::class, 'LdapServiceStructure' => LdapStructureService::class, 'LdapServiceSystem' => LdapSystemService::class, ], ], 'delegators' => [ 'LdapServicePeople' => [ LazyServiceFactory::class, ], 'LdapServiceGeneric' => [ LazyServiceFactory::class, ], 'LdapServiceGroup' => [ LazyServiceFactory::class, ], 'LdapServiceStructure' => [ LazyServiceFactory::class, ], 'LdapServiceSystem' => [ LazyServiceFactory::class, ], ], ], ); src/UnicaenLdap/Entity/Group.php +3 −3 Changes for src/UnicaenLdap/Entity/Group.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -67,11 +67,11 @@ class Group extends Entity */ public function getPeople($orderBy = null) { /* @var $people \UnicaenLdap\Service\People */ $people = $this->getService()->getServiceLocator()->get('ldapServicePeople'); /* @var $peopleService \UnicaenLdap\Service\People */ $peopleService = $this->getService()->getLdapPeopleService(); /** @var People[] $result */ $result = $people->getAllBy($this->get('member'), 'dn', $orderBy); $result = $peopleService->getAllBy($this->get('member'), 'dn', $orderBy); return $result; } Loading src/UnicaenLdap/Entity/People.php +16 −15 Changes for src/UnicaenLdap/Entity/People.php: 16 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -133,9 +133,9 @@ class People extends Entity */ public function getGroups(DateTime $dateObservation = null, $orderBy = null) { $group = $this->getService()->getServiceLocator()->get('ldapServiceGroup'); $groupService = $this->getService()->getLdapGroupService(); return $group->filterValids($group->getAllBy($this->get('memberOf'), 'dn', $orderBy), $dateObservation); return $groupService->filterValids($groupService->getAllBy($this->get('memberOf'), 'dn', $orderBy), $dateObservation); } /** Loading Loading @@ -171,46 +171,47 @@ class People extends Entity /** * Retourne les structures auxquelles appartiennent la personne * * @return Structure[] * @return Entity[]|Structure[] */ public function getEduPersonOrgUnit() { $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); $dn = $this->eduPersonOrgUnitDN; if (empty($dn)) return null; return $structure->getAllBy($dn, 'dn'); return $structureService->getAllBy($dn, 'dn'); } /** * Retourne la structure principale à laquelle appartient la personne * * @return Structure * @return Entity|Structure * @throws \UnicaenLdap\Exception */ public function getEduPersonPrimaryOrgUnit() { $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); $dn = $this->eduPersonPrimaryOrgUnitDN; if (empty($dn)) return null; return $structure->getBy($dn, 'dn'); return $structureService->getBy($dn, 'dn'); } /** * Retourne la structure d'affectation de la personne * * @todo à terminer * @return Structure[] * @return Entity|Structure * @throws \Exception */ public function getEntiteAffectation() { throw new \Exception('Méthode pas finie'); $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); $codes = $this->getNode()->getAttribute('supannEntiteAffectation'); var_dump($codes); return $structure->getBy($dn, 'dn'); return $structureService->getBy($dn, 'dn'); } /** Loading @@ -223,7 +224,7 @@ class People extends Entity public function getEntiteAffectationPrincipale() { throw new \Exception('Méthode pas finie'); $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); $codes = []; $affectations = $this->getNode()->getAttribute('supannAffectation'); Loading @@ -233,7 +234,7 @@ class People extends Entity $code = $this->supannAffectation; if (empty($dn)) return null; return $structure->getBy($dn, 'dn'); return $structureService->getBy($dn, 'dn'); } /** Loading @@ -246,13 +247,13 @@ class People extends Entity public function getAffectationDescription() { throw new \Exception('Méthode pas finie'); $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); list($code, $description) = explode(';', $this->supannAffectation); $code = $this->supannAffectation; if (empty($dn)) return null; return $structure->getBy($dn, 'dn'); return $structureService->getBy($dn, 'dn'); } /** Loading Loading
.gitignore 0 → 100644 +2 −0 Changes for .gitignore: 2 added lines, 0 removed lines. Original line number Diff line number Diff line .idea vendor No newline at end of file
composer.json +9 −9 Changes for composer.json: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -3,17 +3,17 @@ "description": "Module Ldap des applications Unicaen", "require": { "php": "^5.6 || ^7.0", "zendframework/zend-servicemanager": "~2.4 || ^2.7", "zendframework/zend-modulemanager": "~2.4 || ^2.7", "zendframework/zend-config": "~2.4 || ^2.7", "zendframework/zend-serializer": "~2.4 || ^2.7", "zendframework/zend-log": "~2.4 || ^2.7", "zendframework/zend-i18n": "~2.4 || ^2.7", "zendframework/zend-stdlib": "~2.4 || ^2.7", "zendframework/zend-ldap": "~2.4 || ^2.7" "zendframework/zend-config": "^3.2", "zendframework/zend-i18n": "^2.9", "zendframework/zend-ldap": "^2.10", "zendframework/zend-log": "^2.10", "zendframework/zend-modulemanager": "^2.8", "zendframework/zend-serializer": "^2.9", "zendframework/zend-servicemanager": "^3.4", "zendframework/zend-stdlib": "^3.2" }, "require-dev": { "phpunit/PHPUnit": ">=3.7", "phpunit/phpunit": ">=3.7", "zendframework/zend-test": ">=2.2" }, "autoload": { Loading
config/module.config.php +58 −1 Changes for config/module.config.php: 58 added lines, 1 removed line. Original line number Diff line number Diff line <?php use UnicaenLdap\LdapFactory; namespace UnicaenLdap; use UnicaenLdap\Entity\Generic; use UnicaenLdap\Entity\Group; use UnicaenLdap\Entity\People; use UnicaenLdap\Entity\Structure; use UnicaenLdap\Entity\System; use UnicaenLdap\Options\ModuleOptionsFactory; use UnicaenLdap\Service\Generic as LdapGenericService; use UnicaenLdap\Service\GenericFactory as GenericServiceFactory; use UnicaenLdap\Service\Group as LdapGroupService; use UnicaenLdap\Service\GroupFactory as GroupServiceFactory; use UnicaenLdap\Service\People as LdapPeopleService; use UnicaenLdap\Service\PeopleFactory as PeopleServiceFactory; use UnicaenLdap\Service\Structure as LdapStructureService; use UnicaenLdap\Service\StructureFactory as StructureServiceFactory; use UnicaenLdap\Service\System as LdapSystemService; use UnicaenLdap\Service\SystemFactory as SystemServiceFactory; use Zend\ServiceManager\Proxy\LazyServiceFactory; ;; return array( 'unicaen-ldap' => [ Loading @@ -23,5 +37,48 @@ return array( 'LdapServiceStructure' => StructureServiceFactory::class, 'LdapServiceSystem' => SystemServiceFactory::class, ], 'aliases' => [ 'ldap' => 'Ldap', 'ldapOptions' => 'LdapOptions', 'ldapServiceGeneric' => 'LdapServiceGeneric', 'ldapServiceGroup' => 'LdapServiceGroup', 'ldapServicePeople' => 'LdapServicePeople', 'ldapServiceStructure' => 'LdapServiceStructure', 'ldapServiceSystem' => 'LdapServiceSystem', LdapGenericService::class => 'LdapServiceGeneric', LdapPeopleService::class => 'LdapServicePeople', LdapGroupService ::class => 'LdapServiceGroup', LdapStructureService::class => 'LdapServiceStructure', LdapSystemService::class => 'LdapServiceSystem', ], 'lazy_services' => [ // Mapping services to their class names is required since the ServiceManager is not a declarative DIC. 'class_map' => [ 'LdapServicePeople' => LdapPeopleService::class, 'LdapServiceGeneric' => LdapGenericService::class, 'LdapServiceGroup' => LdapGroupService::class, 'LdapServiceStructure' => LdapStructureService::class, 'LdapServiceSystem' => LdapSystemService::class, ], ], 'delegators' => [ 'LdapServicePeople' => [ LazyServiceFactory::class, ], 'LdapServiceGeneric' => [ LazyServiceFactory::class, ], 'LdapServiceGroup' => [ LazyServiceFactory::class, ], 'LdapServiceStructure' => [ LazyServiceFactory::class, ], 'LdapServiceSystem' => [ LazyServiceFactory::class, ], ], ], );
src/UnicaenLdap/Entity/Group.php +3 −3 Changes for src/UnicaenLdap/Entity/Group.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -67,11 +67,11 @@ class Group extends Entity */ public function getPeople($orderBy = null) { /* @var $people \UnicaenLdap\Service\People */ $people = $this->getService()->getServiceLocator()->get('ldapServicePeople'); /* @var $peopleService \UnicaenLdap\Service\People */ $peopleService = $this->getService()->getLdapPeopleService(); /** @var People[] $result */ $result = $people->getAllBy($this->get('member'), 'dn', $orderBy); $result = $peopleService->getAllBy($this->get('member'), 'dn', $orderBy); return $result; } Loading
src/UnicaenLdap/Entity/People.php +16 −15 Changes for src/UnicaenLdap/Entity/People.php: 16 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -133,9 +133,9 @@ class People extends Entity */ public function getGroups(DateTime $dateObservation = null, $orderBy = null) { $group = $this->getService()->getServiceLocator()->get('ldapServiceGroup'); $groupService = $this->getService()->getLdapGroupService(); return $group->filterValids($group->getAllBy($this->get('memberOf'), 'dn', $orderBy), $dateObservation); return $groupService->filterValids($groupService->getAllBy($this->get('memberOf'), 'dn', $orderBy), $dateObservation); } /** Loading Loading @@ -171,46 +171,47 @@ class People extends Entity /** * Retourne les structures auxquelles appartiennent la personne * * @return Structure[] * @return Entity[]|Structure[] */ public function getEduPersonOrgUnit() { $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); $dn = $this->eduPersonOrgUnitDN; if (empty($dn)) return null; return $structure->getAllBy($dn, 'dn'); return $structureService->getAllBy($dn, 'dn'); } /** * Retourne la structure principale à laquelle appartient la personne * * @return Structure * @return Entity|Structure * @throws \UnicaenLdap\Exception */ public function getEduPersonPrimaryOrgUnit() { $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); $dn = $this->eduPersonPrimaryOrgUnitDN; if (empty($dn)) return null; return $structure->getBy($dn, 'dn'); return $structureService->getBy($dn, 'dn'); } /** * Retourne la structure d'affectation de la personne * * @todo à terminer * @return Structure[] * @return Entity|Structure * @throws \Exception */ public function getEntiteAffectation() { throw new \Exception('Méthode pas finie'); $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); $codes = $this->getNode()->getAttribute('supannEntiteAffectation'); var_dump($codes); return $structure->getBy($dn, 'dn'); return $structureService->getBy($dn, 'dn'); } /** Loading @@ -223,7 +224,7 @@ class People extends Entity public function getEntiteAffectationPrincipale() { throw new \Exception('Méthode pas finie'); $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); $codes = []; $affectations = $this->getNode()->getAttribute('supannAffectation'); Loading @@ -233,7 +234,7 @@ class People extends Entity $code = $this->supannAffectation; if (empty($dn)) return null; return $structure->getBy($dn, 'dn'); return $structureService->getBy($dn, 'dn'); } /** Loading @@ -246,13 +247,13 @@ class People extends Entity public function getAffectationDescription() { throw new \Exception('Méthode pas finie'); $structure = $this->getService()->getServiceLocator()->get('ldapServiceStructure'); $structureService = $this->getService()->getLdapStructureService(); list($code, $description) = explode(';', $this->supannAffectation); $code = $this->supannAffectation; if (empty($dn)) return null; return $structure->getBy($dn, 'dn'); return $structureService->getBy($dn, 'dn'); } /** Loading