📄 message.php
字号:
<?php/* Copyright Intermesh 2003 Author: Merijn Schering <mschering@intermesh.nl> Version: 1.0 Release date: 08 July 2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */require_once ("../../Group-Office.php");$GO_SECURITY->authenticate();$GO_MODULES->authenticate('email');require_once ($GO_CONFIG->class_path."mail/imap.class.inc");require_once ($GO_MODULES->class_path."email.class.inc");$mail = new imap();$email = new email();$overlib = new overlib();$GO_HEADER['nomessages'] = true;$GO_HEADER['head'] = $overlib->get_header();require_once ($GO_LANGUAGE->get_language_file('email'));$em_settings = $email->get_settings($GO_SECURITY->user_id);$link_back = (isset ($_REQUEST['link_back']) && $_REQUEST['link_back'] != '') ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];$to = '';$texts = '';$images = '';$account_id = isset ($_REQUEST['account_id']) ? $_REQUEST['account_id'] : 0;$task = isset ($_REQUEST['task']) ? $_REQUEST['task'] : '';$mailbox = isset ($_REQUEST['mailbox']) ? $_REQUEST['mailbox'] : "INBOX";$uid = isset ($_REQUEST['uid']) ? $_REQUEST['uid'] : 0;$return_to = (isset ($_REQUEST['return_to']) && $_REQUEST['return_to'] != '') ? $_REQUEST['return_to'] : null;$link_back = (isset ($_REQUEST['link_back']) && $_REQUEST['link_back'] != '') ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];$task = (isset ($_REQUEST['task']) && $_REQUEST['task'] != '') ? $_REQUEST['task'] : '';$part = isset ($_REQUEST['part']) ? $_REQUEST['part'] : '';$query = isset ($_REQUEST['query']) ? $_REQUEST['query'] : '';$account = $email->get_account($account_id);if ($account && $mail->open($account['host'], $account['type'], $account['port'], $account['username'], $account['password'], $mailbox, 0, $account['use_ssl'], $account['novalidate_cert'])) { if ($task == 'move_mail') { $messages = array ($uid); $move_to_mailbox = smart_stripslashes($_REQUEST['move_to_mailbox']); if ($mail->move($move_to_mailbox, $messages) && $mail->reopen($move_to_mailbox)) { header('Location: '.$GO_MODULES->url.'index.php?account_id='.$account_id.'&mailbox='.urlencode($mailbox)); exit (); } } //sort messages for determination of previous and next message if ($mailbox == $account['sent']) { $email_search_query = str_replace('FROM', 'TO', $_SESSION['email_search_query']); } else { $email_search_query = $_SESSION['email_search_query']; } $reverse = ($_REQUEST['sort_ascending']!='1') ? '1' : '0'; $mail->sort($_REQUEST['sort_index'],$reverse, $email_search_query); if(!$content = $mail->get_message($uid, 'html', $part)) { $GO_HEADER['body_arguments'] = 'onload="javascript:parent.update_toolbar(true);"'; require($GO_THEME->theme_path.'header.inc'); $h1 = new html_element('h1', $ml_get_message_error_title); $p = new html_element('p', $ml_get_message_error_text); echo $h1->get_html().$p->get_html(); require($GO_THEME->theme_path.'footer.inc'); exit(); } $subject = !empty ($content["subject"]) ? enc_utf8($content["subject"]) : $ml_no_subject;} else { require_once ($GO_THEME->theme_path.'header.inc'); echo '<p class="Error">'.$ml_connect_failed.' \''.$account['host'].'\' '.$ml_at_port.': '.$account['port'].'</p>'; echo '<p class="Error">'.imap_last_error().'</p>'; require_once ($GO_THEME->theme_path.'footer.inc'); exit ();}//update notified mail stateif ($content["new"] == '1'){ if($account['auto_check'] == '1') { $_SESSION['notified_new_mail'] -= 1; } if($em_folder = $email->get_folder($account_id, $mailbox)) { $em_folder['unseen']--; $email->__update_folder($em_folder); } $treeview_refresh = 'parent.treeview.location=\'treeview.php\';';}else{ $treeview_refresh = '';}$GO_HEADER['body_arguments'] = 'onload="javascript:parent.update_toolbar(true);parent.toggle_next_button('.($content['next']>0).');parent.toggle_previous_button('.($content['previous']>0).');parent.messages.table_select_single(\'0\', \'messages_table\',\''.$uid.'\');parent.messages.table_clear_old_class('.$uid.');'.$treeview_refresh.'"';require_once ($GO_THEME->theme_path."header.inc");echo '<form method="get" action="'.$_SERVER['PHP_SELF'].'" name="email_form">';?><input type="hidden" name="link_back" value="<?php echo $link_back; ?>" /><input type="hidden" name="mailbox" value="<?php echo $mailbox; ?>" /><input type="hidden" name="sort_index" value="<?php echo $_REQUEST['sort_index']; ?>" /><input type="hidden" name="sort_ascending" value="<?php echo $_REQUEST['sort_ascending']; ?>" /><input type="hidden" name="return_to" value="<?php echo $return_to; ?>" /><input type="hidden" name="account_id" value="<?php echo $account_id; ?>" /><input type="hidden" name="uid" value="<?php echo $uid; ?>" /><input type="hidden" name="task" /><input type="hidden" name="query" value="<?php echo $query; ?>"/><script type="text/javascript"><!--function hideLargeHeader(){ var largeHeader = get_object("largeHeader"); largeHeader.style.display = 'none';}function toggle_header(){ var largeHeader = get_object("largeHeader"); var smallHeader = get_object("smallHeader"); var largeHeaderDisplay = largeHeader.style.display; largeHeader.style.display = smallHeader.style.display; smallHeader.style.display =largeHeaderDisplay; }function move_mail(){ document.email_form.task.value='move_mail'; document.email_form.submit();}function get_message(uid){ document.email_form.uid.value=uid; document.email_form.submit();}function next_message(){ get_message(<?php echo $content['next']; ?>);}function previous_message(){ get_message(<?php echo $content['previous']; ?>);}//--></script><?php$has_contacts_module = (isset ($GO_MODULES->modules['addressbook']) && $GO_MODULES->modules['addressbook']['read_permission']);if ($has_contacts_module) { require_once ($GO_MODULES->modules['addressbook']['class_path'].'addressbook.class.inc'); $ab = new addressbook();}if ($has_contacts_module) { if ($contact = $ab->get_contact_by_email($content['sender'], $GO_SECURITY->user_id)) { if ($contact['color'] != '') { $style = ' style="color: #'.$contact['color'].';"'; } else { $style = ''; } $from = '<a '.$style.' href="javascript:popup(\''.$GO_MODULES->modules['addressbook']['url'].'contact.php?contact_id='.$contact['id'].'&return_to=javascript:window.close();\');" class="normal" '.' title="'.$strShowProfile.'">'.$content['from'].'</a>'; } else { $name = split_name($content['from']); $add_contact_link = $GO_MODULES->modules['addressbook']['url'].'contact.php?email='.$content['sender'].'&first_name='.urlencode($name['first']).'&middle_name='.urlencode($name['middle']).'&last_name='.urlencode($name['last']).'&popup=true'; if ($em_settings['add_senders'] == '1' && $content["new"] == '1') { $ask_to_add = true; } $from = '<a href="javascript:popup(\''.$add_contact_link.'\');" class="normal" title="'.$strAddContact.'">'.$content['from'].'</a>'; }} else { $user = $GO_USERS->get_user_by_email($content['sender']); if ($user['id'] && $GO_SECURITY->user_is_visible($user['id'])) { $from = '<a href="javascript:popup(\''.$GO_CONFIG->control_url.'user.php?id='.$user['id'].'&popup=true\');" title="'.$strShowProfile.'">'.$content['from'].'</a>'; } else { $from = $content['from']; }}$from .= ' <'.$content['sender'].'>';$from .= ' <a href="javascript:document.location=\'about:blank\';parent.messages.location.href=\'messages.php?account_id='.$account_id.'&task=set_search_query&from='.$content['sender'].'&uid='.$uid.'\';" title="'.$ml_search_sender.'"><img src="'.$GO_THEME->images['magnifier'].'" border="0" align="middle" /></a>';?><table class="headerTable" width="100%" id="smallHeader"><tr> <td width="10" valign="top"><a href="javascript:toggle_header();" style="cursor:default;"><img src="<?php echo $GO_THEME->images['plus_node']; ?>" border="0" /></a></td> <td> <?php if($content["priority"] > 3) { echo '<img src="'.$GO_THEME->images['info'].'" border="0" width="16" height="16" align="middle" /> '; }elseif($content["priority"] < 3 && $content["priority"] > 0) { echo '<img src="'.$GO_THEME->images['alert'].'" border="0" width="16" height="16" align="middle" /> '; } ?> <b><?php echo $ml_subject; ?>:</b> <?php echo $subject; ?></td> <td><b><?php echo $ml_from; ?>:</b> <?php echo $from; ?></td> <td><b><?php echo $strDate; ?>:</b> <?php echo date($_SESSION['GO_SESSION']['date_format'].' '.$_SESSION['GO_SESSION']['time_format'], get_time($content['udate'])); ?></td></tr></table><table class="headerTable" width="100%" id="largeHeader" style="display:none"><tr><td width="10" valign="top"><a href="javascript:toggle_header();" style="cursor:default;"><img src="<?php echo $GO_THEME->images['min_node']; ?>" border="0" /></a></td> <td> <table border="0"> <?php if($content["priority"] > 3) { echo '<tr><td class="Success" colspan="2"><img src="'.$GO_THEME->images['info'].'" border="0" width="16" height="16" align="middle" /> '.$ml_low_priority.'</td></tr>'; }elseif($content["priority"] < 3 && $content["priority"] > 0) { echo '<tr><td class="Error" colspan="2"><img src="'.$GO_THEME->images['alert'].'" border="0" width="16" height="16" align="middle" /> '.$ml_high_priority.'</td></tr>'; } ?> <tr> <td><b><?php echo $ml_subject; ?>:</b></td> <td><?php echo $subject; ?></td> </tr> <tr> <td><b><?php echo $ml_from; ?>:</b></td> <td> <?php echo $from; ?> </td> </tr> <tr> <td valign="top"><b><?php echo $ml_to; ?>:</b></td> <td> <?php$to = "";if (isset ($content["to"])) { for ($i = 0; $i < sizeof($content["to"]); $i ++) { if ($i != 0) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -