public function MasterAdd($id, $name, $description, $password) { $random_salt = \Lobby::randStr(15); $hashed = hash("sha512", $this->master_salt . $password . $random_salt); if (!$this->MasterExists($id)) { saveData("master_" . $id . "_name", $name); saveData("master_" . $id . "_description", $description); saveData("master_" . $id . "_password", $hashed); saveData("master_" . $id . "_password_salt", $random_salt); saveData("master_" . $id . "_items", ''); \H::saveJSONData("keyrings", array($id => 1)); return true; } else { return false; } }
<?php $this->addScript("new-site.js"); $this->addStyle("site-settings.css"); $this->setTitle("{$name} - Settings"); echo $this->inc("/src/inc/partial/site.sidebar.php", array("su" => $su)); ?> <div class="contents"> <h2>Settings</h2> <?php if (isset($_POST['delete_site']) && \H::csrf()) { \H::saveJSONData("sites", array($name => false)); $this->redirect("?status=site-deleted"); } else { if (isset($_POST['submit'])) { $output = $_POST['output']; $tagline = $_POST['tagline']; $theme = isset($_POST['theme']) ? $_POST['theme'] : ""; if ($output != "" && $theme != "") { if (!file_exists($output) || !is_writable($output)) { \Lobby::ser("Output Path problem", "The path you gave as output doesn't exist or permission is not acceptable. Make sure it's an existing directory with Read & Write permission", false); } else { if (array_search($theme, $this->themes) === false) { \Lobby::ser("Invalid Theme", "The theme you selected doesn't exist", false); } else { // Everything's great $this->addSite($name, $tagline, $output, $theme, isset($_POST['empty']) ? 1 : 0, isset($_POST['titleTag']) ? 1 : 0); /* Generate the site */ $gSite = new \Lobby\App\sige\Site($this->getSite($name), $this); $gSite->generate($this->getPages($name)); \Lobby::sss("Site updated", "The site was updated and generated successfully");
<?php if (isset($_POST['network']) && isset($_POST['id']) && isset($this->available_networks[$_POST['network']])) { H::saveJSONData("accounts", array($_POST['network'] => array($_POST['id'] => array(false)))); var_dump(H::getJSONData("accounts")); }