-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1 Start: 10/03/2004 *\r
- * =============== Last change: 10/03/2004 *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * File : birthday_confirm.php *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Birthday bonus confirmation link *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung : Geburtstagsgutschrift bestaetigen *\r
- * -------------------------------------------------------------------- *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * Copyright (c) 2003 - 2008 by Roland Haeder *\r
- * For more information visit: http://www.mxchange.org *\r
- * *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or *\r
- * (at your option) any later version. *\r
- * *\r
- * This program is distributed in the hope that it will be useful, *\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\r
- * GNU General Public License for more details. *\r
- * *\r
- * You should have received a copy of the GNU General Public License *\r
- * along with this program; if not, write to the Free Software *\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *\r
- * MA 02110-1301 USA *\r
- ************************************************************************/\r
-\r
-// Load security stuff here (Oh, I hope this is not unsecure? Am I paranoia??? ;-) )\r
-require_once("inc/libs/security_functions.php");\r
-\r
-// Init "action" and "what"\r
-global $what, $action;\r
-$GLOBALS['what'] = ""; $GLOBALS['action'] = "";\r
-if (!empty($_GET['action'])) $GLOBALS['action'] = trim(strip_tags($_GET['action']));\r
-if (!empty($_GET['what'])) $GLOBALS['what'] = trim(strip_tags($_GET['what']));\r
-\r
-// Set module\r
-$GLOBALS['module'] = "birthday_confirm"; $CSS = -1;\r
-\r
-// Load the required file(s)\r
-require ("inc/config.php");\r
-\r
-if (defined('mxchange_installed') && (mxchange_installed))\r
-{\r
- // Script is installed so let's check for his confirmation link...\r
- $uid = strip_tags(bigintval($_GET['uid']));\r
-\r
- // Only allow numbers here...\r
- $chk = strip_tags(bigintval($_GET['check']));\r
-\r
- // .. only first 32 numbers\r
- $chk = substr($chk, 0, 32);\r
-\r
- // Check if link is not clicked so far\r
- $result = SQL_QUERY_ESC("SELECT DISTINCT b.points, d.sex, d.surname, d.family, d.status\r
-FROM "._MYSQL_PREFIX."_user_birthday AS b\r
-LEFT JOIN "._MYSQL_PREFIX."_user_data AS d\r
-ON b.userid=d.userid\r
-WHERE b.userid=%d AND b.chk_value='%s' LIMIT 1",\r
- array($uid, $chk), __FILE__, __LINE__);\r
-\r
- if (SQL_NUMROWS($result) == 1)\r
- {\r
- // Ok, congratulation again! Here's your gift from us...\r
- list($GIFT, $salut, $sname, $fname, $status) = SQL_FETCHROW($result);\r
- if ($status == "CONFIRMED")\r
- {\r
- // Set mode depending on how many mails the member has to confirm\r
- $locked = false;\r
- if (($ref_payout > 0) && ($CONFIG['direct_pay'] == "N")) $locked = true;\r
-\r
- // Add points to account\r
- ADD_POINTS_REFSYSTEM($uid, $GIFT, false, "0", $locked, strtolower($CONFIG['birthday_mode']));\r
-\r
- // Remove entry from table\r
- $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_birthday WHERE userid=%d LIMIT 1",\r
- array($uid), __FILE__, __LINE__);\r
-\r
- // Update mediadata if version is 0.0.4 or newer\r
- if (GET_EXT_VERSION("mediadata") >= "0.0.4")\r
- {\r
- // Update database\r
- MEDIA_UPDATE_ENTRY(array("total_points"), "add", $GIFT);\r
- }\r
-\r
- // Transfer data to constants for the template\r
- define('__SALUT', TRANSLATE_SEX($salut));\r
- define('__SNAME', $sname);\r
- define('__FNAME', $fname);\r
- define('__GIFT' , $GIFT);\r
-\r
- // Load message from template\r
- define('__MSG', LOAD_TEMPLATE("birthday_msg", true));\r
- }\r
- else\r
- {\r
- // Unconfirmed / locked accounts cannot get points\r
- define('__MSG', BIRTHDAY_CANNOT_STATUS_1.TRANSLATE_STATUS($status).BIRTHDAY_CANNOT_STATUS_2);\r
- }\r
- }\r
- else\r
- {\r
- // Cannot load data!\r
- define('__MSG', BIRTHDAY_CANNOT_LOAD_DATA);\r
- }\r
-\r
- // Free memory\r
- SQL_FREERESULT($result);\r
-\r
- // Set this because we have no module in URI\r
- $GLOBALS['module'] = "birthday_confirm";\r
-\r
- // Include header\r
- include(PATH."inc/header.php");\r
-\r
- // Load birthday header template (for your banners, e.g.?)\r
- define('__BIRTHDAY_HEADER', LOAD_TEMPLATE("birthday_header", true));\r
-\r
- // Load birthday footer template (for your banners, e.g.?)\r
- define('__BIRTHDAY_FOOTER', LOAD_TEMPLATE("birthday_footer", true));\r
-\r
- // Load final template and output it\r
- LOAD_TEMPLATE("birthday_confirm");\r
-\r
- // Include footer\r
- include(PATH."inc/footer.php");\r
-}\r
- else\r
-{\r
- // You have to configure first!\r
- LOAD_URL(URL."/install.php");\r
-}\r
-// Really all done here... ;-)\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 10/03/2004 *
+ * =============== Last change: 10/03/2004 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : birthday_confirm.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Birthday bonus confirmation link *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Geburtstagsgutschrift bestaetigen *
+ * -------------------------------------------------------------------- *
+ * *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program 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; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * 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 *
+ ************************************************************************/
+
+// Load security stuff here (Oh, I hope this is not unsecure? Am I paranoia??? ;-) )
+require_once("inc/libs/security_functions.php");
+
+// Init "action" and "what"
+global $what, $action;
+$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
+if (!empty($_GET['action'])) $GLOBALS['action'] = secureString($_GET['action']);
+if (!empty($_GET['what'])) $GLOBALS['what'] = secureString($_GET['what']);
+
+// Set module
+$GLOBALS['module'] = "birthday_confirm"; $CSS = -1;
+
+// Load the required file(s)
+require ("inc/config.php");
+
+if (defined('mxchange_installed') && (mxchange_installed))
+{
+ // Script is installed so let's check for his confirmation link...
+ $uid = strip_tags(bigintval($_GET['uid']));
+
+ // Only allow numbers here...
+ $chk = strip_tags(bigintval($_GET['check']));
+
+ // .. only first 32 numbers
+ $chk = substr($chk, 0, 32);
+
+ // Check if link is not clicked so far
+ $result = SQL_QUERY_ESC("SELECT DISTINCT b.points, d.sex, d.surname, d.family, d.status
+FROM "._MYSQL_PREFIX."_user_birthday AS b
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON b.userid=d.userid
+WHERE b.userid=%d AND b.chk_value='%s' LIMIT 1",
+ array($uid, $chk), __FILE__, __LINE__);
+
+ if (SQL_NUMROWS($result) == 1)
+ {
+ // Ok, congratulation again! Here's your gift from us...
+ list($GIFT, $salut, $sname, $fname, $status) = SQL_FETCHROW($result);
+ if ($status == "CONFIRMED")
+ {
+ // Set mode depending on how many mails the member has to confirm
+ $locked = false;
+ if (($ref_payout > 0) && ($CONFIG['allow_direct_pay'] == "N")) $locked = true;
+
+ // Add points to account
+ ADD_POINTS_REFSYSTEM($uid, $GIFT, false, "0", $locked, strtolower($CONFIG['birthday_mode']));
+
+ // Remove entry from table
+ $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_birthday WHERE userid=%d LIMIT 1",
+ array($uid), __FILE__, __LINE__);
+
+ // Update mediadata if version is 0.0.4 or newer
+ if (GET_EXT_VERSION("mediadata") >= "0.0.4")
+ {
+ // Update database
+ MEDIA_UPDATE_ENTRY(array("total_points"), "add", $GIFT);
+ }
+
+ // Transfer data to constants for the template
+ define('__SALUT', TRANSLATE_SEX($salut));
+ define('__SNAME', $sname);
+ define('__FNAME', $fname);
+ define('__GIFT' , $GIFT);
+
+ // Load message from template
+ define('__MSG', LOAD_TEMPLATE("birthday_msg", true));
+ }
+ else
+ {
+ // Unconfirmed / locked accounts cannot get points
+ define('__MSG', BIRTHDAY_CANNOT_STATUS_1.TRANSLATE_STATUS($status).BIRTHDAY_CANNOT_STATUS_2);
+ }
+ }
+ else
+ {
+ // Cannot load data!
+ define('__MSG', BIRTHDAY_CANNOT_LOAD_DATA);
+ }
+
+ // Free memory
+ SQL_FREERESULT($result);
+
+ // Set this because we have no module in URI
+ $GLOBALS['module'] = "birthday_confirm";
+
+ // Include header
+ include(PATH."inc/header.php");
+
+ // Load birthday header template (for your banners, e.g.?)
+ define('__BIRTHDAY_HEADER', LOAD_TEMPLATE("birthday_header", true));
+
+ // Load birthday footer template (for your banners, e.g.?)
+ define('__BIRTHDAY_FOOTER', LOAD_TEMPLATE("birthday_footer", true));
+
+ // Load final template and output it
+ LOAD_TEMPLATE("birthday_confirm");
+
+ // Include footer
+ include(PATH."inc/footer.php");
+}
+ else
+{
+ // You have to configure first!
+ LOAD_URL(URL."/install.php");
+}
+// Really all done here... ;-)
+?>