Renamed all SQL-related functions to camel-case notation
[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  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
20  * For more information visit: http://mxchange.org                      *
21  *                                                                      *
22  * This program is free software; you can redistribute it and/or modify *
23  * it under the terms of the GNU General Public License as published by *
24  * the Free Software Foundation; either version 2 of the License, or    *
25  * (at your option) any later version.                                  *
26  *                                                                      *
27  * This program is distributed in the hope that it will be useful,      *
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
30  * GNU General Public License for more details.                         *
31  *                                                                      *
32  * You should have received a copy of the GNU General Public License    *
33  * along with this program; if not, write to the Free Software          *
34  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         exit();
41 } // END - if
42
43 $mode = 'guest';
44
45 if (isGetRequestElementSet('order')) {
46         // Order number placed, is he also logged in?
47         if (isMember()) {
48                 // Ok, test passed... :)
49                 $content = getPoolDataFromId(getRequestElement('order'));
50
51                 // Finally is the entry valid?
52                 if ((count($content) > 0) && ($content['data_type'] == 'TEMP')) {
53                         // Load subject and URL (but forwhat do we need the subject line here???
54                         list($url) = sqlFetchRow($result);
55
56                         // This fixes a white page
57                         setPostRequestElement('url', $url);
58
59                         // Mode is member
60                         $mode = 'member';
61                 } else {
62                         // Matching line not found
63                         redirectToUrl('modules.php?module=index&amp;what=login');
64                 }
65         } else {
66                 // He is no longer logged in
67                 redirectToUrl('modules.php?module=index&amp;what=login');
68         }
69 } // END - if
70
71 if ((isPostRequestElementSet('url')) || (isGetRequestElementSet('url')) || (!isFullPage())) {
72         // Default URL is ours
73         $url = getUrl();
74
75         // Use URL from POST or GET data if set
76         if (isPostRequestElementSet('url')) {
77                 // POST data comes first
78                 $url = postRequestElement('url');
79         } elseif (isGetRequestElementSet('url')) {
80                 // Then GET data
81                 $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(getRequestElement('url')))));
82         }
83
84         // Add missing element
85         $frame = '';
86         if (!isFullPage()) {
87                 $frame = getRequestElement('frame');
88         } // END - if
89
90         // Switch on 'frame'
91         // @TODO Rewrite this somehow
92         switch ($frame) {
93                 case '':
94                         switch ($mode) {
95                                 case 'member':
96                                         // Build frameset
97                                         $content['order'] = bigintval(getRequestElement('order'));
98                                         $content['url']   = generateDereferrerUrl($url);
99                                         loadTemplate('member_order_frametester', FALSE, $content);
100                                         break;
101
102                                 case 'guest':
103                                         $content['url']   = generateDereferrerUrl($url);
104                                         loadTemplate('guest_frametester', FALSE, $content);
105                                         break;
106                         } // END - switch
107                         break;
108
109                 case 'test_top':
110                         displayMessage('{--GUEST_FRAMETESTER_TOP--}');
111                         break;
112
113                 case 'back': // Back buttom
114                         loadTemplate('member_order_back', FALSE, getRequestElement('order'));
115                         break;
116
117                 case 'send': // Send mail away
118                         loadTemplate('member_order_send', FALSE, getRequestElement('order'));
119                         break;
120         } // END - switch
121 } else {
122         // Go away...
123         redirectToUrl('modules.php?module=login');
124 }
125
126 // [EOF]
127 ?>