Loading code/test3.php +5 −9 Original line number Diff line number Diff line Loading @@ -9,17 +9,13 @@ echo '<br /><br /><br /><br /><br /><br /><br />'; $um = $container->get(\Framework\User\UserManager::class); dump($um->getCurrent()); dump($um->getCurrentProfile()); $um->updatePrivileges(); dump($um->getPrivileges()); $intervenant = $um->getCurrentProfile()->getContext('intervenant'); dump($intervenant->getId()); $ldap = $container->get(\Utilisateur\Connecteur\LdapConnecteur::class); dump($ldap->getUtilisateurCourantCode()); $a = $container->get(\Laminas\Authentication\AuthenticationService::class); $c = $a->getIdentity(); dump($c); No newline at end of file config/autoload/bdd.global.php +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ return [ 'connection' => [ 'orm_default' => [ 'params' => [ 'driverClass' => \Doctrine\DBAL\Driver\OCI8\Driver::class, 'driverClass' => \Application\ORM\OracleDriver::class, 'host' => $config['bdd']['host'] ?? null, 'port' => $config['bdd']['port'] ?? null, 'dbname' => $config['bdd']['dbname'] ?? null, Loading module/Application/src/ORM/OracleDriver.php 0 → 100644 +57 −0 Original line number Diff line number Diff line <?php namespace Application\ORM; use \Doctrine\DBAL\Driver\AbstractOracleDriver; use Doctrine\DBAL\Driver\OCI8\Connection; use Doctrine\DBAL\Driver\OCI8\Exception\ConnectionFailed; use Doctrine\DBAL\Driver\OCI8\Exception\InvalidConfiguration; class OracleDriver extends AbstractOracleDriver { /** * {@inheritDoc} * * @return Connection */ public function connect( #[SensitiveParameter] array $params ) { $username = $params['user'] ?? ''; $password = $params['password'] ?? ''; $charset = $params['charset'] ?? ''; $sessionMode = $params['sessionMode'] ?? OCI_NO_AUTO_COMMIT; $connectionString = $this->getEasyConnectString($params); $persistent = ! empty($params['persistent']); $exclusive = ! empty($params['driverOptions']['exclusive']); if ($persistent && $exclusive) { throw InvalidConfiguration::forPersistentAndExclusive(); } if ($persistent) { $connection = @oci_pconnect($username, $password, $connectionString, $charset, $sessionMode); } elseif ($exclusive) { $connection = @oci_new_connect($username, $password, $connectionString, $charset, $sessionMode); } else { $connection = @oci_connect($username, $password, $connectionString, $charset, $sessionMode); } if ($connection === false) { throw ConnectionFailed::new(); } return new Connection($connection); } public function getDatabasePlatform() { return new OraclePlatform(); } } No newline at end of file module/Application/src/ORM/OraclePlatform.php 0 → 100644 +14 −0 Original line number Diff line number Diff line <?php namespace Application\ORM; use Doctrine\DBAL\Platforms\OraclePlatform as DoctrineOraclePlatform; class OraclePlatform extends DoctrineOraclePlatform { public function getMaxIdentifierLength() { return 100; } } module/Application/src/View/Helper/LayoutViewHelper.php +5 −5 Original line number Diff line number Diff line Loading @@ -68,8 +68,8 @@ class LayoutViewHelper extends AbstractHtmlElement return ['connecte' => false]; } $user = $this->userManager->getCurrent(); $profile = $this->userManager->getCurrentProfile(); $user = $this->userManager->getUser(); $profile = $this->userManager->getProfile(); $needStructures = false; $roles = []; Loading @@ -81,7 +81,7 @@ class LayoutViewHelper extends AbstractHtmlElement if (!$needStructures && $r?->getPeutChangerStructure()) { $needStructures = true; } $roles[$p->getCode()] = [ $roles[$p->getId()] = [ 'libelle' => $p->getDisplayName(), 'peutChangerStructure' => $r?->getPeutChangerStructure() ?? false, ]; Loading @@ -94,8 +94,8 @@ class LayoutViewHelper extends AbstractHtmlElement return [ 'utilisateurNom' => $user->getDisplayName(), 'roleNom' => $profile->getDisplayName(), 'roleId' => $profile->getCode(), 'roleNom' => $profile?->getDisplayName() ?? 'Authentifié(e)', 'roleId' => $profile?->getId(), 'connecte' => true, 'usurpationEnabled' => $this->isUsurpationEnabled(), 'usurpationEnCours' => $this->isUsurpationEnCours(), Loading Loading
code/test3.php +5 −9 Original line number Diff line number Diff line Loading @@ -9,17 +9,13 @@ echo '<br /><br /><br /><br /><br /><br /><br />'; $um = $container->get(\Framework\User\UserManager::class); dump($um->getCurrent()); dump($um->getCurrentProfile()); $um->updatePrivileges(); dump($um->getPrivileges()); $intervenant = $um->getCurrentProfile()->getContext('intervenant'); dump($intervenant->getId()); $ldap = $container->get(\Utilisateur\Connecteur\LdapConnecteur::class); dump($ldap->getUtilisateurCourantCode()); $a = $container->get(\Laminas\Authentication\AuthenticationService::class); $c = $a->getIdentity(); dump($c); No newline at end of file
config/autoload/bdd.global.php +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ return [ 'connection' => [ 'orm_default' => [ 'params' => [ 'driverClass' => \Doctrine\DBAL\Driver\OCI8\Driver::class, 'driverClass' => \Application\ORM\OracleDriver::class, 'host' => $config['bdd']['host'] ?? null, 'port' => $config['bdd']['port'] ?? null, 'dbname' => $config['bdd']['dbname'] ?? null, Loading
module/Application/src/ORM/OracleDriver.php 0 → 100644 +57 −0 Original line number Diff line number Diff line <?php namespace Application\ORM; use \Doctrine\DBAL\Driver\AbstractOracleDriver; use Doctrine\DBAL\Driver\OCI8\Connection; use Doctrine\DBAL\Driver\OCI8\Exception\ConnectionFailed; use Doctrine\DBAL\Driver\OCI8\Exception\InvalidConfiguration; class OracleDriver extends AbstractOracleDriver { /** * {@inheritDoc} * * @return Connection */ public function connect( #[SensitiveParameter] array $params ) { $username = $params['user'] ?? ''; $password = $params['password'] ?? ''; $charset = $params['charset'] ?? ''; $sessionMode = $params['sessionMode'] ?? OCI_NO_AUTO_COMMIT; $connectionString = $this->getEasyConnectString($params); $persistent = ! empty($params['persistent']); $exclusive = ! empty($params['driverOptions']['exclusive']); if ($persistent && $exclusive) { throw InvalidConfiguration::forPersistentAndExclusive(); } if ($persistent) { $connection = @oci_pconnect($username, $password, $connectionString, $charset, $sessionMode); } elseif ($exclusive) { $connection = @oci_new_connect($username, $password, $connectionString, $charset, $sessionMode); } else { $connection = @oci_connect($username, $password, $connectionString, $charset, $sessionMode); } if ($connection === false) { throw ConnectionFailed::new(); } return new Connection($connection); } public function getDatabasePlatform() { return new OraclePlatform(); } } No newline at end of file
module/Application/src/ORM/OraclePlatform.php 0 → 100644 +14 −0 Original line number Diff line number Diff line <?php namespace Application\ORM; use Doctrine\DBAL\Platforms\OraclePlatform as DoctrineOraclePlatform; class OraclePlatform extends DoctrineOraclePlatform { public function getMaxIdentifierLength() { return 100; } }
module/Application/src/View/Helper/LayoutViewHelper.php +5 −5 Original line number Diff line number Diff line Loading @@ -68,8 +68,8 @@ class LayoutViewHelper extends AbstractHtmlElement return ['connecte' => false]; } $user = $this->userManager->getCurrent(); $profile = $this->userManager->getCurrentProfile(); $user = $this->userManager->getUser(); $profile = $this->userManager->getProfile(); $needStructures = false; $roles = []; Loading @@ -81,7 +81,7 @@ class LayoutViewHelper extends AbstractHtmlElement if (!$needStructures && $r?->getPeutChangerStructure()) { $needStructures = true; } $roles[$p->getCode()] = [ $roles[$p->getId()] = [ 'libelle' => $p->getDisplayName(), 'peutChangerStructure' => $r?->getPeutChangerStructure() ?? false, ]; Loading @@ -94,8 +94,8 @@ class LayoutViewHelper extends AbstractHtmlElement return [ 'utilisateurNom' => $user->getDisplayName(), 'roleNom' => $profile->getDisplayName(), 'roleId' => $profile->getCode(), 'roleNom' => $profile?->getDisplayName() ?? 'Authentifié(e)', 'roleId' => $profile?->getId(), 'connecte' => true, 'usurpationEnabled' => $this->isUsurpationEnabled(), 'usurpationEnCours' => $this->isUsurpationEnCours(), Loading