{site}.inc.php is the base for all jobs.
[platal.git] / include / emails.inc.php
index 0157690..f9c131a 100644 (file)
@@ -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.
@@ -586,6 +586,26 @@ class Redirect
         }
         return $mails;
     }
+
+    // function active_emails() {{{2
+
+    public function active_emails()
+    {
+        $emails = array();
+        foreach ($this->emails as $mail) {
+            if ($mail->active) {
+                $emails[] = $mail;
+            }
+        }
+        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: