X-Git-Url: http://git.euphorik.ch/?p=cl7.git;a=blobdiff_plain;f=php%2Fparticipant.php;h=e940f74854c03dc2f59c16bfc922bcf230f548c8;hp=e2b47be621e55ed0e56f5630074c96ff2c82bc04;hb=424a8f0a34fc72fe64daaac4686f991a298933a3;hpb=912c54815fb34d93de674af2bcf3acc85ce7421d diff --git a/php/participant.php b/php/participant.php index e2b47be..e940f74 100644 --- a/php/participant.php +++ b/php/participant.php @@ -20,6 +20,19 @@ class Participant */ public function Participant($v1=NULL, $v2=NULL) { + $this->authentifier($v1, $v2); + } + + /** + * Est-ce que le participant existe ? C-à-d qu'il est inscrit. + */ + public function existe() + { + return $this->id != 0; + } + + private function authentifier($v1=NULL, $v2=NULL) + { # Aucunes valeurs transmise => ce n'est pas un participant valide. if ($v1 == NULL && $v2 == NULL) return; @@ -36,18 +49,12 @@ class Participant $this->id = pg_fetch_object($res)->id; $this->chargerInfos(); } - } - - /** - * Est-ce que le participant existe ? C-à-d qu'il est inscrit. - */ - public function existe() - { - return $this->id != 0; } - public function chargerInfos() + public function chargerInfos($v1=NULL, $v2=NULL) { + $this->authentifier($v1, $v2); + if (!$this->existe()) return;