Skip to content

Commit

Permalink
Item965: respect the unsetting of {Register}{HidePassword} even when …
Browse files Browse the repository at this point in the history
…register generates a password

git-svn-id: http://svn.foswiki.org/trunk@2495 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Feb 14, 2009
1 parent 97a9fe0 commit 815ab20
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/lib/Foswiki/UI/Register.pm
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,15 @@ sub complete {

my $users = $session->{users};
try {
unless ( defined($data->{Password}) ) {
#SMELL: should give consideration to disabling $Foswiki::cfg{Register}{HidePasswd}
#though that may reduce the conf options an admin has..
#OR, a better option would be that the rego email would thus point the user to the resetPasswd url.
$data->{Password} = Foswiki::Users::randomPassword();
#add data to the form so it can go out in the registration emails.
push(@{ $data->{form} }, {name=>'Password', value=>$data->{Password} });
}

my $cUID = $users->addUser(
$data->{LoginName}, $data->{WikiName},
$data->{Password}, $data->{Email}
Expand Down Expand Up @@ -1492,7 +1501,7 @@ sub _getDataFromQuery {
my $data = {};
foreach ( $query->param() ) {
if (/^(Twk([0-9])(.*))/) {
my @values = $query->param( $1 );
my @values = $query->param( $1 ) || ();
my $required = $2;
my $name = $3;
# deal with multivalue fields like checkboxen
Expand Down

0 comments on commit 815ab20

Please sign in to comment.