diff options
author | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
commit | 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch) | |
tree | 75be5fba4368472fb11c8015aee026b2b9a71888 /pages/thinkpad.inc | |
parent | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff) | |
download | pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2 pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip |
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'pages/thinkpad.inc')
-rw-r--r-- | pages/thinkpad.inc | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/pages/thinkpad.inc b/pages/thinkpad.inc deleted file mode 100644 index af1bcfa..0000000 --- a/pages/thinkpad.inc +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -// 2:20 - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; - -$password = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["thinkpad"]["password"]; -$mac = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["thinkpad"]["mac"]; -$error = ""; -$success = ""; - -if (isset($_POST["submit"]) && isset($_POST["pwd"])) { - if (password_verify($_POST["pwd"], $password)) { - $out = []; - exec("bash -c '/usr/sbin/ether-wake " . $mac . "'", $out); - - if (count($out) === 0) { - $success = "Successfully turned laptop on, please wait 5 minutes before connecting to it, and don't forget to turn it back off afterwards you dork"; - } else { - $error = "Failed to initiate Wake on LAN message: " . implode(", ", $out); - } - } else { - $error = "Invalid password, I am going to burn down your house if you're trying to touch my laptop"; - } -} - -?> - -<br> -<div class="container"> - <div id="page-content"> - <h2>ThinkPad</h2> - - <?php if (trim($error) !== ""): ?> - <div class="alert alert-danger"><b>Error:</b> <?= $error ?></div> - <?php endif; ?> - <?php if (trim($success) !== ""): ?> - <div class="alert alert-success"><b>Success:</b> <?= $success ?></div> - <?php endif; ?> - - <form method="post"> - <input type="hidden" name="submit" action="/-/thinkpad"> - <p><input type="password" name="pwd" class="form-control" placeholder="Password" style="filter: invert(1) hue-rotate(180deg);"></p> - <button class="btn btn-primary">Flip the switch!</button> - </form> - </div> -</div> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> |