Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.13 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <?php session_start();  ?>
  3. <html><head><meta http-equiv="Content-Type" charset=UTF-8">
  4.     <title>Loxone Smart Home</title>
  5.  
  6.    
  7.     <meta name="viewport" content="user-scalable=0, width=device-width, initial-scale=1.0, maximum-scale=1.0">
  8.    
  9.  
  10.  
  11.    
  12.     <link rel="icon" type="image/png" href="icon.png" />
  13.     <link rel="stylesheet" href="css/misc.css">
  14.  
  15.  
  16.     <link id="pre-load-login-css" rel="stylesheet" href="css/loader.css">
  17.  
  18. </head>
  19.  
  20. <body class="light-mode">
  21.  
  22.  
  23.  
  24.  
  25. <div class="login-container">
  26.     <div class="login-container__login-bg">
  27.     </div>
  28.     <div class="login-container__logo-container">
  29.        
  30.    
  31.      
  32.     </div>
  33.     <div class="login-container__login-window">
  34.         <div class="login-window__icon-container">
  35.             <img class="icon-container__img" src="icon.png">
  36.         </div>
  37.        
  38.        
  39.    
  40.        
  41.        
  42.         <form class="login-window__login-form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  43.         <div class="login-form__title">Loxone webové rozhranie</div>
  44.         <br>
  45.         <input id="username" name="username" placeholder="Užívateľské meno" type="text" class="login-form__username" autocorrect="off" autocapitalize="off" spellcheck="false" required>
  46.         <input id="password" name="password" placeholder="Heslo" type="password" class="login-form__password" required>
  47.        
  48.        
  49.         <br>
  50.         <button type="submit" name="odoslat" class="login-form__connect-button">PRIHLÁSIŤ</button>
  51.        
  52.         </form>
  53.            <?php  if(isset($_POST['odoslat'])){  
  54.     $username = $_POST['username'];
  55.     $username = trim( $username );
  56.     $username = htmlspecialchars( $username, ENT_QUOTES );
  57.     $password = $_POST['password'];
  58.     $password = trim( $password );
  59.     $password = htmlspecialchars( $password, ENT_QUOTES );  
  60.     if($username=="celi" && $password=="celi"){
  61.    
  62.     $_SESSION['id'] = 1;  
  63.              
  64.     header("Location: system");
  65.     }else{
  66.    echo "Údaje nie sú správne! Váš pokus bol uložený do logu!";
  67.    $ip = "";
  68.  
  69. if (!empty($_SERVER["HTTP_CLIENT_IP"]))
  70. {
  71.  //check for ip from share internet
  72.  $ip = $_SERVER["HTTP_CLIENT_IP"];
  73. }
  74. elseif (!empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
  75. {
  76.  // Check for the Proxy User                    
  77.  $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
  78. }
  79. else
  80. {
  81.  $ip = $_SERVER["REMOTE_ADDR"];
  82. }
  83. $t = file_get_contents("logy/neuspesneprihlasenia.txt");
  84.       $today = date("Y-m-d H:i:s");
  85.      
  86.        $t .= $today." Pouzivatel z ip ".$ip." sa neprihlasil, zadal zle prihlasovacie informacie, meno: ".$username." a heslo: ".$password."\r\n";
  87.       file_put_contents("logy/neuspesneprihlasenia.txt",$t);
  88.     }
  89.      
  90.  
  91.      
  92.        
  93.      
  94.       }      
  95.            ?>
  96.  
  97.         <div class="login-window__loader-container hidden">
  98.             <div class="loader-container__spinner"></div>
  99.             <div class="loader-container__text-container">
  100.                 <div class="text-container__title"></div>
  101.                 <div class="text-container__subtitle"></div>
  102.             </div>
  103.         </div>
  104.     </div>
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement