コード例 #1
0
ファイル: install-app.php プロジェクト: saviobosco/lobby
  <body>
    <?php 
\Lobby::doHook("admin.body.begin");
?>
    <div class="workspace">
      <div class="contents">
        <?php 
if (H::input("id") == null) {
    ser("Error", "No App is mentioned. Install Apps from <a href='lobby-store.php'>Lobby Store</a>");
}
if (H::input("action") == "enable" && H::csrf()) {
    $App = new \Lobby\Apps($_GET['id']);
    if (!$App->exists) {
        ser("Error", "App is not installed");
    }
    $App->enableApp();
    sss("Enabled", "The App <b>{$_GET['id']}</b> is enabled. The author says thanks.<a href='" . $App->info['URL'] . "' class='button green'>Open App</a>");
}
if (H::input("action") == "remove" && H::csrf()) {
    $App = new \Lobby\Apps($_GET['id']);
    if (!$App->exists) {
        ser("Error", "App is not installed");
    }
    $App->removeApp();
    sss("Removed", "The App <b>{$_GET['id']}</b> was successfully removed.");
}
$id = H::input("id");
if ($id != null && H::input("action") == null && H::csrf()) {
    ?>
          <h1>Install App</h1>
          <iframe src="<?php 
コード例 #2
0
ファイル: apps.php プロジェクト: saviobosco/lobby
            ?>
</b> ?</p>
            <div clear></div>
            <a class="button green" href="<?php 
            echo L_URL . "/admin/install-app.php?action=remove&id={$app}&" . H::csrf("g");
            ?>
">Yes, I'm Sure</a>
            <a class="button red" href="<?php 
            echo L_URL . "/admin/apps.php";
            ?>
">No, I'm Not</a>
        <?php 
            exit;
        } else {
            if ($action == "enable") {
                if ($App->enableApp()) {
                    sss("Enabled", "App has been enabled.");
                } else {
                    ser("Error", "The App couldn't be enabled. Try again.", false);
                }
            }
        }
    }
}
$Apps = \Lobby\Apps::getApps();
if (count($Apps) == 0) {
    ser("No Enabled Apps", "Lobby didn't find any apps that has been enabled", false);
}
if (count($Apps) != 0) {
    ?>
          <table style="width: 100%;margin-top:5px">