X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fsponsor_functions.php;h=814a19b26036677d99e2e4e31ffd380fceb035dd;hb=180f978ebe21d5fcec3a51be8405028e7523e6a9;hp=c225215424b2f79ef863463b1064ab67a70d5311;hpb=99be3ce68f08d6e36202789168188a9078b04aea;p=mailer.git diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index c225215424..814a19b260 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -79,7 +79,7 @@ function handleSponsorRequest ($postData, $update=false, $messageArray=array(), if (SQL_NUMROWS($result) == 1) { // Yes, he is! if ((getWhat() == 'add_sponsor') || ($update)) { - // Already found! + // Already found $ALREADY = true; } else { // Update his data @@ -106,7 +106,7 @@ function handleSponsorRequest ($postData, $update=false, $messageArray=array(), default: // Test if there is are time selections - convertSelectionsToTimestamp($postData, $DATA, $k, $skip); + convertSelectionsToEpocheTime($postData, $DATA, $k, $skip); break; } // END - switch @@ -157,7 +157,7 @@ function handleSponsorRequest ($postData, $update=false, $messageArray=array(), // Generate hash code $DATA['keys'][] = 'hash'; // @TODO Rewrite this to API function - $DATA['values'][] = md5(session_id().':'.$postData['email'].':'.detectRemoteAddr().':'.detectUserAgent().':'.time()); + $DATA['values'][] = md5(session_id() . getEncryptSeperator() . $postData['email'] . getEncryptSeperator() . detectRemoteAddr() . getEncryptSeperator() . detectUserAgent() . getEncryptSeperator() . time()); $DATA['keys'][] = 'remote_addr'; $DATA['values'][] = detectRemoteAddr(); } @@ -207,9 +207,9 @@ function handleSponsorRequest ($postData, $update=false, $messageArray=array(), $result = SQL_QUERY_ESC($sql, $DATA['values'], __FUNCTION__, __LINE__); } // END - if } else { - // Error found! + // Error detected $message = getMessageFromIndexedArray('{--SPONSOR_DATA_NOT_SAVED--}', 'failed', $messageArray); - loadTemplate('admin_settings_saved', false, $message); + displayMessage($message); } // Always return the status @@ -226,7 +226,7 @@ function sponsorTranslateUserStatus ($status) { // Then use it $ret = getMessage($constantName); } else { - // Not found! + // Not found //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status)); logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status)); $ret = getMaskedMessage('ACCOUNT_STATUS_UNKNOWN', $status); @@ -311,7 +311,7 @@ ORDER BY $OUT .= loadTemplate('sponsor_action', true, $content); } else { // No sub menus active - $OUT .= loadTemplate('admin_settings_saved', true, '{--SPONSOR_NO_SUB_MENUS_ACTIVE--}'); + $OUT .= displayMessage('{--SPONSOR_NO_SUB_MENUS_ACTIVE--}', true); } // Free memory @@ -319,7 +319,7 @@ ORDER BY } // END - while } else { // No main menus active - $OUT .= loadTemplate('admin_settings_saved', true, '{--SPONSOR_NO_MAIN_MENUS_ACTIVE--}'); + $OUT .= displayMessage('{--SPONSOR_NO_MAIN_MENUS_ACTIVE--}', true); } // Free memory @@ -340,8 +340,8 @@ function addSponsorContent ($what) { // Every sponsor action will output nothing directly. It will be written into $GLOBALS['sponsor_output']! loadIncludeOnce($INC); } else { - // File not found! - $GLOBALS['sponsor_output'] .= loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_CONTENT_404', $what)); + // File not found + $GLOBALS['sponsor_output'] .= displayMessage(getMaskedMessage('SPONSOR_CONTENT_404', $what), true); } // Return content @@ -428,7 +428,7 @@ function saveSponsorData ($postData, $content) { // Generate hash code // @TODO Rewrite this to API function - $HASH = md5(session_id() . ':' . $postData['email'] . ':' . detectRemoteAddr() . ':' . detectUserAgent() . ':' . time()); + $HASH = md5(session_id() . getEncryptSeperator() . $postData['email'] . getEncryptSeperator() . detectRemoteAddr() . getEncryptSeperator() . detectUserAgent() . getEncryptSeperator() . time()); $DATA[] = $HASH; } // END - if } // END - if @@ -574,11 +574,11 @@ function doProcessSponsorFormRequest ($messageArray = array()) { // Prepare data for the email template $content['id'] = $id; $content['hash'] = $hash; - $content['email'] = secureString(postRequestParameter('email')); - $content['surname'] = secureString(postRequestParameter('surname')); - $content['family'] = secureString(postRequestParameter('family')); + $content['email'] = postRequestParameter('email'); + $content['surname'] = postRequestParameter('surname'); + $content['family'] = postRequestParameter('family'); $content['timestamp'] = generateDateTime(time(), 0); - $content['password'] = secureString(postRequestParameter('pass1')); + $content['password'] = postRequestParameter('pass1'); // Generate email and send it to the new sponsor $message = loadEmailTemplate('sponsor_confirm', $content, $id);