Changeset 946
- Timestamp:
- 12/15/07 23:46:10
(10 months ago)
- Author:
- rats
- Message:
* Update Squirrelmail to version 1.4.13 (#932)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r945 |
r946 |
|
| 6 | 6 | | * to fix: no errors on adding user (custom HP) | |
|---|
| 7 | 7 | \_________________________________________________________________/ |
|---|
| | 8 | |
|---|
| | 9 | 2007-23-15 Benedikt Heintel |
|---|
| | 10 | - TOOLS: |
|---|
| | 11 | * Update Squirrelmail to version 1.4.13 (#932) |
|---|
| | 12 | |
|---|
| 8 | 13 | |
|---|
| 9 | 14 | 2007-12-13 Benedikt Heintel |
|---|
| r821 |
r946 |
|
| 10 | 10 | * @copyright © 1999-2007 The SquirrelMail Project Team |
|---|
| 11 | 11 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 12 | | * @version $Id: Deliver.class.php 12565 2007-07-20 17:13:46Z kink $ |
|---|
| | 12 | * @version $Id: Deliver.class.php 12749 2007-10-31 03:38:19Z jangliss $ |
|---|
| 13 | 13 | * @package squirrelmail |
|---|
| 14 | 14 | */ |
|---|
| … | … | |
| 32 | 32 | * function mail - send the message parts to the SMTP stream |
|---|
| 33 | 33 | * |
|---|
| 34 | | * @param Message $message Message class to send |
|---|
| 35 | | * @param resource $stream file handle to the SMTP stream |
|---|
| | 34 | * @param Message $message Message object to send |
|---|
| | 35 | * @param resource $stream Handle to the SMTP stream |
|---|
| | 36 | * @param string $reply_id Identifies message being replied to |
|---|
| | 37 | * (OPTIONAL; caller should ONLY specify |
|---|
| | 38 | * a value for this when the message |
|---|
| | 39 | * being sent is a reply) |
|---|
| | 40 | * @param string $reply_ent_id Identifies message being replied to |
|---|
| | 41 | * in the case it was an embedded/attached |
|---|
| | 42 | * message inside another (OPTIONAL; caller |
|---|
| | 43 | * should ONLY specify a value for this |
|---|
| | 44 | * when the message being sent is a reply) |
|---|
| 36 | 45 | * |
|---|
| 37 | 46 | * @return integer $raw_length |
|---|
| 38 | 47 | */ |
|---|
| 39 | | function mail($message, $stream=false) { |
|---|
| | 48 | function mail($message, $stream=false, $reply_id=0, $reply_ent_id=0) { |
|---|
| 40 | 49 | $rfc822_header = $message->rfc822_header; |
|---|
| 41 | 50 | if (count($message->entities)) { |
|---|
| … | … | |
| 46 | 55 | } |
|---|
| 47 | 56 | $raw_length = 0; |
|---|
| | 57 | |
|---|
| | 58 | |
|---|
| | 59 | // calculate reply header if needed |
|---|
| | 60 | // |
|---|
| | 61 | if ($reply_id) { |
|---|
| | 62 | global $imapConnection, $username, $key, $imapServerAddress, |
|---|
| | 63 | $imapPort, $mailbox; |
|---|
| | 64 | if (!$imapConnection) |
|---|
| | 65 | $imapConnection = sqimap_login($username, $key, |
|---|
| | 66 | $imapServerAddress, $imapPort, 0); |
|---|
| | 67 | |
|---|
| | 68 | sqimap_mailbox_select($imapConnection, $mailbox); |
|---|
| | 69 | $reply_message = sqimap_get_message($imapConnection, $reply_id, $mailbox); |
|---|
| | 70 | |
|---|
| | 71 | if ($reply_ent_id) { |
|---|
| | 72 | /* redefine the messsage in case of message/rfc822 */ |
|---|
| | 73 | $reply_message = $message->getEntity($reply_ent_id); |
|---|
| | 74 | /* message is an entity which contains the envelope and type0=message |
|---|
| | 75 | * and type1=rfc822. The actual entities are childs from |
|---|
| | 76 | * $reply_message->entities[0]. That's where the encoding and is located |
|---|
| | 77 | */ |
|---|
| | 78 | |
|---|
| | 79 | $orig_header = $reply_message->rfc822_header; /* here is the envelope located */ |
|---|
| | 80 | |
|---|
| | 81 | } else { |
|---|
| | 82 | $orig_header = $reply_message->rfc822_header; |
|---|
| | 83 | } |
|---|
| | 84 | $message->reply_rfc822_header = $orig_header; |
|---|
| | 85 | } |
|---|
| | 86 | |
|---|
| | 87 | |
|---|
| 48 | 88 | $reply_rfc822_header = (isset($message->reply_rfc822_header) |
|---|
| 49 | 89 | ? $message->reply_rfc822_header : ''); |
|---|
| r821 |
r946 |
|
| 8 | 8 | * @copyright © 1999-2007 The SquirrelMail Project Team |
|---|
| 9 | 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 10 | | * @version $Id: Deliver_SMTP.class.php 12561 2007-07-20 16:53:53Z kink $ |
|---|
| | 10 | * @version $Id: Deliver_SMTP.class.php 12778 2007-11-25 21:41:35Z pdontthink $ |
|---|
| 11 | 11 | * @package squirrelmail |
|---|
| 12 | 12 | */ |
|---|
| … | … | |
| 29 | 29 | |
|---|
| 30 | 30 | function initStream($message, $domain, $length=0, $host='', $port='', $user='', $pass='', $authpop=false) { |
|---|
| 31 | | global $use_smtp_tls,$smtp_auth_mech,$username,$key,$onetimepad; |
|---|
| | 31 | global $use_smtp_tls, $smtp_auth_mech; |
|---|
| 32 | 32 | |
|---|
| 33 | 33 | if ($authpop) { |
|---|
| 34 | | $this->authPop($host, '', $username, $pass); |
|---|
| | 34 | $this->authPop($host, '', $user, $pass); |
|---|
| 35 | 35 | } |
|---|
| 36 | 36 | |
|---|
| … | … | |
| 121 | 121 | // Depending on mechanism, generate response string |
|---|
| 122 | 122 | if ($smtp_auth_mech == 'cram-md5') { |
|---|
| 123 | | $response = cram_md5_response($username,$pass,$chall); |
|---|
| | 123 | $response = cram_md5_response($user,$pass,$chall); |
|---|
| 124 | 124 | } elseif ($smtp_auth_mech == 'digest-md5') { |
|---|
| 125 | | $response = digest_md5_response($username,$pass,$chall,'smtp',$host); |
|---|
| | 125 | $response = digest_md5_response($user,$pass,$chall,'smtp',$host); |
|---|
| 126 | 126 | } |
|---|
| 127 | 127 | fputs($stream, $response); |
|---|
| … | … | |
| 155 | 155 | return(0); |
|---|
| 156 | 156 | } |
|---|
| 157 | | fputs($stream, base64_encode ($username) . "\r\n"); |
|---|
| | 157 | fputs($stream, base64_encode ($user) . "\r\n"); |
|---|
| 158 | 158 | $tmp = fgets($stream, 1024); |
|---|
| 159 | 159 | if ($this->errorCheck($tmp, $stream)) { |
|---|
| … | … | |
| 192 | 192 | |
|---|
| 193 | 193 | /* Ok, who is sending the message? */ |
|---|
| 194 | | $fromaddress = ($from->mailbox && $from->host) ? |
|---|
| | 194 | $fromaddress = (strlen($from->mailbox) && $from->host) ? |
|---|
| 195 | 195 | $from->mailbox.'@'.$from->host : ''; |
|---|
| 196 | 196 | fputs($stream, 'MAIL FROM:<'.$fromaddress.">\r\n"); |
|---|
| … | … | |
| 203 | 203 | for ($i = 0, $cnt = count($to); $i < $cnt; $i++) { |
|---|
| 204 | 204 | if (!$to[$i]->host) $to[$i]->host = $domain; |
|---|
| 205 | | if ($to[$i]->mailbox) { |
|---|
| | 205 | if (strlen($to[$i]->mailbox)) { |
|---|
| 206 | 206 | fputs($stream, 'RCPT TO:<'.$to[$i]->mailbox.'@'.$to[$i]->host.">\r\n"); |
|---|
| 207 | 207 | $tmp = fgets($stream, 1024); |
|---|
| … | … | |
| 214 | 214 | for ($i = 0, $cnt = count($cc); $i < $cnt; $i++) { |
|---|
| 215 | 215 | if (!$cc[$i]->host) $cc[$i]->host = $domain; |
|---|
| 216 | | if ($cc[$i]->mailbox) { |
|---|
| | 216 | if (strlen($cc[$i]->mailbox)) { |
|---|
| 217 | 217 | fputs($stream, 'RCPT TO:<'.$cc[$i]->mailbox.'@'.$cc[$i]->host.">\r\n"); |
|---|
| 218 | 218 | $tmp = fgets($stream, 1024); |
|---|
| … | … | |
| 225 | 225 | for ($i = 0, $cnt = count($bcc); $i < $cnt; $i++) { |
|---|
| 226 | 226 | if (!$bcc[$i]->host) $bcc[$i]->host = $domain; |
|---|
| 227 | | if ($bcc[$i]->mailbox) { |
|---|
| | 227 | if (strlen($bcc[$i]->mailbox)) { |
|---|
| 228 | 228 | fputs($stream, 'RCPT TO:<'.$bcc[$i]->mailbox.'@'.$bcc[$i]->host.">\r\n"); |
|---|
| 229 | 229 | $tmp = fgets($stream, 1024); |
|---|
| r821 |
r946 |
|
| 8 | 8 | * @copyright © 2003-2007 The SquirrelMail Project Team |
|---|
| 9 | 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 10 | | * @version $Id: Message.class.php 12542 2007-07-16 21:04:37Z kink $ |
|---|
| | 10 | * @version $Id: Message.class.php 12757 2007-11-04 10:08:07Z kink $ |
|---|
| 11 | 11 | * @package squirrelmail |
|---|
| 12 | 12 | * @subpackage mime |
|---|
| … | … | |
| 31 | 31 | */ |
|---|
| 32 | 32 | var $rfc822_header = ''; |
|---|
| | 33 | /** |
|---|
| | 34 | * Headers from original email in reply |
|---|
| | 35 | * @var string |
|---|
| | 36 | */ |
|---|
| | 37 | var $reply_rfc822_header = ''; |
|---|
| 33 | 38 | /** |
|---|
| 34 | 39 | * MessageHeader object |
|---|
| … | … | |
| 821 | 826 | */ |
|---|
| 822 | 827 | function parseParenthesis($read, $i) { |
|---|
| 823 | | for (; $read{$i} != ')'; ++$i) { |
|---|
| | 828 | for ($i++; $read{$i} != ')'; ++$i) { |
|---|
| 824 | 829 | switch ($read{$i}) { |
|---|
| 825 | 830 | case '"': $this->parseQuote($read, $i); break; |
|---|
| r821 |
r946 |
|
| 8 | 8 | * @copyright © 2003-2007 The SquirrelMail Project Team |
|---|
| 9 | 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 10 | | * @version $Id: Rfc822Header.class.php 12656 2007-08-31 23:20:21Z pdontthink $ |
|---|
| | 10 | * @version $Id: Rfc822Header.class.php 12764 2007-11-15 05:52:52Z jangliss $ |
|---|
| 11 | 11 | * @package squirrelmail |
|---|
| 12 | 12 | * @subpackage mime |
|---|
| … | … | |
| 538 | 538 | $aAddress[] = $this->createAddressObject($aStack,$aComment,$sEmail,$sGroup); |
|---|
| 539 | 539 | $oAddr = end($aAddress); |
|---|
| 540 | | if(!$oAddr || ((isset($oAddr)) && !$oAddr->mailbox && !$oAddr->personal)) { |
|---|
| | 540 | if(!$oAddr || ((isset($oAddr)) && !strlen($oAddr->mailbox) && !$oAddr->personal)) { |
|---|
| 541 | 541 | $sEmail = $sGroup . ':;'; |
|---|
| 542 | 542 | } |
|---|
| … | … | |
| 589 | 589 | } |
|---|
| 590 | 590 | } |
|---|
| 591 | | if (!$grouplookup && !$oAddr->mailbox) { |
|---|
| | 591 | if (!$grouplookup && !strlen($oAddr->mailbox)) { |
|---|
| 592 | 592 | $oAddr->mailbox = trim($sEmail); |
|---|
| 593 | | if ($sHost && $oAddr->mailbox) { |
|---|
| | 593 | if ($sHost && strlen($oAddr->mailbox)) { |
|---|
| 594 | 594 | $oAddr->host = $sHost; |
|---|
| 595 | 595 | } |
|---|
| 596 | 596 | } else if (!$grouplookup && !$oAddr->host) { |
|---|
| 597 | | if ($sHost && $oAddr->mailbox) { |
|---|
| | 597 | if ($sHost && strlen($oAddr->mailbox)) { |
|---|
| 598 | 598 | $oAddr->host = $sHost; |
|---|
| 599 | 599 | } |
|---|
| 600 | 600 | } |
|---|
| 601 | 601 | } |
|---|
| 602 | | if (!$aAddrBookAddress && $oAddr->mailbox) { |
|---|
| | 602 | if (!$aAddrBookAddress && strlen($oAddr->mailbox)) { |
|---|
| 603 | 603 | $aProcessedAddress[] = $oAddr; |
|---|
| 604 | 604 | } else { |
|---|
| … | … | |
| 930 | 930 | } else { |
|---|
| 931 | 931 | if (!is_array($this->cc)) $this->cc = array(); |
|---|
| | 932 | if (!is_array($this->to)) $this->to = array(); |
|---|
| 932 | 933 | $srch_addr = $this->parseAddress($address); |
|---|
| 933 | 934 | $results = array(); |
|---|
| r331 |
r946 |
|
| 1 | | Here is a windows registry file to set SquirrelMail as a windows email program |
|---|
| 2 | | Once this entry is installed, go to Internet Options and select the Programs |
|---|
| 3 | | tab. SquirrelMail should be an option under E-mail: |
|---|
| | 1 | This file can be used to allow you to jump right to the SquirrelMail compose |
|---|
| | 2 | screen to send a message when you click on a "mailto" link on any web page |
|---|
| | 3 | in Windows NT, 2000 or XP (and Vista?). |
|---|
| | 4 | |
|---|
| | 5 | Place the contents of this file (make sure to only use the part of this file |
|---|
| | 6 | below starting on the line after "Cut here") into a text file on the target |
|---|
| | 7 | computer, named exactly "squirrelmail.mailto.reg" (without the quotes) (make |
|---|
| | 8 | sure the file extension is in fact ".reg", and not ".txt"). Find the text |
|---|
| | 9 | "http://example.org/squirrelmail" and change this to the correct address for |
|---|
| | 10 | your SquirrelMail installation. When the file has been saved, double-click on |
|---|
| | 11 | it and confirm that you want to add the information to the registry. |
|---|
| | 12 | |
|---|
| | 13 | Once the registry has been updated in this manner, you can now choose |
|---|
| | 14 | SquirrelMail as your system's default mail program by going to the "Internet |
|---|
| | 15 | Options" configuration window, which can be found in the Control Panel or in |
|---|
| | 16 | Internet Explorer by clicking on Tools-->Internet Options. Choose the |
|---|
| | 17 | "Programs" tab and SquirrelMail will be an option under "E-mail". |
|---|
| | 18 | |
|---|
| 4 | 19 | |
|---|
| 5 | 20 | ---- Cut here ---- |
|---|
| … | … | |
| 19 | 34 | |
|---|
| 20 | 35 | [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\SquirrelMail\Protocols\mailto\shell\open\command] |
|---|
| 21 | | @="rundll32.exe url.dll,FileProtocolHandler http://mail.server/squirrelmail/src/mailto.php?emailaddress=%1" |
|---|
| | 36 | @="rundll32.exe url.dll,FileProtocolHandler http://example.org/squirrelmail/src/mailto.php?emailaddress=%1" |
|---|
| 22 | 37 | |
|---|
| 23 | 38 | [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\SquirrelMail\shell] |
|---|
| r331 |
r946 |
|
| 1 | | Here is a windows registry file to set SquirrelMail as a windows email program |
|---|
| 2 | | Once this entry is installed, go to Internet Options and select the Programs |
|---|
| 3 | | tab. SquirrelMail should be an option under E-mail: |
|---|
| | 1 | This file can be used to allow you to jump right to the SquirrelMail compose |
|---|
| | 2 | screen to send a message when you click on a "mailto" link on any web page |
|---|
| | 3 | in Windows 95, 98, 98se, and probably Windows ME. |
|---|
| | 4 | |
|---|
| | 5 | Place the contents of this file (make sure to only use the part of this file |
|---|
| | 6 | below starting on the line after "Cut here") into a text file on the target |
|---|
| | 7 | computer, named exactly "squirrelmail.mailto.reg" (without the quotes) (make |
|---|
| | 8 | sure the file extension is in fact ".reg", and not ".txt"). Find the text |
|---|
| | 9 | "http://example.org/squirrelmail" and change this to the correct address for |
|---|
| | 10 | your SquirrelMail installation. When the file has been saved, double-click on |
|---|
| | 11 | it and confirm that you want to add the information to the registry. |
|---|
| | 12 | |
|---|
| | 13 | Once the registry has been updated in this manner, you can now choose |
|---|
| | 14 | SquirrelMail as your system's default mail program by going to the "Internet |
|---|
| | 15 | Options" configuration window, which can be found in the Control Panel or in |
|---|
| | 16 | Internet Explorer by clicking on Tools-->Internet Options. Choose the |
|---|
| | 17 | "Programs" tab and SquirrelMail will be an option under "E-mail". |
|---|
| | 18 | |
|---|
| 4 | 19 | |
|---|
| 5 | 20 | ---- Cut here ---- |
|---|
| … | … | |
| 19 | 34 | |
|---|
| 20 | 35 | [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\SquirrelMail\Protocols\mailto\shell\open\command] |
|---|
| 21 | | @="rundll32.exe url.dll,FileProtocolHandler http://mail.server/squirrelmail/src/mailto.php?emailaddress=%1" |
|---|
| | 36 | @="rundll32.exe url.dll,FileProtocolHandler http://example.org/squirrelmail/src/mailto.php?emailaddress=%1" |
|---|
| 22 | 37 | |
|---|
| 23 | 38 | [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\SquirrelMail\shell] |
|---|
| r826 |
r946 |
|
| 2 | 2 | reply_to= |
|---|
| 3 | 3 | show_html_default=0 |
|---|
| 4 | | sort=0 |
|---|
| 5 | | compose_window_type=html |
|---|
| r703 |
r946 |
|
| 8 | 8 | * @copyright © 1999-2007 The SquirrelMail Project Team |
|---|
| 9 | 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 10 | | * @version $Id: addressbook.php 12127 2007-01-13 20:07:24Z kink $ |
|---|
| | 10 | * @version $Id: addressbook.php 12718 2007-10-01 19:37:52Z pdontthink $ |
|---|
| 11 | 11 | * @package squirrelmail |
|---|
| 12 | 12 | * @subpackage addressbook |
|---|
| … | … | |
| 351 | 351 | |
|---|
| 352 | 352 | function full_address($row) { |
|---|
| 353 | | global $addrsrch_fullname, $data_dir, $username; |
|---|
| 354 | | $prefix = getPref($data_dir, $username, 'addrsrch_fullname'); |
|---|
| 355 | | if (($prefix != "" || (isset($addrsrch_fullname) && |
|---|
| 356 | | $prefix == $addrsrch_fullname)) && $prefix != 'noprefix') { |
|---|
| 357 | | $name = ($prefix == 'nickname' ? $row['nickname'] : $row['name']); |
|---|
| 358 | | return $name . ' <' . trim($row['email']) . '>'; |
|---|
| 359 | | } else { |
|---|
| | 353 | global $data_dir, $username; |
|---|
| | 354 | $addrsrch_fullname = getPref($data_dir, $username, 'addrsrch_fullname'); |
|---|
| | 355 | if ($addrsrch_fullname == 'fullname') |
|---|
| | 356 | return $row['name'] . ' <' . trim($row['email']) . '>'; |
|---|
| | 357 | else if ($addrsrch_fullname == 'nickname') |
|---|
| | 358 | return $row['nickname'] . ' <' . trim($row['email']) . '>'; |
|---|
| | 359 | else // "noprefix" |
|---|
| 360 | 360 | return trim($row['email']); |
|---|
| 361 | | } |
|---|
| 362 | 361 | } |
|---|
| 363 | 362 | |
|---|
| r821 |
r946 |
|
| 8 | 8 | * @copyright © 1999-2007 The SquirrelMail Project Team |
|---|
| 9 | 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 10 | | * @version $Id: auth.php 12629 2007-08-29 23:59:12Z pdontthink $ |
|---|
| | 10 | * @version $Id: auth.php 12746 2007-10-30 16:28:43Z jangliss $ |
|---|
| 11 | 11 | * @package squirrelmail |
|---|
| 12 | 12 | */ |
|---|
| … | … | |
| 55 | 55 | // information-loss. |
|---|
| 56 | 56 | $session_expired_post = $_POST; |
|---|
| 57 | | $session_expired_location = PAGE_NAME; |
|---|
| | 57 | if (defined('PAGE_NAME')) { |
|---|
| | 58 | $session_expired_location = PAGE_NAME; |
|---|
| | 59 | } |
|---|
| | 60 | |
|---|
| 58 | 61 | if (!sqsession_is_registered('session_expired_post')) { |
|---|
| 59 | 62 | sqsession_register($session_expired_post,'session_expired_post'); |
|---|
| r821 |
r946 |
|
| 9 | 9 | * @copyright © 1999-2007 The SquirrelMail Project Team |
|---|
| 10 | 10 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 11 | | * @version $Id: display_messages.php 12576 2007-08-09 06:49:27Z pdontthink $ |
|---|
| | 11 | * @version $Id: display_messages.php 12797 2007-12-01 02:29:12Z pdontthink $ |
|---|
| 12 | 12 | * @package squirrelmail |
|---|
| 13 | 13 | */ |
|---|
| … | … | |
| 27 | 27 | '<a href="'.sqm_baseuri()."src/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">"; |
|---|
| 28 | 28 | |
|---|
| 29 | | if (strpos($mailbox, $default_folder_prefix) === 0) |
|---|
| 30 | | $mailbox = substr($mailbox, strlen($default_folder_prefix)); |
|---|
| 31 | | |
|---|
| | 29 | if (!empty($default_folder_prefix)) { |
|---|
| | 30 | if (strpos($mailbox, $default_folder_prefix) === 0) |
|---|
| | 31 | $mailbox = substr($mailbox, strlen($default_folder_prefix)); |
|---|
| | 32 | } |
|---|
| | 33 | |
|---|
| 32 | 34 | $string .= sprintf (_("Click here to return to %s"), |
|---|
| 33 | 35 | htmlspecialchars(imap_utf7_decode_local($mailbox))). |
|---|
| … | … | |
| 45 | 47 | $color, $theme, $theme_default; |
|---|
| 46 | 48 | |
|---|
| | 49 | include_once( SM_PATH . 'functions/page_header.php' ); |
|---|
| | 50 | |
|---|
| 47 | 51 | $base_uri = sqm_baseuri(); |
|---|
| 48 | 52 | |
|---|
| 49 | | include_once( SM_PATH . 'functions/page_header.php' ); |
|---|
| 50 | | if ( !isset( $org_logo ) ) { |
|---|
| 51 | | // Don't know yet why, but in some accesses $org_logo is not set. |
|---|
| 52 | | include( SM_PATH . 'config/config.php' ); |
|---|
| 53 | | } |
|---|
| | 53 | $logout_link = $base_uri . 'src/login.php'; |
|---|
| | 54 | |
|---|
| | 55 | list($junk, $errString, $errTitle, $logout_link) |
|---|
| | 56 | = do_hook('logout_error', $errString, $errTitle, $logout_link); |
|---|
| | 57 | |
|---|
| 54 | 58 | /* Display width and height like good little people */ |
|---|
| 55 | 59 | $width_and_height = ''; |
|---|
| … | … | |
| 78 | 82 | $color[8] = '#000000'; /* black Normal text */ |
|---|
| 79 | 83 | } |
|---|
| 80 | | |
|---|
| 81 | | $logout_link = $base_uri . 'src/login.php'; |
|---|
| 82 | | |
|---|
| 83 | | list($junk, $errString, $errTitle, $logout_link) |
|---|
| 84 | | = do_hook('logout_error', $errString, $errTitle, $logout_link); |
|---|
| 85 | 84 | |
|---|
| 86 | 85 | if ( $errTitle == '' ) { |
|---|
| r821 |
r946 |
|
| 6 | 6 | * @copyright © 1999-2007 The SquirrelMail Project Team |
|---|
| 7 | 7 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 8 | | * @version $Id: global.php 12546 2007-07-16 22:27:13Z kink $ |
|---|
| | 8 | * @version $Id: global.php 12793 2007-11-27 21:26:57Z jangliss $ |
|---|
| 9 | 9 | * @package squirrelmail |
|---|
| 10 | 10 | */ |
|---|
| … | … | |
| 186 | 186 | |
|---|
| 187 | 187 | /** |
|---|
| | 188 | * Squelch error output to screen (only) for the given function. |
|---|
| | 189 | * |
|---|
| | 190 | * This provides an alternative to the @ error-suppression |
|---|
| | 191 | * operator where errors will not be shown in the interface |
|---|
| | 192 | * but will show up in the server log file (assuming the |
|---|
| | 193 | * administrator has configured PHP logging). |
|---|
| | 194 | * |
|---|
| | 195 | * @since 1.4.12 and 1.5.2 |
|---|
| | 196 | * |
|---|
| | 197 | * @param string $function The function to be executed |
|---|
| | 198 | * @param array $args The arguments to be passed to the function |
|---|
| | 199 | * (OPTIONAL; default no arguments) |
|---|
| | 200 | * NOTE: The caller must take extra action if |
|---|
| | 201 | * the function being called is supposed |
|---|
| | 202 | * to use any of the parameters by |
|---|
| | 203 | * reference. In the following example, |
|---|
| | 204 | * $x is passed by reference and $y is |
|---|
| | 205 | * passed by value to the "my_func" |
|---|
| | 206 | * function. |
|---|
| | 207 | * sq_call_function_suppress_errors('my_func', array(&$x, $y)); |
|---|
| | 208 | * |
|---|
| | 209 | * @return mixed The return value, if any, of the function being |
|---|
| | 210 | * executed will be returned. |
|---|
| | 211 | * |
|---|
| | 212 | */ |
|---|
| | 213 | function sq_call_function_suppress_errors($function, $args=NULL) { |
|---|
| | 214 | $display_errors = ini_get('display_errors'); |
|---|
| | 215 | ini_set('display_errors', '0'); |
|---|
| | 216 | $ret = call_user_func_array($function, $args); |
|---|
| | 217 | ini_set('display_errors', $display_errors); |
|---|
| | 218 | return $ret; |
|---|
| | 219 | } |
|---|
| | 220 | |
|---|
| | 221 | /** |
|---|
| 188 | 222 | * Add a variable to the session. |
|---|
| 189 | 223 | * @param mixed $var the variable to register |
|---|
| … | … | |
| 313 | 347 | global $base_uri; |
|---|
| 314 | 348 | |
|---|
| 315 | | if (isset($_COOKIE[session_name()])) setcookie(session_name(), '', 0, $base_uri); |
|---|
| 316 | | if (isset($_COOKIE['username'])) setcookie('username', '', 0, $base_uri); |
|---|
| 317 | | if (isset($_COOKIE['key'])) setcookie('key', '', 0, $base_uri); |
|---|
| | 349 | if (isset($_COOKIE[session_name()])) setcookie(session_name(), $_COOKIE[session_name()], 1, $base_uri); |
|---|
| | 350 | if (isset($_COOKIE['key'])) setcookie('key', 'SQMTRASH', 1, $base_uri); |
|---|
| 318 | 351 | |
|---|
| 319 | 352 | $sessid = session_id(); |
|---|
| r821 |
r946 |
|
| 9 | 9 | * @copyright © 1999-2007 The SquirrelMail Project Team |
|---|
| 10 | 10 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 11 | | * @version $Id: imap_messages.php 12690 2007-09-15 01:35:02Z pdontthink $ |
|---|
| | 11 | * @version $Id: imap_messages.php 12769 2007-11-19 04:21:49Z jangliss $ |
|---|
| 12 | 12 | * @package squirrelmail |
|---|
| 13 | 13 | * @subpackage imap |
|---|
| … | … | |
| 144 | 144 | 3=> 'FROM', |
|---|
| 145 | 145 | 4=> 'SUBJECT', |
|---|
| 146 | | 5=> 'SUBJECT'); |
|---|
| | 146 | 5=> 'SUBJECT', |
|---|
| | 147 | 8=> 'SIZE', |
|---|
| | 148 | 9=> 'SIZE'); |
|---|
| 147 | 149 | if ($internal_date_sort == true) { |
|---|
| 148 | 150 | $sort_on[0] = 'ARRIVAL'; |
|---|
| … | … | |
| 167 | 169 | } |
|---|
| 168 | 170 | |
|---|
| 169 | | if ($sort == 0 || $sort == 2 || $sort == 4) { |
|---|
| | 171 | if ($sort == 0 || $sort == 2 || $sort == 4 || $sort == 8) { |
|---|
| 170 | 172 | $server_sort_array = array_reverse($server_sort_array); |
|---|
| 171 | 173 | } |
|---|
| r821 |
r946 |
|
| 9 | 9 | * @copyright © 1999-2007 The SquirrelMail Project Team |
|---|
| 10 | 10 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 11 | | * @version $Id: mailbox_display.php 12680 2007-09-06 07:42:09Z pdontthink $ |
|---|
| | 11 | * @version $Id: mailbox_display.php 12770 2007-11-19 05:26:16Z jangliss $ |
|---|
| 12 | 12 | * @package squirrelmail |
|---|
| 13 | 13 | */ |
|---|
| … | … | |
| 346 | 346 | if ($num_msgs >= 1) { |
|---|
| 347 | 347 | $id = sqimap_get_php_sort_order ($imapConnection, $mbxresponse); |
|---|
| 348 | | if ($sort < 6 ) { |
|---|
| | 348 | if ($sort != 6 ) { |
|---|
| 349 | 349 | $end = $num_msgs; |
|---|
| 350 | 350 | $end_loop = $end; |
|---|
| … | … | |
| 553 | 553 | * 4 = Subject (up) |
|---|
| 554 | 554 | * 5 = Subject (dn) |
|---|
| | 555 | * 6 = default no sort |
|---|
| | 556 | * 7 - UNUSED |
|---|
| | 557 | * 8 = Size (up) |
|---|
| | 558 | * 9 = Size (dn) |
|---|
| 555 | 559 | */ |
|---|
| 556 | 560 | |
|---|
| … | … | |
| 567 | 571 | $msort[] = $item['SUBJECT-SORT']; |
|---|
| 568 | 572 | } |
|---|
| | 573 | } elseif (($sort == 8) || ($sort == 9)) { |
|---|
| | 574 | foreach ($msgs as $item) { |
|---|
| | 575 | $msort[] = $item['SIZE']; |
|---|
| | 576 | } |
|---|
| 569 | 577 | } else { |
|---|
| 570 | 578 | $msort = $msgs; |
|---|
| 571 | 579 | } |
|---|
| 572 | | if ($sort < 6) { |
|---|
| | 580 | if ($sort != 6) { |
|---|
| 573 | 581 | if ($sort % 2) { |
|---|
| 574 | 582 | asort($msort); |
|---|
| … | … | |
| 873 | 881 | break; |
|---|
| 874 | 882 | case 6: /* size */ |
|---|
| 875 | | echo html_tag( 'td', '<b>' . _("Size") . '</b>', 'center', '', 'width="5%" nowrap' ); |
|---|
| | 883 | echo html_tag( 'td' ,'' , 'left', '', 'width="5%" nowrap' ) |
|---|
| | 884 | . '<b>' . _("Size") . '</b>'; |
|---|
| | 885 | if ($showsort) { |
|---|
| | 886 | ShowSortButton($sort, $mailbox, 8, 9); |
|---|
| | 887 | } |
|---|
| | 888 | echo "</td>\n"; |
|---|
| 876 | 889 | break; |
|---|
| 877 | 890 | } |
|---|
| r821 |
r946 |
|
| 9 | 9 | * @copyright © 1999-2007 The SquirrelMail Project Team |
|---|
| 10 | 10 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|---|
| 11 | | * @version $Id: mime.php 12396 2007-05-17 15:20:55Z kink $ |
|---|
| | 11 | * @version $Id: mime.php 12803 2007-12-05 20:21:46Z jangliss $ |
|---|
| 12 | 12 | * @package squirrelmail |
|---|
| 13 | 13 | */ |
|---|
| … | … | |
| 128 | 128 | } else if (ereg('"([^"]*)"', $topline, $regs)) { |
|---|
| 129 | 129 | $ret = $regs[1]; |
|---|
| | 130 | } else if ((stristr($topline, 'nil') !== false) && (empty($wholemessage))) { |
|---|
| | 131 | $ret = $wholemessage; |
|---|
| 130 | 132 | } else { |
|---|
| 131 | 133 | global $where, $what, $mailbox, $passed_id, $startMessage; |
|---|
| … | … | |
| 1705 | 1707 | if (isset($aUrl['scheme'])) { |
|---|
| 1706 | 1708 | switch(strtolower($aUrl['scheme'])) { |
|---|
| | 1709 | case 'mailto': |
|---|
| 1707 | 1710 | case 'http': |
|---|
| 1708 | 1711 | case 'https': |
|---|
| … | … | |
| 2181 | 2184 | * @param $body the body of the message |
|---|
| 2182 | 2185 | * @param $id the id of the message |
|---|
| | 2186 | * @param boolean $take_mailto_links When TRUE, converts mailto: links |
|---|
| | 2187 | * into internal SM compose links |
|---|
| | 2188 | * (optional; default = TRUE) |
|---|
| 2183 | 2189 | * @return a string with html safe to display in the browser. |
|---|
| 2184 | 2190 | */ |
|---|
| 2185 | | function magicHTML($body, $id, $message, $mailbox = 'INBOX') { |
|---|
| | 2191 | function magicHTML($body, $id, $message, $mailbox = 'INBOX', $take_mailto_links =true) { |
|---|
| | 2192 | |
|---|
| | 2193 | // require_once(SM_PATH . 'functions/url_parser.php'); // for $MailTo_PReg_Match |
|---|
| | 2194 | |
|---|
| 2186 | 2195 | global $attachment_common_show_images, $view_unsafe_images, |
|---|
| 2187 | 2196 | $has_unsafe_images; |
|---|
| … | … | |
| 2335 | 2344 | $has_unsafe_images = true; |
|---|
| 2336 | 2345 | } |
|---|
| | 2346 | |
|---|
| | 2347 | // we want to parse mailto's in HTML output, change to SM compose links |
|---|
| | 2348 | // this is a modified version of code from url_parser.php... but Marc is |
|---|
| | 2349 | // right: we need a better filtering implementation; adding this randomly |
|---|
| | 2350 | // here is not a great solution |
|---|
| | 2351 | // |
|---|
| | 2352 | if ($take_mailto_links) { |
|---|
| | 2353 | // parseUrl($trusted); // this even parses URLs inside of tags... too aggressive |
|---|
| | 2354 | global $MailTo_PReg_Match; |
|---|
| | 2355 | $MailTo_PReg_Match = '/mailto:' . substr($MailTo_PReg_Match, 1) ; |
|---|
| | 2356 | if ((preg_match_all($MailTo_PReg_Match, $trusted, $regs)) && ($regs[0][0] != '')) { |
|---|
| | 2357 | foreach ($regs[0] as $i => $mailto_before) { |
|---|
| | 2358 | $mailto_params = $regs[10][$i]; |
|---|
| | 2359 | // get rid of any tailing quote since we have to add send_to to the end |
|---|
| | 2360 | // |
|---|
| | 2361 | if (substr($mailto_before, strlen($mailto_before) - 1) == '"') |
|---|
| | 2362 | $mailto_before = substr($mailto_before, 0, strlen($mailto_before) - 1); |
|---|
| | 2363 | if (substr($mailto_params, strlen($mailto_params) - 1) == '"') |
|---|
| | 2364 | $mailto_params = substr($mailto_params, 0, strlen($mailto_params) - 1); |
|---|
| | 2365 | |
|---|
| | 2366 | if ($regs[1][$i]) { //if there is an email addr before '?', we need to merge it with the params |
|---|
| | 2367 | $to = 'to=' . $regs[1][$i]; |
|---|
| | 2368 | if (strpos($mailto_params, 'to=') > -1) //already a 'to=' |
|---|
| | 2369 | $mailto_params = str_replace('to=', $to . '%2C%20', $mailto_params); |
|---|
| | 2370 | else { |
|---|
| | 2371 | if ($mailto_params) //already some params, append to them |
|---|
| | 2372 | $mailto_params .= '&' . $to; |
|---|
| | 2373 | else |
|---|
| | 2374 | $mailto_params .= '?' . $to; |
|---|
| | 2375 | } |
|---|
| | 2376 | } |
|---|
| | 2377 | |
|---|
| | 2378 | $url_str = preg_replace(array('/to=/i', '/(?<!b)cc=/i', '/bcc=/i'), array('send_to=', 'send_to_cc=', 'send_to_bcc='), $mailto_params); |
|---|
| | 2379 | |
|---|
| | 2380 | // we'll already have target=_blank, no need to allow comp_in_new |
|---|
| | 2381 | // here (which would be a lot more work anyway) |
|---|
| | 2382 | // |
|---|
| | 2383 | global $compose_new_win; |
|---|
| | 2384 | $temp_comp_in_new = $compose_new_win; |
|---|
| | 2385 | $compose_new_win = 0; |
|---|
| | 2386 | $comp_uri = makeComposeLink('src/compose.php' . $url_str, $mailto_before); |
|---|
| | 2387 | $compose_new_win = $temp_comp_in_new; |
|---|
| | 2388 | |
|---|
| | 2389 | // remove <a href=" and anything after the next quote (we only |
|---|
| | 2390 | // need the uri, not the link HTML) in compose uri |
|---|
| | 2391 | // |
|---|
| | 2392 | $comp_uri = substr($comp_uri, 9); |
|---|
| | 2393 | $comp_uri = substr($comp_uri, 0, strpos($comp_uri, '"', 1)); |
|---|
| | 2394 | $trusted = str_replace($mailto_before, $comp_uri, $trusted); |
|---|
| | 2395 | } |
|---|
| | 2396 | } |
|---|
| | 2397 | } |
|---|
| | 2398 | |
|---|
| 2337 | 2399 | return $trusted; |
|---|
| 2338 | 2400 | } |
|---|
| r826 |
r946 |
|
| 19 | 19 | |
|---|
| 20 | 20 | /* Always set up the language before calling these functions */ |
|---|
| 21 | | function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE) { |
|---|
| | 21 | function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { |
|---|
| 22 | 22 | global $squirrelmail_language; |
|---|
| 23 | 23 | |
|---|
| … | … | |
| 25 | 25 | global $base_uri; |
|---|
| 26 | 26 | } |
|---|
| 27 | | global $theme_css, $custom_css, $pageheader_sent, $minimize_button; |
|---|
| | 27 | global $theme_css, $custom_css, $pageheader_sent; |
|---|
| 28 | 28 | |
|---|
| 29 | 29 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' . |
|---|
| … | … | |
| 33 | 33 | if ( !isset( $custom_css ) || $custom_css == 'none' ) { |
|---|
| 34 | 34 | if ($theme_css != '') { |
|---|
| 35 | | echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$theme_css\" />"; |
|---|
| | 35 | echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$theme_css\">"; |
|---|
| 36 | 36 | } |
|---|
| 37 | 37 | } else { |
|---|
| 38 | 38 | echo '<link rel="stylesheet" type="text/css" href="' . |
|---|
| 39 | | $base_uri . 'themes/css/'.$custom_css.'" />'; |
|---|
| | 39 | $base_uri . 'themes/css/'.$custom_css.'">'; |
|---|
| 40 | 40 | } |
|---|
| 41 | 41 | |
|---|
| … | … | |
| 43 | 43 | // Why is it added here? Header ('Content-Type:..) is used in i18n.php |
|---|
| 44 | 44 | echo "<!-- \xfd\xfe -->\n"; |
|---|
| 45 | | echo '<meta http-equiv="Content-type" content="text/html; charset=euc-jp" />' . "\n"; |
|---|
| | 45 | echo '<meta http-equiv="Content-type" content="text/html; charset=euc-jp">' . "\n"; |
|---|
| 46 | 46 | } |
|---|
| 47 | 47 | |
|---|
| … | … | |
| 64 | 64 | |
|---|
| 65 | 65 | ECHO; |
|---|
| 66 | | echo <<<END |
|---|
| 67 | | <script type="text/javascript"> |
|---|
| 68 | | function reveal(myvar){ |
|---|
| 69 | | t=document.getElementById(myvar); |
|---|
| 70 | | if(t.style.display=='none'){t.style.display='block';}else{t.style.display='none';} |
|---|
| 71 | | } |
|---|
| 72 | | </script> |
|---|
| 73 | | END; |
|---|
| | 66 | |
|---|
| 74 | 67 | echo "\n</head>\n\n"; |
|---|
| 75 | 68 | |
|---|
| … | … | |
| 92 | 85 | function displayPageHeader($color, $mailbox, $xtra='', $session=false) { |
|---|
| 93 | 86 | |
|---|
| 94 | | global $hide_sm_attributions, $PHP_SELF, $frame_top, |
|---|
|
|