Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ixti/397634 to your computer and use it in GitHub Desktop.
Save ixti/397634 to your computer and use it in GitHub Desktop.
From 75567145b5472d2760680a1e133e568331a2da8b Mon Sep 17 00:00:00 2001
From: Aleksey V. Zapparov <...>
Date: Tue, 23 Mar 2010 11:12:16 +0100
Subject: [PATCH] Dirty fix.
- Workaround for serial number validation
- Removed ask for serial number (fixed SN = FREE-AS-IN-FREEDOM)
- Removed annoying ads from top of admin's interface
---
admin/includes/classes/sss_verify.php | 45 +++++-----------------------
admin/includes/header.php | 5 ---
admin/sss_validate.php | 2 +-
3 files changed, 9 insertions(+), 43 deletions(-)
diff --git a/admin/includes/classes/sss_verify.php b/admin/includes/classes/sss_verify.php
index 19149fc..a3857e7 100644
--- a/admin/includes/classes/sss_verify.php
+++ b/admin/includes/classes/sss_verify.php
@@ -248,43 +248,14 @@ echo "</pre>";
}
function sendToHost($encode = false) {
- global $url;
- //$url = 'https://api.creloaded.com/sss/sssAPI.php';
- $url = 'https://api.creloaded.com/sss/sssAPI.php';
- $port = '443';
- $method = 'POST';
- $data = $this->data;
- // convert characters to proper format for post
- if ($encode == true) {
- $data = urlencode($data);
- }
- // setup the cURL connection
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- //curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl, CURLOPT_POST, 1);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type", "application/x-www-form-urlencoded"));
- curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
- // added support for curl proxy
- if (defined('CURL_PROXY_HOST') && defined('CURL_PROXY_PORT') && CURL_PROXY_HOST != '' && CURL_PROXY_PORT != '') {
- curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, TRUE);
- curl_setopt($curl, CURLOPT_PROXY, CURL_PROXY_HOST . ":" . CURL_PROXY_PORT);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
- }
- if (defined('CURL_PROXY_USER') && defined('CURL_PROXY_PASSWORD') && CURL_PROXY_USER != '' && CURL_PROXY_PASSWORD != '') {
- curl_setopt($curl, CURLOPT_PROXYUSERPWD, CURL_PROXY_USER . ':' . CURL_PROXY_PASSWORD);
- }
- ob_start();
- curl_exec($curl);
- $result = ob_get_contents();
- ob_end_clean();
- if (curl_errno($curl)) {
- $result = curl_errno($curl) . ' - cURL ' . curl_error($curl);
- }
- curl_close($curl);
- return $result;
+ return '<Status>'
+ . '<returnCode>Success</returnCode>'
+ . '<ownerName>All Good People</ownerName>'
+ . '<billableName>All Good People</billableName>'
+ . '<validationProduct>' . $this->validationProduct . '</validationProduct>'
+ . '<expirationDate>' . date('Y-m-d', mktime(0, 0, 0, 12, 31, date('Y') + 3)) . '</expirationDate>'
+ . '<graceDays>365</graceDays>'
+ . '</Status>';
}
}
?>
\ No newline at end of file
diff --git a/admin/includes/header.php b/admin/includes/header.php
index 8b76d4b..d570088 100644
--- a/admin/includes/header.php
+++ b/admin/includes/header.php
@@ -49,11 +49,6 @@ function showSearch (section) {
<td align="left" valign="middle" class="head-content" rowspan="2">
<a href="<?php echo tep_catalog_href_link();?>" target="_blank"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . '/' . STORE_LOGO ,STORE_NAME);?></a>
</td>
- <td align="right" valign="top" class="HeaderMessage"><!--Banner Script mods to fix TEXT ONLY ad area for Admin Header This ad area reserved for Security Alert System - Please DO NOT change! -->
- <!--Banner Script Start-->
- <iframe src="messages.php?s=header" frameborder="0" width="468" height="52" scrolling="No" allowtransparency="true"></iframe>
- <!--Banner Script End-->
- </td>
<td rowspan="2" align="right" width="76" valign="middle" class="HeaderMessage"> <?php echo tep_image(DIR_WS_IMAGES . 'pro_badge.png'); ?></td>
</tr>
<!--<tr>
diff --git a/admin/sss_validate.php b/admin/sss_validate.php
index ae27991..506aa88 100644
--- a/admin/sss_validate.php
+++ b/admin/sss_validate.php
@@ -16,7 +16,7 @@ $error_message = ($error == true) ? $_SESSION['validate_error']['error_message']
$action = (isset($_GET['action']) && ($_GET['action'] != '')) ? $_GET['action'] : '';
$_SESSION['force_registration'] = true;
$paction = (isset($_POST['action']) && ($_POST['action'] != '')) ? $_POST['action'] : '';
-$serial = (isset($_POST['serial']) && ($_POST['serial'] != '')) ? tep_db_prepare_input($_POST['serial']) : '';
+$serial = tep_db_prepare_input('FREE-AS-IN-FREEDOM');
if (($paction == 'validate') || $serial && !$error) {
// check for blank serial
if ($serial == '') {
--
1.7.0
@janeblonde
Copy link

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment