* @package tao */ class tao_models_classes_HttpBasicAuthAdapter implements common_user_auth_Adapter { /** * @var common_http_Request */ private $request; /** * Creates an Authentication adapter from an OAuth Request * * @param common_http_Request $request */ public function __construct(common_http_Request $request) { $this->request = $request; } /** * @see common_user_auth_Adapter::authenticate() * * @return common_user_User * @throws LoginFailedException */ public function authenticate() { if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] == "") { throw new LoginFailedException(['Rest (Basic) login failed for user (missing login/password)']); } return LoginService::authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); } }