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
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Christophe Turbout
auth
Commits
258638bc
Commit
258638bc
authored
Jan 25, 2019
by
Bertrand Gauthier
Browse files
Options
Downloads
Patches
Plain Diff
Possibilité de reconnaître un compte utilisateur local.
parent
79481be8
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
src/UnicaenAuth/Entity/Db/AbstractUser.php
+19
-0
19 additions, 0 deletions
src/UnicaenAuth/Entity/Db/AbstractUser.php
src/UnicaenAuth/Entity/Shibboleth/ShibUser.php
+2
-1
2 additions, 1 deletion
src/UnicaenAuth/Entity/Shibboleth/ShibUser.php
with
21 additions
and
1 deletion
src/UnicaenAuth/Entity/Db/AbstractUser.php
+
19
−
0
View file @
258638bc
...
@@ -14,6 +14,9 @@ use Doctrine\ORM\Mapping as ORM;
...
@@ -14,6 +14,9 @@ use Doctrine\ORM\Mapping as ORM;
*/
*/
abstract
class
AbstractUser
implements
UserInterface
,
ProviderInterface
abstract
class
AbstractUser
implements
UserInterface
,
ProviderInterface
{
{
const
PASSWORD_LDAP
=
'ldap'
;
const
PASSWORD_SHIB
=
'shib'
;
/**
/**
* @var int
* @var int
* @ORM\Id
* @ORM\Id
...
@@ -246,6 +249,22 @@ abstract class AbstractUser implements UserInterface, ProviderInterface
...
@@ -246,6 +249,22 @@ abstract class AbstractUser implements UserInterface, ProviderInterface
$this
->
roles
->
add
(
$role
);
$this
->
roles
->
add
(
$role
);
}
}
/**
* Retourne true si cet utilisateur est local.
*
* Un utilisateur est local s'il ne résulte pas d'une authentification LDAP ou Shibboleth.
* Son mot de passe est chiffré dans la table des utilisateurs.
*
* @return bool
*/
public
function
isLocal
()
{
return
!
in_array
(
$this
->
getPassword
(),
[
AbstractUser
::
PASSWORD_LDAP
,
AbstractUser
::
PASSWORD_SHIB
,
]);
}
/**
/**
*
*
* @return string
* @return string
...
...
This diff is collapsed.
Click to expand it.
src/UnicaenAuth/Entity/Shibboleth/ShibUser.php
+
2
−
1
View file @
258638bc
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
UnicaenAuth\Entity\Shibboleth
;
namespace
UnicaenAuth\Entity\Shibboleth
;
use
UnicaenAuth\Entity\Db\AbstractUser
;
use
ZfcUser\Entity\UserInterface
;
use
ZfcUser\Entity\UserInterface
;
class
ShibUser
implements
UserInterface
class
ShibUser
implements
UserInterface
...
@@ -200,7 +201,7 @@ class ShibUser implements UserInterface
...
@@ -200,7 +201,7 @@ class ShibUser implements UserInterface
*/
*/
public
function
getPassword
()
public
function
getPassword
()
{
{
return
'shib'
;
return
AbstractUser
::
PASSWORD_SHIB
;
}
}
/**
/**
...
...
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