Merge remote branch 'origin/platal-0.10.2'
[platal.git] / include / validations / nomusage.inc.php
index 319b1cf..9eb101f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -39,7 +39,7 @@ class UsageReq extends Validate
     public $rules = "Refuser
     tout ce qui n'est visiblement pas un nom de famille (ce qui est
     extremement rare car à peu près n'importe quoi peut être un nom de
-    famille...)";
+    famille&hellip;)";
 
     // }}}
     // {{{ constructor
@@ -114,9 +114,13 @@ class UsageReq extends Validate
     public function commit()
     {
         require_once 'notifs.inc.php';
-        register_watch_op($this->user->id(), WATCH_FICHE, 'nom');
+        register_watch_op($this->user->id(), WATCH_FICHE, '', 'nom');
         require_once('user.func.inc.php');
         set_new_usage($this->user->id(), $this->nom_usage, $this->alias);
+
+        // Update the local User object, to pick up the new bestalias.
+        $this->user = User::getSilent($this->user->id());
+
         return true;
     }