$value) { // Secure id number $id = bigintval($id); // Get pool data from given id $content = getPoolDataFromId($id); // Found some data? if (isFilledArray($content)) { // Is the surfbar installed? // @TODO Rewrite these if-blocks to a filter if ((isExtensionActive('surfbar')) && (getConfig('surfbar_migrate_order') == 'Y')) { // Then "migrate" the URL to the surfbar doSurfbarAdminMigrateUrl($content['url'], $content['sender']); } // END - if // Check for bonus extension version >= 0.4.4 for the order bonus if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (isBonusRallyeActive())) { // Add points directly sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_order`=`bonus_order`+{?bonus_order?} WHERE `userid`=%s LIMIT 1", array(bigintval($content['sender'])), __FILE__, __LINE__); // Subtract bonus points from system handleBonusPoints(getBonusOrder(), $content['sender']); } // END - if // Load email template $message_user = loadEmailTemplate('member_order_accepted', $content, $content['sender']); // Send email sendEmail($content['sender'], '{--MEMBER_ORDER_ACCEPTED--}', $message_user); // Unlock selected email updatePoolDataById($id, 'data_type', 'NEW', NULL, " AND `data_type`='ADMIN'"); } // END - if } // END - foreach // Set message $message = '{--ADMIN_MAILS_ACTIVATED--}'; } else { // Nothing checked! $message = '{--ADMIN_MAILS_NOTHING_CHECKED--}'; } // Mails unlocked for mail delivery displayMessage($message); } elseif (isPostRequestElementSet('reject')) { if (ifPostContainsSelections()) { // Reject mail orders $OUT = ''; foreach (postRequestElement('sel') as $id => $value) { // Secure id number $id = bigintval($id); // Get pool data from given id $content = getPoolDataFromId($id); // Load email template and send it away $message_user = loadEmailTemplate('member_order_rejected', $content, $content['sender']); sendEmail($content['sender'], '{--MEMBER_ORDER_REJECTED--}', $message_user); // If you do not enter an URL to redirect to, your URL will be set! if ((!isPostRequestElementSet('redirect')) || (postRequestElement('redirect') == 'http://')) { setPostRequestElement('redirect', getUrl()); } // END - if // Redirect URL updatePoolDataById($id, NULL, array('url' => postRequestElement('redirect'), 'data_type' => 'NEW')); // Prepare data for the row template $content = array( 'id' => $id, 'url' => postRequestElement('url', $id), ); // Load row template and switch colors $OUT .= loadTemplate('admin_unlock_emails_redir_row', TRUE, $content); } // END - foreach // Load main template loadTemplate('admin_unlock_emails_redir', FALSE, $OUT); } else { // Nothing selected displayMessage('{--ADMIN_MAILS_NOTHING_CHECKED--}'); } } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (isExtensionActive('blacklist')) && (isUrlBlacklistEnabled())) { // Lock URLs foreach (postRequestElement('sel') as $id => $url) { // Secure id number $id = bigintval($id); // Lookup in blacklist insertUrlInBlacklist($url); } // END - foreach // Output message displayMessage('{--ADMIN_URLS_BLOCKED--}'); } elseif ((!isFormSent('lock')) && (!isFormSent('accept')) && (!isFormSent('reject'))) { // Mail orders are in pool so we can display them $OUT = ''; while ($content = sqlFetchArray($result_main)) { // Prepare data for the template $content['timestamp'] = generateDateTime($content['timestamp'], 2); // Load row template and switch colors $OUT .= loadTemplate('admin_unlock_emails_row', TRUE, $content); } // END - while // Free memory sqlFreeResult($result_main); // Remember in array $content['rows'] = $OUT; // Load main template loadTemplate('admin_unlock_emails', FALSE, $content); } elseif ((isFormSent('lock')) && ((!isExtensionActive('blacklist')) || (!isUrlBlacklistEnabled()))) { // URL blacklist not activated displayMessage('{--ADMIN_URL_BLACKLIST_DISABLED--}'); } else { // Wrong call! displayMessage('{--ADMIN_WRONG_CALL--}'); } } else { // No mail orders fond displayMessage('{--ADMIN_NO_MAILS_IN_POOL--}'); } // [EOF] ?>