Rename xorg_ constants to pl_
[platal.git] / include / emails.inc.php
index 555946d..616fe0f 100644 (file)
@@ -186,7 +186,7 @@ class EmailRedirection extends Email
                              SET  panne_level = IF(flags = 'panne', panne_level - 1, panne_level),
                                   flags = 'active'
                            WHERE  uid={?} AND email={?}", $this->uid, $this->email);
-            $_SESSION['log']->log("email_on", $this->email.($this->uid!=S::v('uid') ? "(admin on {$this->uid})" : ""));
+            S::logger()->log("email_on", $this->email.($this->uid!=S::v('uid') ? "(admin on {$this->uid})" : ""));
             $this->active = true;
             $this->broken = false;
         }
@@ -199,7 +199,7 @@ class EmailRedirection extends Email
         if ($this->active) {
             XDB::execute("UPDATE  emails SET flags =''
                            WHERE  uid={?} AND email={?}", $this->uid, $this->email);
-            $_SESSION['log']->log("email_off",$this->email.($this->uid != S::v('uid') ? "(admin on {$this->uid})" : "") );
+            S::logger()->log("email_off",$this->email.($this->uid != S::v('uid') ? "(admin on {$this->uid})" : "") );
             $this->active = false;
         }
     }
@@ -264,7 +264,7 @@ class EmailStorage extends Email
     // Shortname to realname mapping for known mail storage backends.
     private $display_names = array(
         'imap'       => 'Accès de secours aux emails (IMAP)',
-        'googleapps' => 'Compte GMail / Google Apps',
+        'googleapps' => 'Compte Google Apps',
     );
 
     // Retrieves the current list of actives storages.
@@ -273,7 +273,7 @@ class EmailStorage extends Email
         $res = XDB::query("SELECT  mail_storage
                              FROM  auth_user_md5
                             WHERE  user_id = {?}", $this->uid);
-        return new FlagSet($res->fetchOneCell());
+        return new PlFlagSet($res->fetchOneCell());
     }
 
     // Updates the list of active storages.
@@ -281,7 +281,7 @@ class EmailStorage extends Email
     {
         XDB::execute("UPDATE  auth_user_md5
                          SET  mail_storage = {?}
-                       WHERE  user_id = {?}", $storages->flags(), $this->uid);
+                       WHERE  user_id = {?}", $storages, $this->uid);
     }
 
     // Returns the list of allowed storages for the @p user.
@@ -411,7 +411,7 @@ class Redirect
             return ERROR_INACTIVE_REDIRECTION;
         }
         XDB::execute('DELETE FROM emails WHERE uid={?} AND email={?}', $this->uid, $email);
-        $_SESSION['log']->log('email_del',$email.($this->uid!=S::v('uid') ? " (admin on {$this->uid})" : ""));
+        S::logger()->log('email_del',$email.($this->uid!=S::v('uid') ? " (admin on {$this->uid})" : ""));
         foreach ($this->emails as $i => $mail) {
             if ($email == $mail->email) {
                 unset($this->emails[$i]);
@@ -434,7 +434,7 @@ class Redirect
         }
         XDB::execute('REPLACE INTO emails (uid,email,flags) VALUES({?},{?},"active")', $this->uid, $email);
         if ($logger = S::v('log', null)) { // may be absent --> step4.php
-            $logger->log('email_add',$email.($this->uid!=S::v('uid') ? " (admin on {$this->uid})" : ""));
+            S::logger()->log('email_add',$email.($this->uid!=S::v('uid') ? " (admin on {$this->uid})" : ""));
         }
         foreach ($this->emails as $mail) {
             if ($mail->email == $email_stripped) {
@@ -599,6 +599,13 @@ class Redirect
         }
         return $emails;
     }
+
+    // function get_uid() {{{2
+
+    public function get_uid()
+    {
+        return $this->uid;
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: