コード例 #1
0
ファイル: pay.php プロジェクト: Rastrian/Donationraptor
<?php

require "init.php";
import("models.database");
import("models.settings");
import("models.products");
import("lib.postget");
import("lib.external.minecraft");
# Check if required vars exist
if (!postget::has("get", "gateway", "products", "player")) {
    echo "Bad request";
    exit;
}
# Check if the gateway exists
$gateway = $_GET["gateway"];
if (!import("gateways", $gateway)) {
    echo "Non-existing gateway D:";
    exit;
}
# If it does, create a class of it
$class = ucfirst($gateway) . "Gateway";
$gw = new $class();
# Get the products
$product_ids = explode(",", $_GET["products"]);
$products = new Products($product_ids);
# Calculate the total price and make a csv
$price = $products->price();
$csv = $products->CSV();
$player = $_GET["player"];
# Verify the username is a payed minecraft user
if (!Minecraft::verifyUsername($player)) {
コード例 #2
0
ファイル: index.php プロジェクト: Rastrian/Donationraptor
import("models.admin");
import("lib.postget");
# Load the settings
$settings = Settings::get();
#===================================
# Create a new admin, which will
# either check the users post details
# against the database or check
# the users session details
#===================================
# Checks if required variables are present.
if (!postget::has("post", "email", "password")) {
    die("Username and password required");
}
# Gets optional vairables, and uses the default if not present
$additional = postget::get($_POST, array("remember" => false, "ipchange" => false));
$admin = new admin($_POST['email'], $_POST['password'], $additional['remember'], $additional['ipchange']);
?>
<!DOCTYPE HTML>
<html>
	<head>
		<!-- Echo title from the database -->
		<title><?php 
echo $settings['storetitle'];
?>
 | Admin Panel</title>
		
		<!-- Import Bootstrap -->
		<?php 
HTMLA::css("../static/css/bootstrap.min.css");
?>
コード例 #3
0
ファイル: style.php プロジェクト: Rastrian/Donationraptor
<?php

require "init.php";
import("lib.less");
import("lib.postget");
header("Content-type: text/css");
header("X-Content-Type-Options: nosniff");
if (!postget::has("get", "template", "name")) {
    header("Status: 404 Not Found");
    die("/* I need a template and a name! */");
}
$template = $_GET["template"];
$name = $_GET["name"];
function loadcssfile($file, $cacheFile)
{
    // load the cache
    if (file_exists($cacheFile)) {
        $cache = unserialize(file_get_contents($cacheFile));
    } else {
        $cache = $file;
    }
    $less = new lessc();
    $less->setFormatter("compressed");
    $less->setImportDir(array(__ROOT__ . DS . ".." . DS . "style" . DS . "less"));
    $newCache = $less->cachedCompile($cache);
    if (!is_array($cache) || $newCache["updated"] > $cache["updated"]) {
        @file_put_contents($cacheFile, serialize($newCache));
    }
    return $newCache['compiled'];
}
$lesswrapper = function ($template, $name) {