summaryrefslogtreecommitdiff
path: root/rt/lib/RT/User_Overlay.pm
diff options
context:
space:
mode:
authorivan <ivan>2004-03-11 02:05:38 +0000
committerivan <ivan>2004-03-11 02:05:38 +0000
commit289340780927b5bac2c7604d7317c3063c6dd8cc (patch)
treec4100ab9857ae00c330213af8a46e66c208580e6 /rt/lib/RT/User_Overlay.pm
parent945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd (diff)
import of rt 3.0.9RT_3_0_9
Diffstat (limited to 'rt/lib/RT/User_Overlay.pm')
-rw-r--r--rt/lib/RT/User_Overlay.pm17
1 files changed, 11 insertions, 6 deletions
diff --git a/rt/lib/RT/User_Overlay.pm b/rt/lib/RT/User_Overlay.pm
index e828ebd71..ba322cd4b 100644
--- a/rt/lib/RT/User_Overlay.pm
+++ b/rt/lib/RT/User_Overlay.pm
@@ -203,14 +203,16 @@ sub Create {
@_ # get the real argumentlist
);
-
- $args{'EmailAddress'} = $self->CanonicalizeEmailAddress($args{'EmailAddress'});
-
#Check the ACL
unless ( $self->CurrentUser->HasRight(Right => 'AdminUsers', Object => $RT::System) ) {
return ( 0, $self->loc('No permission to create users') );
}
+ $args{'EmailAddress'} = $self->CanonicalizeEmailAddress($args{'EmailAddress'});
+ # if the user doesn't have a name defined, set it to the email address
+ $args{'Name'} = $args{'EmailAddress'} unless ($args{'Name'});
+
+
# Privileged is no longer a column in users
my $privileged = $args{'Privileged'};
@@ -234,7 +236,9 @@ sub Create {
#TODO Specify some sensible defaults.
- unless ( defined( $args{'Name'} ) ) {
+ unless ( $args{'Name'} ) {
+ use Data::Dumper;
+ $RT::Logger->crit(Dumper \%args);
return ( 0, $self->loc("Must specify 'Name' attribute") );
}
@@ -274,6 +278,7 @@ sub Create {
#If the create failed.
unless ($id) {
+ $RT::Handle->Rollback();
$RT::Logger->error("Could not create a new user - " .join('-'. %args));
return ( 0, $self->loc('Could not create user') );
@@ -729,7 +734,7 @@ sub ResetPassword {
my $template = RT::Template->new( $self->CurrentUser );
- if ( $self->IsPrivileged ) {
+ if ( $self->Privileged ) {
$template->LoadGlobalTemplate('RT_PasswordChange_Privileged');
}
else {
@@ -929,7 +934,7 @@ sub GenerateRandomPassword {
my $length = $min_length + int( rand( $max_length - $min_length ) );
- my $char = $self->GenerateRandomNextChar( $total_sum, $start_freq );
+ my $char = $self->_GenerateRandomNextChar( $total_sum, $start_freq );
my @word = ( $char + $a );
for ( 2 .. $length ) {
$char =