X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fuser.php;h=a54b904ad6b50e1c2c3b4f4311f244ddddee4baf;hb=7d7d64abd7f3fa110cd68f7a6f7623b02f18a18f;hp=f7f90faf204f9934f7dcfc66fde7d6ba8fce9584;hpb=6d33f1d395b294b3e2b189b64355e63df42147e7;p=platal.git diff --git a/classes/user.php b/classes/user.php index f7f90fa..a54b904 100644 --- a/classes/user.php +++ b/classes/user.php @@ -264,6 +264,11 @@ class User extends PlUser WHERE a.uid = {?}', $this->id()); } + public function isActive() + { + return $this->state == 'active'; + } + /** Overload PlUser::promo(): there no promo defined for a user in the current * schema. The promo is a field from the profile. */ @@ -291,6 +296,22 @@ class User extends PlUser return $this->profile()->lastName(); } + public function fullName($with_promo = false) + { + if (!$this->hasProfile()) { + return $this->full_name; + } + return $this->profile()->fullName($with_promo); + } + + public function directoryName() + { + if (!$this->hasProfile()) { + return $this->full_name; + } + return $this->profile()->directory_name; + } + /** Return the main profile attached with this account if any. */ public function profile()