[Rt-devel] Option for Identical Names

Joby Walker joby at u.washington.edu
Tue Jun 19 17:07:52 EDT 2007


Name cannot be identical for this is the login identity of the user!
Real Name is the name of the user and can be non-unique.

Joby Walker
C&C SSG, University of Washington


Matthew Ekstrand-Abueg wrote:
> Hello all,
> 
> I have noticed that the code blocks creation of multiple users with the
> same name.  This is not desirable for a large-community where people may
> have the same name, but everyone still has difference email addresses.
> So, as a workaround, I modified the code in the check so that if it is
> trying to auto create a user with the same name, it instead takes the
> email address and puts it into the name field, obviously still failing
> after that if two of the same email addresses exist.
> 
> I honestly don't remember if this was a part of the LDAP_Overlay I
> added, so I am mentioning this just in case that is true.
> 
> In etc/RT_SiteConfig.pm:
> 
> # Allows for multiple users to be created with the same Name
> Set($AllowDuplicateNames, 1);
> 
> In lib/RT/User_Overlay.pm Create function:
> 
> #SANITY CHECK THE NAME AND ABORT IF IT'S TAKEN
> if ($RT::SystemUser) {   #This only works if RT::SystemUser has been defined
>     my $TempUser = RT::User->new($RT::SystemUser);
>     $TempUser->Load( $args{'Name'} );
>     if ( $TempUser->Id ) {
>         if ( $RT::AllowDuplicateNames ) {
>             $args{'Name'} = $args{'EmailAddress'};
>         } else {
>             return ( 0, $self->loc('Name in use') );
>     }
>      }
> 
>     return ( 0, $self->loc('Email address in use') )
>       unless ( $self->ValidateEmailAddress( $args{'EmailAddress'} ) );
> }
> else {
>     $RT::Logger->warning( "$self couldn't check for pre-existing users");
> }
> 
> Notice the added internal if statements.  I hope my changes are at least
> marginally helpful in resolving this issue.  Thank you very much.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


More information about the Rt-devel mailing list