Skip to content

Commit

Permalink
Item1826: more porting and spelling
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/HTTPDUserAdminContrib@4508 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Jul 20, 2009
1 parent ccba608 commit e535263
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 23 deletions.
20 changes: 9 additions & 11 deletions data/System/HTTPDUserAdminContrib.txt
Expand Up @@ -7,19 +7,17 @@ One line description, required for extensions repository catalog.

---++ 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,
and [[http://httpd.apache.org/docs/2.2/mod/mod_authn_dbd.html][auth SQL]] support to foswiki,
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%.WikiUsers 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.
If you are using the Text mode a once off converstion from an existing Foswiki 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.
run =perl -pi~ -e "s/$([^:]*):([^:]*):(.*)^/$1:$2:emails=$3/g" foswiki/data/.htpasswd= to convert from Foswiki'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
Expand All @@ -36,23 +34,23 @@ 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
2 select Foswiki::Users::HTTPDUserAdminContrib in the Security|Passwords|{PasswordManager} selector in Configure
3 then set the appropriate settings in the Exensions|HTTPDUserAdminContrib section of Configure.

%$INSTALL_INSTRUCTIONS%

---++ Contrib Info

| Contrib Author(s): | TWiki:Main.SvenDowideit |
| Copyright: | © 2008 SvenDowideit@distributedINFORMATION.com |
| Contrib Author(s): | Foswiki:Main.SvenDowideit |
| Copyright: | © 2008 SvenDowideit@fosiki.com |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Contrib Version: | %$VERSION% |
| 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 |
| Jul 2009 | port to Foswiki |
| March 2008 | version 2 - updated for the t(m)wiki 4.2.0 release, changes to allow registration, DB (MySQL in particular) and added group table |
| July 2007 | version 1 - initial release |
| Dependencies: | %$DEPENDENCIES% |
| Contrib Home: | http://twiki.org/cgi-bin/view/Plugins/HTTPDUserAdminContrib |
| Feedback: | http://twiki.org/cgi-bin/view/Plugins/HTTPDUserAdminContribDev |
| Contrib Home: | http://foswiki.org/Extensions/HTTPDUserAdminContrib |

__Related Topics:__ [[%SYSTEMWEB%.Contribs][Contribs]], %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences

Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/HTTPDUserAdminContrib/Config.spec
@@ -1,6 +1,6 @@
# ---+ Extensions
# ---++ HTTPDUserAdminContrib
#more feature rich password handleing, using HTTPD::UserAdmin - supports Text, DBM and SQL backends
# feature rich password handling, using HTTPD::UserAdmin - supports Text, DBM and SQL backends

# **SELECT Text,DBM,SQL**
#DBType - The type of database, one of 'DBM', 'Text', or 'SQL' (Default is 'Text')
Expand Down
1 change: 0 additions & 1 deletion lib/Foswiki/Contrib/HTTPDUserAdminContrib/DEPENDENCIES
@@ -1,6 +1,5 @@
# Dependencies for HTTPDUserAdminContrib
# Example:
# Time::ParseDate,>=2003.0211,cpan,Required.
# TWiki::Plugins,>=1.15,perl,TWiki 4.1 release.
HTTPD::UserAdmin,>=1.66,perl,
HTTPD::Authen,>=1.66,perl
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/HTTPDUserAdminContrib/MANIFEST
@@ -1,5 +1,5 @@
# Release manifest for HTTPDUserAdminContrib
data/Foswiki/HTTPDUserAdminContrib.txt 0644 Documentation
data/System/HTTPDUserAdminContrib.txt 0644 Documentation
lib/Foswiki/Contrib/HTTPDUserAdminContrib.pm 0644 Perl module
lib/Foswiki/Contrib/HTTPDUserAdminContrib/Config.spec
lib/Foswiki/Users/HTTPDUserAdminUser.pm 0644 Perl module
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/HTTPDUserAdminContrib/build.pl
Expand Up @@ -8,7 +8,7 @@ BEGIN
$build = new Foswiki::Contrib::Build('HTTPDUserAdminContrib');

# (Optional) Set the details of the repository for uploads.
# This can be any web on any accessible TWiki installation.
# This can be any web on any accessible foswiki installation.
# These defaults will be used when expanding tokens in .txt
# files, but be warned, they can be overridden at upload time!

Expand Down
4 changes: 2 additions & 2 deletions lib/Foswiki/Users/HTTPDUserAdminUser.pm
@@ -1,13 +1,13 @@
# Module of Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2007 SvenDowideit@home.org.au
# Copyright (C) 2007 SvenDowideit@foswiki.com
# All Rights Reserved.
# Foswiki Contributors are listed in the AUTHORS file in the root of
# this distribution. NOTE: Please extend that file, not this notice.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version. For
# more details read LICENSE in the root of this distribution.
#
Expand Down
10 changes: 4 additions & 6 deletions lib/Foswiki/Users/HTTPDUserAdminUserMapping.pm
@@ -1,6 +1,6 @@
# Module of Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2007 Sven Dowideit, SvenDowideit@distributedINFORMATION.com
# Copyright (C) 2007 Sven Dowideit, SvenDowideit@fosiki.com
# and Foswiki Contributors. All Rights Reserved. Foswiki Contributors
# are listed in the AUTHORS file in the root of this distribution.
# NOTE: Please extend that file, not this notice.
Expand Down Expand Up @@ -43,14 +43,13 @@ use HTTPD::GroupAdmin;
---++ ClassMethod new ($session, $impl)
Constructs a new user mapping handler of this type, referring to $session
for any required TWiki services.
for any required foswiki services.
=cut

sub new {
my( $class, $session ) = @_;

# The null mapping name is reserved for TWiki for backward-compatibility
my $this = $class->SUPER::new( $session, '' );

my %configuration = (
Expand Down Expand Up @@ -305,7 +304,6 @@ sub userExists {
return $loginName;
}

# TWiki allows *groups* to log in
if( $this->isGroup( $loginName )) {
return $loginName;
}
Expand Down Expand Up @@ -441,7 +439,7 @@ sub findUserByWikiName {

# Bloody compatibility!
# The wikiname is always a registered user for the purposes of this
# mapping. We have to do this because TWiki defines access controls
# mapping. We have to do this because foswiki defines access controls
# in terms of mapped users, and if a wikiname is *missing* from the
# mapping there is "no such user".
#HUH? push( @users, getCanonicalUserID( $this, $wn ));
Expand Down Expand Up @@ -516,7 +514,7 @@ sub passwordError {

#######################################################################
# don't create or use the MAIN.WikiUsers topic
# this is a copy of the functionality in TopicUserMapping, with the TWikiUser topic part removed
# this is a copy of the functionality in TopicUserMapping, with the WikiUser topic part removed
#TODO: shame that its the UI::Registration code that creates the User topic - tahts close to pointless too

sub addUser {
Expand Down

0 comments on commit e535263

Please sign in to comment.