daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 120 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $valid_passwords = array(
  4.     "usuario" => "contraseña",
  5.     "usuario" => "contraseña",
  6.     "usuario" => "contraseña"
  7. );
  8.  
  9. $valid_users = array_keys($valid_passwords);
  10.  
  11. $user = $_SERVER['PHP_AUTH_USER'];
  12. $pass = $_SERVER['PHP_AUTH_PW'];
  13.  
  14. $validated = (in_array($user, $valid_users)) && ($pass == $valid_passwords[$user]);
  15.  
  16. if (!$validated) {
  17.   header('WWW-Authenticate: Basic realm="Autenticación requerida"');
  18.   header('HTTP/1.0 401 Unauthorized');
  19.   require("error/401.php");
  20.   exit;
  21. }
  22.  
  23. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top