This is my first EE2 extension. There very well may be more coming in the future as my currnet job position has be building and maintaining websites using ExpressionEngine. The requirements for creating extensions are documented on the EE website, but I had done a lot of searching for examples to make this finally work for me.
This extension is called when entries are submitted. If the entry submitted is in the channel you have in the settings, the extension checks for username, password and directory name fields within the channel. If the submitted password field is empty, the entension generates a random password based on the settings. The directory will be created with .htaccess and .htpasswd files. If an additional file was provided in the settings, the extension will also copy that file to the directory.
If the entry already has the directory structure in place, it will only update the htpasswd file with the new username and password that was submitted and skip the rest of the processing.
One the extension has been installed and enabled in your EE install, you will be able to access the settings for the extension.

This is the system path to the directory in which each of the new protected directories will be created.
This is the name of the protected area that appears on the password prompt.
The number of chatacters to use in passwords that are randomly generated.
Types of characters that are used in the generation of random passwords.
The channel to make the directories for.
The name of the field in the channel that stores the username to log in with.
The name of the field in the channel that stores the password to log in with.
The name of the field that contains the name of the directory to be created.
System path to a file that you would like copied to the newly reated directories.
The most up-to-date files can be found via the GitHub repository for this project.
Comments, ratings, etc. can be found on the Devot-ee Add-on Page.
| package | Entry Authenication Directory |
|---|---|
| version | 1.0 |
| author | Justin Koivisto |
| copyright | Copyright © 2011 Justin Koivisto |
| license | LGPL |
| link | http://koivi.com/ee-entry-auth-dir |
All code and scripts available for download on http://koivi.com are written by Justin Koivisto, ZCE and fall under the GNU Lesser General Public License (LGPL) Version 2.1 (unless noted otherwise). The full license agreement can be found within the LICENSE file within each distribution package.
© 2004 - Justin Koivisto, ZCE
Valid XHTML 1.0