Changeset 2291 for trunk


Ignore:
Timestamp:
11/06/19 19:35:22 (5 years ago)
Author:
nanardon
Message:

Add a warning if similar account is detected

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/root/html/create/default.tt

    r1459 r2291  
    33<h2>Créer un objet de type [% c.forward('/obj_to_label', [ form.otype ]) | html %]</h2> 
    44<div id="objectform" class="objectform"> 
     5 
     6[% IF ochelper.warning %] 
     7<p class=error>[% ochelper.warning %]</p> 
     8[% END %] 
     9 
    510<form action="[% c.uri_for('/create', form.otype) %]" method="POST"> 
    611<table border="1"> 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/OCHelper/User.pm

    r1984 r2291  
    77use base qw(LATMOS::Accounts::Bases::OCHelper); 
    88use LATMOS::Accounts::Utils; 
     9use LATMOS::Accounts::I18N; 
    910 
    1011=head1 NAME 
     
    3435             
    3536            if ($info->{contents}{sn}) { 
     37 
     38                # On regarde si on objet de même nom existe: 
     39                if ($info->{contents}{givenName}) { 
     40                    if (my @objs = $self->base->search_objects( 
     41                            'user', 
     42                            'givenName~' . $info->{contents}{givenName}, 
     43                            'sn~' . $info->{contents}{sn} ) ) { 
     44                        $info->{warning} = l('A user having same name already exists: %s', join(', ', @objs)); 
     45                    } 
     46                } 
    3647                my $login = buildLogin( 
    3748                    sub { 
Note: See TracChangeset for help on using the changeset viewer.