projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes vim mode line.
[platal.git]
/
classes
/
pluser.php
diff --git
a/classes/pluser.php
b/classes/pluser.php
index
187f131
..
e5baf6c
100644
(file)
--- a/
classes/pluser.php
+++ b/
classes/pluser.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-201
0
Polytechnique.org *
+ * Copyright (C) 2003-201
1
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-146,6
+146,17
@@
abstract class PlUser implements PlUserInterface
return $this->hruid;
}
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)) {
public function bestEmail()
{
if (!empty($this->bestalias)) {
@@
-356,7
+367,7
@@
abstract class PlUser implements PlUserInterface
$list[$i] = $login;
}
}
$list[$i] = $login;
}
}
- return
$list
;
+ return
array_unique($list)
;
}
return null;
}
}
return null;
}
@@
-392,7
+403,7
@@
abstract class PlUser implements PlUserInterface
private static function stripBadChars($text)
{
private static function stripBadChars($text)
{
- return str_replace(array(' ', "'"
), array('-', '
'),
+ return str_replace(array(' ', "'"
, '+'), array('-', '', '_
'),
strtolower(stripslashes(replace_accent(trim($text)))));
}
strtolower(stripslashes(replace_accent(trim($text)))));
}
@@
-415,7
+426,7
@@
abstract class PlUser implements PlUserInterface
public static function makeHrid($firstname, $lastname, $category)
{
$cat = self::stripBadChars($category);
public static function makeHrid($firstname, $lastname, $category)
{
$cat = self::stripBadChars($category);
- if (!cat) {
+ if (!
$
cat) {
Platal::page()->kill("$category is not a suitable category.");
}
Platal::page()->kill("$category is not a suitable category.");
}
@@
-443,5
+454,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
f
enc=utf-8:
?>
?>