Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
ldap
Commits
959927aa
Commit
959927aa
authored
Oct 03, 2014
by
David Surville
Browse files
Ajout du filtre pour les roles
parent
3937a692
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenLdap/Filter/People.php
View file @
959927aa
<?php
namespace
UnicaenLdap\Filter
;
use
UnicaenLdap\Entity\Structure
;
use
Zend\Ldap\Filter\MaskFilter
;
use
UnicaenLdap\Entity\Structure
as
Structure
;
/**
* Filtres pour les personnes
...
...
@@ -54,7 +55,7 @@ class People extends Filter
{
return
self
::
orFilter
(
self
::
username
(
$name
),
self
::
nam
r
(
$name
)
self
::
nam
e
(
$name
)
);
}
...
...
@@ -62,7 +63,7 @@ class People extends Filter
* Génère un filtre de recherche par affectation
*
* @todo à terminer
* @param string|Structure $structure Structure
* @param string|
Entity
Structure $structure Structure
* @return self
*/
public
static
function
affectation
(
$name
)
...
...
@@ -86,16 +87,21 @@ class People extends Filter
}
/**
* Génère un filtre de recherche selon leur appartenance à un groupe et leur structure d'affectation.
*
* @todo à terminer
* @return self
* Génère un filtre de recherche pour les rôles
*
* @param string $role
* @param string $type
* @param string $structure
* @return type
*/
public
static
function
role
(
$role
,
$structure
=
null
,
$recursive
=
false
)
{
//(supannRoleEntite=[role={SUPANN}%s][type={SUPANN}%s][code=%s]*)
// (&(uid=*)(|(ucbnSousStructure=%s;*)(supannAffectation=%s;*)))
//return self::equals('cn', $name);
throw
new
Exception
(
'Méthode non terminée'
);
public
static
function
role
(
$role
=
null
,
$type
=
null
,
$structure
=
null
)
{
$mask
=
'supannRoleEntite=[role={SUPANN}%s][type={SUPANN}%s][code=%s][libelle=*]'
;
return
self
::
string
(
self
::
unescapeValue
(
new
MaskFilter
(
$mask
,
$role
?:
'*'
,
$type
?:
'*'
,
$structure
?:
'*'
)
)
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment