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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
auth
Commits
8d1d077d
Commit
8d1d077d
authored
11 years ago
by
Bertrand Gauthier
Browse files
Options
Downloads
Patches
Plain Diff
Aide de vue UserInfo : n'a besoin que du mapper d'accès aux structures LDAP.
parent
075bdac1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Module.php
+1
-1
1 addition, 1 deletion
Module.php
src/UnicaenAuth/View/Helper/UserInfo.php
+23
-23
23 additions, 23 deletions
src/UnicaenAuth/View/Helper/UserInfo.php
with
24 additions
and
24 deletions
Module.php
+
1
−
1
View file @
8d1d077d
...
...
@@ -137,7 +137,7 @@ class Module implements ConfigProviderInterface, ViewHelperProviderInterface, Se
},
'userInfo'
=>
function
(
HelperPluginManager
$sm
)
{
$helper
=
new
View\Helper\UserInfo
(
$sm
->
getServiceLocator
()
->
get
(
'zfcuser_auth_service'
));
$helper
->
set
Service
Structure
(
$sm
->
getServiceLocator
()
->
get
(
'ldap_structure_
service
'
));
$helper
->
set
Mapper
Structure
(
$sm
->
getServiceLocator
()
->
get
(
'ldap_structure_
mapper
'
));
return
$helper
;
},
),
...
...
This diff is collapsed.
Click to expand it.
src/UnicaenAuth/View/Helper/UserInfo.php
+
23
−
23
View file @
8d1d077d
...
...
@@ -2,7 +2,7 @@
namespace
UnicaenAuth\View\Helper
;
use
UnicaenApp\Entity\Ldap\People
;
use
UnicaenApp\
Service
\Ldap\Structure
as
Service
Structure
;
use
UnicaenApp\
Mapper
\Ldap\Structure
as
Mapper
Structure
;
use
Zend\View\Helper\HtmlList
;
/**
...
...
@@ -15,9 +15,9 @@ use Zend\View\Helper\HtmlList;
class
UserInfo
extends
UserAbstract
{
/**
* @var
Service
Structure
* @var
Mapper
Structure
*/
protected
$
service
Structure
;
protected
$
mapper
Structure
;
/**
* @var bool
...
...
@@ -28,7 +28,7 @@ class UserInfo extends UserAbstract
* Point d'entrée.
*
* @param boolean $affectationPrincipale Indique s'il ne faut prendre en compte que l'affectation principale
* @return
U
se
rInfo
* @return se
lf
*/
public
function
__invoke
(
$affectationPrincipale
=
false
)
{
...
...
@@ -57,9 +57,9 @@ class UserInfo extends UserAbstract
if
(
$authIdentity
instanceof
People
)
{
// affectations admin
$affectations
=
$authIdentity
->
getAffectationsAdmin
(
$this
->
get
Service
Structure
()
->
getMapper
()
,
$this
->
getAffectationPrincipale
());
$affectations
=
$authIdentity
->
getAffectationsAdmin
(
$this
->
get
Mapper
Structure
(),
$this
->
getAffectationPrincipale
());
if
(
$affectations
)
{
// $affectations = (array)$this->get
Service
Structure()->getMapper()->findChemin(array_keys($affectations));
// $affectations = (array)$this->get
Mapper
Structure()->getMapper()->findChemin(array_keys($affectations));
if
(
empty
(
$affectations
))
$affectations
[]
=
$this
->
getView
()
->
translate
(
"Aucune affectation trouvée."
);
ksort
(
$affectations
);
...
...
@@ -70,7 +70,7 @@ class UserInfo extends UserAbstract
// affectations recherche
$affectations
=
$authIdentity
->
getAffectationsRecherche
();
if
(
$affectations
)
{
$affectations
=
(
array
)
$this
->
get
Service
Structure
()
->
getMapper
()
->
findAllPathByCodeStructure
(
array_keys
(
$affectations
));
$affectations
=
(
array
)
$this
->
get
Mapper
Structure
()
->
findAllPathByCodeStructure
(
array_keys
(
$affectations
));
ksort
(
$affectations
);
$affectations
=
$helperHtmlList
(
$affectations
,
$ordered
=
false
,
$attribs
=
false
,
$escape
=
false
);
$out
.
=
sprintf
(
$templateAffRech
,
$affectations
);
...
...
@@ -101,7 +101,7 @@ class UserInfo extends UserAbstract
// // affectations admin
// $affectations = $authIdentity->getLdapIdentityData()->getAffectationsAdmin($this->getAffectationPrincipale());
// if ($affectations) {
// $affectations = (array)$this->get
Service
Structure()->findChemin(array_keys($affectations));
// $affectations = (array)$this->get
Mapper
Structure()->findChemin(array_keys($affectations));
// if (empty($affectations))
// $affectations[] = "Aucune affectation trouvée.";
// ksort($affectations);
...
...
@@ -112,7 +112,7 @@ class UserInfo extends UserAbstract
// // affectations recherche
// $affectations = $authIdentity->getLdapIdentityData()->getAffectationsRecherche();
// if ($affectations) {
// $affectations = (array)$this->get
Service
Structure()->findChemin(array_keys($affectations));
// $affectations = (array)$this->get
Mapper
Structure()->findChemin(array_keys($affectations));
// ksort($affectations);
// $affectations = $helperHtmlList($affectations, $ordered = false, $attribs = false, $escape = false);
// $out .= sprintf($templateAffRech, $affectations);
...
...
@@ -174,7 +174,7 @@ class UserInfo extends UserAbstract
* Active ou non l'affichage de l'affectation principale seulement.
*
* @param bool $affectationPrincipale
* @return
U
se
rInfo
* @return se
lf
*/
public
function
setAffectationPrincipale
(
$affectationPrincipale
=
true
)
{
...
...
@@ -183,24 +183,24 @@ class UserInfo extends UserAbstract
}
/**
* Spécifie le
service
d'accès aux structures de l'annuaire LDAP.
* Spécifie le
mapper
d'accès aux structures de l'annuaire LDAP.
*
* @param
Service
Structure $
service
Structure
* @return
U
se
rInfo
* @param
Mapper
Structure $
mapper
Structure
* @return se
lf
*/
public
function
set
Service
Structure
(
Service
Structure
$
service
Structure
)
public
function
set
Mapper
Structure
(
Mapper
Structure
$
mapper
Structure
)
{
$this
->
service
Structure
=
$
service
Structure
;
$this
->
mapper
Structure
=
$
mapper
Structure
;
return
$this
;
}
/**
* Retourne le
service
d'accès aux structures de l'annuaire LDAP.
* Retourne le
mapper
d'accès aux structures de l'annuaire LDAP.
*
* @return
Service
Structure
* @return
Mapper
Structure
*/
public
function
get
Service
Structure
()
public
function
get
Mapper
Structure
()
{
return
$this
->
service
Structure
;
return
$this
->
mapper
Structure
;
}
}
\ No newline at end of file
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