Loading CHANGELOG.md +6 −0 Original line number Diff line number Diff line # OSE 12 alpha ## Nouveautés * Possibilité de bloquer l'usage de certains rôles si l'on se trouve hors du réseau de l'établissement # OSE 11.2 ## Correction de bug Loading config.local.php.default +34 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,40 @@ return [ /* Langue utilisée (la liste des langues est disponible dans le répertoire /language de l'application) */ 'locale' => 'fr_FR', /* Fonction qui détermine si le client est situé dans le réseau de l'établissement ou non * * Si la fonction retourne true, alors on n'est topujours considéré comme connecté depuis le réseau de l'établissement */ 'inEtablissement' => function () { /* Exemple de test : $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $forwarded = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : ''; $ipInterne = '10.'; // les IP doivent débuter par 10.* pour être considérés comme de l'établissement $proxies = [ // Liste des adresses IP de vos proxies ]; $reverseProxies = [ // Liste des adresses IP des reverse-proxies ]; // Si on est en direct et en interne sans passer par le proxy (pas de redirection) if (0 === strpos($ip,$ipInterne) && $forwarded === '') return true; // Si on est en interne, que l'on sort puis on re-rentre en passant par le reverse proxy if (in_array($ip,$reverseProxies) && 0 === strpos($forwarded,$ipInterne)) return true; // Si on est en interne, que l'on passe par le proxy en interne if (in_array($ip,$proxies) && 0 === strpos($forwarded,$ipInterne)) return true; // Sinon, on vient de l'extérieur return false; */ return true; }, ], Loading module/Application/config/aaa_module.config.php +4 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,10 @@ $config = [ Cache\CacheService::class => Cache\Factory\CacheServiceFactory::class, Service\UtilisateurService::class => Service\Factory\UtilisateurServiceFactory::class, Assertion\InformationAssertion::class => \UnicaenAuth\Assertion\AssertionFactory::class, HostLocalization\HostLocalizationOse::class => HostLocalization\HostLocalizationOseFactory::class, ], 'aliases' => [ 'HostLocalization' => HostLocalization\HostLocalizationOse::class, ], ], 'view_helpers' => [ Loading module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Role.dcm.xml +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ <field name="histoModification" type="datetime" column="HISTO_MODIFICATION" nullable="false"/> <field name="libelle" type="string" column="LIBELLE" length="50" nullable="false"/> <field name="peutChangerStructure" type="boolean" column="PEUT_CHANGER_STRUCTURE" nullable="false" /> <field name="accessibleExterieur" type="boolean" column="ACCESSIBLE_EXTERIEUR" nullable="false" /> <many-to-one field="perimetre" target-entity="Application\Entity\Db\Perimetre"> <join-columns> <join-column name="PERIMETRE_ID" referenced-column-name="ID"/> Loading module/Application/src/Application/Entity/Db/Role.php +29 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,11 @@ class Role implements HistoriqueAwareInterface, RoleInterface */ protected $peutChangerStructure; /** * @var bool */ private $accessibleExterieur = true; /** * @var \Doctrine\Common\Collections\Collection */ Loading Loading @@ -198,6 +203,30 @@ class Role implements HistoriqueAwareInterface, RoleInterface /** * @return bool */ public function getAccessibleExterieur(): bool { return $this->accessibleExterieur; } /** * @param bool $accessibleExterieur * * @return Role */ public function setAccessibleExterieur(bool $accessibleExterieur): Role { $this->accessibleExterieur = $accessibleExterieur; return $this; } /** * Get id * Loading Loading
CHANGELOG.md +6 −0 Original line number Diff line number Diff line # OSE 12 alpha ## Nouveautés * Possibilité de bloquer l'usage de certains rôles si l'on se trouve hors du réseau de l'établissement # OSE 11.2 ## Correction de bug Loading
config.local.php.default +34 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,40 @@ return [ /* Langue utilisée (la liste des langues est disponible dans le répertoire /language de l'application) */ 'locale' => 'fr_FR', /* Fonction qui détermine si le client est situé dans le réseau de l'établissement ou non * * Si la fonction retourne true, alors on n'est topujours considéré comme connecté depuis le réseau de l'établissement */ 'inEtablissement' => function () { /* Exemple de test : $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $forwarded = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : ''; $ipInterne = '10.'; // les IP doivent débuter par 10.* pour être considérés comme de l'établissement $proxies = [ // Liste des adresses IP de vos proxies ]; $reverseProxies = [ // Liste des adresses IP des reverse-proxies ]; // Si on est en direct et en interne sans passer par le proxy (pas de redirection) if (0 === strpos($ip,$ipInterne) && $forwarded === '') return true; // Si on est en interne, que l'on sort puis on re-rentre en passant par le reverse proxy if (in_array($ip,$reverseProxies) && 0 === strpos($forwarded,$ipInterne)) return true; // Si on est en interne, que l'on passe par le proxy en interne if (in_array($ip,$proxies) && 0 === strpos($forwarded,$ipInterne)) return true; // Sinon, on vient de l'extérieur return false; */ return true; }, ], Loading
module/Application/config/aaa_module.config.php +4 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,10 @@ $config = [ Cache\CacheService::class => Cache\Factory\CacheServiceFactory::class, Service\UtilisateurService::class => Service\Factory\UtilisateurServiceFactory::class, Assertion\InformationAssertion::class => \UnicaenAuth\Assertion\AssertionFactory::class, HostLocalization\HostLocalizationOse::class => HostLocalization\HostLocalizationOseFactory::class, ], 'aliases' => [ 'HostLocalization' => HostLocalization\HostLocalizationOse::class, ], ], 'view_helpers' => [ Loading
module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Role.dcm.xml +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ <field name="histoModification" type="datetime" column="HISTO_MODIFICATION" nullable="false"/> <field name="libelle" type="string" column="LIBELLE" length="50" nullable="false"/> <field name="peutChangerStructure" type="boolean" column="PEUT_CHANGER_STRUCTURE" nullable="false" /> <field name="accessibleExterieur" type="boolean" column="ACCESSIBLE_EXTERIEUR" nullable="false" /> <many-to-one field="perimetre" target-entity="Application\Entity\Db\Perimetre"> <join-columns> <join-column name="PERIMETRE_ID" referenced-column-name="ID"/> Loading
module/Application/src/Application/Entity/Db/Role.php +29 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,11 @@ class Role implements HistoriqueAwareInterface, RoleInterface */ protected $peutChangerStructure; /** * @var bool */ private $accessibleExterieur = true; /** * @var \Doctrine\Common\Collections\Collection */ Loading Loading @@ -198,6 +203,30 @@ class Role implements HistoriqueAwareInterface, RoleInterface /** * @return bool */ public function getAccessibleExterieur(): bool { return $this->accessibleExterieur; } /** * @param bool $accessibleExterieur * * @return Role */ public function setAccessibleExterieur(bool $accessibleExterieur): Role { $this->accessibleExterieur = $accessibleExterieur; return $this; } /** * Get id * Loading