projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add options block demo
[squirrelmail.git]
/
src
/
mailto.php
diff --git
a/src/mailto.php
b/src/mailto.php
index b69855d5d51bc586eec7edc445ef36e7170e1bb4..94a8e7261006309d7718154388ee28e817bed574 100644
(file)
--- a/
src/mailto.php
+++ b/
src/mailto.php
@@
-3,9
+3,6
@@
/**
* mailto.php -- mailto: url handler
*
/**
* mailto.php -- mailto: url handler
*
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
* This checks to see if we're logged in. If we are we open up a new
* compose window for this email, otherwise we go to login.php
* (the above functionality has been disabled, by default you are required to
* This checks to see if we're logged in. If we are we open up a new
* compose window for this email, otherwise we go to login.php
* (the above functionality has been disabled, by default you are required to
@@
-14,16
+11,22
@@
* Use the following url to use mailto:
* http://<your server>/<squirrelmail base dir>/src/mailto.php?emailaddress=%1
* see ../contrib/squirrelmail.mailto.reg for a Windows Registry file
* Use the following url to use mailto:
* http://<your server>/<squirrelmail base dir>/src/mailto.php?emailaddress=%1
* see ../contrib/squirrelmail.mailto.reg for a Windows Registry file
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
* @package squirrelmail
*/
* @package squirrelmail
*/
-/** Path for SquirrelMail required files. */
-define('SM_PATH','../');
+/** This is the mailto page */
+define('PAGE_NAME', 'mailto');
+
+// reduce the included files in int.php
+$bLogin = true;
-/*
SquirrelMail required files. */
-require_once(SM_PATH . 'config/config.php');
-require_once(SM_PATH . 'functions/global.php');
-require
_once(SM_PATH . 'functions/strings
.php');
+/*
*
+ * Include the SquirrelMail initialization file.
+ */
+require
('../include/init
.php');
/* Force users to login each time? */
$force_login = true;
/* Force users to login each time? */
$force_login = true;
@@
-38,6
+41,8
@@
$trtable = array('cc' => 'send_to_cc',
'subject' => 'subject');
$url = '';
'subject' => 'subject');
$url = '';
+$data = array();
+
if(sqgetGlobalVar('emailaddress', $emailaddress)) {
$emailaddress = trim($emailaddress);
if(stristr($emailaddress, 'mailto:')) {
if(sqgetGlobalVar('emailaddress', $emailaddress)) {
$emailaddress = trim($emailaddress);
if(stristr($emailaddress, 'mailto:')) {
@@
-47,33
+52,32
@@
if(sqgetGlobalVar('emailaddress', $emailaddress)) {
list($emailaddress, $a) = explode('?', $emailaddress, 2);
if(strlen(trim($a)) > 0) {
$a = explode('=', $a, 2);
list($emailaddress, $a) = explode('?', $emailaddress, 2);
if(strlen(trim($a)) > 0) {
$a = explode('=', $a, 2);
- $
url .= $trtable[strtolower($a[0])] . '=' . urlencode($a[1]) . '&'
;
+ $
data[strtolower($a[0])] = $a[1]
;
}
}
}
}
- $
url = 'send_to=' . urlencode($emailaddress) . '&' . $url
;
+ $
data['to'] = $emailaddress
;
/* CC, BCC, etc could be any case, so we'll fix them here */
foreach($_GET as $k=>$g) {
$k = strtolower($k);
if(isset($trtable[$k])) {
$k = $trtable[$k];
/* CC, BCC, etc could be any case, so we'll fix them here */
foreach($_GET as $k=>$g) {
$k = strtolower($k);
if(isset($trtable[$k])) {
$k = $trtable[$k];
- $
url .= $k . '=' . urlencode($g) . '&'
;
+ $
data[$k] = $g
;
}
}
}
}
- $url = substr($url, 0, -1);
}
sqsession_is_active();
if($force_login == false && sqsession_is_registered('user_is_logged_in')) {
if($compose_only == true) {
}
sqsession_is_active();
if($force_login == false && sqsession_is_registered('user_is_logged_in')) {
if($compose_only == true) {
- $redirect = 'compose.php?
' . $url
;
+ $redirect = 'compose.php?
mailtodata=' . urlencode(serialize($data))
;
} else {
} else {
- $redirect = 'webmail.php?
right_frame=compose.php?' . urlencode($url
);
+ $redirect = 'webmail.php?
mailtodata=' . urlencode(serialize($data)
);
}
} else {
}
} else {
- $redirect = 'login.php?mailto
=' . urlencode($url
);
+ $redirect = 'login.php?mailto
data=' . urlencode(serialize($data)
);
}
session_write_close();
header('Location: ' . get_location() . '/' . $redirect);
}
session_write_close();
header('Location: ' . get_location() . '/' . $redirect);
-?>
+