From: Stéphane Jacob Date: Mon, 12 Jul 2010 11:50:42 +0000 (+0200) Subject: Adds isActive in both User and Profile classes. X-Git-Tag: xorg/1.0.1~352 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=280806d9b54e0a40cefb3c542d4ebe5af84d5d8e;p=platal.git Adds isActive in both User and Profile classes. Signed-off-by: Stéphane Jacob --- diff --git a/classes/profile.php b/classes/profile.php index 095d1ef..8c791fa 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -198,6 +198,14 @@ class Profile return $this->owner; } + public function isActive() + { + if ($this->owner()) { + return $this->owner->isActive(); + } + return false; + } + public function promo() { return $this->promo; diff --git a/classes/user.php b/classes/user.php index db0f675..64991a4 100644 --- a/classes/user.php +++ b/classes/user.php @@ -260,6 +260,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. */