Example #1
0
    //using PHP's native support to verify the signature
    $result = openssl_verify($signed_data, $signature, $key, OPENSSL_ALGO_SHA1);
    if (0 === $result) {
        return false;
    } else {
        if (1 !== $result) {
            return false;
        } else {
            return true;
        }
    }
}
define('PUBLIC_KEY', 'MIHNMA0GCSqGSIb3DQEBAQUAA4G7ADCBtwKBrwD22i2MZCduwjQ2h+yo77c7hA0Wk+Q4PuHC4FVMkuVdUcEAw++OOKxnV2MkPDsfDZu1uui99ONo7dyni2g++MASG1kGIfkqMFSvWa2fdwRlaCCBzfN52UwCcZ0VBkn5cU6Ss1H61MC3ecvUQDcVcz1nimUqNUpgs0iwt1f5x7RsjMXwN11Co8ML4/OyHnK3SEjDxNM/W3zQJ8CIcV3LtEVso6LJt4cXpHiQmJ/vMhMCAwEAAQ==');
define('PACKAGE_NAME', 'com.raianraika.magic');
$devID = $_GET["did"];
$devID = CleanHackerTXT($devID);
$responseData = base64_decode($_GET['rsd']);
//$responseData='{"orderId": "Qda85m87jnSV8Pex", "purchaseToken": "Qda85m87jnSV8Pex", "developerPayload": "ajab rasmi shodeha", "packageName": "com.raianraika.magic", "purchaseState": 0, "purchaseTime": 1394041928813, "productId": "666"}';
$signature = base64_decode($_GET['sng']);
//$signature='NiNXZJqvtThtpumxo9VGf5oiEfR08360HZQbAhZkFWweb6InrSauV8RULTtOM  3mpFx1HodEssMTjno0Dc0UJ8N1CQwS94XHl4qQpx5IoLCDbSmhHd82QPYbMIe2dwUsSo19y6S4NU2tDgro BuADiRR24pgXzAvcZjTlByUpvJApe8hWCApiGVwrQpXpa0J87D0SCJUapWwSdC5FFLnOSPMQopAhWp/YbzqMZW';
if (verifySignatureTransaction($responseData, $signature, PUBLIC_KEY)) {
    $responseData = str_replace("{", "", $responseData);
    $responseData = str_replace("}", "", $responseData);
    $parts = explode(',', $responseData);
    for ($i = 0; $i < count($parts); $i++) {
        $data = explode(':', $parts[$i]);
        $temp = str_replace('"', "", $data[0]);
        $temp = trim($temp);
        if ($temp == "orderId") {
            $orderID = str_replace('"', "", $data[1]);
        }
Example #2
0
function att($is_admin = false)
{
    // send true
    session_start();
    require_once 'ConfigPro.php';
    require_once 'function.php';
    $DomainName = strtolower($Domain);
    $refsite = $_SERVER['HTTP_REFERER'];
    $ref1 = trim($refsite);
    //$ref1=strtolower($ref1);
    $ref1 = substr($ref1, 0, 38);
    $ref2 = preg_replace("/http:\\/\\//", "", $ref1);
    $ref3 = preg_replace("/www./", "", $ref2);
    $ref4 = explode("/", $ref3, 3);
    $ref5 = $ref4[0] . "/" . $ref4[1] . "/";
    $refsite = $ref5;
    $wmid = CleanHackerTXT($_SESSION['wmid']);
    $wmkey = CleanHackerTXT($_SESSION['wmkey']);
    $r3 = $_SERVER['SERVER_ADMIN'];
    $r3 = trim(strtolower($r3));
    if (!$wmid || !$wmkey) {
        session_destroy();
        header('Location: ' . "http://" . $refsite . "login.php?err=1");
        exit;
    } else {
        $tablename = "login";
        $link = mysql_connect($host, $user, $password);
        $query = "SELECT * FROM {$tablename} WHERE ((user='******') AND (pass='******'))";
        $result = sql($query);
        //mysql_db_query ($dbname,$query,$link) OR die(mysql_error());
        $mn = mysql_num_rows($result);
        if ($mn <= "0") {
            session_destroy();
            header('Location: ' . "http://" . $refsite . "login.php?err=2");
            exit;
        }
        if ($is_admin) {
            if (is_admin() == false) {
                session_destroy();
                exit;
            }
        }
        $_SESSION['UID'] = $result['id'];
    }
}