X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fpluser.php;h=c974b7e3ad50fa8170be9fb70fc2fba6bcfc1cf1;hb=c16ab9ce3537fad8a05ecba1cdb25268440aec29;hp=57656558a05361d20b0232de2660acae75b12f03;hpb=38d66919e0b8d40eb28d2ffcf81ae11f8452cfe1;p=platal.git diff --git a/classes/pluser.php b/classes/pluser.php index 5765655..c974b7e 100644 --- a/classes/pluser.php +++ b/classes/pluser.php @@ -82,6 +82,7 @@ abstract class PlUser implements PlUserInterface // !"), 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 @@ -367,7 +368,7 @@ abstract class PlUser implements PlUserInterface $list[$i] = $login; } } - return $list; + return array_unique($list); } return null; } @@ -403,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))))); } @@ -426,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."); } @@ -454,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: ?>