Show
Ignore:
Timestamp:
07/19/08 22:39:51 (17 months ago)
Author:
bchoate
Message:

Make the display name a required field for all authentication methods. BugId:80675

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-41/lib/MT/CMS/User.pm

    r2774 r2820  
    15571557    my $name     = $app->param('name'); 
    15581558    my $nickname = $app->param('nickname'); 
     1559 
    15591560    if ( $pref eq 'MT' ) { 
    15601561        if ( defined $name ) { 
     
    15641565        return $eh->error( $app->translate("User requires username") ) 
    15651566          if ( !$name ); 
    1566  
    1567         if ( defined $nickname ) { 
    1568             $nickname =~ s/(^\s+|\s+$)//g; 
    1569             $app->param( 'nickname', $nickname ); 
    1570         } 
     1567    } 
     1568 
     1569    # Display name is required for all auth types; for new users 
     1570    # under external auth, the field is not shown, so the value is 
     1571    # undefined. Only check requirement if the value is defined. 
     1572    if ( defined $nickname ) { 
     1573        $nickname =~ s/(^\s+|\s+$)//g; 
     1574        $app->param( 'nickname', $nickname ); 
    15711575        return $eh->error( $app->translate("User requires display name") ) 
    1572           if ( !$nickname ); 
     1576          if ( !length( $nickname ) ); 
    15731577    } 
    15741578 
     
    16141618    if ( $app->param('url') ) { 
    16151619        my $url = $app->param('url'); 
    1616         return $eh->error( MT->translate("Website URL is imperfect") ) 
     1620        return $eh->error( MT->translate("Website URL is invalid") ) 
    16171621          unless is_url($url); 
    16181622    }