[Rt-commit] r5907 - commitbit/lib/CommitBit/Model
clkao at bestpractical.com
clkao at bestpractical.com
Mon Sep 11 17:58:05 EDT 2006
Author: clkao
Date: Mon Sep 11 17:58:05 2006
New Revision: 5907
Modified:
commitbit/lib/CommitBit/Model/Repository.pm
commitbit/lib/CommitBit/Model/User.pm
Log:
Don't silently drop errors from the with_write_lock eval.
Modified: commitbit/lib/CommitBit/Model/Repository.pm
==============================================================================
--- commitbit/lib/CommitBit/Model/Repository.pm (original)
+++ commitbit/lib/CommitBit/Model/Repository.pm Mon Sep 11 17:58:05 2006
@@ -84,6 +84,7 @@
release_write_lock() || Carp::croak "Couldn't release write lock :(";
return 1;
};
+ warn $@ if $@;
return 0;
}
@@ -139,7 +140,7 @@
print $fh $self->autogenerated_file_warning;
my $users = $self->associated_users;
while (my $user = $users->next) {
- print $fh `htpasswd -nmsb @{[$user->name]} @{[$user->password]}`;
+ print $fh `htpasswd -nmb @{[$user->email]} @{[$user->password]}`;
}
};
}
@@ -152,7 +153,7 @@
print $fh "[users]\n";
my $users = $self->associated_users;
while (my $user = $users->next) {
- print $fh $user->name. ' = '. $user->password. "\n";
+ print $fh $user->email. ' = '. $user->password. "\n";
}
# all users that involves in any project in the repository
@@ -172,7 +173,7 @@
print $file $self->autogenerated_file_warning;
while ( my $project = $projects->next ) {
print $file "[" . $project->root_path . "]\n" || die $@;
- foreach my $user ( @{ $project->members->items_arrayref } ) {
+ foreach my $user ( @{ $project->members->items_array_ref } ) {
print $file $user->username . " = rw\n" || die $@;
}
if ($project->public) {
Modified: commitbit/lib/CommitBit/Model/User.pm
==============================================================================
--- commitbit/lib/CommitBit/Model/User.pm (original)
+++ commitbit/lib/CommitBit/Model/User.pm Mon Sep 11 17:58:05 2006
@@ -33,6 +33,15 @@
}
+sub create {
+ my $self = shift;
+ my $args = { @_ };
+ unless (length $args->{password}) {
+ # $args->{password} ; # generate random ones
+ }
+ return $self->SUPER::create(%$args);
+}
+
sub name_and_email {
my $self = shift;
return join(' ', ($self->nickname ||''), "<".$self->email.">");
More information about the Rt-commit
mailing list