本文整理汇总了PHP中adminGateKeeper函数的典型用法代码示例。如果您正苦于以下问题:PHP adminGateKeeper函数的具体用法?PHP adminGateKeeper怎么用?PHP adminGateKeeper使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了adminGateKeeper函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
adminGateKeeper();
$title = "Create a Custom Page";
$body = drawForm(array("name" => "create_custom_page", "method" => "post", "action" => "CreateCustomPage"));
$this->html = drawpage($title, $body);
}
示例2: __construct
function __construct()
{
adminGateKeeper();
$guid = pageArray(2);
$product = getEntity($guid);
\Stripe\Stripe::setApiKey(EcommercePlugin::secretKey());
if ($product->interval != "one_time") {
try {
$plan = \Stripe\Plan::retrieve($guid);
$plan->delete();
} catch (Exception $e) {
forward();
}
} else {
if ($product->stripe_sku) {
$sku = \Stripe\SKU::retrieve($product->stripe_sku);
$sku->delete();
}
if ($product->stripe_product_id) {
$stripe_product = \Stripe\Product::retrieve($product->stripe_product_id);
$stripe_product->delete();
}
}
$product->delete();
new SystemMessage("Your product has been deleted.");
forward("store");
}
示例3: view
/**
* Clears cache
*/
public function view()
{
adminGateKeeper();
Cache::clear();
new SystemMessage("All caches have been cleared.");
forward();
}
示例4: __construct
public function __construct()
{
if (!pageArray(2)) {
forward("admin/plugins");
}
$guid = pageArray(2);
adminGateKeeper();
$plugin = getEntity($guid);
classGateKeeper($plugin, "Plugin");
$plugin->status = "disabled";
$plugin->save();
Cache::clear();
Cache::clear();
Admintab::deleteAll();
Setting::updateSettingsTable();
clearCache();
Cache::clear();
Systemvariable::set("setup_complete", false);
$translations = getEntities(array("type" => "Translationentity"));
if ($translations) {
foreach ($translations as $translation) {
$translation->delete();
}
}
new SystemMessage("Your plugin has been disabled.");
forward("admin/plugins");
}
示例5: __construct
function __construct()
{
adminGateKeeper();
$ip = pageArray(2);
if ($ip) {
new BlacklistIp($ip);
$params = array("type" => "User", "metadata_name_value_pairs" => array(array("name" => "ip1", "value" => $ip), array("name" => "ip2", "value" => $ip)), "metadata_name_value_pairs_operand" => "OR");
$users = getEntities($params);
$tables = Dbase::getAllTables(false);
foreach ($users as $user) {
new BlacklistEmail($user->email);
$guid = $user->guid;
foreach ($tables as $table) {
$entities = getEntities(array("type" => $table, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => $guid), array("name" => "container_guid", "value" => $guid)), "metadata_name_value_pairs_operand" => "OR"));
if ($entities) {
foreach ($entities as $entity) {
$entity->delete();
}
}
}
$user->delete();
}
new SystemMessage("Ip {$ip} has been banned, and all users using it have been deleted.");
forward("home");
}
}
示例6: __construct
public function __construct()
{
$guid = pageArray(2);
adminGateKeeper();
$plugin = getEntity($guid);
Setting::updateSettingsTable();
clearCache();
Cache::clear();
Cache::clear();
if ($plugin->enable()) {
new SystemMessage("Plugin Enabled");
new Cache("enabled_plugins_", false, "site");
new Cache("enabled_plugins_reversed", false, "site");
Systemvariable::set("setup_complete", false);
forward("admin/plugins");
}
Setting::updateSettingsTable();
clearCache();
Cache::clear();
Cache::clear();
Admintab::deleteAll();
$translations = getEntities(array("type" => "Translationentity"));
if ($translations) {
foreach ($translations as $translation) {
$translation->delete();
}
}
new SystemMessage("Your plugin can't be enabled. Check requirements");
forward("admin/plugins");
}
示例7: __construct
function __construct()
{
adminGateKeeper();
$guid = getInput("guid");
$title = getInput("title");
$description = getInput('description');
$price = getInput("price");
$hidden = getInput("hidden") == 0 ? false : true;
$product = getEntity($guid);
$product->title = $title;
$product->description = $description;
$product->price = $price;
$product->hidden = $hidden;
$product->save();
$product->createAvatar();
if (isset($_FILES["download"]) && $_FILES["download"]["name"]) {
$file = new File();
$file->access_id = "product";
$file->container_guid = $product->guid;
$guid = $file->save();
uploadFile("download", $guid, array("zip"));
$product->download = $guid;
}
new SystemMessage("Your product has been updated.");
forward("store");
}
示例8: __construct
public function __construct()
{
adminGateKeeper();
Admintab::deleteAll();
Cache::clear();
Cache::clear();
$plugins = Plugin::getAll();
if ($plugins) {
foreach ($plugins as $plugin) {
$plugin->enable();
}
Cache::clear();
Cache::clear();
Cache::clear();
new SystemMessage("All possible plugins have been enabled.");
}
Systemvariable::set("setup_complete", false);
$translations = getEntities(array("type" => "Translationentity"));
if ($translations) {
foreach ($translations as $translation) {
$translation->delete();
}
}
forward("admin/plugins");
}
示例9: __construct
function __construct()
{
adminGateKeeper();
$home_page = getInput("home_page");
Setting::set("home_page", $home_page);
new SystemMessage("Your home page has been updated.");
forward();
}
示例10: __construct
public function __construct()
{
adminGateKeeper();
$google_analytics = getInput("google_analytics");
Setting::set("google_analytics", $google_analytics);
new SystemMessage("Your code has been updated.");
forward();
}
示例11: __construct
public function __construct()
{
adminGateKeeper();
$add_this = getInput("add_this");
Setting::set("add_this", $add_this);
new SystemMessage("Your Addthis Code has been updated");
forward();
}
示例12: __construct
function __construct()
{
adminGateKeeper();
$guid = pageArray(2);
$page = getEntity($guid);
$page->delete();
new SystemMessage("Your page has been deleted.");
forward("admin/custom_pages");
}
示例13: __construct
public function __construct()
{
adminGateKeeper();
Cache::clear();
Cache::clear();
Cache::clear();
new SystemMessage(translate("system:cache:cleaned:success:system:message"));
forward();
}
示例14: __construct
function __construct()
{
adminGateKeeper();
$guid = pageArray(2);
$report = getEntity($guid);
$report->closed = true;
$report->save();
forward("admin/reported_content");
}
示例15: __construct
public function __construct()
{
adminGateKeeper();
$guid = pageArray(2);
$activity = getEntity($guid);
$activity->delete();
new SystemMessage("Your activity has been deleted.");
forward();
}