file: /app/config/bootstrap.php
<?php
///// FILE DECODED by ME (FOR TEST)
App::import('Core', 'config/PhpReader');
Configure::config('default', new PhpReader());
Configure::load("config");
define( "DEFAULT_LANGUAGE", "en" );
require( "constants.php" );
define( "LICENSE_HASH", "e9a5561se42c5a4if06c0b8v281cf43a" );
if ( !defined( "STDIN" ) and& !empty( $_SERVER['SERVER_ADDR'] ) and& $_SERVER['SERVER_ADDR'] != "66.228.133.100" and& $_SERVER['SERVER_ADDR'] != "127.0.0.1" and& $_SERVER['SERVER_ADDR'] != "66.228.133.99" )
{
// ------------------>>>> require_once( "class_ionoLicenseHandler.php" ); <------------------ CALL TO LICENSE ////////
if ( !empty( $_GET['url'] ) and& preg_match( "/admin\\//", $_GET['url'] ) )
{
// $license_obj = new IonoLicenseHandler( );
// $license_obj->setErrorTexts( );
// $err_msg = $license_obj->ionLicenseHandler( ( "site.license_key" ), 1 );
if ( $err_msg != "" )
{
// exit( $err_msg );
}
}
else
{
$license_key_path = APP.DS."tmp".DS."key.php";
if ( file_exists( $license_key_path ) )
{
require_once( $license_key_path );
$host = str_replace( );
$str = $CFG['app']['license_key'].$host.LICENSE_HASH;
$hash = md5( $str );
if ( $CFG['app']['license_verified'] != $hash )
{
exit( "Sorry invalid license" );
}
}
else
{
$license_key = ( "site.license_key" );
$license_obj = new IonoLicenseHandler( );
$license_obj->setErrorTexts( );
$err_msg = $license_obj->ionLicenseHandler( $license_key, 3 );
$host = $_SERVER['HTTP_HOST'];
if ( strcasecmp( "www.", substr( $_SERVER['HTTP_HOST'], 0, 4 ) ) == 0 )
{
$host = substr( $_SERVER['HTTP_HOST'], 4 );
}
$str = $license_key.$host.LICENSE_HASH;
$str = md5( $str );
$str = "<?php\n\$CFG['app']['license_key'] = '{$license_key}';\n\$CFG['app']['license_verified'] = '{$str}';\n?>";
$handle = fopen( $license_key_path, "x+" );
fwrite( $handle, $str );
fclose( $handle );
$email_content = "Hi,\n\t\t\t\t\n\tBurrow installed successfully in http://".$_SERVER['HTTP_HOST']."/ on ".date( "h:ia, d F, Y" ).".\n\tIP ADDRESS: ".$_SERVER['REMOTE_ADDR']."\n\tPackage Version: v1.0b13\n\tSVN Revision No: 9045\n\tLicense Key: ".$license_key."\n\nRegards,\nBurrow Dev Team";
// -------------->>>> mail( "burrow@ag***a.in", "Burrow installed successfully in http://".str_replace( "www.", "", $_SERVER['HTTP_HOST'] ), $email_content, "From: Burrow Dev Team <burrow@ag***a.in>" ); <-------------------- MAIL TO SOFTWARE HOUSE
}
else
{
exit( $err_msg );
}
}
}
}
?>
<?php
// file: /app/config/class_ionoLicenseHandler.php
///// FILE DECODED by ME (FOR TEST)
class IonoLicenseHandler
{
public $home_url_site = "http://customers.ag***a.com";
public $home_url_port = 80;
public $home_url_iono = "/sales/remote.php";
public $user_defined_string = "f258410f387e";
public $comm_terminate = true;
public $license_terminate = true;
public $product_license_id = 298;
public $product_id = 156;
public function setErrorTexts()
{
$this->error_text['disabled'] = "<p><strong>License Error:</strong> Your license is disabled. </p>";
$this->error_text['suspended'] = "<p><strong>License Error:</strong> Your license has been suspended. </p>";
$this->error_text['expired'] = "<p><strong>License Error:</strong> Your license has expired. </p>";
$this->error_text['exceeded'] = "<p><strong>License Error:</strong> You have reached the maximum number of installs allowed. </p>";
$this->error_text['invalid_user'] = "<p><strong>License Error:</strong> Invalid license key. </p>";
$this->error_text['invalid_code'] = "<p><strong>License Error:</strong> Invalid license status code. </p>";
$this->error_text['invalid_hash'] = "<p><strong>License Error:</strong> Invalid communication hash. </p>";
$this->error_text['wrong_product'] = "<p><strong>License Error:</strong> The license key you provided is not for this product. </p>";
$this->error_text['integrated_product_license_missing'] = "<p><strong>License Error in Integration:</strong> The license key for the integrated product is not provided.</p>";
$this->error_text['integrated_product_id_missing'] = "<p><strong>License Error in Integration:</strong> The product id given for integration is invalid. Upgrade your files.</p>";
}
public function ionLicenseHandler($license_key, $request_type)
{
if (!empty($this->product_id))
{
$key_parts = explode("-", $license_key);
if (!isset($key_parts[2]) || $key_parts[2] != $this->product_id)
{
return $this->error_text['wrong_product'];
}
}
if (!empty($this->product_license_id))
{
$key_parts = explode("-", $license_key);
$product_license_id = array(substr(md5($this->product_license_id), 0, 8));
if (!in_array($key_parts[4], $product_license_id))
{
return $this->error_text['wrong_product'];
}
}
$host = $_SERVER['HTTP_HOST'];
if (strcasecmp("www.", substr($_SERVER['HTTP_HOST'], 0, 4)) == 0)
{
$host = substr($_SERVER['HTTP_HOST'], 4);
}
$request = "remote=licensenew&type=".$request_type."&license_key=".urlencode(base64_encode($license_key));
$request .= "&host_ip=".urlencode(base64_encode($_SERVER['SERVER_ADDR']))."&host_name=".urlencode(base64_encode($host));
$request .= "&hash=".urlencode(base64_encode(md5($request)));
$request = $this->home_url_site.$this->home_url_iono."?".$request;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request);
curl_setopt($ch, CURLOPT_PORT, $this->home_url_port);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "iono (
http://www.o***e.co.uk/i**o)");
$content = curl_exec($ch);
curl_close($ch);
if (!$content)
{
return "Unable to communicate with Iono";
}
$content = explode("-", $content);
$status = $content[0];
$hash = $content[1];
if ($hash == md5($this->user_defined_string.$host))
{
switch ($status)
{
case 0 :
$err_msg = $this->error_text['disabled'];
unset($home_url_site);
unset($home_url_iono);
unset($user_defined_string);
unset($request);
unset($header);
unset($return);
unset($fpointer);
unset($content);
unset($status);
unset($hash);
break;
case 1 :
$err_msg = "";
break;
case 2 :
$err_msg = $this->error_text['suspended'];
unset($home_url_site);
unset($home_url_iono);
unset($user_defined_string);
unset($request);
unset($header);
unset($return);
unset($fpointer);
unset($content);
unset($status);
unset($hash);
break;
case 3 :
$err_msg = $this->error_text['expired'];
unset($home_url_site);
unset($home_url_iono);
unset($user_defined_string);
unset($request);
unset($header);
unset($return);
unset($fpointer);
unset($content);
unset($status);
unset($hash);
break;
case 4 :
$err_msg = $this->error_text['exceeded'];
unset($home_url_site);
unset($home_url_iono);
unset($user_defined_string);
unset($request);
unset($header);
unset($return);
unset($fpointer);
unset($content);
unset($status);
unset($hash);
break;
case 10 :
$err_msg = $this->error_text['invalid_user'];
unset($home_url_site);
unset($home_url_iono);
unset($user_defined_string);
unset($request);
unset($header);
unset($return);
unset($fpointer);
unset($content);
unset($status);
unset($hash);
break;
}
$err_msg = $this->error_text['invalid_code'];
unset($home_url_site);
unset($home_url_iono);
unset($user_defined_string);
unset($request);
unset($header);
unset($return);
unset($fpointer);
unset($content);
unset($status);
unset($hash);
break;
return $err_msg;
}
return $this->error_text['invalid_hash'];
}
}
?>