2 /************************************************************************
3 * MXChange v0.2.1 Start: 05/14/2007 *
4 * =============== Last change: 05/14/2007 *
6 * -------------------------------------------------------------------- *
7 * File : lead-confirm.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Script for lead-campaign codes *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Alles um den Bestaetigungslink *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
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 - 2008 by Roland Haeder *
21 * For more information visit: http://www.mxchange.org *
23 * This program is free software; you can redistribute it and/or modify *
24 * it under the terms of the GNU General Public License as published by *
25 * the Free Software Foundation; either version 2 of the License, or *
26 * (at your option) any later version. *
28 * This program is distributed in the hope that it will be useful, *
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
31 * GNU General Public License for more details. *
33 * You should have received a copy of the GNU General Public License *
34 * along with this program; if not, write to the Free Software *
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
37 ************************************************************************/
39 // Load security stuff here (Oh, I hope this is not unsecure? Am I paranoia??? ;-) )
40 require("inc/libs/security_functions.php");
42 // Init "action" and "what"
43 $GLOBALS['startTime'] = microtime(true);
44 $GLOBALS['what'] = "";
45 $GLOBALS['action'] = "";
48 $GLOBALS['module'] = "lead-confirm";
51 $GLOBALS['output_mode'] = "0";
54 require("inc/config.php");
56 // Is the script installed?
59 LOAD_INC("inc/header.php");
61 // Initialize the array for the template
64 'lead_email' => "INVALID@EMAIL"
68 if (isSessionVariableSet('lead_uid')) {
69 // Is the user-account unlocked and valid?
70 $result = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1",
71 array(bigintval(get_session('lead_uid'))), __FILE__, __LINE__);
72 if (SQL_NUMROWS($result) == 1) {
73 // Secure the ID number
74 $content['lead_uid'] = bigintval(get_session('lead_uid'));
76 // Load the email address
77 list($email) = SQL_FETCHROW($result);
80 $content['lead_email'] = COMPILE_CODE($email);
83 $content['lead_uid'] = 0;
87 $content['lead_email'] = constant('WEBMASTER');
90 // Load the lead template
91 LOAD_TEMPLATE("lead_code", false, $content);
94 LOAD_INC("inc/footer.php");
96 // You have to install first!
97 LOAD_URL("install.php");