![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/demo.cartinsight.co/vendor/intervention/httpauth/src/Token/ |
<?php namespace Intervention\HttpAuth\Token; use Intervention\HttpAuth\Key; class PhpAuthUser extends NullToken { /** * Parsed authentification username * * @var string */ protected $username; /** * Parsed authentification password * * @var string */ protected $password; /** * Transform current instance to key object * * @return Key */ public function toKey(): Key { $key = new Key(); $key->setProperty('username', $this->username); $key->setProperty('password', $this->password); return $key; } /** * Parse environment variables and store value in object * * @return bool "true" if value was found or "false" */ protected function parse(): bool { if ($username = $this->getArrayValue($_SERVER, 'PHP_AUTH_USER')) { $this->username = $username; $this->password = array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : null; return true; } return false; } }