Esempio n. 1
0
<?php

$notifications = Lobby\DB::getJSONOption("notify_items");
/**
 * If there is a update available either app or core, add a Notify item
 */
if (\Lobby\Update::isAvailable()) {
    $notifications["update"] = array("contents" => "New Updates Are Available", "icon" => "update", "iconURL" => null, "href" => \Lobby::u("/admin/update.php"));
}
echo json_encode($notifications);
Esempio n. 2
0
<?php

class logSysLobbyDB
{
    public function prepare($query)
    {
        $obj = \Lobby\DB::getDBH()->prepare($query);
        return $obj;
    }
}
require_once __DIR__ . "/class.logsys.php";
$salt = Lobby\DB::getOption("admin_secure_salt");
$cookie = Lobby\DB::getOption("admin_secure_cookie");
\Fr\LS::config(array("db" => array("table" => \Lobby\DB::getPrefix() . "users"), "features" => array("auto_init" => false, "start_session" => false, "email_login" => false), "keys" => array("cookie" => $cookie, "salt" => $salt)));
Esempio n. 3
0
 * Add the <head> files if it's not the install page
 */
if (!\Lobby::status("lobby.install")) {
    /**
     * Left Menu
     */
    \Lobby\UI\Panel::addTopItem("lobbyHome", array("text" => "Home", "href" => L_URL, "position" => "left"));
    $adminArray = array("text" => "Admin", "href" => "/admin", "position" => "left");
    $adminArray["subItems"] = array("app_manager" => array("text" => "Apps", "href" => "/admin/apps.php"), "lobby_store" => array("text" => "Lobby Store", "href" => "/admin/lobby-store.php"), "about" => array("text" => "Settings", "href" => "/admin/settings.php"));
    \Lobby\UI\Panel::addTopItem("lobbyAdmin", $adminArray);
    if (\Lobby\FS::exists("/upgrade.lobby")) {
        require_once L_DIR . "/includes/src/Update.php";
        $l_info = json_decode(\Lobby\FS::get("/lobby.json"));
        if ($lobby_version != $l_info->version) {
            Lobby\DB::saveOption("lobby_latest_version", $l_info->version);
            Lobby\DB::saveOption("lobby_latest_version_release", $l_info->released);
        }
        \Lobby\Update::finish_software_update();
    }
}
if (\Lobby::status("lobby.admin")) {
    /**
     * Add Admin Pages' stylesheet, script
     */
    \Assets::js("admin", "/admin/js/admin.js");
    /**
     * Add sidebar
     */
    Hooks::addAction("admin.body.begin", function () {
        require L_DIR . "/admin/inc/sidebar.php";
    });
Esempio n. 4
0
 function sendStatusToLobby($statusID, $status)
 {
     global $appID;
     Lobby\DB::saveJSONOption("lobby_app_downloads", array($appID => array("statusID" => $statusID, "status" => $status, "updated" => time())));
 }
Esempio n. 5
0
<?php

use Fr\Process;
$appID = \Request::postParam("id");
if (!CSRF::check()) {
    echo json_encode(array("statusID" => "error", "status" => "CSRF Token didn't match"));
} else {
    if ($appID === null) {
        echo json_encode(array("statusID" => "error", "status" => "Invalid App ID"));
    } else {
        /**
         * A queue of App downloads
         */
        $appInstallQueue = Lobby\DB::getJSONOption("lobby_app_downloads");
        /**
         * If the $appID is in the queue, then give the download status of it
         * If the updated value is less than 20 seconds ago, then restart the download
         */
        if (isset($appInstallQueue[$appID]) && $appInstallQueue[$appID]["updated"] > strtotime("-20 seconds")) {
            echo json_encode(array("statusID" => $appInstallQueue[$appID]["statusID"], "status" => $appInstallQueue[$appID]["status"]));
        } else {
            $appInfo = \Lobby\Server::store(array("get" => "app", "id" => $appID));
            /**
             * App doesn't exist on Lobby Store
             */
            if ($appInfo === "false") {
                echo json_encode(array("status" => "error", "error" => "App Doesn't Exist"));
            } else {
                $appName = $appInfo["name"];
                $Process = new Process(Process::getPHPExecutable(), array("arguments" => array(L_DIR . "/admin/ajax/install-app-bg.php", \Lobby::getLID(), base64_encode(serialize($_SERVER)), $appID)));
                /**
Esempio n. 6
0
            $rd_size = FS::normalizeSize($download_size);
            echo "<script>document.getElementById('downloadStatus').innerHTML = 'Downloaded {$percent}% of {$rd_size}';</script>";
        } else {
            $downloaded = FS::normalizeSize($downloaded);
            $GLOBALS['non_percent'] = 1;
            echo "<script>document.getElementById('downloadStatus').innerHTML = 'Downloaded {$downloaded}';</script>";
        }
        flush();
        if ($percent == 100 && !isset($GLOBALS['install-msg-printed'])) {
            echo "<p>Installing <b>{$GLOBALS['name']}</b>...</p>";
            $GLOBALS['install-msg-printed'] = 1;
            flush();
        }
    }
};
if ($type === "app" && \Lobby\Update::app($appID)) {
    $App = new Apps($appID);
    $App->enableApp();
    if ($isUpdate) {
        $appUpdates = Lobby\DB::getJSONOption("app_updates");
        if (isset($appUpdates[$appID])) {
            unset($appUpdates[$appID]);
        }
        Lobby\DB::saveOption("app_updates", json_encode($AppUpdates));
    }
    echo "Installed - The app has been " . ($isUpdate ? "updated." : "installed. <a target='_parent' href='" . $App->info["url"] . "'>Open App</a>");
} else {
    if ($type === "lobby" && ($redirect = \Lobby\Update::software())) {
        echo "<a target='_parent' href='{$redirect}'>Updated Lobby</a>";
    }
}
Esempio n. 7
0
</td>
            </tr>
            <tr>
              <td>Latest Version Release Date</td>
              <td><?php 
echo Lobby\DB::getOption("lobby_latest_version_release");
?>
</td>
            </tr>
          </tbody>
        </table>
        <cl/>
        <?php 
/**
 * Check if the current version is not the latest version
 */
if (\Lobby::$version < \Lobby\DB::getOption("lobby_latest_version")) {
    ?>
          <div clear></div>
          <a class="btn red" href="update.php">Update To Version <?php 
    echo Lobby\DB::getOption("lobby_latest_version");
    ?>
</a>
        <?php 
}
?>
      </div>
    </div>
  </body>
</html>