HTTP Auth

Overview

This plugin utilizes HTTP basic authenitcation as a basis to provide or deny access to a web page. This plugin was needed to allow template parsing in EE2 while still using the per-directory HTTP Auth. In order to get to the files, the user needs to enter the valid credentials for a private project page and download the files.

Usage

{exp:http_auth:auth directory="dir" username="user" password="pass" crypt="DES" pass_file=".htpasswd"}

Returns the authenticated user name on success or an emptry string on failure. If not logged in, will display the default HTTP Auth login prompt.

  • directory Required. A system path or relative to the %{DOCUMENT_ROOT} and should contain the .htpasswd file.
  • username Optional. The username to log in with
  • password Optional. The password to log in with
  • crypt Optional. The crypt type used to create the htpasswd file ("DES" default)
  • pass_file Optional. The system path to the htpasswd file (".htpasswd" default)

{exp:http_auth:username}

Returns the logged in username according to $_SERVER["PHP_AUTH_USER"]

{exp:http_auth:password}

Returns the logged in password according to $_SERVER["PHP_AUTH_PW"]

Current Version Information

The most up-to-date files can be found via the GitHub repository for this project.

package HTTP Auth
version 1.0
author Justin Koivisto
copyright Copyright © 2012 Justin Koivisto
license LGPL
link http://koivi.com/ee-http-auth