Merge commit 'origin/master' into fusionax
[platal.git] / modules / email.php
index 489a364..787bbae 100644 (file)
@@ -259,7 +259,15 @@ class EmailModule extends PLModule
             $actifs = Env::v('emails_actifs', Array());
             print_r(Env::v('emails_rewrite'));
             if (Env::v('emailop') == "ajouter" && Env::has('email')) {
-                $result = $redirect->add_email(Env::v('email'));
+                $new_email = Env::v('email');
+                if ($new_email == "new@example.org") {
+                    $new_email = Env::v('email_new');
+                }
+                $result = $redirect->add_email($new_email);
+                if ($result == ERROR_INVALID_EMAIL) {
+                    $page->assign('email', $new_email);
+                }
+                $page->assign('retour', $result);
             } elseif (empty($actifs)) {
                 $result = ERROR_INACTIVE_REDIRECTION;
             } elseif (is_array($actifs)) {
@@ -311,6 +319,9 @@ class EmailModule extends PLModule
         // Display GoogleApps acount information.
         require_once 'googleapps.inc.php';
         $page->assign('googleapps', GoogleAppsAccount::account_status($user->id()));
+
+        require_once 'emails.combobox.inc.php';
+        fill_email_combobox($page);
     }
 
     function handler_antispam(&$page, $statut_filtre = null)