--- register 27 Apr 2003 09:03:42 -0000 1.37 +++ register 23 Jun 2003 09:46:17 -0000 @@ -28,13 +28,7 @@ use TWiki; use TWiki::Net; use TWiki::Plugins; - -if( $TWiki::OS eq "WINDOWS" ) { - require MIME::Base64; - import MIME::Base64 qw( encode_base64 ); - require Digest::SHA1; - import Digest::SHA1 qw( sha1 ); -} +use TWiki::Htpasswd; &main(); @@ -94,7 +88,7 @@ # check if user entry already exists if( ( $wikiName ) && ( ( &TWiki::Store::topicExists( $webName, $wikiName ) ) - || ( htpasswdExistUser( $wikiName ) ) + || ( &TWiki::Htpasswd::findEntry( $wikiName ) ) ) ) { # PTh 20 Jun 2000: changed to getOopsUrl $url = &TWiki::getOopsUrl( $webName, $topic, "oopsregexist", $wikiName ); @@ -142,7 +136,9 @@ # generate user entry and add to .htpasswd file if( ! $remoteUser ) { - htpasswdAddUser( htpasswdGeneratePasswd( $wikiName, $passwordA ) ); + my $newEntry = &TWiki::Htpasswd::makeEntry( $wikiName, + &TWiki::Htpasswd::encodePassword( $wikiName, $passwordA ) ); + &TWiki::Htpasswd::addEntry( $newEntry ); } # send email confirmation @@ -223,6 +219,7 @@ TWiki::redirect( $query, $url ); } +# pvgoran: this function is no longer needed. sub htpasswdGeneratePasswd { my ( $user, $passwd ) = @_; @@ -246,6 +243,7 @@ return "$user\:$passwdcrypt"; } +# pvgoran: this function is no longer needed. sub htpasswdExistUser { my ( $user ) = @_; @@ -262,6 +260,7 @@ return ""; } +# pvgoran: this function is no longer needed. sub htpasswdAddUser { my ( $userEntry ) = @_; @@ -274,6 +273,7 @@ &TWiki::Store::saveFile( $TWiki::htpasswdFilename, $text ); } +# pvgoran: this function is no longer needed. sub addUserToTWikiUsersTopic { my ( $wikiName, $remoteUser ) = @_;