Allow parenthesis before hasPerm in smarty templates
[platal.git] / classes / pluser.php
index c350dfa..c974b7e 100644 (file)
@@ -82,6 +82,7 @@ abstract class PlUser implements PlUserInterface
     // <display name> !"), while full name is the official full name.
     protected $display_name = null;
     protected $full_name = null;
+    protected $sort_name = null;
 
     // Other important parameters used when sending emails.
     protected $gender = null;  // Acceptable values are GENDER_MALE and GENDER_FEMALE
@@ -171,13 +172,6 @@ abstract class PlUser implements PlUserInterface
         }
         return $this->email;
     }
-    public function forlifeEmailAlternate()
-    {
-        if (!empty($this->forlife_alternate)) {
-            return $this->forlife_alternate;
-        }
-        return $this->email;
-    }
 
     public function displayName()
     {
@@ -374,7 +368,7 @@ abstract class PlUser implements PlUserInterface
                     $list[$i] = $login;
                 }
             }
-            return $list;
+            return array_unique($list);
         }
         return null;
     }
@@ -410,7 +404,7 @@ abstract class PlUser implements PlUserInterface
 
     private static function stripBadChars($text)
     {
-        return str_replace(array(' ', "'"), array('-', ''),
+        return str_replace(array(' ', "'", '+'), array('-', '', '_'),
                            strtolower(stripslashes(replace_accent(trim($text)))));
     }
 
@@ -433,7 +427,7 @@ abstract class PlUser implements PlUserInterface
     public static function makeHrid($firstname, $lastname, $category)
     {
         $cat = self::stripBadChars($category);
-        if (!cat) {
+        if (!$cat) {
             Platal::page()->kill("$category is not a suitable category.");
         }
 
@@ -461,5 +455,5 @@ abstract class PlUser implements PlUserInterface
     }
 }
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>