Switched PlImage's fields from private to protected
[platal.git] / classes / pluser.php
index c4ae622..3e4418a 100644 (file)
@@ -61,9 +61,11 @@ abstract class PlUser
     protected $hruid = null;
 
     // User main email aliases (forlife is the for-life email address, bestalias
-    // is user-chosen preferred email address).
+    // is user-chosen preferred email address, email might be any email available
+    // for the user).
     protected $forlife = null;
     protected $bestalias = null;
+    protected $email = null;
 
     // Display name is user-chosen name to display (eg. in "Welcome
     // <display name> !"), while full name is the official full name.
@@ -135,11 +137,17 @@ abstract class PlUser
 
     public function bestEmail()
     {
-        return $this->bestalias;
+        if (!empty($this->bestalias)) {
+            return $this->bestalias;
+        }
+        return $this->email;
     }
     public function forlifeEmail()
     {
-        return $this->forlife;
+        if (!empty($this->forlife)) {
+            return $this->forlife;
+        }
+        return $this->email;
     }
 
     public function displayName()