---+!! !HTTPDUserAdminContrib
<!--
One line description, required for extensions repository catalog.
   * Set SHORTDESCRIPTION = A User and Password module supporting text or DBM format htpasswd files, and SQL using HTTPD::UserAdmin CPAN module 
-->
%SHORTDESCRIPTION%

---++ Usage
This Contrib adds [[http://httpd.apache.org/docs/2.2/mod/mod_authn_dbm.html][auth DBM]] 
and [[http://httpd.apache.org/docs/2.2/mod/mod_authn_dbd.html][auth SQL]] support to TWiki, 
though the [[http://search.cpan.org/~lds/HTTPD-User-Manage-1.66/lib/HTTPD/UserAdmin.pm][HTTPD::UserAdmin]] CPAN module.

It has been developed and tested for the TWiki-4.2, though _may_ be useable for previous releases.

You receive maximal performance benefit by using the =SQL= mode, and ensuring ={Register}{AllowLoginName}= is off (so that the %MAINWEB%.TWikiUsers topic is not needed to convert login names to Wiki Names.

See the Extensions | HTTPDUserAdminContrib section of =configure= to set up the specific options.

---+++ Text file user store (.htpassword)
If you are using the Text mode a once off converstion from an existing TWiki htpasswd file must be done, due to differences in the way that email addresses are stored.

run =perl -pi~ -e "s/$([^:]*):([^:]*):(.*)^/$1:$2:emails=$3/g" twiki/data/.htpasswd= to convert from TWiki's native htpassword format.

From there you can use that file in the =Text= =DBType=, use =dbmmanage= to import it to a DBM file, or run a similar tool to import it into your database.
---+++ DBM mode

---+++ SQL mode (DBI)
This Contrib will not create the database setup for you, you will need to have an existing database, with appropriate database connection permissions, and a database table for with the required fields that is accessible by this user.

Note that the DB Schema name is set in the top section of the settings (defaults to the .htpasswd filename).

*Beware:* Do not use table names, or column names that are SQL keywords (such as group)

---+++ extra not yet documented functionality
This Contrib can also define and store group definitions in the same database.

---++ Installation Instructions
   1 Install %TOPIC%
   2 select TWiki::Users::HTTPDUserAdminContrib in the Security|Passwords|{PasswordManager} selector in Configure
   3 then set the appropriate settings in the Exensions|HTTPDUserAdminContrib section of Configure.

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.

Like many other TWiki extensions, this module is shipped with a fully
automatic installer script written using the Build<nop>Contrib.
   * If you have TWiki 4.2 or later, you can install from the =configure= interface (Go to Plugins->Find More Extensions)
      * See the [[http://twiki.org/cgi-bin/view/Plugins/BuildContribInstallationSupplement][installation supplement]] on TWiki.org for more information.
   * If you have any problems, then you can still install manually from the command-line:
      1 Download one of the =.zip= or =.tgz= archives
      1 Unpack the archive in the root directory of your TWiki installation.
      1 Run the installer script ( =perl &lt;module&gt;_installer= )
      1 Run =configure= and enable the module, if it is a plugin.
      1 Repeat for any missing dependencies.
   * If you are *still* having problems, then instead of running the installer script:
      1 Make sure that the file permissions allow the webserver user to access all files.
      1 Check in any installed files that have existing =,v= files in your existing install (take care *not* to lock the files when you check in)
      1 Manually edit !LocalSite.cfg to set any configuration variables.

%IF{"defined 'SYSTEMWEB'" else="<div class='twikiAlert'>%X% WARNING: SYSTEMWEB is not defined in this TWiki. Please add these definitions to your %MAINWEB%.TWikiPreferences, if they are not already there:<br><pre>   * <nop>Set SYSTEMWEB = %<nop>TWIKIWEB%<br>   * <nop>Set USERSWEB = %<nop>MAINWEB%</pre></div>"}%


---++ Contrib Info

|  Contrib Author(s): | TWiki:Main.SvenDowideit |
|  Copyright: | &copy; 2008 SvenDowideit@distributedINFORMATION.com |
|  License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
|  Contrib Version: | 16509 (12 Dec 2008) |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  March 2008 | version 2 - updated for the 4.2.0 release, changes to allow registration, DB (MySQL in particular) and added group table |
|  July 2007 | version 1 - initial release |
|  Dependencies: | None |
|  [[TWiki:Plugins/Benchmark][Benchmarks]]: | %TWIKIWEB%.GoodStyle nn%, %TWIKIWEB%.FormattedSearch nn%, HTTPDUserAdminContrib nn% |
|  Contrib Home: | http://twiki.org/cgi-bin/view/Plugins/HTTPDUserAdminContrib |
|  Feedback: | http://twiki.org/cgi-bin/view/Plugins/HTTPDUserAdminContribDev |
|  Appraisal: | http://twiki.org/cgi-bin/view/Plugins/HTTPDUserAdminContribAppraisal |

__Related Topics:__ %TWIKIWEB%.TWikiContribs, %TWIKIWEB%.DeveloperDocumentationCategory, %TWIKIWEB%.AdminDocumentationCategory, %TWIKIWEB%.TWikiPreferences

<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the feedback topic on twiki.org instead. -->
