Advertisement
johnburn

license.php

May 1st, 2011
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.45 KB | None | 0 0
  1. <?php
  2. function err($msg, $var = "") {
  3.     global $posterr;
  4.     global $_POST;
  5.     $posterr = 1;
  6.     echo "<font color=red>{$msg}</font><br>";
  7.     if ($var) {
  8.         $_POST[$var] = "";
  9.     }
  10. }
  11. function _encryptLIC($theString) {
  12.     global $_TXT;
  13.     global $cckey;
  14.     global $encrypted_string;
  15.     global $cipher_alg;
  16.     global $iv;
  17.     $cckey = "301778a94a97f1441c6fc56112e92000";
  18.     $cipher_alg = MCRYPT_RIJNDAEL_256;
  19.     $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB), MCRYPT_RAND);
  20.     $encrypted_string = mcrypt_encrypt($cipher_alg, $cckey, $theString, MCRYPT_MODE_CBC, $iv);
  21.     return bin2hex($iv) . bin2hex($encrypted_string);
  22. }
  23. function DB_UPDATE($inserts, $debug) {
  24.     global $_TXT;
  25.     $doit = $inserts;
  26.     if ($debug) {
  27.         echo "<p>{$doit} <p>";
  28.     }
  29.     if (!mysql_query($doit)) {
  30.         exit(mysql_error());
  31.     }
  32. }
  33. chdir("Files");
  34. require ("Subs/ev3tH1nG.php");
  35. if (!function_exists("SECURE_URL")) {
  36.     function SECURE_URL($omit) {
  37.         global $_TXT;
  38.         $_SERVER['THIS_URL'] = "http";
  39.         if ($_SERVER['HTTPS'] == "on") {
  40.             $_SERVER.= "FULL_URL";
  41.         }
  42.         $_SERVER.= "THIS_URL";
  43.         if ($_SERVER['SERVER_PORT'] != "80") {
  44.             $_SERVER.= "THIS_URL";
  45.         } else {
  46.             $_SERVER.= "THIS_URL";
  47.         }
  48.         if (" " < $_SERVER['QUERY_STRING']) {
  49.             $_SERVER.= "THIS_URL";
  50.         }
  51.         if ($omit) {
  52.             $_SERVER['THIS_URL'] = str_replace("index.php", "", $_SERVER['THIS_URL']);
  53.         }
  54.         return $_SERVER['THIS_URL'];
  55.     }
  56. }
  57. if (!function_exists("GetMainBaseFromURL")) {
  58.     function GetMainBaseFromURL($url) {
  59.         $chars = preg_split("//", $url, 0 - 1, PREG_SPLIT_NO_EMPTY);
  60.         $slash = 3;
  61.         $i = 0;
  62.         foreach($chars as $key => $char) {
  63.             if ($char == "/") {
  64.                 $j = $i++;
  65.             }
  66.             if ($i == 3) {
  67.                 $pos = $key;
  68.                 break;
  69.                 break;
  70.             }
  71.         }
  72.         $main_base = substr($url, 0, $pos);
  73.         $main_base = str_replace("https://", "", $main_base);
  74.         $main_base = str_replace("https://www.", "", $main_base);
  75.         $main_base = str_replace("http://", "", $main_base);
  76.         $main_base = str_replace("http://www.", "", $main_base);
  77.         $main_base = str_replace("www.", "", $main_base);
  78.         return $main_base;
  79.     }
  80. }
  81. $file_find = GetMainBaseFromURL(SECURE_URL($omit));
  82. $file_find = GetMainBaseFromURL(SECURE_URL($omit));
  83. echo "\n<HTML>\n <HEAD>\n  <TITLE>Setup License</TITLE>\n\n<!-- Add this to have a specific theme --> \n\n</HEAD>\n <BODY BGCOLOR=\"#ffffff\">\n\n\n";
  84. if ($_REQUEST['ins'] && strlen($_REQUEST['regkey']) != 256) {
  85.     err("Registration key must be 256 characters long.");
  86. }
  87. if ($_REQUEST['ins'] && !$posterr) {
  88.     DB_UPDATE("UPDATE xt_config_page SET site_addr='" . trim($_REQUEST['regkey']) . "' LIMIT 1", 0);
  89.     $res = explode("license.php", SECURE_URL(1));
  90.     $reg = $res[1];
  91.     $ourl = $res[0];
  92.     echo "<FONT FACE=\"Verdana,Arial,Times New I2\"><FONT SIZE=\"2\">Your software has been registered. <a href=\"{$ourl}\">Click here</a> to continue.</FONT></FONT><P> <FONT FACE=\"Verdana,Arial,Times New I2\"><FONT SIZE=\"2\"><b>YOU NEED DELETE THIS FILE (license.php) NOW</b></FONT></FONT>";
  93. } else {
  94.     echo "\n<!-- example key: ";
  95.     echo trim(_encryptLIC("localhost::Premier::t::t::t::t::t::t::t::t::t::t::2012-02-15 23:23:23::1000"));
  96.     echo "-->\n<form name=install method=POST>\n<input type=hidden name=\"domainkey\" value=\"";
  97.     echo $file_find;
  98.     echo "\">\n\n <P>\n   <FONT FACE=\"Verdana,Arial,Times New I2\">Paypal.com Clone Installation.</FONT></P>\n  <P>\n   <FONT FACE=\"Verdana,Arial,Times New I2\"><FONT SIZE=\"2\">Please enter the Software \n   Registration Key given to you at the time of purchase. You must have \n   a valid Key in order to run this software, and Key must be used under the domain it was intended for.</FONT></FONT></P>\n\n";
  99.     if ($_REQUEST['i'] == "expired") {
  100.         echo "<center>\n<div style=\"padding:3px; width: 80%; border: 1px dotted red;\">It appears the registration key you are using has expired. Please obtain a new registration key before continuing.</div>\n</center>\n";
  101.     }
  102.     echo "\n  <P>\n   <TABLE WIDTH=\"100%\" CELLPADDING=\"2\" CELLSPACING=\"0\" BORDER=\"0\">\n    <TR>\n     <TD WIDTH=\"50%\" VALIGN=TOP>\n      <P>\n       <FONT SIZE=\"2\"><FONT FACE=\"Verdana,Arial,Times New I2\">\n      <P>\n       Domain Name<BR>\n       <INPUT TYPE=TEXT NAME=\"domainkeya\" SIZE=\"47\" MAXLENGTH=\"256\" value=\"";
  103.     echo $file_find;
  104.     echo "\" disabled></P>\n\n       Registration Key<BR>\n<TEXTAREA name=\"regkey\" COLS=36 ROWS=6></TEXTAREA></P>\n      <P>\n       <INPUT TYPE=SUBMIT NAME=\"ins\" VALUE=\"Register Software\"></FONT></FONT></TD>\n     <TD WIDTH=\"50%\" VALIGN=TOP>\n      <P ALIGN=left>\n       <FONT SIZE=\"3\"><FONT FACE=\"Verdana,Arial,Times New I2\">Required PHP Extensions</FONT></FONT>\n\n      <P ALIGN=left>\n       <FONT SIZE=\"2\"><FONT FACE=\"Verdana,Arial,Ti";
  105.     echo "mes New I2\">Mcrypt ";
  106.     if (!extension_loaded("mcrypt")) {
  107.         echo "<font color=red><b>Missing!</b></font>";
  108.     } else {
  109.         echo "<font color=green><b>Installed!</b></font>";
  110.     }
  111.     if (!extension_loaded("mhash")) {
  112.         echo "<font color=red><b>Missing!</b></font>";
  113.     } else {
  114.         echo "<font color=green><b>Installed!</b></font>";
  115.     }
  116.     echo "</FONT></FONT>\n\n      <P ALIGN=left>\n       <FONT SIZE=\"2\"><FONT FACE=\"Verdana,Arial,Times New I2\">GD ";
  117.     if (!extension_loaded("gd")) {
  118.         echo "<font color=red><b>Missing!</b></font>";
  119.     } else {
  120.         echo "<font color=green><b>Installed!</b></font>";
  121.     }
  122.     echo "</FONT></FONT>\n\n      <P ALIGN=left>\n       <FONT SIZE=\"2\"><FONT FACE=\"Verdana,Arial,Times New I2\">Gettext ";
  123.     if (!extension_loaded("gettext")) {
  124.         echo "<font color=red><b>Missing!</b></font>";
  125.     } else {
  126.         echo "<font color=green><b>Installed!</b></font>";
  127.     }
  128.     echo "</FONT></FONT>\n\n      <P ALIGN=left>\n       <FONT SIZE=\"2\"><FONT FACE=\"Verdana,Arial,Times New I2\">Curl ";
  129.     if (!extension_loaded("curl")) {
  130.         echo "<font color=red><b>Missing!</b></font>";
  131.     } else {
  132.         echo "<font color=green><b>Installed!</b></font>";
  133.     }
  134.     echo "</FONT></FONT>\n\n";
  135.     echo "</TD>\n    </TR>\n   </TABLE>\n\n\n </BODY>\n</HTML>\n\n</form>\n\n";
  136. }
  137. echo "\n </BODY>\n</HTML>\n\n";
  138. echo "\n";
  139. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement