protected function Require401Authentication(IAuthenticatable $authenticatable, $realm = "Login Required", $qs_username_field = "", $qs_password_field = "")
	{
		require_once("verysimple/Authentication/Auth401.php");
		
		$user = $this->Get401Authentication($authenticatable,$qs_username_field, $qs_password_field);

		// we only want to output 401 headers if the user is not already authenticated
		if (!$user)
		{
			if( $this->Get401AuthUsername($qs_username_field) )
			{
				// a username was provided, which means login failed
				Auth401::OutputHeaders("Invalid Login");
			}
			else
			{
				// no username provided, which means prompt for username
				Auth401::OutputHeaders($realm);
			}
		}
	}
protected function Require401Authentication(IAuthenticatable $authenticatable, $realm = "Login Required", $qs_username_field = "", $qs_password_field = "")
	{
		require_once("verysimple/Authentication/Auth401.php");
		
		$user = $this->Get401Authentication($authenticatable,$qs_username_field, $qs_password_field);

		// we only want to output 401 headers if the user is not already authenticated
		if (!$user)
		{
			if( $this->Get401AuthUsername($qs_username_field) )
			{
				// a username was provided, which means login failed
				Auth401::OutputHeaders("Invalid Login");
			}
			else
			{
				// no username provided, which means prompt for username
				Auth401::OutputHeaders($realm);
			}
		}
	}
protected function Require401Authentication ( IAuthenticatable $ authenticatable , $ realm = "Login Required" , $ qs_username_field = "" , $ qs_password_field = "" ) { require_once ( "verysimple/Authentication/Auth401.php" ) ; $ user = $ this -> Get401Authentication ( $ authenticatable , $ qs_username_field , $ qs_password_field ) ; // we only want to output 401 headers if the user is not already authenticated
 if ( ! $ user ) { if ( $ this -> Get401AuthUsername ( $ qs_username_field ) ) { // a username was provided, which means login failed
 Auth401 :: OutputHeaders ( "Invalid Login" ) ; } else { // no username provided, which means prompt for username
 Auth401 :: OutputHeaders ( $ realm ) ; } } }
Requires 401 Authentication.  If authentication fails, this function
terminates with a 401 header.  If success, sets CurrentUser and returns null.
@param IAuthenticatable any IAuthenticatable object
@param string http realm (basically the login message shown to the user)
@param string username querystring field (optional) if provided, the username can be passed via querystring instead of through the auth headers
@param string password querystring field (optional) if provided, the password can be passed via querystring instead of through the auth headers
Requires 401 Authentication . If authentication fails this function terminates with a 401 header . If success sets CurrentUser and returns null .