Beispiel #1
0
     } else {
         \Lobby::redirect("/#");
     }
 } elseif ($_GET['step'] == 2 && H::csrf()) {
     /**
      * We call it again, so that the user had already went through the First Step
      */
     if (\Lobby\Install::step1() === false) {
         // The stuff mentioned in step 1 hasn't been done
     } elseif (isset($_POST['submit'])) {
         $dbhost = \H::input('dbhost', "POST");
         $dbport = \H::input('dbport', "POST");
         $dbname = \H::input('dbname', "POST");
         $username = \H::input('dbusername', "POST");
         $password = \H::input('dbpassword', "POST");
         $prefix = \H::input('prefix', "POST");
         /**
          * We give the database config to the Install Class
          */
         \Lobby\Install::dbConfig(array("host" => $dbhost, "port" => $dbport, "dbname" => $dbname, "username" => $username, "password" => $password, "prefix" => $prefix));
         /**
          * First, check if prefix is valid
          * Check if connection to database can be established using the credentials given by the user
          */
         if ($prefix == "" || preg_match("/[^0-9,a-z,A-Z,\$,_]+/i", $prefix) != 0 || strlen($prefix) > 50) {
             ser("Error", "A Prefix should only contain basic Latin letters, digits 0-9, dollar, underscore and shouldn't exceed 50 characters. <a href='install.php?step=2'>Try Again</a>");
         } elseif (\Lobby\Install::checkDatabaseConnection() !== false) {
             /**
              * Make the Config File
              */
             \Lobby\Install::makeConfigFile();
Beispiel #2
0
    $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 
    echo L_URL . "/admin/download.php?type=app&id={$id}" . H::csrf("g");
    ?>
" style="border: 0;width: 100%;height: 200px;"></iframe>
        <?php 
}
?>
      </div>
    <div>
  </body>
</html>
Beispiel #3
0
<?php

require_once __DIR__ . "/../load.php";
require_once L_DIR . "/includes/src/Update.php";
header("Content-type: text/html");
header('Cache-Control: no-cache');
$id = H::input("id");
$type = H::input("type");
// Turn off output buffering
ini_set('output_buffering', 'off');
// Turn off PHP output compression
ini_set('zlib.output_compression', false);
//Flush (send) the output buffer and turn off output buffering
//ob_end_flush();
while (@ob_end_flush()) {
}
// Implicitly flush the buffer(s)
ini_set('implicit_flush', true);
ob_implicit_flush(true);
if ($id == null || H::csrf() == false) {
    exit;
}
if ($type == "app") {
    $app = \Lobby\Server::Store(array("get" => "app", "id" => $id));
    if ($app == "false") {
        echo "Error - App '<b>{$id}</b>' does not exist in Lobby.";
        exit;
    }
    $name = $app['name'];
} else {
    $name = "Lobby {$id}";
Beispiel #4
0
<?php

$q = H::input("question_id");
$answer = H::input("answer");
if ($q != null && $answer != null) {
    $questions = json_decode($this->get("/src/Data/questions.json"), true);
    list($q_parent, $q_child) = explode("-", $q);
    if (isset($questions[$q_parent][$q_child])) {
        $item = $questions[$q_parent][$q_child];
        $hashed_answer = hash("md5", $answer);
        if ($hashed_answer == strtolower($item['answer'])) {
            $_SESSION['app-millionaire-level'] = $q_parent;
            echo "correct";
        } else {
            foreach ($item['options'] as $option) {
                if (hash("md5", $option) == $item['answer']) {
                    $right_answer = $option;
                }
            }
            echo json_encode(array("money" => $this->money(), "correct" => $right_answer));
        }
    }
}
Beispiel #5
0
        echo '<td><span style="vertical-align:middle;display:inline-block;margin-left:5px;">' . $AppInfo['name'] . '</span></td>';
        echo '<td>' . $AppInfo['version'] . '</td>';
        echo '<td>' . $latest_version . '</td>';
        echo '</tr>';
    }
    ?>
            </tbody></table>
            <input type="hidden" name="action" value="updateApps" />
            <button class="red" style='padding: 10px 15px;' clear>Update Selected Apps</button>
          </form>
        <?php 
}
if (getOption("lobby_version") == getOption("lobby_latest_version") && !\H::input("action", "POST") == "updateApps") {
    echo "<h2>Lobby</h2>";
    sss("Latest Version", "You are using the latest version of Lobby. There are no new releases yet.");
} elseif (!isset($_GET['step']) && !\H::input("action", "POST") == "updateApps") {
    ?>
          <h2>Lobby</h2>
          <p>
            Welcome To The Lobby Update Page. A latest version is available for you to upgrade.
          </p>
          <blockquote>
            Latest Version is <?php 
    echo getOption("lobby_latest_version");
    ?>
            released on <?php 
    echo date("jS F Y", strtotime(getOption("lobby_latest_version_release")));
    ?>
          </blockquote>
          <p style="margin-bottom: 10px;">
            Lobby will automatically download the latest version and install. In case something happens, Lobby will not be accessible anymore. So backup your database and Lobby installation before you do anything.
Beispiel #6
0
<?php

$network = \H::input("network");
$this->addScript("connect.js");
if (isset($this->available_networks[$network])) {
    $Network = ucfirst($network);
    ?>
  <div class='contents'>
    <h1>Connect <?php 
    echo $Network;
    ?>
</h1>
    <p>Please enter your <?php 
    echo ucfirst($network);
    ?>
 account's username and password.</p>
    <form id='login_form' data-network="<?php 
    echo $network;
    ?>
">
      <input type='text' name='username' placeholder='Email/Phone Number' />
      <input type='password' name='password' placeholder='Password' />
      <input type='submit' value='Log In To <?php 
    echo $Network;
    ?>
' />
    </form>
    <div id='login_status' clear></div>
  </div>
  <style>
    .contents input{
Beispiel #7
0
<?php

$q = H::input("question_id");
if ($q != null) {
    $questions = json_decode($this->get("/src/Data/questions.json"), true);
    list($q_parent, $q_child) = explode("-", $q);
    if (isset($questions[$q_parent][$q_child])) {
        $item = $questions[$q_parent][$q_child];
        $wrong = array();
        shuffle($item['options']);
        foreach ($item['options'] as $option) {
            if (hash("md5", $option) != $item['answer'] && count($wrong) != 2) {
                $wrong[] = $option;
            }
        }
        echo json_encode($wrong);
    }
}