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
auth
Commits
258638bc
Commit
258638bc
authored
Jan 25, 2019
by
Bertrand Gauthier
Browse files
Possibilité de reconnaître un compte utilisateur local.
parent
79481be8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Entity/Db/AbstractUser.php
View file @
258638bc
...
...
@@ -14,6 +14,9 @@ use Doctrine\ORM\Mapping as ORM;
*/
abstract
class
AbstractUser
implements
UserInterface
,
ProviderInterface
{
const
PASSWORD_LDAP
=
'ldap'
;
const
PASSWORD_SHIB
=
'shib'
;
/**
* @var int
* @ORM\Id
...
...
@@ -246,6 +249,22 @@ abstract class AbstractUser implements UserInterface, ProviderInterface
$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
...
...
src/UnicaenAuth/Entity/Shibboleth/ShibUser.php
View file @
258638bc
...
...
@@ -2,6 +2,7 @@
namespace
UnicaenAuth\Entity\Shibboleth
;
use
UnicaenAuth\Entity\Db\AbstractUser
;
use
ZfcUser\Entity\UserInterface
;
class
ShibUser
implements
UserInterface
...
...
@@ -200,7 +201,7 @@ class ShibUser implements UserInterface
*/
public
function
getPassword
()
{
return
'shib'
;
return
AbstractUser
::
PASSWORD_SHIB
;
}
/**
...
...
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