Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!defined('TOP_STARTED')) exit('Site security activated !');
- function validate($validate)
- {
- global $error_message, $error;
- if ($validate == 'admin' && logged())
- {
- if (isset($_POST['submitDelete']) && requestMethod('POST'))
- {
- $id = safeInput($_POST['id']);
- query('DELETE FROM scams WHERE id = ?', array($id));
- advancedEmailer($email, SITE_NAME.' - Report Status', 'Your report was rejected by our administration. Think this is a mistake? Contact us.');
- writeSession('report_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Report successfully removed from database. Email for author sent.</div>');
- redirect(SITE_LINK);
- }
- if (isset($_POST['submitVerify']) && requestMethod('POST'))
- {
- $id = safeInput($_POST['id']);
- $email = safeInput($_POST['email']);
- query('UPDATE scams SET status = 1 WHERE id = ?', array($id));
- advancedEmailer($email, SITE_NAME.' - Report Status', 'Your report was approved by our administration. Thank you.');
- writeSession('report_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Report verified. Email for author sent.</div>');
- redirect(safeInput($_SERVER['HTTP_REFERER']));
- }
- }
- if ($validate == 'login')
- {
- if (isset($_POST['submit']) && requestMethod('POST'))
- {
- $username = safeInput($_POST['username']);
- $password = safeInput($_POST['password']);
- if (IoE($username, $password))
- {
- $check = numRows("SELECT COUNT(*) FROM users WHERE name = :name AND password = :pass", array(':name' => $username, ':pass' => passEncode($password)));
- if ($check == 1)
- {
- # ok
- }
- else
- {
- set_error('Incorrect username or password', true);
- }
- }
- else
- {
- set_error('Don\'t leave empty fields', true);
- }
- if (!$error)
- {
- $user_id = fetchArray("SELECT id FROM users WHERE name = :name AND password = :pass LIMIT 1", array(':name' => $username, ':pass' => passEncode($password)));
- writeSession('logged', 1);
- writeSession('user_id', safeInput($user_id['id']));
- redirect(SITE_LINK);
- }
- else
- {
- process_error('login_error', safeInput($_SERVER['HTTP_REFERER']));
- }
- }
- }
- elseif ($validate == 'report-scammer')
- {
- if (isset($_POST['submit']) && requestMethod('POST'))
- {
- $title = safeInput($_POST['title']);
- $seo_title = SEO_link($title);
- $version = safeInput($_POST['version']);
- $type = safeInput($_POST['type']);
- $discordId = safeInput($_POST['discordId']);
- $uniqueId = safeInput($_POST['uniqueId']);
- $skype = safeInput($_POST['skype']);
- $username = safeInput($_POST['username']);
- $bought = safeInput($_POST['bought']);
- $outsidelink = safeInput($_POST['outsidelink']);
- $description = HTMLPurified($_POST['description']);
- $by = safeInput($_POST['by']);
- $youremail = safeInput($_POST['youremail']);
- $paymentMethod = safeInput($_POST['paymentMethod']);
- $scamtype = safeInput($_POST['scamtype']);
- $paymentInfo = safeInput($_POST['paymentInfo']);
- $scamExtra = safeInput($_POST['scamExtra']);
- if ($skype || $discordId || $username)
- {
- # ok
- } else {
- set_error('Plase add one of the following - scammer Skype or Email or Discord ID details', true);
- }
- if (IoE($title, $seo_title, $description, $youremail))
- {
- # ok
- }
- else
- {
- set_error('Don\'t leave empty fields', true);
- }
- if (!$error)
- {
- query("
- INSERT INTO
- scams (title, seo_title, version, type, paymentMethod, paymentInfo, scamtype, scamExtra, discordId, uniqueId, skype, username, bought, outsidelink, description, author, authoremail, date)
- VALUES (
- :title,
- :seo_title,
- :version,
- :type,
- :paymentMethod,
- :paymentInfo,
- :scamtype,
- :scamExtra,
- :discordId,
- :uniqueId,
- :skype,
- :username,
- :bought,
- :outsidelink,
- :description,
- :by,
- :youremail,
- :datea)",
- array(
- ':title' => $title,
- ':seo_title' => $seo_title,
- ':version' => $version,
- ':type' => $type,
- ':paymentMethod' => $paymentMethod,
- ':paymentInfo' => $paymentInfo,
- ':scamtype' => $scamtype,
- ':scamExtra' => $scamExtra,
- ':discordId' => $discordId,
- ':uniqueId' => $uniqueId,
- ':skype' => $skype,
- ':username' => $username,
- ':bought' => $bought,
- ':outsidelink' => $outsidelink,
- ':description' => $description,
- ':by' => $by,
- ':youremail' => $youremail,
- ':datea' => date('Y-m-d H:i')));
- advancedEmailer('rscammers@gmail.com', SITE_NAME.' - New Report Submitted', 'Boss, new report has been submitted. Go and verify/delete it. Have a nice day.');
- writeSession('report_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Report Created. Our administration will review it and will send you an email with confirmation status</div>');
- redirect(safeInput($_SERVER['HTTP_REFERER']));
- }
- else
- {
- process_error('report_error', safeInput($_SERVER['HTTP_REFERER']));
- }
- }
- }
- elseif ($validate == 'report-scammer-update')
- {
- if (isset($_POST['submit']) && requestMethod('POST'))
- {
- $id = safeInput($_POST['id']);
- $title = safeInput($_POST['title']);
- $seo_title = SEO_link($title);
- $version = safeInput($_POST['version']);
- $type = safeInput($_POST['type']);
- $discordId = safeInput($_POST['discordId']);
- $uniqueId = safeInput($_POST['uniqueId']);
- $skype = safeInput($_POST['skype']);
- $username = safeInput($_POST['username']);
- $bought = safeInput($_POST['bought']);
- $outsidelink = safeInput($_POST['outsidelink']);
- $description = HTMLPurified($_POST['description']);
- $by = safeInput($_POST['by']);
- $youremail = safeInput($_POST['youremail']);
- $paymentMethod = safeInput($_POST['paymentMethod']);
- $scamtype = safeInput($_POST['scamtype']);
- $paymentInfo = safeInput($_POST['paymentInfo']);
- $scamExtra = safeInput($_POST['scamExtra']);
- if ($skype || $discordId || $username)
- {
- # ok
- } else {
- set_error('Plase add one of the following - scammer Skype or Email or Discord ID details', true);
- }
- if (IoE($title, $seo_title, $description, $youremail))
- {
- # ok
- }
- else
- {
- set_error('Don\'t leave empty fields', true);
- }
- if (!$error)
- {
- query("
- UPDATE
- scams
- SET
- title = :title,
- seo_title = :seo_title,
- version = :version,
- type = :type,
- paymentMethod = :paymentMethod,
- paymentInfo = :paymentInfo,
- scamtype = :scamtype,
- scamExtra = :scamExtra,
- discordId = :discordId,
- uniqueId = :uniqueId,
- skype = :skype,
- username = :username,
- bought = :bought,
- outsidelink = :outsidelink,
- description = :description,
- author = :by,
- authoremail = :youremail
- WHERE
- id = :id",
- array(
- ':title' => $title,
- ':seo_title' => $seo_title,
- ':version' => $version,
- ':type' => $type,
- ':paymentMethod' => $paymentMethod,
- ':paymentInfo' => $paymentInfo,
- ':scamtype' => $scamtype,
- ':scamExtra' => $scamExtra,
- ':discordId' => $discordId,
- ':uniqueId' => $uniqueId,
- ':skype' => $skype,
- ':username' => $username,
- ':bought' => $bought,
- ':outsidelink' => $outsidelink,
- ':description' => $description,
- ':by' => $by,
- ':youremail' => $youremail,
- ':id' => $id));
- writeSession('report_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Report updated.</div>');
- redirect(safeInput($_SERVER['HTTP_REFERER']));
- }
- else
- {
- process_error('report_error', safeInput($_SERVER['HTTP_REFERER']));
- }
- }
- }
- elseif ($validate == 'search')
- {
- if (isset($_POST['submit_me']) && requestMethod('POST'))
- {
- $keyword = safeInput($_POST['keyword']);
- if (IoE($keyword))
- {
- # ok
- }
- else
- {
- set_error('Error', true);
- }
- if (!$error)
- {
- redirect(SITE_LINK.'/search='.$keyword);
- }
- else
- {
- process_error('search_error', safeInput($_SERVER['HTTP_REFERER']));
- }
- }
- }
- elseif ($validate == 'appealReport')
- {
- if (isset($_POST['submit']) && requestMethod('POST'))
- {
- $email = safeInput($_POST['email']);
- $message = safeInput($_POST['message']);
- if (IoE($email, $message))
- {
- # ok
- }
- else
- {
- set_error('Don\'t leave empty fields', true);
- }
- if (!$error)
- {
- writeSession('contact_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Your message was successfully sent! You should receive confirmation email shortly</div>');
- advancedEmailer('rscammers@gmail.com', SITE_NAME.' Report<strong>From:</strong> '.$email.'<br><strong>Link:</strong>'.safeInput($_SERVER['HTTP_REFERER']).'<br><strong>Message:</strong><br>'.$message);
- redirect(safeInput($_SERVER['HTTP_REFERER']));
- }
- else
- {
- process_error('contact_error', safeInput($_SERVER['HTTP_REFERER']));
- }
- }
- }
- elseif ($validate == 'contact')
- {
- if (isset($_POST['submit']) && requestMethod('POST'))
- {
- $name = safeInput($_POST['name']);
- $topic = safeInput($_POST['topic']);
- $email = safeInput($_POST['email']);
- $message = safeInput($_POST['message']);
- $confirmation = 'Hey, '.$name.'!<br>Your message was successfully received. We will get back to you shortly!<br><strong>Topic:</strong> '.$topic.'<br><strong>Message:</strong><br>'.$message;
- if (IoE($name, $topic, $email, $message))
- {
- # ok
- }
- else
- {
- set_error('Don\'t leave empty fields', true);
- }
- if (!$error)
- {
- writeSession('contact_success', '<div class="alert alert-success" role="alert" style="margin: 15px 0 0 0"><span class="sr-only">Success:</span>Your message was successfully sent! You should receive confirmation email shortly</div>');
- advancedEmailer('rscammers@gmail.com', SITE_NAME.' New Message - '.$topic, '<strong>From:</strong> '.$email.' ('.$name.')<br><strong>Message:</strong><br>'.$message);
- advancedEmailer($email, SITE_NAME.' - Message confirmation', $confirmation);
- redirect(safeInput($_SERVER['HTTP_REFERER']));
- }
- else
- {
- process_error('contact_error', safeInput($_SERVER['HTTP_REFERER']));
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement