Viewing file: autosave.php (3.79 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
############################################################################
# DWmail
# - version 4.0
# - Copyright (c) 2003-2006 Dominion Web Design
# - http://www.dominion-web.com/products/dwmail/
############################################################################
#
# The contents of this file are subject to the DWmail License version
# 2.2 ('License'). You may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.dominion-web.com/products/dwmail/license.php
# Software distributed under the License is distributed on an "AS IS" basis,
# without warranty of any kind, either express or implied.
#
# This code is Copyright (c) 2003-2006 Dominion Web Design.
# All rights reserved.
#
# This software may not be redistributed outside the terms of the
# license agreement.
#
############################################################################
*/
require ("./includes/init.inc.php");
require ("./includes/global.inc.php");
require ("./includes/html.inc.php");
require ("./includes/imap.inc.php");
require ("./includes/functions.inc.php");
require ("./includes/config.inc.php");
require_once("./includes/mime.inc.php");
$MainSettings = new GlobalInit();
$TransIDEnabled = $MainSettings->INIGet('session.use_trans_sid');
session_cache_limiter($DefaultSessionCache);
session_start();
if (!$_SESSION['DefaultLang']) {
$_SESSION['DefaultLang'] = $DefaultLang;
}
require ("./lang/" . strip_tags(str_replace("..", "", trim($_SESSION['DefaultLang']))) . "/global.inc.php");
@setlocale(LC_TIME, $AvailLangs[$_SESSION['DefaultLang']]['locale']);
require ("./includes/options.inc.php");
$_SESSION['tpl'] = strip_tags(trim($_SESSION['tpl']));
$getFile = new fileProperties($_SESSION['tpl']);
$MIMEChecker = new MIME();
if (($_SESSION['sess_u'] == "") && ($_SESSION['sess_p'] == "")) {
echo ("<p>" . $lang['SErrors']['Session'] . "</p>");
exit;
}
$IMAPConnection = new WM_IMAPConnection($_SESSION);
$securitycheck = $IMAPConnection->WM_IMAPCheckSecurity();
if ($securitycheck == 0) {
echo ("<p>" . $lang['SErrors']['IP'] . "</p>");
exit;
}
$crlf = $MainSettings->GetCRLF();
$IMAPConnection->_crlf = $crlf;
$IMAPConnection->_charset = $_SESSION['DefaultCharSet'];
$mailbox = $IMAPConnection->WM_IMAPConnect();
checkmailbox_active($mailbox, $IMAPConnection, $PageHeader, $_SESSION['tpl'], $PageFooter, $getFile, $lang, $genericerror);
$_POST['savedraft'] = 1;
$_POST['ajaxdraft'] = 1;
if ($_POST['subjURN']) {
$_SESSION['folder'] = $IMAPDrafts;
$IMAPConnection->_sessionvars = $_SESSION;
// Search for and delete based on the URN
$searchmessages = $IMAPConnection->WM_IMAPSearch(' SUBJECT "' . strip_tags($_POST['subjURN']) . '"', 'SORTDATE', 1);
if (is_array($searchmessages) and sizeof($searchmessages) >= 1) {
while(list($key2, $value2) = each($searchmessages)) {
$IMAPConnection->WM_IMAPDelete($searchmessages[$key2]['message_uid']);
}
$IMAPConnection->WM_IMAPExpungeMailbox();
}
unset ($searchmessages);
require ('./includes/compose.inc.php');
$IMAPConnection->WM_IMAPClose();
$mailbox = $IMAPConnection->WM_IMAPConnect();
$_SESSION['folder'] = $IMAPDrafts;
$IMAPConnection->_sessionvars = $_SESSION;
$searchmessages2 = $IMAPConnection->WM_IMAPSearch(' SUBJECT "' . strip_tags($_POST['subjURN']) . '"', 'SORTDATE', 1);
if (is_array($searchmessages2) and sizeof($searchmessages2) >= 1) {
while(list($key3, $value3) = each($searchmessages2)) {
$msgid = $searchmessages2[$key3]['message_uid'];
}
}
}
header ("Content-type: text/xml; charset=UTF-8");
echo ("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
echo ("<DWmail>");
echo (" <msgid>" . $msgid . "</msgid>");
echo ("</DWmail>");
$IMAPConnection->WM_IMAPClose();
?>
|