Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 536 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
class Utilisateur {

        const NIVEAU_DEBUTANT = 1;
        const NIVEAU_INTERMEDIAIRE = 2;
        const NIVEAU_EXPERT = 3;

        private $dureeSauvegarde = null;
        private $niveau = null;


        public function __construct($niveauDefaut) {
                $this->niveau = isset($_COOKIE['eflore.niveau']) ? $_COOKIE['eflore.niveau'] : $niveauDefaut;
                $this->dureeSauvegarde = 3600*24*365;
        }

        public function getNiveau() {
                return $this->niveau;
        }

        public function sauver() {
                setcookie('eflore.niveau', time()+$this->dureeSauvegarde, '/', 'www.tela-botanica.org');
        }


}