jkhsjdhjs

index.php | WakeOnLAN

May 21st, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.20 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <?php
  3.     require_once("config.php");
  4.     require_once("functions.php");
  5.     include_once __DIR__.'/../analyticstracking.php';
  6.     $wake_up_pc = isset($_POST["wake_up_pc"]) ? $_POST["wake_up_pc"] : "";
  7.     $password = isset($_POST["password"]) ? $_POST["password"] : "opoqpeoiqw897419872jkasdhj213";
  8.     $ip = "";
  9.     $isrunning = false;
  10. ?>
  11. <html>
  12.     <head>
  13.         <meta http-equiv="content-type" content="text/html; charset=<?php echo "$website_charset"; ?>">
  14.         <title>
  15.             <?php
  16.                 echo "$website_title";
  17.             ?>
  18.         </title>
  19.     </head>
  20.     <body>
  21.         Welcher Rechner soll gestartet werden?
  22.         <br>
  23.         <form method="POST" action="index.php">
  24.             <input type="radio" name="wake_up_pc" value="Benziuminator"> Benziuminator<br>
  25.             Passwort:
  26.             <input type="password" name="password"><br>
  27.             <input type="submit" name="submit" value="Starten!">
  28.         </form>
  29.         <br>
  30.         Meldungen:
  31.         <div id="refresh" style = "border:1px solid black; width:700px; height:120px">
  32.         <?php
  33.             if ($password == $passwordcheck) {
  34.                 echo timestamp();
  35.                 echo " <font color=\"lime\">Passwort korrekt!</font>";
  36.                 if ($wake_up_pc == "Benziuminator") {
  37.                     $ip = $Benziuminator_ip;
  38.                     if (ping($ip) == true) {
  39.                         echo "<br>" . timestamp();
  40.                         echo " Rechner läuft bereits!";
  41.                         $isrunning = true;
  42.                     }
  43.                     else {
  44.                         WakeOnLAN($Benziuminator_mac, $broadcast);
  45.                     }
  46.                 }
  47.                 else {
  48.                     echo "<br>" . timestamp();
  49.                     echo " <font color=\"red\">Bitte wählen Sie einen Rechner aus!</font>";
  50.                 }
  51.             }
  52.             else if ($password == "opoqpeoiqw897419872jkasdhj213") {
  53.             }
  54.             else {
  55.                 echo timestamp();
  56.                 echo " <font color=\"red\">Passwort inkorrekt!</font>";
  57.             }
  58.             if ($ip != "" && $isrunning == false) {
  59.                 echo "<br>" . timestamp();
  60.                 echo " Warten auf Antwort des Rechners...";
  61.                 for ($i = 0; $i <= 120; $i++) {
  62.                     if (ping($ip) == true) {
  63.                         echo "<br>" . timestamp();
  64.                         echo " <font color=\"lime\">Rechner wurde erfolgreich gestartet!</font>";
  65.                         break;
  66.                     }
  67.                     else {
  68.                         sleep(1);
  69.                         if ($i == 120) {
  70.                             echo "<br>" . timestamp();
  71.                             echo " <font color=\"red\">Rechner konnte nicht gestartet werden!</font>";
  72.                         }
  73.                     }
  74.                 }
  75.             }
  76.         ?>
  77.         </div>
  78.     </body>
  79. </html>
Advertisement
Add Comment
Please, Sign In to add comment