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
1e76a5c8
Commit
1e76a5c8
authored
Feb 19, 2013
by
Bertrand Gauthier
Browse files
Options
Downloads
Patches
Plain Diff
L'aide de vue UserPorfile ne renvoit rien dans le module unicaen-auth.
parent
e5378b1d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Module.php
+4
-4
4 additions, 4 deletions
Module.php
src/UnicaenAuth/View/Helper/UserProfile.php
+2
-61
2 additions, 61 deletions
src/UnicaenAuth/View/Helper/UserProfile.php
with
6 additions
and
65 deletions
Module.php
+
4
−
4
View file @
1e76a5c8
...
...
@@ -133,11 +133,11 @@ class Module implements ConfigProviderInterface, ViewHelperProviderInterface, Se
'userStatus'
=>
function
(
HelperPluginManager
$sm
)
{
return
new
View\Helper\UserStatus
(
$sm
->
getServiceLocator
()
->
get
(
'zfcuser_auth_service'
));
},
//
'userProfile' => function (HelperPluginManager $sm) {
//
$helper = new View\Helper\UserProfile($sm->getServiceLocator()->get('zfcuser_auth_service'));
'userProfile'
=>
function
(
HelperPluginManager
$sm
)
{
$helper
=
new
View\Helper\UserProfile
(
$sm
->
getServiceLocator
()
->
get
(
'zfcuser_auth_service'
));
// $helper->setIdentityProvider($sm->getServiceLocator()->get('BjyAuthorize\Service\Authorize')->getIdentityProvider());
//
return $helper;
//
},
return
$helper
;
},
'userInfo'
=>
function
(
HelperPluginManager
$sm
)
{
$helper
=
new
View\Helper\UserInfo
(
$sm
->
getServiceLocator
()
->
get
(
'zfcuser_auth_service'
));
$helper
->
setServiceStructure
(
$sm
->
getServiceLocator
()
->
get
(
'ldap_structure_service'
));
...
...
This diff is collapsed.
Click to expand it.
src/UnicaenAuth/View/Helper/UserProfile.php
+
2
−
61
View file @
1e76a5c8
<?php
namespace
UnicaenAuth\View\Helper
;
use
BjyAuthorize\Provider\Identity\ProviderInterface
as
IdentityProvider
;
/**
* Aide de vue permettant d'afficher le profil de l'utilisateur connecté.
*
...
...
@@ -10,11 +8,6 @@ use BjyAuthorize\Provider\Identity\ProviderInterface as IdentityProvider;
*/
class
UserProfile
extends
UserAbstract
{
/**
* @var IdentityProvider
*/
protected
$identityProvider
;
/**
* Point d'entrée.
*
...
...
@@ -32,58 +25,6 @@ class UserProfile extends UserAbstract
*/
public
function
__toString
()
{
if
(
!
(
$identity
=
$this
->
getIdentity
()))
{
return
null
;
}
if
(
$identity
instanceof
\Zend\Permissions\Acl\Role\RoleInterface
)
{
$roles
=
array
(
$identity
->
getRoleId
());
}
else
{
$roles
=
$this
->
getIdentityRoles
();
}
$template
=
'<strong>'
.
$this
->
getView
()
->
translate
(
"Profil"
)
.
' :</strong> %s'
;
$roles
=
$this
->
getView
()
->
htmlList
(
$roles
,
$ordered
=
false
/*, $attribs = false, $escape = false*/
);
$out
=
sprintf
(
$template
,
$roles
);
return
$out
;
}
/**
*
* @return array
*/
protected
function
getIdentityRoles
()
{
$roles
=
array
();
if
(
$this
->
getIdentityProvider
())
{
$roles
=
$this
->
getIdentityProvider
()
->
getIdentityRoles
();
}
if
(
!
$roles
)
{
$roles
=
array
(
$this
->
getView
()
->
translate
(
"Aucun"
));
}
return
$roles
;
}
/**
*
* @param IdentityProvider $provider
* @return \UnicaenAuth\View\Helper\UserProfile
*/
public
function
setIdentityProvider
(
IdentityProvider
$provider
)
{
$this
->
identityProvider
=
$provider
;
return
$this
;
}
/**
*
* @return IdentityProvider
*/
public
function
getIdentityProvider
()
{
return
$this
->
identityProvider
;
return
''
;
}
}
\ 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
sign in
to comment