Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!isset($_SERVER['PHP_AUTH_USER'])) {
- $realm = "Shopware4 REST-API";
- header('Www-Authenticate: Digest realm="'.$realm.'", domain="/", nonce="'.uniqid().'", opaque="'.md5($realm).'", algorithm="MD5", qop="auth"');
- header('HTTP/1.0 401 Unauthorized');
- echo 'Text, der gesendet wird, falls der Benutzer auf Abbrechen drückt';
- exit;
- } else {
- echo "<p>Hallo {$_SERVER['PHP_AUTH_USER']}.</p>";
- echo "<p>Sie gaben {$_SERVER['PHP_AUTH_PW']} als Passwort ein.</p>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement