first commit
This commit is contained in:
50
jspm/index.php
Normal file
50
jspm/index.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
if( !function_exists('apache_request_headers') ) {
|
||||
|
||||
function apache_request_headers() {
|
||||
$arh = array();
|
||||
$rx_http = '/\AHTTP_/';
|
||||
foreach($_SERVER as $key => $val) {
|
||||
if( preg_match($rx_http, $key) ) {
|
||||
$arh_key = preg_replace($rx_http, '', $key);
|
||||
$rx_matches = array();
|
||||
// do some nasty string manipulations to restore the original letter case
|
||||
// this should work in most cases
|
||||
$rx_matches = explode('_', $arh_key);
|
||||
if( count($rx_matches) > 0 and strlen($arh_key) > 2 ) {
|
||||
foreach($rx_matches as $ak_key => $ak_val) $rx_matches[$ak_key] = ucfirst($ak_val);
|
||||
$arh_key = implode('-', $rx_matches);
|
||||
}
|
||||
$arh[$arh_key] = $val;
|
||||
}
|
||||
}
|
||||
return( $arh );
|
||||
}
|
||||
}
|
||||
|
||||
//SET THE LICENSE INFO
|
||||
$license_owner = '';
|
||||
$license_key = '';
|
||||
|
||||
//DO NOT MODIFY THE FOLLOWING CODE
|
||||
$resp = '';
|
||||
$reqTimeStamp = '';
|
||||
$headers = apache_request_headers();
|
||||
foreach ($headers as $header => $value) {
|
||||
if ($header == 'Timestamp'){
|
||||
$reqTimeStamp = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($reqTimeStamp)) {
|
||||
$license_hash = hash('sha256', $license_key . $reqTimeStamp, false);
|
||||
$resp = $license_owner . '|' . $license_hash;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
ob_clean();
|
||||
header('Content-type: text/plain');
|
||||
echo $resp;
|
||||
ob_end_flush();
|
||||
exit();
|
||||
Reference in New Issue
Block a user