Implements a url-shortener (Closes #1042).
[platal.git] / modules / email.php
index f116ab5..ece008d 100644 (file)
@@ -80,6 +80,8 @@ class EmailModule extends PLModule
             // plat/al's code, we do an a posteriori check on the
             // validity of the bestalias.
             fix_bestalias($user);
+            // Then refetch the user to update its bestalias.
+            S::set('user', User::getWithUID(S::user()->id()));
         }
 
         // Fetch and display aliases.
@@ -296,6 +298,7 @@ class EmailModule extends PLModule
                            ORDER BY  NOT(s.type = \'alias_aux\'), s.email, d.name',
                             $user->id());
         $page->assign('alias', $alias->fetchAllAssoc());
+        $page->assign('best_email', $user->bestEmail());
 
         $page->assign('emails', $redirect->emails);