Select Git revision
ShibUser.php
-
Bertrand Gauthier authored
Configuration de la stratégie d'extraction d'un identifiant utile parmi les données d'authentification shibboleth (config 'shib_user_id_extractor').
Bertrand Gauthier authoredConfiguration de la stratégie d'extraction d'un identifiant utile parmi les données d'authentification shibboleth (config 'shib_user_id_extractor').
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ShibUser.php 3.84 KiB
<?php
namespace UnicaenAuth\Entity\Shibboleth;
use UnicaenAuth\Entity\Db\AbstractUser;
use ZfcUser\Entity\UserInterface;
class ShibUser implements UserInterface
{
/**
* @var string
*/
protected $id;
/**
* @var string
*/
protected $username;
/**
* @var string
*/
protected $email;
/**
* @var string
*/
protected $displayName;
/**
* @var string
*/
protected $nom;
/**
* @var string
*/
protected $prenom;
/**
* @var string
*/
protected $civilite;
/**
* @var int
*/
protected $state = 1;
/**
* Retourne la partie domaine DNS de l'EPPN.
* Retourne par exemple "unicaen.fr" lorsque l'EPPN est "tartempion@unicaen.fr"
*
* @return string
*/
public function getEppnDomain()
{
$parts = explode('@', $this->getEppn());
return $parts[1];
}
/**
* @return string
*/
public function getEppn()
{
return $this->getUsername();
}
/**
* Set eduPersoPrincipalName (EPPN).
*
* @param string $eppn eduPersoPrincipalName (EPPN), ex: 'gauthierb@unicaen.fr'
*/
public function setEppn($eppn)
{
$this->setUsername($eppn);
}
/**
* {@inheritdoc}
*/
public function getId()
{
return $this->id;
}
/**
* Set id.
*
* @param string $id supannEmpId ou supannEtuId
*/
public function setId($id)
{
$this->id = $id;
}
/**
* Get username.
*
* @return string
*/
public function getUsername()
{
return $this->username;
}
/**
* Set username.
*
* @param string $username
*/
public function setUsername($username)
{
$this->username = $username;
}
/**
* Get email.
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set email.
*
* @param string $email
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* Get displayName.
*
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* Set displayName.
*
* @param string $displayName
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
}
/**
* @return string
*/
public function getNom()
{
return $this->nom;
}
/**
* @param string $nom
*/
public function setNom($nom)
{
$this->nom = $nom;
}
/**
* @return string
*/
public function getPrenom()
{
return $this->prenom;
}
/**
* @param string $prenom
*/
public function setPrenom($prenom)
{
$this->prenom = $prenom;
}
/**
* @return string|null
*/
public function getCivilite()
{
return $this->civilite;
}
/**
* @param string|null $civilite
*/
public function setCivilite($civilite = null)
{
$this->civilite = $civilite;
}
/**
* Get password.
*
* @return string
*/
public function getPassword()
{
return AbstractUser::PASSWORD_SHIB;
}
/**
* Set password.
*
* @param string $password
*/
public function setPassword($password)
{
}
/**
* Get state.
*
* @return int
*/
public function getState()
{
return $this->state;
}
/**
* Set state.
*
* @param int $state
*/
public function setState($state)
{
$this->state = $state;
}
/**
*
* @return string
*/
public function __toString()
{
return $this->getDisplayName();
}
}