Fixes promo display in marketing page.
[platal.git] / classes / user.php
index f7f90fa..a54b904 100644 (file)
@@ -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()