*/
public function createImapObject($username, $password, $key)
{
+ global $prefs;
+
if (!is_null($this->ob)) {
return $this->ob;
}
}
$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;
}
}
/**
- * 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.
$this->ob,
$this->_nsdefault
) = unserialize($data);
-
- $this->_postcreate();
}
}