Patched to Drupal 8.4.8 level. See https://www.drupal.org/sa-core-2018-004 and patch...
[yaffs-website] / vendor / behat / mink-browserkit-driver / tests / web-fixtures / basic_auth.php
1 <?php
2 $SERVER = $app['request']->server->all();
3
4 $username = isset($SERVER['PHP_AUTH_USER']) ? $SERVER['PHP_AUTH_USER'] : false;
5 $password = isset($SERVER['PHP_AUTH_PW']) ? $SERVER['PHP_AUTH_PW'] : false;
6
7 if ($username == 'mink-user' && $password == 'mink-password') {
8     echo 'is authenticated';
9 } else {
10     $resp = new \Symfony\Component\HttpFoundation\Response();
11     $resp->setStatusCode(401);
12     $resp->headers->set('WWW-Authenticate', 'Basic realm="Mink Testing Area"');
13
14     echo 'is not authenticated';
15 }