A lot CSS classes rewritten, please update all your themes.
[mailer.git] / inc / modules / frametester.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 10/24/2003 *
4  * ===================                          Last change: 06/30/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : frametester.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Test your website against frame killers          *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Testet die Mitgliedsseite gegen Frame-Killer     *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * Needs to be in all Files and every File needs "svn propset           *
18  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
19  * -------------------------------------------------------------------- *
20  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
21  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
22  * For more information visit: http://www.mxchange.org                  *
23  *                                                                      *
24  * This program is free software; you can redistribute it and/or modify *
25  * it under the terms of the GNU General Public License as published by *
26  * the Free Software Foundation; either version 2 of the License, or    *
27  * (at your option) any later version.                                  *
28  *                                                                      *
29  * This program is distributed in the hope that it will be useful,      *
30  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
31  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
32  * GNU General Public License for more details.                         *
33  *                                                                      *
34  * You should have received a copy of the GNU General Public License    *
35  * along with this program; if not, write to the Free Software          *
36  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
37  * MA  02110-1301  USA                                                  *
38  ************************************************************************/
39
40 // Some security stuff...
41 if (!defined('__SECURITY')) {
42         die();
43 } // END - if
44
45 $mode = 'guest';
46
47 if (isGetRequestParameterSet('order')) {
48         // Order number placed, is he also logged in?
49         if (isMember()) {
50                 // Ok, test passed... :)
51                 $result = SQL_QUERY_ESC("SELECT `subject`, `url` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s AND `data_type`='TEMP' LIMIT 1",
52                         array(bigintval(getRequestParameter('order')), getMemberId()), __FILE__, __LINE__);
53
54                 // Finally is the entry valid?
55                 if (SQL_NUMROWS($result) == 1) {
56                         // Load subject and URL (but forwhat do we need the subject line here???
57                         list($sub, $url) = SQL_FETCHROW($result);
58
59                         // This fixes a white page
60                         setPostRequestParameter('url', $url);
61
62                         // Mode is member
63                         $mode = 'member';
64                 } else {
65                         // Matching line not found!
66                         redirectToUrl('modules.php?module=index&amp;what=login');
67                 }
68
69                 // Free memory
70                 SQL_FREERESULT($result);
71         } else {
72                 // He is no longer logged in
73                 redirectToUrl('modules.php?module=index&amp;what=login');
74         }
75 } // END - if
76
77 if ((isPostRequestParameterSet('url')) || (isGetRequestParameterSet('url')) || (isGetRequestParameterSet('frame'))) {
78         // Default URL is ours
79         $url = getUrl();
80
81         // Use URL from POST or GET data if set
82         if (isPostRequestParameterSet('url')) {
83                 // POST data comes first
84                 $url = postRequestParameter('url');
85         } elseif (isGetRequestParameterSet('url')) {
86                 // Then GET data
87                 $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(getRequestParameter('url')))));
88         }
89
90         // Add missing element
91         $frame = '';
92         if (isGetRequestParameterSet('frame')) $frame = getRequestParameter('frame');
93         switch ($frame) {
94                 case '':
95                         switch ($mode) {
96                                 case 'member':
97                                         // Build frameset
98                                         $content['order'] = bigintval(getRequestParameter('order'));
99                                         $content['url']   = generateDerefererUrl($url);
100                                         loadTemplate('member_order_frametester', false, $content);
101                                         break;
102
103                                 case 'guest':
104                                         $content['url']   = generateDerefererUrl($url);
105                                         loadTemplate('guest_frametester', false, $content);
106                                         break;
107                         } // END - switch
108                         break;
109
110                 case 'test_top':
111                         loadTemplate('admin_settings_saved', false, '{--GUEST_FRAMETESTER_TOP--}');
112                         break;
113
114                 case 'back': // Back buttom
115                         loadTemplate('member_order_back', false, getRequestParameter('order'));
116                         break;
117
118                 case 'send': // Send mail away
119                         loadTemplate('member_order_send', false, getRequestParameter('order'));
120                         break;
121         } // END - switch
122 } else {
123         // Go away...
124         redirectToUrl('modules.php?module=login');
125 }
126
127 // [EOF]
128 ?>