Subversion Repositories Sites.obs-saisons.fr

Rev

Rev 207 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
class DrupalUtilisateur extends Utilisateur {
        
        public function getNomUtilisateurPourId($id) {
                return db_result(db_query("SELECT name FROM {users} WHERE uid = %d", $id));
        }
        
        public function getIdUtilisateurPourNom($nom) {
                return db_result(db_query("SELECT uid FROM {users} WHERE name = '%s'", $nom));
        }
        
        public function getIdentifiantNumerique() {
                return $GLOBALS['user']->uid;           
        }
        
        public function getEmail() {
                return $GLOBALS['user']->mail;
        }
        
        public function getNom() {
                return $GLOBALS['user']->name;
        }
        
        public function getPrenom() {
                return '';      
        }
        
        public function estAdmin() {
                return in_array('3',array_keys($GLOBALS['user']->roles)) || in_array('3',array_keys($GLOBALS['user']->roles)) ;
        }
        
        public function estIdentifie() {
                return user_is_logged_in();
        }
        
        public function getFormulaireIdentification() {
                
                return drupal_get_form('user_login_block');
        }
        
        public function getFormulaireInscription() {
                
                return drupal_get_form('user_register');
        }
}
?>