1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
<?vsp
--
-- $Id$
--
-- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
-- project.
--
-- Copyright (C) 1998-2012 OpenLink Software
--
-- This project 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; only version 2 of the License, dated June 1991.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- General Public License for more details.
--
-- You should have received a copy of the GNU General Public License along
-- with this program; if not, write to the Free Software Foundation, Inc.,
-- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--
--
--no_c_escapes-
declare msgid, _u_id integer;
declare own varchar;
declare msg, parsed_message varchar;
declare inx integer;
declare ses varchar;
declare _page varchar;
declare file_name varchar;
declare changed_name varchar;
declare do_update integer;
_u_id := WS.WS.check_auth (lines);
if (_u_id < 1)
{
http_request_status ('HTTP/1.1 401 Unauthorized');
http ( concat ('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">',
'<HTML><HEAD>',
'<TITLE>401 Unauthorized</TITLE>',
'</HEAD><BODY><H1>Unauthorized</H1>',
'Access to page is forbidden.</BODY></HTML>'));
return (0);
}
else
select U_NAME into own from WS.WS.SYS_DAV_USER where U_ID = _u_id;
_page := get_keyword ('page', params, '');
do_update := 0;
if (_page <> '')
do_update := 1;
file_name := '';
ses := null;
msgid := get_keyword ('msg', params);
if (msgid = '')
msgid := null;
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="<?=adm_what_css()?>" />
<meta name="AUTHOR" content="OpenLink Software">
<meta name="DESCRIPTION" content="Parsing MIME with Virtuoso VSP">
</head>
<FORM method="POST" action="admin_blog_mail_show.vsp">
<?vsp
declare _title varchar;
_title := concat ('Message ', {?'subj'}, '');
adm_page_header(_title, NULL);
select blob_to_string (MM_BODY) into msg from MAIL_MESSAGE where MM_ID = atoi (msgid) and MM_OWN = own;
if (msg is not null)
{
declare idx, len integer;
declare parts, line any;
parsed_message := mime_tree (msg);
parts := parsed_message[2];
len := length (parts);
idx := 0;
while (idx < len)
{
changed_name := get_keyword_ucase ('pictext', params, '');
file_name := changed_name;
MOBBLOGGING_DISPLAY_MIME (msgid, ses, params, parsed_message, msg, '',
'/admin/admin_dav/admin_blog_mail_pic.vsp', idx, do_update, file_name, changed_name);
if (file_name <> '' and _page = '')
{
?>
</TD></TR>
<TR CLASS="CtrlMain" ><TD COLSPAN="2" ALIGN="center">
<B>Blog Title</B>
</TD></TR>
<TR CLASS="CtrlMain"><TD COLSPAN="2" ALIGN="center">
<INPUT type="text" name="subj" value="<?={?'subj'}?>">
</TD></TR>
<?vsp
}
idx := idx + 1;
}
}
else
http ('<strong>EMPTY MESSAGE</strong>');
if (_page = '') { ?>
<TR CLASS="CtrlMain"><TD ALIGN="center" COLSPAN="2">
<TEXTAREA name="pictext" rows="5" cols="70"><?=MOBBLOGGING_MSG_GET_PART(msg, 0)?></TEXTAREA>
</TD></TR>
<TR CLASS="CtrlMain"><TD COLSPAN="2">
</TD></TR>
<TR CLASS="CtrlMain"><TD ALIGN="center" COLSPAN="2">
<INPUT type="submit" name="blog" value="Blog">
<INPUT type="hidden" name="msg" value="<?=msgid?>">
<INPUT type="hidden" name="page" value="1">
</TD></TR>
</FORM>
<?vsp } else { ?>
</FORM>
<FORM method="POST" action="admin_blog_mail.vsp">
<INPUT type="submit" name="back" value="Back">
</FORM>
<?vsp } ?>
<?vsp adm_page_footer(); ?>
</html>
|