<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
return $this->hruid;
}
+ public function isMe($other)
+ {
+ if (!$other) {
+ return false;
+ } else if ($other instanceof PlUser) {
+ return $other->id() == $this->id();
+ } else {
+ return false;
+ }
+ }
+
public function bestEmail()
{
if (!empty($this->bestalias)) {
$list[$i] = $login;
}
}
- return $list;
+ return array_unique($list);
}
return null;
}
private static function stripBadChars($text)
{
- return str_replace(array(' ', "'"), array('-', ''),
+ return str_replace(array(' ', "'", '+'), array('-', '', '_'),
strtolower(stripslashes(replace_accent(trim($text)))));
}
public static function makeHrid($firstname, $lastname, $category)
{
$cat = self::stripBadChars($category);
- if (!cat) {
+ if (!$cat) {
Platal::page()->kill("$category is not a suitable category.");
}
}
}
-// 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:
?>