projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix SU on account.
[platal.git]
/
include
/
validations
/
names.inc.php
diff --git
a/include/validations/names.inc.php
b/include/validations/names.inc.php
index
2c3ff1a
..
41ee0f1
100644
(file)
--- a/
include/validations/names.inc.php
+++ b/
include/validations/names.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-20
09
Polytechnique.org *
+ * Copyright (C) 2003-20
10
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 *
@@
-58,11
+58,11
@@
class NamesReq extends Validate
}
$res = XDB::query("SELECT alias
FROM aliases
}
$res = XDB::query("SELECT alias
FROM aliases
- WHERE id = {?} AND type = 'alias' AND FIND_IN_SET('usage', flags)",
+ WHERE
u
id = {?} AND type = 'alias' AND FIND_IN_SET('usage', flags)",
$this->user->id());
$this->old_alias = $res->fetchOneCell();
if ($this->old_alias != $this->new_alias) {
$this->user->id());
$this->old_alias = $res->fetchOneCell();
if ($this->old_alias != $this->new_alias) {
- $res = XDB::query("SELECT id
+ $res = XDB::query("SELECT
u
id
FROM aliases
WHERE alias = {?}",
$this->new_alias);
FROM aliases
WHERE alias = {?}",
$this->new_alias);
@@
-122,12
+122,14
@@
class NamesReq extends Validate
public function commit()
{
public function commit()
{
- require_once 'notifs.inc.php';
require_once 'name.func.inc.php';
require_once 'name.func.inc.php';
- register_watch_op($this->user->id(), WATCH_FICHE, '', 'search_names');
set_profile_display($this->display_names);
set_alias_names($this->sn_new, $this->sn_old, true, $this->new_alias);
set_profile_display($this->display_names);
set_alias_names($this->sn_new, $this->sn_old, true, $this->new_alias);
+
+ // Update the local User object, to pick up the new bestalias.
+ $this->user = User::getSilent($this->user->id());
+
return true;
}
return true;
}