Add missing 'check_redirect'
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 18 Oct 2007 17:33:28 +0000 (19:33 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 18 Oct 2007 17:33:28 +0000 (19:33 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
include/emails.inc.php
modules/email.php

index a8eef27..a15bb3a 100644 (file)
@@ -332,6 +332,7 @@ class Redirect
     {
         foreach ($this->emails as &$mail) {
             if ($mail->email == $email) {
+                check_redirect($this);
                 return $mail->cleanErrors($this->uid);
             }
         }
@@ -351,6 +352,7 @@ class Redirect
                 $mail->active   = false;
             }
         }
+        check_redirect($this);
     }
 
     // function enable() {{{2
@@ -365,6 +367,7 @@ class Redirect
                 $mail->active   = true;
                 $mail->disabled = false;
             }
+            check_redirect($this);
         }
     }
 
index 27fbdd7..b5c6224 100644 (file)
@@ -65,9 +65,9 @@ class EmailModule extends PLModule
               ORDER BY  LENGTH(alias)";
         $page->assign('aliases', XDB::iterator($sql, $uid));
 
-               $homonyme = XDB::query("SELECT alias FROM aliases INNER JOIN homonymes ON (id = homonyme_id) WHERE user_id = {?} AND type = 'homonyme'", $uid);
-               $page->assign('homonyme', $homonyme->fetchOneCell());
-               
+    $homonyme = XDB::query("SELECT alias FROM aliases INNER JOIN homonymes ON (id = homonyme_id) WHERE user_id = {?} AND type = 'homonyme'", $uid);
+    $page->assign('homonyme', $homonyme->fetchOneCell());
+
         $sql = "SELECT email
                 FROM emails
                 WHERE uid = {?} AND FIND_IN_SET('active', flags)";
@@ -210,20 +210,20 @@ class EmailModule extends PLModule
             $retour = $redirect->delete_email($email);
             $page->assign('retour', $retour);
         }
-               
-               if ($action == 'active' && $email) {
-                       $redirect->modify_one_email($email, true);
-               }
-               
-               if ($action == 'inactive' && $email) {
-                       $redirect->modify_one_email($email, false);
-               }
-               
-               if ($action == 'rewrite' && $email) {
-                       $rewrite = @func_get_arg(3);
-                       $redirect->modify_one_email_redirect($email, $rewrite);
-               }
-               
+
+        if ($action == 'active' && $email) {
+            $redirect->modify_one_email($email, true);
+        }
+
+        if ($action == 'inactive' && $email) {
+            $redirect->modify_one_email($email, false);
+        }
+
+        if ($action == 'rewrite' && $email) {
+            $rewrite = @func_get_arg(3);
+            $redirect->modify_one_email_redirect($email, $rewrite);
+        }
+
         if (Env::has('emailop')) {
             $actifs = Env::v('emails_actifs', Array());
             print_r(Env::v('emails_rewrite'));
@@ -255,6 +255,7 @@ class EmailModule extends PLModule
                    FROM  aliases
                   WHERE  id={?} AND (type='a_vie' OR type='alias')
                ORDER BY  !FIND_IN_SET('usage',flags), LENGTH(alias)", $uid);
+        
         $page->assign('alias', $res->fetchAllAssoc());
         $page->assign('emails',$redirect->emails);
     }
@@ -621,12 +622,12 @@ L'équipe d'administration <support@" . $globals->mail->domain . '>';
         $page->changeTpl('emails/lost.tpl');
 
         $page->assign('lost_emails', XDB::iterator('
-                                       SELECT u.user_id,       a.alias
-                                       FROM auth_user_md5 AS u
-                                               INNER JOIN aliases AS a ON (a.id = u.user_id AND a.type = "a_vie")
-                                               LEFT JOIN emails AS e ON (u.user_id=e.uid AND FIND_IN_SET("active",e.flags))
-                                       WHERE e.uid IS NULL AND u.deces = 0
-                                       ORDER BY u.promo DESC, u.nom, u.prenom'));
+          SELECT u.user_id, a.alias
+          FROM auth_user_md5 AS u
+            INNER JOIN aliases AS a ON (a.id = u.user_id AND a.type = "a_vie")
+            LEFT JOIN emails AS e ON (u.user_id=e.uid AND FIND_IN_SET("active",e.flags))
+          WHERE e.uid IS NULL AND u.deces = 0
+          ORDER BY u.promo DESC, u.nom, u.prenom'));
     }
 }