}
try {
- $ACLDriver = &IMP_Imap_Acl::singleton();
+ $ACLDriver = IMP_Imap_Acl::singleton();
} catch (Horde_Exception $e) {
$notification->push($error, _("This server does not support sharing folders."));
header('Location: ' . $prefs_url);
break;
}
-$imp_folder = &IMP_Folder::singleton();
+$imp_folder = IMP_Folder::singleton();
$rights = $ACLDriver->getRights();
if (empty($folder)) {
break;
}
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->emptyMailbox(array($mbox));
$result = new stdClass;
$result->mbox = $mbox;
$set = Horde_Util::getPost('set');
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$result = $imp_message->flagAllInMailbox($flags, array($mbox), $set);
if ($result) {
$change = _changed($mbox, $cacheid, true);
}
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$result = $imp_message->copy($to, ($action == 'MoveMessage') ? 'move' : 'copy', $indices);
}
}
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
if (!empty($set)) {
$result = $imp_message->flag($set, $indices, true);
}
break;
}
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$change = _changed($mbox, $cacheid, true);
$result = $imp_message->delete($indices);
if ($result) {
$imp_compose = IMP_Compose::singleton(Horde_Util::getPost('imp_compose'));
$imp_compose->destroy();
if ($action == 'DeleteDraft') {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$idx_array = array($imp_compose->getMetadata('draft_index') . IMP::IDX_SEP . IMP::folderPref($prefs->getValue('drafts_folder'), true));
$imp_message->delete($idx_array, array('nuke' => true));
}
$sort = IMP::getSort($mbox);
$change = ($sort['by'] == Horde_Imap_Client::SORT_THREAD);
}
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$expunged = $imp_message->expungeMailbox(array($mbox => 1), array('list' => true));
if (!empty($expunged[$mbox])) {
$expunge_count = count($expunged[$mbox]);
}
// Initialize the VFS.
-$vfsroot = &VFS::singleton($conf['vfs']['type'], Horde::getDriverConfig('vfs', $conf['vfs']['type']));
+$vfsroot = VFS::singleton($conf['vfs']['type'], Horde::getDriverConfig('vfs', $conf['vfs']['type']));
if (is_a($vfsroot, 'PEAR_Error')) {
Horde::fatal(sprintf(_("Could not create the VFS backend: %s"), $vfsroot->getMessage()), $self_url, __LINE__);
}
/* Load $mail_user's preferences so that we can use their
* locale information for the notification message. */
include_once 'Horde/Prefs.php';
- $prefs = &Prefs::singleton($conf['prefs']['driver'], 'horde', $mail_user);
+ $prefs = Prefs::singleton($conf['prefs']['driver'], 'horde', $mail_user);
$prefs->retrieve();
include_once 'Horde/Identity.php';
- $mail_identity = &Identity::singleton('none', $mail_user);
+ $mail_identity = Identity::singleton('none', $mail_user);
$mail_address = $mail_identity->getDefaultFromAddress();
/* Ignore missing addresses, which are returned as <>. */
function _removeAutoSaveDraft($index)
{
if (!empty($index)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->delete(array($index . IMP::IDX_SEP . IMP::folderPref($GLOBALS['prefs']->getValue('drafts_folder'), true)), array('nuke' => true));
}
}
$msg = '';
require_once 'Horde/Identity.php';
-$identity = &Identity::singleton(array('imp', 'imp'));
+$identity = Identity::singleton(array('imp', 'imp'));
if (!$prefs->isLocked('default_identity')) {
$identity_id = Horde_Util::getFormData('identity');
if (!is_null($identity_id)) {
NLS::setTimeZone();
/* Initialize the IMP_Compose:: object. */
-$imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
+$imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
/* Init IMP_UI_Compose:: object. */
$imp_ui = new IMP_UI_Compose();
/* Use IMP_Tree to determine whether the sent mail folder was
* created. */
- $imptree = &IMP_Imap_Tree::singleton();
+ $imptree = IMP_Imap_Tree::singleton();
$imptree->eltDiffStart();
$options = array(
}
try {
- $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $folder);
+ $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $folder);
} catch (Horde_Exception $e) {
$notification->push(_("Requested message not found."), 'horde.error');
$index = $folder = null;
* @package IMP
*/
-function &_getIMPContents($index, $mailbox)
+function _getIMPContents($index, $mailbox)
{
if (empty($index)) {
return false;
}
try {
- $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox);
+ $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox);
return $imp_contents;
} catch (Horde_Exception $e) {
$GLOBALS['notification']->push(_("Could not retrieve the message from the mail server."), 'horde.error');
$header = array();
/* Set the current identity. */
-$identity = &Identity::singleton(array('imp', 'imp'));
+$identity = Identity::singleton(array('imp', 'imp'));
if (!$prefs->isLocked('default_identity')) {
$identity_id = Horde_Util::getFormData('identity');
if (!is_null($identity_id)) {
NLS::setTimeZone();
/* Initialize the IMP_Compose:: object. */
-$imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
+$imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
/* Run through the action handlers. */
$actionID = Horde_Util::getFormData('a');
case 'r':
case 'ra':
case 'rl':
- if (!($imp_contents = &_getIMPContents($index, $thismailbox))) {
+ if (!($imp_contents = _getIMPContents($index, $thismailbox))) {
break;
}
$actions = array('r' => 'reply', 'ra' => 'reply_all', 'rl' => 'reply_list');
// 'f' = forward
case 'f':
- if (!($imp_contents = &_getIMPContents($index, $thismailbox))) {
+ if (!($imp_contents = _getIMPContents($index, $thismailbox))) {
break;
}
$fwd_msg = $imp_compose->forwardMessage($imp_contents);
break;
case _("Redirect"):
- if (!($imp_contents = &_getIMPContents($index, $thismailbox))) {
+ if (!($imp_contents = _getIMPContents($index, $thismailbox))) {
break;
}
$thismailbox = $imp_compose->getMetadata('mailbox');
if ($ctype = $imp_compose->getMetadata('reply_type')) {
- if (!($imp_contents = &_getIMPContents($index, $thismailbox))) {
+ if (!($imp_contents = _getIMPContents($index, $thismailbox))) {
break;
}
if (Horde_Util::getFormData('resume_draft') &&
$prefs->getValue('auto_delete_drafts')) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$idx_array = array($index . IMP::IDX_SEP . $thismailbox);
$delete_draft = $imp_message->delete($idx_array, array('nuke' => true));
}
require $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc';
}
-function &_getIMPContents($index, $mailbox)
+function _getIMPContents($index, $mailbox)
{
if (empty($index)) {
return false;
}
try {
- $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox);
+ $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox);
return $imp_contents;
} catch (Horde_Exception $e) {
$GLOBALS['notification']->push(_("Could not retrieve the message from the mail server."), 'horde.error');
$cursor_pos = $oldrtemode = $rtemode = $siglocation = null;
/* Set the current identity. */
-$identity = &Identity::singleton(array('imp', 'imp'));
+$identity = Identity::singleton(array('imp', 'imp'));
if (!$prefs->isLocked('default_identity')) {
$identity_id = Horde_Util::getFormData('identity');
if (!is_null($identity_id)) {
}
/* Initialize the IMP_Compose:: object. */
-$imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
+$imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
$imp_compose->pgpAttachPubkey((bool) Horde_Util::getFormData('pgp_attach_pubkey'));
$imp_compose->userLinkAttachments((bool) Horde_Util::getFormData('link_attachments'));
$title = _("New Message");
switch ($actionID) {
case 'mailto':
- if (!($imp_contents = &_getIMPContents($index, $thismailbox))) {
+ if (!($imp_contents = _getIMPContents($index, $thismailbox))) {
break;
}
$imp_headers = $imp_contents->getHeaderOb();
case 'reply':
case 'reply_all':
case 'reply_list':
- if (!($imp_contents = &_getIMPContents($index, $thismailbox))) {
+ if (!($imp_contents = _getIMPContents($index, $thismailbox))) {
break;
}
break;
case 'forward':
- if (!($imp_contents = &_getIMPContents($index, $thismailbox))) {
+ if (!($imp_contents = _getIMPContents($index, $thismailbox))) {
break;
}
break;
case 'redirect_send':
- if (!($imp_contents = &_getIMPContents($index, $thismailbox))) {
+ if (!($imp_contents = _getIMPContents($index, $thismailbox))) {
break;
}
if (Horde_Util::getFormData('resume_draft') &&
$prefs->getValue('auto_delete_drafts') &&
($thismailbox == IMP::folderPref($prefs->getValue('drafts_folder'), true))) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$idx_array = array($index . IMP::IDX_SEP . $thismailbox);
if ($imp_message->delete($idx_array)) {
$notification->push(_("The draft message was automatically deleted because it was successfully completed and sent."), 'horde.success');
try {
$addrs = $imp_compose->recipientList($header);
if (!empty($addrs['list'])) {
- $imp_pgp = &Horde_Crypt::singleton(array('IMP', 'Pgp'));
+ $imp_pgp = Horde_Crypt::singleton(array('IMP', 'Pgp'));
foreach ($addrs['list'] as $val) {
$imp_pgp->getPublicKey($val);
}
$showAll = (!$subscribe || $_SESSION['imp']['showunsub']);
/* Initialize the IMP_Imap_Tree object. */
-$imptree = &IMP_Imap_Tree::singleton();
+$imptree = IMP_Imap_Tree::singleton();
$mask = IMP_Imap_Tree::NEXT_SHOWCLOSED;
/* Toggle subscribed view, if necessary. */
));
/* Initialize the IMP_Folder object. */
-$imp_folder = &IMP_Folder::singleton();
+$imp_folder = IMP_Folder::singleton();
/* Initialize the IMP_Imap_Tree object. */
-$imaptree = &IMP_Imap_Tree::singleton();
+$imaptree = IMP_Imap_Tree::singleton();
/* $folder_list is already encoded in UTF7-IMAP. */
$folder_list = Horde_Util::getFormData('folder_list', array());
case 'expunge_folder':
if (!empty($folder_list)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->expungeMailbox(array_flip($folder_list));
}
break;
if ($actionID == 'download_folder') {
$browser->downloadHeaders($folder_list[0] . '.mbox', null, false, strlen($mbox));
} else {
- $horde_compress = &Horde_Compress::singleton('zip');
+ $horde_compress = Horde_Compress::singleton('zip');
$mbox = $horde_compress->compress(array(array('data' => $mbox, 'name' => $folder_list[0] . '.mbox')));
$browser->downloadHeaders($folder_list[0] . '.zip', 'application/zip', false, strlen($mbox));
}
case 'folders_empty_mailbox':
if (!empty($folder_list)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->emptyMailbox($folder_list);
}
break;
case 'mark_folder_seen':
case 'mark_folder_unseen':
if (!empty($folder_list)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->flagAllInMailbox(array('seen'), $folder_list, ($actionID == 'mark_folder_seen'));
}
break;
$loop = array();
$rowct = $sum = 0;
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
foreach ($folder_list as $val) {
$size = $imp_message->sizeMailbox($val, false);
}
/* Get list of mailboxes to poll. */
- $imptree = &IMP_Imap_Tree::singleton();
+ $imptree = IMP_Imap_Tree::singleton();
$folders = $imptree->getPollList(true, true);
$anyUnseen = false;
}
/* Get list of mailboxes to poll. */
- $imaptree = &IMP_Imap_Tree::singleton();
+ $imaptree = IMP_Imap_Tree::singleton();
$folders = $imaptree->getPollList(true, true);
/* Quota info, if available. */
$name_url = Horde_Util::addParameter(Horde::applicationUrl('mailbox.php'), 'no_newmail_popup', 1);
/* Initialize the IMP_Tree object. */
- $imaptree = &IMP_Imap_Tree::singleton();
+ $imaptree = IMP_Imap_Tree::singleton();
$mask = IMP_Imap_Tree::NEXT_SHOWCLOSED;
if ($GLOBALS['prefs']->getValue('subscribe')) {
$mask |= IMP_Imap_Tree::NEXT_SHOWSUB;
/* See if the address points to the user's public key. */
if (is_a($key, 'PEAR_Error')) {
require_once 'Horde/Identity.php';
- $identity = &Identity::singleton(array('imp', 'imp'));
+ $identity = Identity::singleton(array('imp', 'imp'));
$personal_pubkey = $this->getPersonalPublicKey();
if (!empty($personal_pubkey) && $identity->hasAddress($address)) {
return $personal_pubkey;
public function blacklistMessage($indices, $show_link = true)
{
if ($this->_processBWlist($indices, _("your blacklist"), 'blacklistFrom', 'showBlacklist', $show_link)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
if (($msg_count = $imp_message->delete($indices))) {
if ($msg_count == 1) {
$addr = array();
foreach ($msgList as $mbox => $msgIndices) {
foreach ($msgIndices as $idx) {
- $contents = &IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox);
+ $contents = IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox);
$hdr = $contents->getHeaderOb();
$addr[] = Horde_Mime_Address::bareAddress($hdr->getValue('from'));
}
old sent-mail folders. Then sort this array according to
the date. */
include_once 'Horde/Identity.php';
- $identity = &Identity::singleton(array('imp', 'imp'));
- $imp_folder = &IMP_Folder::singleton();
+ $identity = Identity::singleton(array('imp', 'imp'));
+ $imp_folder = IMP_Folder::singleton();
$sent_mail_folders = $identity->getAllSentmailFolders();
$folder_array = array();
include_once 'Horde/Identity.php';
- $identity = &Identity::singleton(array('imp', 'imp'));
- $imp_folder = &IMP_Folder::singleton();
+ $identity = Identity::singleton(array('imp', 'imp'));
+ $imp_folder = IMP_Folder::singleton();
foreach ($identity->getAllSentmailfolders() as $sent_folder) {
/* Display a message to the user and rename the folder.
public function describe()
{
include_once 'Horde/Identity.php';
- $identity = &Identity::singleton(array('imp', 'imp'));
+ $identity = Identity::singleton(array('imp', 'imp'));
$new_folders = $old_folders = array();
foreach ($identity->getAllSentmailfolders() as $folder) {
*/
static public function log($type, $msg_ids, $data = null)
{
- $history = &Horde_History::singleton();
+ $history = Horde_History::singleton();
if (!is_array($msg_ids)) {
$msg_ids = array($msg_ids);
*/
static public function getLog($msg_id)
{
- $history = &Horde_History::singleton();
+ $history = Horde_History::singleton();
$res = $history->getHistory(self::_getUniqueHistoryId($msg_id));
if (is_a($res, 'PEAR_Error')) {
}
$msg_ids = array_map(array('IMP_Maillog', '_getUniqueHistoryId'), $msg_ids);
- $history = &Horde_History::singleton();
+ $history = Horde_History::singleton();
return $history->removeByNames($msg_ids);
}
$vCal->setAttribute('PRODID', '-//The Horde Project//' . HORDE_AGENT_HEADER . '//EN');
$vCal->setAttribute('METHOD', 'REPLY');
- $vEvent_reply = &Horde_iCalendar::newComponent('vevent', $vCal);
+ $vEvent_reply = Horde_iCalendar::newComponent('vevent', $vCal);
$vEvent_reply->setAttribute('UID', $vEvent->getAttribute('UID'));
if (!is_a($vEvent->getAttribute('SUMMARY'), 'PEAR_error')) {
$vEvent_reply->setAttribute('SUMMARY', $vEvent->getAttribute('SUMMARY'));
$vEvent_reply->setAttribute('ORGANIZER', $vEvent->getAttribute('ORGANIZER'), array_pop($organizer));
// Find out who we are and update status.
- $identity = &Identity::singleton(array('imp', 'imp'));
+ $identity = Identity::singleton(array('imp', 'imp'));
$attendees = $vEvent->getAttribute('ATTENDEE');
if (!is_array($attendees)) {
$attendees = array($attendees);
require_once 'Horde/Identity.php';
// Find out who we are and update status.
- $identity = &Identity::singleton();
+ $identity = Identity::singleton();
$email = $identity->getFromAddress();
// Build the reply.
$is_attendee = false;
if (!is_a($attendees, 'PEAR_Error') && !empty($attendees)) {
require_once 'Horde/Identity.php';
- $identity = &Identity::singleton(array('imp', 'imp'));
+ $identity = Identity::singleton(array('imp', 'imp'));
for ($i = 0, $c = count($attendees); $i < $c; ++$i) {
$attendee = parse_url($attendees[$i]);
if (!empty($attendee['path']) &&
}
/* Get the data from the attachment. */
- $tnef = &Horde_Compress::singleton('tnef');
+ $tnef = Horde_Compress::singleton('tnef');
$tnefData = $tnef->decompress($this->_mimepart->getContents());
/* Display the requested file. Its position in the $tnefData
protected function _renderInfo()
{
/* Get the data from the attachment. */
- $tnef = &Horde_Compress::singleton('tnef');
+ $tnef = Horde_Compress::singleton('tnef');
$tnefData = $tnef->decompress($this->_mimepart->getContents());
$text = '';
/* Send the requested file. Its position in the zip archive is located
* in 'zip_attachment'. */
$data = $this->_mimepart->getContents();
- $zip = &Horde_Compress::singleton('zip');
+ $zip = Horde_Compress::singleton('zip');
$fileKey = Horde_Util::getFormData('zip_attachment') - 1;
$zipInfo = $zip->decompress($data, array('action' => HORDE_COMPRESS_ZIP_LIST));
* It will only create a new instance if no instance with the same
* parameters currently exists.
*
- * This method must be invoked as: $var = &IMP_Quota::singleton()
+ * This method must be invoked as: $var = IMP_Quota::singleton()
*
* @param string $driver The type of concrete subclass to return.
* @param array $params A hash containing any additional configuration
protected function _connect()
{
if (!$this->_connected) {
- $this->_db = &DB::connect($this->_params,
- array('persistent' => !empty($this->_params['persistent']),
- 'ssl' => !empty($this->_params['ssl'])));
- if (is_a($this->_db, 'PEAR_Error')) {
+ $this->_db = DB::connect($this->_params,
+ array('persistent' => !empty($this->_params['persistent']),
+ 'ssl' => !empty($this->_params['ssl'])));
+ if ($this->_db instanceof PEAR_Error) {
throw new Horde_Exception(_("Unable to connect to SQL server."));
}
$_SESSION['imp']['search'] = array('q' => array());
}
if (!$no_vf) {
- $imaptree = &IMP_Imap_Tree::singleton();
+ $imaptree = IMP_Imap_Tree::singleton();
foreach ($this->_getVFolderList() as $key => $val) {
if (!empty($val['vfolder']) &&
!$this->isVTrashFolder($key) &&
unset($vfolders[$id]);
$this->_saveVFolderList($vfolders);
if (!$no_delete) {
- $imaptree = &IMP_Imap_Tree::singleton();
+ $imaptree = IMP_Imap_Tree::singleton();
$imaptree->delete($id);
}
}
$this->_saveVFolderList($vfolders);
}
- $imaptree = &IMP_Imap_Tree::singleton();
+ $imaptree = IMP_Imap_Tree::singleton();
$imaptree->insertVFolders(array($id => $label));
return $id;
}
/* Create Virtual Trash with new folder list. */
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
$fl = $imp_folder->flist();
$flist = array();
foreach ($fl as $mbox) {
public function createVINBOXFolder()
{
/* Initialize IMP_Imap_Tree. */
- $imaptree = &IMP_Imap_Tree::singleton();
+ $imaptree = IMP_Imap_Tree::singleton();
/* Delete the current Virtual Inbox folder, if it exists. */
$vinbox_id = $GLOBALS['prefs']->getValue('vinbox_id');
}
/* Do login tasks. */
- $tasks = &Horde_LoginTasks::singleton('imp', is_null($url) ? Horde::selfUrl(true, true, true) : $url);
+ $tasks = Horde_LoginTasks::singleton('imp', is_null($url) ? Horde::selfUrl(true, true, true) : $url);
$tasks->runTasks();
/* If the user wants to run filters on login, make sure they get
}
/* Check for drafts due to session timeouts. */
- $imp_compose = &IMP_Compose::singleton();
+ $imp_compose = IMP_Compose::singleton();
$imp_compose->recoverSessionExpireDraft();
$_SESSION['imp']['logintasks'] = true;
/* Fetch the raw message contents (headers and complete
* body). */
try {
- $imp_contents = &IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox);
+ $imp_contents = IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox);
} catch (Horde_Exception $e) {
continue;
}
if (!isset($imp_compose)) {
require_once 'Horde/Identity.php';
- $imp_compose = &IMP_Compose::singleton();
- $identity = &Identity::singleton(array('imp', 'imp'));
+ $imp_compose = IMP_Compose::singleton();
+ $identity = Identity::singleton(array('imp', 'imp'));
try {
$from_line = $identity->getFromLine();
} catch (Horde_Exception $e) {
/* Delete spam after report. */
$delete_spam = $GLOBALS['prefs']->getValue('delete_spam_after_report');
if ($delete_spam) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
switch ($delete_spam) {
case 1:
if ($action == 'spam') {
{
/**
*/
- function expandAddresses($input, $imp_compose)
+ public function expandAddresses($input, $imp_compose)
{
$result = $imp_compose->expandAddresses($this->getAddressList($input));
*
* @throws Horde_Exception
*/
- function redirectMessage($to, $imp_compose, $contents, $encoding)
+ public function redirectMessage($to, $imp_compose, $contents, $encoding)
{
try {
$recip = $imp_compose->recipientList(array('to' => $to));
}
$recipients = implode(', ', $recip['list']);
- $identity = &Identity::singleton(array('imp', 'imp'));
+ $identity = Identity::singleton(array('imp', 'imp'));
$from_addr = $identity->getFromAddress();
$headers = $contents->getHeaderOb();
/**
*/
- function getForwardData(&$imp_compose, &$imp_contents, $index)
+ public function getForwardData(&$imp_compose, &$imp_contents, $index)
{
$fwd_msg = $imp_compose->forwardMessage($imp_contents);
$subject_header = $imp_compose->attachIMAPMessage(array($index), $fwd_msg['headers']);
/**
*/
- function attachAutoCompleter($fields)
+ public function attachAutoCompleter($fields)
{
/* Attach autocompleters to the compose form elements. */
foreach ($fields as $val) {
/**
*/
- function attachSpellChecker($mode, $add_br = false)
+ public function attachSpellChecker($mode, $add_br = false)
{
$menu_view = $GLOBALS['prefs']->getValue('menu_view');
$show_text = ($menu_view == 'text' || $menu_view == 'both');
/**
*/
- function getAddressList($to, $to_list = array(), $to_field = array(),
+ public function getAddressList($to, $to_list = array(), $to_field = array(),
$to_new = '', $expand = false)
{
$to = rtrim(trim($to), ',');
/**
*/
- function initRTE($mode = 'imp', $editoronly = false)
+ public function initRTE($mode = 'imp', $editoronly = false)
{
- $editor = &Horde_Editor::singleton('Fckeditor', array('id' => 'message', 'no_notify' => true));
+ $editor = Horde_Editor::singleton('Fckeditor', array('id' => 'message', 'no_notify' => true));
if ($editoronly) {
return $editor;
}
$ret['from'] = _("Invalid Address");
$ret['error'] = true;
} else {
- $identity = &Identity::singleton(array('imp', 'imp'));
+ $identity = Identity::singleton(array('imp', 'imp'));
if ($identity->hasAddress($from['inner'])) {
/* This message was sent by one of the user's identity
* addresses - show To: information instead. */
$success = true;
if ($mdn_flag) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->flag(array('$MDNSent'), $uid . IMP::IDX_SEP . $mailbox, true);
}
} catch (Horde_Mime_Exception $e) {
/* Load Identity. */
require_once 'Horde/Identity.php';
- $identity = &Identity::singleton(array('imp', 'imp'));
+ $identity = Identity::singleton(array('imp', 'imp'));
$selected_identity = $identity->getDefault();
$sent_mail_folder = $identity->getValue('sent_mail_folder');
if (!empty($sent_mail_folder)) {
$composeCache = null;
if (!empty($args['composeCache'])) {
- $imp_compose = &IMP_Compose::singleton($args['composeCache']);
+ $imp_compose = IMP_Compose::singleton($args['composeCache']);
$composeCache = $args['composeCache'];
if ($imp_compose->numberOfAttachments()) {
}
/* Generate the sorted mailbox list now. */
- $imp_mailbox = &IMP_Mailbox::singleton($mbox);
+ $imp_mailbox = IMP_Mailbox::singleton($mbox);
$sorted_list = $imp_mailbox->getSortedList();
$msgcount = count($sorted_list['s']);
* is a chance that the mailbox doesn't exist. If there is at least
* 1 message, we don't need this check. */
if (empty($msgcount) && !$is_search) {
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
if (!$imp_folder->exists($mbox)) {
$GLOBALS['notification']->push(sprintf(_("Mailbox %s does not exist."), $label), 'horde.error');
}
/* Get unseen/thread information. */
if (!$is_search) {
- $imptree = &IMP_Imap_Tree::singleton();
+ $imptree = IMP_Imap_Tree::singleton();
$info = $imptree->getElementInfo($mbox);
if (!empty($info)) {
$md->unseen = $info['unseen'];
$ob['flags'] = array_merge($ob['flags'], Horde::callHook('_imp_hook_msglist_flags', array($ob, 'dimp'), 'imp'));
}
- $imp_flags = &IMP_Imap_Flags::singleton();
+ $imp_flags = IMP_Imap_Flags::singleton();
$flag_parse = $imp_flags->parse(array(
'atc' => isset($ob['structure']) ? $ob['structure'] : null,
'flags' => $ob['flags'],
/* Parse MIME info and create the body of the message. */
try {
- $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox);
+ $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox);
} catch (Horde_Exception $e) {
$result['error'] = $error_msg;
$result['errortype'] = 'horde.error';
require_once dirname(__FILE__) . '/base.php';
if (IMP::checkAuthentication(true)) {
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
return $imp_folder->flist();
}
require_once dirname(__FILE__) . '/base.php';
if (IMP::checkAuthentication(true)) {
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
return $imp_folder->create(IMP::appendNamespace($folder), $GLOBALS['prefs']->getValue('subscribe'));
}
require_once dirname(__FILE__) . '/base.php';
if (IMP::checkAuthentication(true)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
return $imp_message->delete(array($mailbox => $indices), array('nuke' => true));
}
require_once dirname(__FILE__) . '/base.php';
if (IMP::checkAuthentication(true)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
return $imp_message->copy($target, 'copy', array($mailbox => $indices), true);
}
require_once dirname(__FILE__) . '/base.php';
if (IMP::checkAuthentication(true)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
return $imp_message->copy($target, 'move', array($mailbox => $indices), true);
}
require_once dirname(__FILE__) . '/base.php';
if (IMP::checkAuthentication(true)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
return $imp_message->flag($flags, 'move', array($mailbox => $indices), $set);
}
require_once dirname(__FILE__) . '/base.php';
if (IMP::checkAuthentication(true)) {
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
$imp_folder->clearFlistCache();
- $imaptree = &IMP_Imap_Tree::singleton();
+ $imaptree = IMP_Imap_Tree::singleton();
$imaptree->init();
$GLOBALS['imp_search']->sessionSetup(true);
}
$s_ctrl = Registry::SESSION_READONLY;
break;
}
-$registry = &Registry::singleton($s_ctrl);
+$registry = Registry::singleton($s_ctrl);
// We explicitly do not check application permissions for the compose
// and login pages, since those are handled below and need to fall through
// that just timed out, store the draft.
if (!(Auth::isAuthenticated() || (Auth::getProvider() == 'imp'))) {
if ($compose_page) {
- $imp_compose = &IMP_Compose::singleton();
+ $imp_compose = IMP_Compose::singleton();
$imp_compose->sessionExpireDraft();
}
Horde::authenticationFailureRedirect();
// are likely to trigger this case.
if (empty($_SESSION['imp'])) {
if ($compose_page) {
- $imp_compose = &IMP_Compose::singleton();
+ $imp_compose = IMP_Compose::singleton();
$imp_compose->sessionExpireDraft();
require IMP_BASE . '/login.php';
} else {
if ($compose_page) {
if (!IMP::checkAuthentication(true, ($authentication === 'horde'))) {
- $imp_compose = &IMP_Compose::singleton();
+ $imp_compose = IMP_Compose::singleton();
$imp_compose->sessionExpireDraft();
require IMP_BASE . '/login.php';
exit;
}
// Notification system.
-$notification = &Horde_Notification::singleton();
+$notification = Horde_Notification::singleton();
if (($viewmode == 'mimp') ||
(Horde_Util::nonInputVar('login_page') && $GLOBALS['browser']->isMobile())) {
- $GLOBALS['imp_notify'] = &$notification->attach('status', null, 'Horde_Notification_Listener_Mobile');
+ $GLOBALS['imp_notify'] = $notification->attach('status', null, 'Horde_Notification_Listener_Mobile');
} else {
- $GLOBALS['imp_notify'] = &$notification->attach('status', array('viewmode' => $viewmode), 'IMP_Notification_Listener_Status');
+ $GLOBALS['imp_notify'] = $notification->attach('status', array('viewmode' => $viewmode), 'IMP_Notification_Listener_Status');
if ($viewmode == 'imp') {
$notification->attach('audio');
}
$sent_mail_folder = IMP::appendNamespace($sent_mail_default);
}
if (!empty($sent_mail_folder)) {
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
if (!$imp_folder->exists($sent_mail_folder)) {
$imp_folder->create($sent_mail_folder, $prefs->getValue('subscribe'));
}
} else {
if (empty($folder) && !empty($new)) {
$folder = IMP::appendNamespace($new);
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
if (!$imp_folder->create($folder, $prefs->getValue('subscribe'))) {
$folder = null;
}
function handle_flagmanagement($updated)
{
- $imp_flags = &IMP_Imap_Flags::singleton();
+ $imp_flags = IMP_Imap_Flags::singleton();
$action = Horde_Util::getFormData('flag_action');
$data = Horde_Util::getFormData('flag_data');
}
if ($prefs->isDirty('subscribe') || $prefs->isDirty('tree_view')) {
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
$imp_folder->clearFlistCache();
- $imaptree = &IMP_Imap_Tree::singleton();
+ $imaptree = IMP_Imap_Tree::singleton();
$imaptree->init();
}
// 'e' = expunge mailbox
case 'e':
if (!$readonly) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->expungeMailbox(array($imp_mbox['mailbox'] => 1));
}
break;
$mailbox_url = IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']);
/* Build the list of messages in the mailbox. */
-$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox']);
+$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox']);
$pageOb = $imp_mailbox->buildMailboxPage(Horde_Util::getFormData('p'), Horde_Util::getFormData('s'));
/* Generate page links. */
}
/* Get flag information. */
- $imp_flags = &IMP_Imap_Flags::singleton();
+ $imp_flags = IMP_Imap_Flags::singleton();
$flag_parse = $imp_flags->parse(array(
'flags' => $ob['flags'],
'personal' => Horde_Mime_Address::getAddressesFromObject($ob['envelope']['to']),
case 'delete_messages':
if (!empty($indices)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->delete($indices);
}
break;
case 'undelete_messages':
if (!empty($indices)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->undelete($indices);
}
break;
case 'move_messages':
case 'copy_messages':
if (!empty($indices) && !empty($targetMbox)) {
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
if (!empty($newMbox) && ($newMbox == 1)) {
$targetMbox = IMP::folderPref($targetMbox, true);
$newMbox = true;
$flag = substr($flag, 1);
$set = false;
}
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->flag(array($flag), $indices, $set);
}
break;
break;
case 'expunge_mailbox':
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->expungeMailbox(array($imp_mbox['mailbox'] => 1));
break;
break;
case 'empty_mailbox':
- $imp_message = &IMP_Message::singleton();
+ $imp_message = IMP_Message::singleton();
$imp_message->emptyMailbox(array($imp_mbox['mailbox']));
break;
exit;
}
-$imp_flags = &IMP_Imap_Flags::singleton();
+$imp_flags = IMP_Imap_Flags::singleton();
/* Display the navbar and actions if there is at least 1 message in mailbox. */
if ($pageOb['msgcount']) {
require_once dirname(__FILE__) . '/lib/base.php';
/* Make sure we have a valid index. */
-$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']);
+$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']);
if (!$imp_mailbox->isValidIndex(false)) {
header('Location: ' . Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('a' => 'm'), null, false));
exit;
}
/* Initialize IMP_Message object. */
-$imp_message = &IMP_Message::singleton();
+$imp_message = IMP_Message::singleton();
/* Determine if mailbox is readonly. */
$readonly = $imp_imap->isReadOnly($imp_mbox['mailbox']);
/* Parse the message. */
try {
- $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name);
+ $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name);
} catch (Horde_Exception $e) {
header('Location: ' . Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $mailbox_name), array('a' => 'm'), null, false));
exit;
/* Create the Identity object. */
require_once 'Horde/Identity.php';
-$user_identity = &Identity::singleton(array('imp', 'imp'));
+$user_identity = Identity::singleton(array('imp', 'imp'));
/* Develop the list of headers to display. */
$basic_headers = $imp_ui->basicHeaders();
}
}
-$imp_flags = &IMP_Imap_Flags::singleton();
+$imp_flags = IMP_Imap_Flags::singleton();
$flag_parse = $imp_flags->parse(array(
'flags' => $flags,
'personal' => $match_identity
}
/* Make sure we have a valid index. */
-$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']);
+$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']);
if (!$imp_mailbox->isValidIndex(false)) {
_returnToMailbox(null, 'message_missing');
require IMP_BASE . '/mailbox.php';
}
/* Initialize IMP_Message object. */
-$imp_message = &IMP_Message::singleton();
+$imp_message = IMP_Message::singleton();
/* Set the current time zone. */
NLS::setTimeZone();
/* Initialize the user's identities. */
require_once 'Horde/Identity.php';
-$user_identity = &Identity::singleton(array('imp', 'imp'));
+$user_identity = Identity::singleton(array('imp', 'imp'));
/* Run through action handlers. */
$actionID = Horde_Util::getFormData('actionID');
/* Parse the message. */
try {
- $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name);
+ $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name);
} catch (Horde_Exception $e) {
$imp_mailbox->removeMsgs(true);
_returnToMailbox(null, 'message_missing');
/* Generate the view link. */
$view_link = IMP::generateIMPUrl('view.php', $imp_mbox['mailbox'], $index, $mailbox_name);
-$imp_flags = &IMP_Imap_Flags::singleton();
+$imp_flags = IMP_Imap_Flags::singleton();
/* Everything below here is related to preparing the output. */
if (!IMP::$printMode) {
function _reloadWindow()
{
- $cacheSess = &Horde_SessionObjects::singleton();
+ $cacheSess = Horde_SessionObjects::singleton();
$reload = Horde_Util::getFormData('reload');
$cacheSess->setPruneFlag($reload, true);
Horde_Util::closeWindowJS('opener.focus();opener.location.href="' . $cacheSess->query($reload) . '";');
case 'save_attachment_public_key':
/* Retrieve the key from the message. */
try {
- $contents = &IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox'));
+ $contents = IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox'));
} catch (Horde_Exception $e) {
Horde::fatal($e, __FILE__, __LINE__);
}
if (!$t->get('no_file_upload')) {
$t->set('no_source', !$GLOBALS['prefs']->getValue('add_source'));
if (!$t->get('no_source')) {
- $cacheSess = &Horde_SessionObjects::singleton();
+ $cacheSess = Horde_SessionObjects::singleton();
$t->set('public_import_url', Horde_Util::addParameter(Horde_Util::addParameter($selfURL, 'actionID', 'import_public_key'), 'reload', $cacheSess->storeOid($selfURL, false)));
$t->set('import_pubkey-help', Horde_Help::link('imp', 'pgp-import-pubkey'));
}
$t->set('personalkey-delete-help', Horde_Help::link('imp', 'pgp-personalkey-delete'));
} else {
require_once 'Horde/Identity.php';
- $imp_identity = &Identity::singleton(array('imp', 'imp'));
+ $imp_identity = Identity::singleton(array('imp', 'imp'));
$t->set('fullname', $imp_identity->getFullname());
$t->set('personalkey-create-name-help', Horde_Help::link('imp', 'pgp-personalkey-create-name'));
$t->set('personalkey-create-comment-help', Horde_Help::link('imp', 'pgp-personalkey-create-comment'));
$mailbox = IMP::appendNamespace(preg_replace('/\//', $ns_info['delimiter'], trim($request_parts[0], '/')));
/* Make sure mailbox exists or else exit immediately. */
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
if (!$imp_folder->exists($mailbox)) {
exit;
}
}
/* Obtain some information describing the mailbox state. */
-$imp_mailbox = &IMP_Mailbox::singleton($mailbox);
+$imp_mailbox = IMP_Mailbox::singleton($mailbox);
$total_num = $imp_mailbox->getMessageCount();
$unseen_num = ($imp_search->isVINBOXFolder($mailbox))
? $imp_mailbox->getMessageCount()
$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'save_image':
- $contents = &IMP_Contents::singleton($index);
+ $contents = IMP_Contents::singleton($index);
$mime_part = $contents->getMIMEPart($id);
$image_data = array(
'filename' => $mime_part->getName(true),
$mboxes = array();
$newcol = $numcolumns = 1;
- $imp_folder = &IMP_Folder::singleton();
+ $imp_folder = IMP_Folder::singleton();
$mailboxes = $imp_folder->flist(array(), !is_null($shown) ? $shown : null);
$total = ceil(count($mailboxes) / 3);
function _actionWindow()
{
$oid = Horde_Util::getFormData('passphrase_action');
- $cacheSess = &Horde_SessionObjects::singleton();
+ $cacheSess = Horde_SessionObjects::singleton();
$cacheSess->setPruneFlag($oid, true);
Horde_Util::closeWindowJS($cacheSess->query($oid));
}
function _reloadWindow()
{
- $cacheSess = &Horde_SessionObjects::singleton();
+ $cacheSess = Horde_SessionObjects::singleton();
$reload = Horde_Util::getFormData('reload');
$cacheSess->setPruneFlag($reload, true);
Horde_Util::closeWindowJS('opener.focus();opener.location.href="' . $cacheSess->query($reload) . '";');
case 'save_attachment_public_key':
/* Retrieve the key from the message. */
try {
- $contents = &IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox'));
+ $contents = IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox'));
} catch (Horde_Exception $e) {
Horde::fatal($e, __FILE__, __LINE__);
}
if (!$t->get('no_file_upload')) {
$t->set('no_source', !$GLOBALS['prefs']->getValue('add_source'));
if (!$t->get('no_source')) {
- $cacheSess = &Horde_SessionObjects::singleton();
+ $cacheSess = Horde_SessionObjects::singleton();
$t->set('public_import_url', Horde_Util::addParameter(Horde_Util::addParameter($selfURL, 'actionID', 'import_public_key'), 'reload', $cacheSess->storeOid($selfURL, false)));
$t->set('import_pubkey-help', Horde_Help::link('imp', 'smime-import-pubkey'));
}
}
if ($stationery['t'] == 'html') {
- $editor = &Horde_Editor::singleton('Fckeditor', array('id' => 'content'));
+ $editor = Horde_Editor::singleton('Fckeditor', array('id' => 'content'));
}
/* Show the header. */
$t->set('linebreaks', true);
}
-$menu = &new Horde_Mobile_card('o', _("Menu"));
+$menu = new Horde_Mobile_card('o', _("Menu"));
$mset = &$menu->add(new Horde_Mobile_linkset());
$mset->add(new Horde_Mobile_link(_("Refresh"), $selfurl));
if ($subscribe) {
$show_quota = (isset($_SESSION['imp']['quota']) && is_array($_SESSION['imp']['quota']));
// Get the list of available IMAP flags
-$imp_flags = &IMP_Imap_Flags::singleton();
+$imp_flags = IMP_Imap_Flags::singleton();
$flag_list = $imp_flags->getList(array('imap' => true));
// Small utility functions to simplify creating dimpactions buttons.
}
/* Generate flag array. */
-$imp_flags = &IMP_Imap_Flags::singleton();
+$imp_flags = IMP_Imap_Flags::singleton();
foreach ($imp_flags->getList() as $val) {
$flags[$val['flag']] = array_filter(array(
'b' => isset($val['b']) ? $val['b'] : null,
<?php
/* Get the list of flags. */
-$imp_flags = &IMP_Imap_Flags::singleton();
+$imp_flags = IMP_Imap_Flags::singleton();
$flaglist = $imp_flags->getList(array('div' => true, 'fgcolor' => true));
/* Get the graphics. */
*/
$mode = Horde_Util::getFormData('mode', 'thread');
-$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']);
+$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']);
$error = false;
if ($mode == 'thread') {
/* Get the body of the message. */
$curr_msg = $curr_tree = array();
- $contents = &IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox);
+ $contents = IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox);
$mime_id = $contents->findBody();
if ($contents->canDisplay($mime_id, IMP_Contents::RENDER_INLINE)) {
$ret = $contents->renderMIMEPart($mime_id, IMP_Contents::RENDER_INLINE);
}
/* Flag messages as seen. */
-$imp_message = &IMP_Message::singleton();
+$imp_message = IMP_Message::singleton();
$imp_message->flag(array('\\seen'), $loop_array);
$template = new IMP_Template();