Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • 5.x
  • ll-php8-bs5
  • release_5_bs5
  • ll-php8
  • 4.x
  • laminas_migration
  • release_1.0.0.2
  • release_4.0.0
  • release_3.2.8
  • bootstrap4_migration
  • 1.0.0.3
  • 6.0.7
  • 6.0.6
  • 6.0.5
  • 6.0.4
  • 6.0.3
  • 6.0.2
  • 6.0.1
  • 5.1.1
  • 6.0.0
  • 5.1.0
  • 5.0.0
  • 4.0.2
  • 3.2.11
  • 4.0.1
  • 3.2.10
  • 4.0.0
  • 1.0.0.2
  • 3.2.9
  • 3.2.8
31 results

ShibUser.php

Blame
  • 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();
        }
    }