$txtEmailDownload = $user_email_row['email']; $subjectDownload = "Digital Product Order placed at " . SITE_NAME; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $headers .= "From: " . SITE_EMAIL . "<" . SITE_EMAIL . ">" . "\r\n"; /*-------Email Template reading function call------------*/ $mailcontent_digital_product = readEmailTemplate('digital_product'); $product_download_details .= "\n\n*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*\r\n"; $product_download_details .= "<font color='#FF0000'>Note: If you do not have pop-ups enabled on your browser, the product download many not work properly.So please enable pop-ups before downloading !!</font>"; $mailcontent_digital_product = str_replace('[product_details]', $product_download_details, $mailcontent_digital_product); $mailcontent_digital_product = nl2br($mailcontent_digital_product); $mail_send_details = "<html><head><link href='" . SITE_URL . "/style/template1-admin.css' rel='stylesheet' type='text/css'></head><body><center><div align='left' id='layout'><div align='left' class='header'><div align='left' class='logo'><img src=" . $logofolder . "/" . $logoimage . " width='125' height='39'/></div></div><div>" . $mailcontent_digital_product . "</div></div><div align='left' class='clear_float'><img src=" . $imagefolder . "/clear.gif width=1 height=1/></div></div></div></center></body></html>"; //$mailsent = mail($txtEmailDownload,$subjectDownload,$mail_send_details,$headers); } /*-----------------Digital Product Mail Sending Ends----------------*/ // Send Giftcertificate Mails if ($gift_coupon_flag == 1) { sendgiftCertificateMail_Buyer($orderid, $CustomArray[0]); } else { sendBuyerEmail($orderid, $CustomArray[0]); sendSellerEmail($orderid, $CustomArray[0]); sendAdminEmail($orderid, $CustomArray[0]); } //Send Mail To Buyer } // end if paypal check } //end ipn check if emptyCart($CustomArray[0]); $_SESSION["sess_addresses_collected"] = false; $_SESSION["sess_stock_adjusted"] = false;
<?php // include files include "../../includes/session.php"; include "../../includes/functions.php"; include "../../lang/" . getLang(''); // captcha $showCaptcha = getCaptchaText(); // send email if ($_POST) { $result = sendAdminEmail('1', $_POST['id'], $_POST['report']); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link type="text/css" rel="stylesheet" href="style.css"> <style> .table { border: 0px; } .header { font-weight: bold;
// Send Giftcertificate Mails if ($gift_coupon_flag == 1) { sendgiftCertificateMail_Buyer($orderid, $_SESSION["sess_userid"], $usertype); sendgiftCertificateMail_Seller($orderid, $_SESSION["sess_userid"]); sendgiftCertificateMail_Admin($orderid, $_SESSION["sess_userid"]); } //Send Digital Certificate Mails if ($product_download_flag == 1) { sendDigitalCertificateMail_Buyer($orderid, $_SESSION["sess_userid"], $usertype); sendDigitalCertificateMail_Seller($orderid, $_SESSION["sess_userid"]); sendDigitalCertificateMail_Admin($orderid, $_SESSION["sess_userid"]); } if ($product_download_flag != 1 && $gift_coupon_flag != 1) { sendBuyerEmail($orderid, $_SESSION["sess_userid"], $usertype); sendSellerEmail($orderid, $_SESSION["sess_userid"]); sendAdminEmail($orderid, $_SESSION["sess_userid"]); } adjustStock($_SESSION["sess_userid"], "-"); emptyCart($_SESSION["sess_userid"]); $_SESSION["sess_addresses_collected"] = false; $_SESSION["sess_stock_adjusted"] = false; $_SESSION["sess_addresses_collected"] = false; $_SESSION["sess_stock_adjusted"] = false; $_SESSION['couponCode_det'] = ''; if (isset($_SESSION['guest_login']) && $_SESSION['guest_login'] != '') { session_unregister($_SESSION['guest_login']); session_unregister($_SESSION['sess_userid']); $_SESSION['guest_login'] = ''; $_SESSION["sess_userid"] = ''; } $_SESSION["sess_guest_username"] = '';
function wiki($wiki, $article) { global $dataSource; global $_CONFIG; global $_EXTRAS; $out = ''; //if ($_CONFIG['oneWiki']){ $base = $_CONFIG['base']; $url = $_CONFIG['base'] . "/{$article}"; //} else { // $base = $_CONFIG['base']."/".$wiki; // $url = $_CONFIG['base']."/$wiki/$article"; //} $content = array($wiki, $article, "", "aqWiki (Admin)", date("r")); if (!isset($_GET['action'])) { $_GET['action'] = false; } switch ($_GET['action']) { case "viewrev": if (!$_GET['id']) { panic("View Revision", "Parameters incorrect"); } $id = $_GET['id']; $pages = $dataSource->getPage($article); debug("Found " . count($pages) . " pages"); $row = $pages[$id]; $content[2] = '<div class="info"><b>Note:</b> This is a <i>specific revision</i> of this page, and may be outdated, The current version is ((here|' . $article . ')). You can see the differences between this and the current revision <a href="' . $url . '?action=diff&from=' . $id . '">here</a></div>'; if (in_array($_EXTRAS['me'], $_EXTRAS['admins'])) { $content[2] .= '<div class="adminFunctions">Admin Actions: <a href="' . $url . '?action=revert&id=' . $id . '">Revert back to this version</a> </div>'; } $content[2] .= $row['content']; #."\n\n [ \"Edit This Page\":$url?action=edit | \"View Source\":$url?action=src ]"; $content[3] = $row['creator']; $content[4] = date("r", $row['created']); $limit = 3; $current = 0; $_EXTRAS['versions'] = ''; foreach ($pages as $row) { $line = date("r", $row['created']) . " - \"" . $row['creator'] . "\":{$base}/~" . $row['creator']; if ($row['comment']) { $line .= " : " . $row['comment']; } if ($row['revision'] == $id) { $_EXTRAS['versions'] .= "# " . $line . " [ Current ]\n"; } else { $_EXTRAS['versions'] .= "# " . $line . " [ <a href=\"" . $url . "?action=viewrev&id=" . $row['revision'] . "\" title=\"View this revision\">View</a> |" . " <a href=\"" . $url . "?action=diff&from=" . $id . "&to=" . $row['revision'] . "\"\" title=\"View differences between this and the current revision\">Diff</a> ]\n"; } $current++; if ($id < $row['revision']) { // Nothing happens } elseif ($current >= $limit && $_GET['action'] != "allrev") { if ($id == $row['revision']) { $limit += 6; } else { $_EXTRAS['versions'] .= "# \"Show rest of revisions\":" . $url . "?action=allrev\n"; break; } } } $content[2] .= $out; break; case "diff": $content[2] = "These are the differences between two versions of (({$article})). Lines styled <span class=\"added\">" . "like this</span> have been added to the entry, lines <span class=\"removed\">like this</span> have been removed.\n\n"; $from = isset($_GET['from']) ? $_GET['from'] : false; $to = isset($_GET['to']) ? $_GET['to'] : false; $_EXTRAS['textarea'] = $dataSource->diff($article, $from, $to); $content[2] .= "[[TEXTAREA]]"; break; case "newUser": /*mysql> describe users; +---------------+------------------+-------------------+ | Field | Type | Collation | +---------------+------------------+-------------------+ | id | int(10) unsigned | binary | | username | varchar(64) | latin1_swedish_ci | | real_name | tinytext | latin1_swedish_ci | | email | tinytext | latin1_swedish_ci | | birthday | date | latin1_swedish_ci | | password | tinytext | latin1_swedish_ci | | location | int(11) | binary | | last_access | timestamp | latin1_swedish_ci | | date_creation | timestamp | latin1_swedish_ci | | access_level | int(11) | binary | +---------------+------------------+-------------------+ 10 rows in set (0.05 sec) */ $form = '<form class="shiny" method=post action="' . $_SERVER['REQUEST_URI'] . '"><h2>New User</h2>' . "\n\n" . '|Username|<input type="text" name="username" value="' . $_POST['username'] . '">|(Must not be blank)|' . "\n" . '|Display Name|<input type="text" name="name" value="' . $_POST['name'] . '">|(Must not be blank)<br>|' . "\n" . '|e-Mail|<input type="text" name="email" value="' . $_POST['email'] . '">|(Must not be blank)<br>|' . "\n" . '|Password|<input type="password" name="password">|(Must not be blank)<br>|' . "\n" . '|Repeat Password |<input type="password" name="password2">| (Must match above) |' . "\n\n"; if (isset($_CONFIG['recaptcha_public_key'])) { require_once 'recaptchalib.php'; $public_key = $_CONFIG['recaptcha_public_key']; $form .= '<aqWikiNoProcess>' . recaptcha_get_html($public_key) . "</aqWikiNoProcess>\n\n"; } $form .= '<input type="submit" name="submit" value="Create User">' . "\n\n" . '</form>'; #print_r($_POST); if ($_POST['submit']) { $errors = array(); if ($_POST['username'] == "") { $errors[] = "Username cannot be blank"; } elseif (strstr($_POST['username'], ",")) { $errors[] = "Username cannot contain commas"; } elseif (isset($_EXTRAS['reservedUsers']) && in_array($_POST['username'], $_EXTRAS['reservedUsers'])) { $errors[] = "Username invalid"; } elseif (!$dataSource->unique("users", "username", $_POST['username'])) { $errors[] = "Username must be unique"; } if ($_POST['email'] == "") { $errors[] = "email cannot be blank"; } elseif (!$dataSource->unique("users", "email", $_POST['email'])) { $errors[] = "email must be unique"; } if ($_POST['name'] == "") { $errors[] = "Display Name cannot be blank"; } elseif (!$dataSource->unique("users", "real_name", $_POST['name'])) { $errors[] = "Display Name must be unique"; } if ($_POST['password'] == "") { $errors[] = "password cannot be blank"; } elseif ($_POST['password'] != $_POST['password2']) { $errors[] = "passwords must match"; } if (isset($_CONFIG['recaptcha_private_key'])) { $privatekey = $_CONFIG['recaptcha_private_key']; $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { $errors[] = "Captcha invalid"; } } if (count($errors) == 0) { $dataSource->newUser($_POST['username'], $_POST['name'], $_POST['password'], $_POST['email']); sendAdminEmail('New User Created', $_POST); $out = "h2. New user created\n\n"; $out .= "Hi, " . $_POST['name'] . ", Welcome to this aqWiki install.\n\n"; $url = parse_url($_SERVER['REQUEST_URI']); $out .= "You should now \"login\":" . $url['path'] . "?action=login"; } else { $out = "h2. Error in user creation\n\n"; foreach ($errors as $error) { $out .= "* " . $error . "\n"; } $out .= "\n\n" . $form; } } else { $out = "h2. New user\n\n"; $out .= $form; } $content[2] = $out; break; case "edit": if ($_EXTRAS['reqEdit']) { doAuth($_EXTRAS['reqEdit'], "edit a page"); } if ($_EXTRAS['restrictNewPages']) { doAuth($_EXTRAS['restrictNewPages'], "create a new page"); } $form = true; $text = false; switch ($_POST['submit']) { case "Preview": $out = $_POST['content']; $text = stripslashes($_POST['content']); break; case "Spell Check": $checker = new Spellchecker(); $text = strip_tags(textile($_POST['content'])); $num_errors = $checker->check($text); if ($num_errors > 0) { $out .= "h3. Spell Check\n\n"; #$out .= "Items <span class=\"spellCorrect\">like this</span> could be errors, hover over for suggestions. Items <span class=\"spellNoSuggest\">like this</span> arn't in the dictionary, and the spell checker has no idea.\n\n"; $errors = $checker->getErrors(); $oldtext = $text; foreach ($errors as $word => $suggestions) { /*$title = trim(implode(', ', $suggestions)); if ($title == ""){ $span = '<|-|'.$title.'|-|>'.$word.'</-|>'; } else { $span = '<|||'.$title.'|||>'.$word.'</||>'; }*/ $suggs = implode(' ', $suggestions); if ($suggs != " ") { $errorlist .= "*" . $word . ":* " . $suggs . "\n\n"; } else { $noidea[] = $word; } # $text = str_replace($word, $span, $text); #$text = preg_replace("/(\W|^)$word(\W|\$)/i", "$1$span$2", $text); } /* //if ($title == ""){ $text = str_replace('<|-|', '<span class="spellNoSuggest"', $text); $text = str_replace('|-|>', '>', $text); $text = str_replace('</-|>', '</span>', $text); //} else { $text = str_replace('<|||', '<span class="spellCorrect" title="', $text); $text = str_replace('|||>', '">', $text); $text = str_replace('</||>', '</span>', $text); //}*/ } if ($noidea) { $errorlist .= "*No idea about:* " . implode(' ', $noidea) . "\n\n"; } #$out .= $text; $out .= $errorlist . "\n"; $text = stripslashes($_POST['content']); break; case "Post": $page = array_shift($dataSource->getPage($article)); if ($page['rev_created'] > $_POST['edittime']) { $content[2] .= collision_detection($page, $_POST); $text = $_POST['content']; //$form = false; } else { $dataSource->post($article, $_POST['content'], $_POST['comment']); $form = false; header("location: {$url}"); } } if ($text) { $_EXTRAS['textarea'] = $text; } elseif (!$dataSource->pageExists($article)) { $_POST['comment'] = "Start of a brand new world"; $_EXTRAS['textarea'] = ""; } else { $_EXTRAS['textarea'] = stripslashes($dataSource->getContent($article)); } preg_match_all("/\\[\\[LOCKED\\|(.*?)\\]\\]/", $_EXTRAS['textarea'], $matches); foreach ($matches[0] as $index => $match) { $users = $matches[1][$index]; doAuth($users, "view this"); } if ($form) { $out .= "<form method=post action=\"" . $_SERVER['REQUEST_URI'] . "\" class=\"shiny wikiedit\">"; $out .= '<h2>Editing "' . $content[1] . '"</h2>'; $out .= "<p>You should read the ((help)). If you are having problems with the formatting, post it and add a note explaining the problem to ((formattingProblems)) and I'll dive in and fix it. If you believe you've found a bug in the wiki software, post your problem to \"the bug tracker\":http://trac.aqxs.net/aqwiki/newticket and I'll dive in and fix that too.</p>\n"; //$out .= "<label for=\"creator\">Author</label>\n"; //$out .= $_EXTRAS['me']."<br>\n"; $out .= "<label for=\"content\">Content of page \"" . $content[1] . "\"</label>\n"; $out .= "<textarea name=\"content\" id=\"content\" rows=\"30\" cols=\"72\">[[TEXTAREA]]</textarea>\n<br>\n"; $out .= "<label for=\"comment\">Comment</label>\n"; $out .= "<input type=\"text\" name=\"comment\" id=\"comment\" size=\"72\" value=\"" . $_POST['comment'] . "\"><br>\n"; $out .= "<input class=\"submit\" type=\"hidden\" name=\"edittime\" value=\"" . time() . "\">\n"; $out .= "<input class=\"submit\" type=\"submit\" name=\"submit\" value=\"Post\"> "; $out .= "<input class=\"submit\" type=\"submit\" name=\"submit\" value=\"Preview\"> "; $out .= "<input class=\"submit\" type=\"submit\" name=\"submit\" value=\"Spell Check\"> "; $out .= "<input class=\"submit\" type=\"reset\" name=\"revert\" value=\"Revert to pre-editing\">\n"; $out .= "</form>"; $content[2] .= $out; break; } case "allrev": if (!$dataSource->pageExists($article)) { $content[2] = 'Error: Page doesn\'t exist. What are you playing at?'; break; } $content[2] = '<form method="GET" action="' . $url . '" style="width: auto;">'; $content[2] .= '<h2>Viewing all revisions for ((' . $article . "))</h2>\n\n"; $content[2] .= 'Select the <input type="radio" /> boxes to compare two revisions' . "\n\n"; $pages = $dataSource->getPage($article); $pages = array_reverse($pages); foreach ($pages as $row) { $line = '<input type="radio" name="from" value="' . $row['revision'] . '">'; $line .= '<input type="radio" name="to" value="' . $row['revision'] . '">'; $line .= date("Y-m-d H:i", $row['created']) . " - " . userlink($row['creator']); if ($row['comment']) { $line .= " : " . $row['comment']; } $content[2] .= "# " . $line . " [ <a href=\"" . $url . "?action=viewrev&id=" . $row['revision'] . "\" title=\"View this revision\">View</a> |" . " <a href=\"" . $url . "?action=diff&from=" . $row['revision'] . "\"\" title=\"View differences between this and the current revision\">Diff</a> ]\n"; } $content[2] .= '<input type="submit" value="Compare Revisions"> <input type="hidden" value="diff" name="action"> </form>'; break; case "revert": if (!in_array($_EXTRAS['me'], $_EXTRAS['admins'])) { panic('AqWiki Reversion', 'You\'re not an admin, you can\'t do this shit'); } if (!$_GET['id']) { die("Parameters incorrect"); } $id = $_GET['id']; $pages = $dataSource->getPage($article); $oldVersion = $pages[$id]; //die($oldVersion['content']); $dataSource->post($article, $oldVersion['content'], 'reverted back to version ' . $id); $form = false; $content[2] = 'Reverted ((' . $article . ')) back to version ' . $id; break; default: $_EXTRAS['versions'] = ""; if (!$dataSource->pageExists($article)) { if ($_EXTRAS['restrictNewPages'] || $_EXTRAS['reqEdit']) { if ($_EXTRAS['restrictNewPages'] == "register") { $message = "any registered users"; } else { $message = "only certain users"; } if (!isset($_EXTRAS['newPageMessage'])) { $npm = "This page doesn't exist yet. [[TYPES]] can create new pages. Do you want to do so?\n\n\"Go On Then\":[[EDITURL]]"; } else { $npm = $_EXTRAS['newPageMessage']; } $content[2] = str_replace(array("[[TYPES]]", "[[EDITURL]]"), array($message, $url . "?action=edit"), $npm); } else { $content[2] = "This page doesn't exist yet, Would you like to create it?\n\n\"Go On Then\":" . $url . "?action=edit"; } } else { $_EXTRAS['nearby'] = $dataSource->nearby($article); $pages = $dataSource->getPage($article); $row = array_shift($pages); if (strcmp($row['wiki'], $wiki) != 0) { $base = $_CONFIG['base'] . "/" . $row['wiki']; $url = $base . "/" . $article; header("location: " . $url); } $content[2] = $row['content']; $content[3] = $row['creator']; $content[4] = date("r", $row['created']); $line = date("r", $row['created']) . " - " . userlink($row['creator']); if ($row['comment']) { $line .= " : " . $row['comment']; } if ($_EXTRAS['current'] != $article) { $pages = $dataSource->getPage($_EXTRAS['current']); $row = array_shift($pages); } $_EXTRAS['versions'] .= "# " . $line . " [ Current ]\n"; $limit = 10; $current = 0; foreach ($pages as $row) { $line = date("Y-m-d\tH:i", $row['created']) . " - " . userlink($row['creator']); if ($row['comment']) { $line .= " : " . $row['comment']; } $_EXTRAS['versions'] .= "# " . $line . " [ <a href=\"" . $url . "?action=viewrev&id=" . $row['revision'] . "\" title=\"View this revision\">View</a> |" . " <a href=\"" . $url . "?action=diff&from=" . $row['revision'] . "\"\" title=\"View differences between this and the current revision\">Diff</a> ]\n"; $current++; if ($_GET['action'] != "allrev" && $current > $limit) { $_EXTRAS['versions'] .= "# \"Show list of revisions\":" . $url . "?action=allrev\n"; break; } } #$content[2] .= $out; } } return $content; }
$rowPay = mysql_fetch_array($rs_select_pay); $paymentComplete_Status = $rowPay['payment_completed_status']; if ($paymentComplete_Status == 'N') { if ($gift_flag == 1) { sendgiftCertificateMail_Buyer($orderid, $userid); sendgiftCertificateMail_Seller($orderid, $userid); sendgiftCertificateMail_Admin($orderid, $userid); } else { if ($digital_flag == 1) { sendDigitalCertificateMail_Buyer($orderid, $userid, $usertype); sendDigitalCertificateMail_Seller($orderid, $userid); sendDigitalCertificateMail_Admin($orderid, $userid); } else { sendBuyerEmail($orderid, $userid, $usertype); sendSellerEmail($orderid, $userid); sendAdminEmail($orderid, $userid); } } $sql_update_order_payment = "UPDATE " . $tableprefix . "orders SET payment_completed_status='Y' where order_id=" . $orderid . " "; $res_update = mysql_query($sql_update_order_payment) or die(mysql_error()); } adjustStock($userid, "-"); emptyCart($userid); } } } else { //exit('DoDirectPayment failed: <br>' . print_r($httpParsedResponseAr, true)); $errorArry = $httpParsedResponseAr; $errorMsg = "DoDirectPayment failed: <br>" . urldecode($httpParsedResponseAr['L_LONGMESSAGE0']); } $active_template = displayTemplate();
function closeSession($sendMail = true) { logMessage("Close session"); if ($sendMail) { sendAdminEmail(prepareEmailMessage()); } die; }