Missing theme extension fixed in theme_edit/theme_import
[mailer.git] / inc / modules / frametester.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    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  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
18  * This program is free software; you can redistribute it and/or modify *
19  * it under the terms of the GNU General Public License as published by *
20  * the Free Software Foundation; either version 2 of the License, or    *
21  * (at your option) any later version.                                  *
22  *                                                                      *
23  * This program is distributed in the hope that it will be useful,      *
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
26  * GNU General Public License for more details.                         *
27  *                                                                      *
28  * You should have received a copy of the GNU General Public License    *
29  * along with this program; if not, write to the Free Software          *
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
37         require($INC);
38 }
39
40 $MODE = "guest";
41
42 if (!empty($_GET['order'])) {
43         // Order number placed, is he also logged in?
44         if(IS_MEMBER()) {
45                 // Ok, test passed... :)
46                 $result = SQL_QUERY_ESC("SELECT subject, url FROM "._MYSQL_PREFIX."_pool WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
47                  array(bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
48
49                 // Finally is the entry valid?
50                 if (SQL_NUMROWS($result) == 1) {
51                         // Load subject and URL (but forwhat do we need the subject line here???
52                         list($sub, $url) = SQL_FETCHROW($result);
53
54                         // This fixes a white page
55                         $_POST['url'] = $url;
56
57                         // Mode is member
58                         $MODE = "member";
59                 } else {
60                         // Matching line not found!
61                         LOAD_URL("modules.php?module=index&amp;what=login");
62                 }
63
64                 // Free memory
65                 SQL_FREERESULT($result);
66         } else {
67                 // He is no longer logged in
68                 LOAD_URL("modules.php?module=index&amp;what=login");
69         }
70 }
71
72 if ((!empty($_POST['url'])) || (!empty($_GET['url'])) || (!empty($_GET['frame']))) {
73         // Default URL is ours
74         $url = URL;
75
76         // Decode URL if set in GET parameters
77         if (!empty($_GET['url']))  $url = gzuncompress(base64_decode(str_replace(" ", "+", COMPILE_CODE(urldecode($_GET['url'])))));
78
79         // Use URL from POST data if set
80         if (!empty($_POST['url'])) $url = $_POST['url'];
81
82         // Add missing element
83         $frame = "";
84         if (!empty($_GET['frame'])) $frame = SQL_ESCAPE($_GET['frame']);
85         switch ($frame)
86         {
87         case "":
88                 switch ($MODE)
89                 {
90                 case "member":
91                         // Build frameset
92                         define('__ORDER_VALUE', bigintval($_GET['order']));
93                         define('__URL_VALUE'  , DEREFERER($url));
94                         LOAD_TEMPLATE("member_order_frametester");
95                         break;
96
97                 case "guest":
98                         define('__URL_VALUE'  , DEREFERER($url));
99                         LOAD_TEMPLATE("guest_frametester");
100                         break;
101                 }
102                 break;
103
104         case "test_top":
105                 OUTPUT_HTML("<STRONG class=\"guest_done\">".GUEST_FRAMETESTER_TOP."</SPAN>");
106                 break;
107
108         case "back": // Back buttom
109                 LOAD_TEMPLATE("member_order_back", false, $_GET['order']);
110                 break;
111
112         case "send": // Send mail away
113                 LOAD_TEMPLATE("member_order_send", false, $_GET['order']);
114                 break;
115         }
116 } else {
117         // Go away...
118         LOAD_URL("modules.php?module=login");
119 }
120 //
121 ?>