Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
auth
Commits
87b6f3a7
Commit
87b6f3a7
authored
9 years ago
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
Ajout du champ permettant de gérer les filtres LDAP au modèle et à l'entité Role
Refactoring
parent
29acec33
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Module.php
+1
-25
1 addition, 25 deletions
Module.php
config/module.config.php
+86
-71
86 additions, 71 deletions
config/module.config.php
data/schema_mysql.sql
+1
-0
1 addition, 0 deletions
data/schema_mysql.sql
src/UnicaenAuth/Entity/Db/Role.php
+61
-5
61 additions, 5 deletions
src/UnicaenAuth/Entity/Db/Role.php
with
149 additions
and
101 deletions
Module.php
+
1
−
25
View file @
87b6f3a7
...
...
@@ -5,14 +5,13 @@ namespace UnicaenAuth;
use
Zend\ModuleManager\Feature\AutoloaderProviderInterface
;
use
Zend\ModuleManager\Feature\ConfigProviderInterface
;
use
Zend\ModuleManager\Feature\ServiceProviderInterface
;
use
Zend\ModuleManager\Feature\ViewHelperProviderInterface
;
/**
* Point d'entrée du module d'authentification Unicaen.
*
* @author Bertrand GAUTHIER <bertrand.gauthier@unicaen.fr>
*/
class
Module
implements
ConfigProviderInterface
,
ViewHelperProviderInterface
,
ServiceProviderInterface
class
Module
implements
ConfigProviderInterface
,
ServiceProviderInterface
{
/**
*
...
...
@@ -113,29 +112,6 @@ class Module implements ConfigProviderInterface, ViewHelperProviderInterface, Se
}
}
/**
*
* @return array
* @see ViewHelperProviderInterface
*/
public
function
getViewHelperConfig
()
{
return
[
'factories'
=>
[
'userConnection'
=>
'UnicaenAuth\View\Helper\UserConnectionFactory'
,
'userCurrent'
=>
'UnicaenAuth\View\Helper\UserCurrentFactory'
,
'userStatus'
=>
'UnicaenAuth\View\Helper\UserStatusFactory'
,
'userProfile'
=>
'UnicaenAuth\View\Helper\UserProfileFactory'
,
'userInfo'
=>
'UnicaenAuth\View\Helper\UserInfoFactory'
,
'userProfileSelect'
=>
'UnicaenAuth\View\Helper\UserProfileSelectFactory'
,
'userProfileSelectRadioItem'
=>
'UnicaenAuth\View\Helper\UserProfileSelectRadioItemFactory'
,
],
'invokables'
=>
[
'appConnection'
=>
'UnicaenAuth\View\Helper\AppConnection'
,
],
];
}
/**
*
* @return array
...
...
This diff is collapsed.
Click to expand it.
config/module.config.php
+
86
−
71
View file @
87b6f3a7
...
...
@@ -93,7 +93,7 @@ $bjyauthorize = [
*/
'UnicaenAuth\Provider\Role\Config'
=>
[
'guest'
=>
[
'name'
=>
"Non authentifié(e)"
,
'selectable'
=>
false
,
'children'
=>
[
'user'
=>
[
'name'
=>
"Authentifié(e)"
,
'selectable'
=>
false
]
'user'
=>
[
'name'
=>
"Authentifié(e)"
,
'selectable'
=>
false
]
,
]],
],
/**
...
...
@@ -151,22 +151,22 @@ return [
'zfcuser_entity'
=>
[
'class'
=>
'Doctrine\ORM\Mapping\Driver\AnnotationDriver'
,
'paths'
=>
[
__DIR__
.
'/../src/UnicaenAuth/Entity/Db'
]
__DIR__
.
'/../src/UnicaenAuth/Entity/Db'
,
]
,
],
'orm_auth_driver'
=>
[
'class'
=>
'Doctrine\ORM\Mapping\Driver\AnnotationDriver'
,
'cache'
=>
'array'
,
'paths'
=>
[
__DIR__
.
'/../src/UnicaenAuth/Entity/Db'
]
__DIR__
.
'/../src/UnicaenAuth/Entity/Db'
,
]
,
],
'orm_default'
=>
[
'class'
=>
'Doctrine\ORM\Mapping\Driver\DriverChain'
,
'drivers'
=>
[
'UnicaenAuth\Entity\Db'
=>
'zfcuser_entity'
,
'UnicaenAuth\Entity\Db'
=>
'orm_auth_driver'
]
'UnicaenAuth\Entity\Db'
=>
'orm_auth_driver'
,
]
,
],
],
],
...
...
@@ -179,7 +179,7 @@ return [
'UnicaenAuth\Authentication\Storage\Db'
=>
'UnicaenAuth\Authentication\Storage\Db'
,
'UnicaenAuth\Authentication\Storage\Ldap'
=>
'UnicaenAuth\Authentication\Storage\Ldap'
,
'UnicaenAuth\View\RedirectionStrategy'
=>
'UnicaenAuth\View\RedirectionStrategy'
,
'authUserContext'
=>
'UnicaenAuth\Service\UserContext'
'authUserContext'
=>
'UnicaenAuth\Service\UserContext'
,
],
'abstract_factories'
=>
[
'UnicaenAuth\Authentication\Adapter\AbstractFactory'
,
...
...
@@ -318,4 +318,19 @@ return [
],
],
],
'view_helpers'
=>
[
'factories'
=>
[
'userConnection'
=>
'UnicaenAuth\View\Helper\UserConnectionFactory'
,
'userCurrent'
=>
'UnicaenAuth\View\Helper\UserCurrentFactory'
,
'userStatus'
=>
'UnicaenAuth\View\Helper\UserStatusFactory'
,
'userProfile'
=>
'UnicaenAuth\View\Helper\UserProfileFactory'
,
'userInfo'
=>
'UnicaenAuth\View\Helper\UserInfoFactory'
,
'userProfileSelect'
=>
'UnicaenAuth\View\Helper\UserProfileSelectFactory'
,
'userProfileSelectRadioItem'
=>
'UnicaenAuth\View\Helper\UserProfileSelectRadioItemFactory'
,
],
'invokables'
=>
[
'appConnection'
=>
'UnicaenAuth\View\Helper\AppConnection'
,
],
],
];
\ No newline at end of file
This diff is collapsed.
Click to expand it.
data/schema_mysql.sql
+
1
−
0
View file @
87b6f3a7
...
...
@@ -14,6 +14,7 @@ CREATE TABLE IF NOT EXISTS `user_role` (
`role_id`
VARCHAR
(
64
)
NOT
NULL
,
`is_default`
TINYINT
(
1
)
NOT
NULL
DEFAULT
0
,
`parent_id`
INT
(
11
)
NULL
DEFAULT
NULL
,
`ldap_filter`
varchar
(
255
)
CHARACTER
SET
utf8
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
),
UNIQUE
INDEX
`unique_role`
(
`role_id`
ASC
),
INDEX
`idx_parent_id`
(
`parent_id`
ASC
),
...
...
This diff is collapsed.
Click to expand it.
src/UnicaenAuth/Entity/Db/Role.php
+
61
−
5
View file @
87b6f3a7
...
...
@@ -45,6 +45,12 @@ class Role implements HierarchicalRoleInterface
*/
protected
$parent
;
/**
* @var string
* @ORM\Column(name="ldap_filter", type="string", length=255, unique=true, nullable=true)
*/
protected
$ldapFilter
;
/**
* @var \Doctrine\Common\Collections\Collection
* @ORM\ManyToMany(targetEntity="UnicaenAuth\Entity\Db\User")
...
...
@@ -55,6 +61,8 @@ class Role implements HierarchicalRoleInterface
*/
protected
$users
;
/**
* Get the id.
*
...
...
@@ -65,6 +73,8 @@ class Role implements HierarchicalRoleInterface
return
$this
->
id
;
}
/**
* Set the id.
*
...
...
@@ -75,9 +85,12 @@ class Role implements HierarchicalRoleInterface
public
function
setId
(
$id
)
{
$this
->
id
=
(
int
)
$id
;
return
$this
;
}
/**
* Get the role id.
*
...
...
@@ -88,6 +101,8 @@ class Role implements HierarchicalRoleInterface
return
$this
->
roleId
;
}
/**
* Set the role id.
*
...
...
@@ -98,9 +113,12 @@ class Role implements HierarchicalRoleInterface
public
function
setRoleId
(
$roleId
)
{
$this
->
roleId
=
(
string
)
$roleId
;
return
$this
;
}
/**
* Is this role the default one ?
*
...
...
@@ -111,6 +129,8 @@ class Role implements HierarchicalRoleInterface
return
$this
->
isDefault
;
}
/**
* Set this role as the default one.
*
...
...
@@ -121,9 +141,12 @@ class Role implements HierarchicalRoleInterface
public
function
setIsDefault
(
$isDefault
)
{
$this
->
isDefault
=
(
boolean
)
$isDefault
;
return
$this
;
}
/**
* Get the parent role
*
...
...
@@ -134,6 +157,8 @@ class Role implements HierarchicalRoleInterface
return
$this
->
parent
;
}
/**
* Set the parent role.
*
...
...
@@ -144,9 +169,36 @@ class Role implements HierarchicalRoleInterface
public
function
setParent
(
Role
$parent
)
{
$this
->
parent
=
$parent
;
return
$this
;
}
/**
* @return string
*/
public
function
getLdapFilter
()
{
return
$this
->
ldapFilter
;
}
/**
* @param string $ldapFilter
*
* @return Role
*/
public
function
setLdapFilter
(
$ldapFilter
)
{
$this
->
ldapFilter
=
$ldapFilter
;
return
$this
;
}
/**
* Get users.
*
...
...
@@ -157,6 +209,8 @@ class Role implements HierarchicalRoleInterface
return
$this
->
users
->
getValues
();
}
/**
* Add a user to the role.
*
...
...
@@ -169,6 +223,8 @@ class Role implements HierarchicalRoleInterface
$this
->
users
[]
=
$user
;
}
/**
*
* @return string
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment