Adds TODOs.
[platal.git] / modules / email.php
index 3a0721e..424feca 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -235,8 +235,9 @@ class EmailModule extends PLModule
         $email = str_replace(' ', '+', $email);
 
         // Apply email redirection change requests.
+        $result = SUCCESS;
         if ($action == 'remove' && $email) {
-            $retour = $redirect->delete_email($email);
+            $result = $redirect->delete_email($email);
         }
 
         if ($action == 'active' && $email) {
@@ -262,19 +263,19 @@ class EmailModule extends PLModule
                 if ($new_email == "new@example.org") {
                     $new_email = Env::v('email_new');
                 }
-                $retour = $redirect->add_email($new_email);
-                if ($retour == ERROR_INVALID_EMAIL) {
+                $result = $redirect->add_email($new_email);
+                if ($result == ERROR_INVALID_EMAIL) {
                     $page->assign('email', $new_email);
                 }
-                $page->assign('retour', $retour);
+                $page->assign('retour', $result);
             } elseif (empty($actifs)) {
-                $retour = ERROR_INACTIVE_REDIRECTION;
+                $result = ERROR_INACTIVE_REDIRECTION;
             } elseif (is_array($actifs)) {
-                $retour = $redirect->modify_email($actifs, Env::v('emails_rewrite', Array()));
+                $result = $redirect->modify_email($actifs, Env::v('emails_rewrite', Array()));
             }
         }
 
-        switch ($retour) {
+        switch ($result) {
           case ERROR_INACTIVE_REDIRECTION:
             $page->trigError('Tu ne peux pas avoir aucune adresse de redirection active, sinon ton adresse '
                              . $user->forlifeEmail() . ' ne fonctionnerait plus.');