From: Michael M Slusarz Date: Thu, 20 Jan 2011 17:17:42 +0000 (-0700) Subject: This should only need to be done on creation of IMAP object X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=86d2d6a31ca2dd9bd0683d93a498c05cbc72615b;p=horde.git This should only need to be done on creation of IMAP object --- diff --git a/imp/lib/Imap.php b/imp/lib/Imap.php index a7619d6d6..8bdad2fbe 100644 --- a/imp/lib/Imap.php +++ b/imp/lib/Imap.php @@ -61,6 +61,8 @@ class IMP_Imap implements Serializable */ public function createImapObject($username, $password, $key) { + global $prefs; + if (!is_null($this->ob)) { return $this->ob; } @@ -102,7 +104,15 @@ class IMP_Imap implements Serializable } $this->ob = $ob; - $this->_postcreate(); + + if ($protocol == 'pop') { + /* Turn some options off if we are working with POP3. */ + $prefs->setValue('save_sent_mail', false); + $prefs->setLocked('save_sent_mail', true); + $prefs->setLocked('sent_mail_folder', true); + $prefs->setLocked('drafts_folder', true); + $prefs->setLocked('trash_folder', true); + } return $ob; } @@ -138,23 +148,6 @@ class IMP_Imap implements Serializable } /** - * Alter some IMP/Horde settings once we load/create the object. - */ - protected function _postcreate() - { - global $prefs; - - if ($this->ob instanceof Horde_Imap_Client_Socket_Pop3) { - /* Turn some options off if we are working with POP3. */ - $prefs->setValue('save_sent_mail', false); - $prefs->setLocked('save_sent_mail', true); - $prefs->setLocked('sent_mail_folder', true); - $prefs->setLocked('drafts_folder', true); - $prefs->setLocked('trash_folder', true); - } - } - - /** * Is the given mailbox read-only? * * @param string $mailbox The mailbox to check. @@ -435,8 +428,6 @@ class IMP_Imap implements Serializable $this->ob, $this->_nsdefault ) = unserialize($data); - - $this->_postcreate(); } }