X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Femails.inc.php;h=be0b6fd8b5f3001a88df51925a2ddf89bea633f4;hb=1c82f959c6e69a5a979e46e530872685106f9103;hp=7f4f17d699b1b953e48e124ba6df84970984ef06;hpb=77e786e1d93d7017e611c42b6b4541d9ae2fbdbc;p=platal.git diff --git a/include/emails.inc.php b/include/emails.inc.php index 7f4f17d..be0b6fd 100644 --- a/include/emails.inc.php +++ b/include/emails.inc.php @@ -19,8 +19,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once("xorg.misc.inc.php"); - define("SUCCESS", 1); define("ERROR_INACTIVE_REDIRECTION", 2); define("ERROR_INVALID_EMAIL", 3); @@ -186,7 +184,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 +197,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; } } @@ -273,7 +271,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. @@ -411,7 +409,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 +432,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) {