<div class='contents'> <h1>KeyRing</h1> <p>Store your sensitive informations securely.</p> <?php if ($this->set) { echo "<div style='margin-left: 20px;'>"; foreach (\H::getJSONData("keyrings") as $master => $null) { $name = getData("master_{$master}" . "_name"); echo $this->l("/view?id={$master}", $name, "class='button red'") . "<cl/>"; } echo "</div>"; } else { sme("No KeyRings", "You haven't created any keyrings"); } ?> <a href='<?php echo APP_URL; ?> /new-master' class='button green'>Create A New KeyRing</a> </div>
<h1>Tokens</h1> <p>Tokens are used while user forgets password or on 2 step verification.</p> <?php if ($this->set) { $this->load(); if (isset($_POST['clear_tokens'])) { $sql = \Lobby\App\fr_logsys\Fr\LS::$dbh->prepare("TRUNCATE TABLE `resetTokens`"); $sql->execute(); echo sme("Tokens Cleared", "All tokens were cleared from the table"); } $_GET['start'] = isset($_GET['start']) ? $_GET['start'] : 0; $sql = \Lobby\App\fr_logsys\Fr\LS::$dbh->prepare("SELECT * FROM `resetTokens` LIMIT :start, 10"); $sql->bindParam(":start", $_GET['start'], \PDO::PARAM_INT); $sql->execute(); if ($sql->rowCount() == 0) { echo sme("No Tokens", "There are currently no tokens stored in the table."); } else { echo "<table><thead><th width='30%'>User</th><th width='50%'>Token</th><th title='YYYY-MM-DD HH:MM:SS' width='20%'>Created</th></thead><tbody>"; while ($r = $sql->fetch()) { ?> <tr> <td title="User ID: <?php echo $r['uid']; ?> "><?php echo \Lobby\App\fr_logsys\Fr\LS::getUser("name", $r['uid']); ?> </td> <td><?php echo $r['token']; ?>
echo "<a class='button dialog' data-dialog='new_user.php'>New User</a>"; echo "<a class='button green dialog' data-dialog='new_col.php'>Add New Column</a>"; echo "<a class='button green dialog' data-dialog='export.php'>Export as SQL</a>"; if (isset($_POST['remove_user'])) { $sql = $this->dbh->prepare("DELETE FROM `" . $this->table . "` WHERE `id` = ?"); $sql->execute(array($_POST['remove_user'])); sss("Removed User", "The user with the ID '" . htmlspecialchars($_POST['remove_user']) . "' was deleted from the database"); } $_GET['start'] = isset($_GET['start']) ? $_GET['start'] : 0; $sql = $this->dbh->prepare("SELECT * FROM `" . $this->table . "` ORDER BY `id` LIMIT :start, 10"); $sql->bindValue(":start", (int) trim($_GET['start']), \PDO::PARAM_INT); $sql->execute(); $results = $sql->fetchAll(\PDO::FETCH_ASSOC); $usersCount = $sql->rowCount(); if ($usersCount == 0) { echo sme("No Users", "There are currently no users stored in the table."); } else { echo "<table><thead>"; echo "<th width='15%'>Actions</th>"; $description = array("User ID" => "uid: The user's unique ID", "username" => "username: Username of user", "created" => "created: The date when the user created her/his account", "attempt" => "attempt: The number of times the user have attempted logins or the time for which the user was blocked from loggging in."); $sql = $this->dbh->query("DESCRIBE `" . $this->table . "`"); foreach ($sql->fetchAll() as $null => $column) { $column_name = $column['Field']; if ($column_name != "password" && $column_name != "password_salt") { $column_name = $column_name == "id" ? "User ID" : $column_name; echo "<th title='" . (isset($description[$column_name]) ? $description[$column_name] : $column_name) . "'>" . ucfirst($column_name) . "<a class='removeColumn' title='Delete Column' data-column='{$column_name}'></a></th>"; } } echo "</thead><tbody>"; foreach ($results as $r) { $id = $r['id'];
case "enable-fail": echo ser("Error", "The App couldn't be enabled. Try again.", false); break; } } else { if ($action !== null && CSRF::check()) { if ($action === "remove") { /** * Do not show app info during confirmation */ $showAppInfo = false; echo sme("Confirm", "<p>Are you sure you want to remove the app <b>{$appIDEscaped}</b> ? This cannot be undone.</p>" . Lobby::l("/admin/install-app.php?action=remove&app={$appID}" . CSRF::getParam(), "Yes, I'm sure", "class='btn red'") . Lobby::l("/admin/apps.php?app={$appID}" . CSRF::getParam(), "No, I'm not", "class='btn blue' id='cancel'")); } else { if ($action === "clear-data") { $showAppInfo = false; echo sme("Confirm", "<p>Are you sure you want to clear the data of app <b>{$appIDEscaped}</b> ? This cannot be undone.</p>" . Lobby::l("/admin/install-app.php?action=clear-data&app={$appID}" . CSRF::getParam(), "Yes, I'm sure", "class='btn red'") . Lobby::l("/admin/apps.php?app={$appID}" . CSRF::getParam(), "No, I'm not", "class='btn blue' id='cancel'")); } } } } if ($showAppInfo) { ?> <div class="row"> <div class="col m3" id="leftpane" style="text-align: center;"> <img src="<?php echo \Lobby::u("admin/image/clear.gif"); ?> " height="200" width="200" /> <script> $(window).load(function(){ var image = $("#leftpane img");