[Rt-commit] r5912 - in commitbit: .

clkao at bestpractical.com clkao at bestpractical.com
Mon Sep 11 18:33:35 EDT 2006


Author: clkao
Date: Mon Sep 11 18:33:34 2006
New Revision: 5912

Modified:
   commitbit/Makefile.PL
   commitbit/lib/CommitBit/Model/Repository.pm
   commitbit/lib/CommitBit/Model/User.pm

Log:
Generate passwords for users created by project member.

Modified: commitbit/Makefile.PL
==============================================================================
--- commitbit/Makefile.PL	(original)
+++ commitbit/Makefile.PL	Mon Sep 11 18:33:34 2006
@@ -2,5 +2,6 @@
 name('CommitBit');
 version('0.01');
 requires('Jifty' => '0.60728');
+requires('Text::Password::Pronounceable' => '0');
 
 WriteAll;

Modified: commitbit/lib/CommitBit/Model/Repository.pm
==============================================================================
--- commitbit/lib/CommitBit/Model/Repository.pm	(original)
+++ commitbit/lib/CommitBit/Model/Repository.pm	Mon Sep 11 18:33:34 2006
@@ -174,7 +174,7 @@
         while ( my $project = $projects->next ) {
             print $file "[" . $project->root_path . "]\n" || die $@;
             foreach my $user ( @{ $project->members->items_array_ref } ) {
-                print $file $user->username . " = rw\n" || die $@;
+                print $file $user->email . " = rw\n" || die $@;
             }
             if ($project->public) {
                 print $file "* = r\n";

Modified: commitbit/lib/CommitBit/Model/User.pm
==============================================================================
--- commitbit/lib/CommitBit/Model/User.pm	(original)
+++ commitbit/lib/CommitBit/Model/User.pm	Mon Sep 11 18:33:34 2006
@@ -33,11 +33,15 @@
 
 }
 
+use Text::Password::Pronounceable;
+
+my $pp = Text::Password::Pronounceable->new(8,10);
+
 sub create {
     my $self = shift;
     my $args = { @_ };
     unless (length $args->{password}) {
-	# $args->{password} ; # generate random ones
+	$args->{password} = $pp->generate;
     }
     return $self->SUPER::create(%$args);
 }


More information about the Rt-commit mailing list