projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes payment for group non member.
[platal.git]
/
classes
/
user.php
diff --git
a/classes/user.php
b/classes/user.php
index
801fe39
..
f24a8dc
100644
(file)
--- a/
classes/user.php
+++ b/
classes/user.php
@@
-292,6
+292,14
@@
class User extends PlUser
return $this->profile()->fullName($with_promo);
}
return $this->profile()->fullName($with_promo);
}
+ public function shortName($with_promo = false)
+ {
+ if (!$this->hasProfile()) {
+ return $this->full_name;
+ }
+ return $this->profile()->shortName($with_promo);
+ }
+
public function directoryName()
{
if (!$this->hasProfile()) {
public function directoryName()
{
if (!$this->hasProfile()) {
@@
-300,6
+308,11
@@
class User extends PlUser
return $this->profile()->directory_name;
}
return $this->profile()->directory_name;
}
+ static public function compareDirectoryName($a, $b)
+ {
+ return strcasecmp(replace_accent($a->directoryName()), replace_accent($b->directoryName()));
+ }
+
/** Return the main profile attached with this account if any.
*/
public function profile($forceFetch = false, $fields = 0x0000, $visibility = null)
/** Return the main profile attached with this account if any.
*/
public function profile($forceFetch = false, $fields = 0x0000, $visibility = null)
@@
-764,11
+777,13
@@
class User extends PlUser
$this->forlifeEmail(), $newuser->id());
// Reftech new user so its forlifeEmail will be correct.
$this->forlifeEmail(), $newuser->id());
// Reftech new user so its forlifeEmail will be correct.
- $newuser = getSilentWithUID($newuser->id());
+ $newuser =
self::
getSilentWithUID($newuser->id());
}
// Change email used in mailing lists.
if ($this->forlifeEmail() != $newuser->forlifeEmail()) {
}
// Change email used in mailing lists.
if ($this->forlifeEmail() != $newuser->forlifeEmail()) {
+ // The super user is the user who has the right to do the modification.
+ $super_user = S::user();
// group mailing lists
$group_domains = XDB::fetchColumn('SELECT g.mail_domain
FROM groups AS g
// group mailing lists
$group_domains = XDB::fetchColumn('SELECT g.mail_domain
FROM groups AS g
@@
-776,11
+791,11
@@
class User extends PlUser
WHERE g.mail_domain != \'\' AND gm.uid = {?}',
$this->id());
foreach ($group_domains as $mail_domain) {
WHERE g.mail_domain != \'\' AND gm.uid = {?}',
$this->id());
foreach ($group_domains as $mail_domain) {
- $mmlist = new MMList($
this
, $mail_domain);
+ $mmlist = new MMList($
super_user
, $mail_domain);
$mmlist->replace_email_in_all($this->forlifeEmail(), $newuser->forlifeEmail());
}
// main domain lists
$mmlist->replace_email_in_all($this->forlifeEmail(), $newuser->forlifeEmail());
}
// main domain lists
- $mmlist = new MMList($
this
);
+ $mmlist = new MMList($
super_user
);
$mmlist->replace_email_in_all($this->forlifeEmail(), $newuser->forlifeEmail());
}
}
$mmlist->replace_email_in_all($this->forlifeEmail(), $newuser->forlifeEmail());
}
}