ConnorLinfoot

Web App Installer V2.1 Password security

Mar 21st, 2014
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. <?php
  2. /*
  3. Auto Web Application Download/Install Script!
  4.  
  5. Version 2.1
  6. Copyright 2014 All Rights Reserved Enkel Hosting Ltd
  7.  
  8. More PHP Scrips at http://devbox.enkelhosting.com
  9.  
  10. */
  11.  
  12. //      Options
  13. $security = 'none'; //Security method
  14.  
  15. /*
  16.  
  17. Security Modes:
  18.  
  19. ip: Use a whitelist IP and only allow access to someone on that IP
  20. password: User will be asked to enter the password chosen
  21. none: No security will be used
  22.  
  23. */
  24.  
  25.  
  26. //      IP Whitelist Options
  27. $ip = '000.000.000.000'; //Remote IP
  28.  
  29.  
  30. //      Password Options
  31. $password = 'Password123';
  32.  
  33. $debug = false;
  34.  
  35. if( $security == 'ip' ){
  36.     if( $ip != $_SERVER['REMOTE_ADDR'] ){
  37.         echo 'Your IP is not whitelisted!';
  38.         exit;
  39.     }
  40. } else if( $security == 'password' && !isset($_GET['password'] ) ){
  41.     echo 'Please type the password!';
  42.     echo '<form>';
  43.     echo '<input type="password" name="password">';
  44.     echo '<input type="submit" value="Login">';
  45.     echo '</form>';
  46.     exit;
  47. } else if( $security == 'password' && isset($_GET['password'] ) ){
  48.     if( $password != $_GET['password'] ){
  49.         echo 'Incorrect Password';
  50.         exit;
  51.     }
  52. } else if( $security == 'none' ){
  53.    
  54. } else {
  55.     echo 'Invalid Security Mode';
  56.     exit;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment