X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_links.php;h=18848922d90c9bc32a64f4bc639ae786b32ca2a9;hp=2fd651fd1fd67007b80b73d27ea0f3e18fb16432;hb=27f65d023a3388a8bd85be8ee5991f776f541847;hpb=357b2ca133fc1f89db74097955c366cb4bee6996 diff --git a/inc/modules/admin/what-list_links.php b/inc/modules/admin/what-list_links.php index 2fd651fd1f..18848922d9 100644 --- a/inc/modules/admin/what-list_links.php +++ b/inc/modules/admin/what-list_links.php @@ -47,7 +47,7 @@ if (empty($_GET['del'])) $_GET['del'] = ""; if (!empty($_GET['u_id'])) { // Check if the user already exists - $result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); // Is there an entry? @@ -74,8 +74,8 @@ if (!empty($_GET['u_id'])) { // Some unconfirmed mails left if ($_GET['del'] == "all") { // Delete all unconfirmed mails by this user - $result_del = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s LIMIT %s", - array(bigintval($_GET['u_id']), $nums), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s LIMIT %s", + array(bigintval($_GET['u_id']), $nums), __FILE__, __LINE__); // Prepare mail and send it away $msg = LOAD_EMAIL_TEMPLATE("admin-del_links", $nums, bigintval($_GET['u_id'])); @@ -87,23 +87,33 @@ if (!empty($_GET['u_id'])) { // List all unconfirmed mails $SW = 2; $OUT = ""; while (list($id, $id2, $type) = SQL_FETCHROW($result)) { - // Load data from stats table... + // Initializes some variables $cat = ""; + $DATA = ""; + $PROBLEM = GENERAL_MAIL_PROBLEM; + $result_data = false; // Closes Bug #58 + + // Load data from stats table... switch ($type) { case "NORMAL": $result_data = SQL_QUERY_ESC("SELECT subject, timestamp_ordered, cat_id FROM "._MYSQL_PREFIX."_user_stats WHERE id=%s LIMIT 1", - array(bigintval($id)), __FILE__, __LINE__); + array(bigintval($id)), __FILE__, __LINE__); $type = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM; $LINK = "".$id.""; break; case "BONUS": $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1", - array(bigintval($id2)), __FILE__, __LINE__); + array(bigintval($id2)), __FILE__, __LINE__); $type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM; $LINK = "".$id2.""; break; + + default: // Problem in application detected! + // Log the error + DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid email type %s detected.", $type)); + break; } if (SQL_NUMROWS($result_data) == 1) { @@ -145,7 +155,7 @@ if (!empty($_GET['u_id'])) { define('__EMAIL_VALUE', "".$email.""); define('__EMAIL_LIST' , $OUT); define('__NUMS_VALUE' , $nums); - define('__UID_VALUE' , $_GET['u_id']); + define('__UID' , bigintval($_GET['u_id'])); // Load final template LOAD_TEMPLATE("admin_list_links");