[첫화면으로]UseModWiki소스수정/올바르지않은아이디

마지막으로 [b]

환경설정에서 사용할 수 없는 아이디를 넣었을 때의 처리 문제 해결

sub DoUpdatePrefs {
    ...
    if ($FreeLinks) {
        $username =~ s/^\[\[(.+)\]\]/$1/;  # Remove [[ and ]] if added
        $username =  &FreeToNormal($username);
        $username =~ s/_/ /g;
    }
### 아래 if 문의 처음 네 블럭을 수정한다.
#   if ($username eq "") {
#       print T('UserName removed.'), '<br>';
#       undef $UserData{'username'};
#   } elsif ((!$FreeLinks) && (!($username =~ /^$LinkPattern$/))) {
#       print Ts('Invalid UserName %s: not saved.', $username), "<br>\n";
#   } elsif ($FreeLinks && (!($username =~ /^$FreeLinkPattern$/))) {
#       print Ts('Invalid UserName %s: not saved.', $username), "<br>\n";
#   } elsif (length($username) > 50) {  # Too long
#       print T('UserName must be 50 characters or less. (not saved)'), "<br>\n";
    if (length($username) < 4) {
        print T('UserName must be 4 characters or more. (not saved)'), "<br>\n";
        $UserID = 0;
        print &ScriptLink("action=editprefs", T('Try Again'));
        print &GetCommonFooter();
        return;
    } elsif ((!$FreeLinks) && (!($username =~ /^$LinkPattern$/))) {
        print Ts('Invalid UserName %s: not saved.', $username), "<br>\n";
        $UserID = 0;
        print &ScriptLink("action=editprefs", T('Try Again'));
        print &GetCommonFooter();
        return;
    } elsif ($FreeLinks && (!($username =~ /^$FreeLinkPattern$/))) {
        print Ts('Invalid UserName %s: not saved.', $username), "<br>\n";
        $UserID = 0;
        print &ScriptLink("action=editprefs", T('Try Again'));
        print &GetCommonFooter();
        return;
    } elsif (length($username) > 50) {  # Too long
        print T('UserName must be 50 characters or less. (not saved)'), "<br>\n";
        $UserID = 0;
        print &ScriptLink("action=editprefs", T('Try Again'));
        print &GetCommonFooter();
        return;
### 여기까지
    } else {
        print Ts('UserName %s saved.', $username), '<br>';
        $UserData{'username'} = $username;
    }
    ...
}


위키위키분류

마지막 편집일: 2007-1-8 12:19 pm (변경사항 [d])
658 hits | Permalink | 변경내역 보기 [h] | 페이지 소스 보기