Subversion Repositories PEEPS

Rev

Rev 41 | Rev 47 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 41 Rev 42
Line 134... Line 134...
134
    my $OG = getUser ($F->{person_id});
134
    my $OG = getUser ($F->{person_id});
Line 135... Line 135...
135
    
135
    
136
#    if ($F->{derby_name} ne $OG->{derby_name} and checkDupes ('derby_name', $F->{derby_name})) { push @ERRORS, "Derby Name already in use. Pick a different one."; $F->{derby_name} = ""; }
136
#    if ($F->{derby_name} ne $OG->{derby_name} and checkDupes ('derby_name', $F->{derby_name})) { push @ERRORS, "Derby Name already in use. Pick a different one."; $F->{derby_name} = ""; }
Line 137... Line -...
137
#    if (!$F->{derby_name}) { push @ERRORS, "Blank Derby Name!"; }
-
 
138
    
-
 
139
    if (!$F->{username})  { push @ERRORS, "Blank Username!"; }
-
 
140
    if ($F->{username} ne $OG->{username} and checkDupes ('username', 'authentication', $F->{username})) { push @ERRORS, "Username already in use."; $F->{username} = ""; }
-
 
141
    if (!$F->{name_first})  { push @ERRORS, "Blank First Name!"; }
-
 
142
    if (!$F->{name_last})  { push @ERRORS, "Blank Last Name!"; }
-
 
143
    if ($F->{default_jersey_number} and $F->{default_jersey_number} !~ /^\d{1,4}$/) { push @ERRORS, "Illegal Jersey Number! (Must be 1 to 4 digits, only.)"; }
-
 
144
    if (!$F->{email})      { push @ERRORS, "Blank Email!"; } else {
-
 
145
      $F->{email} =~ s/\s+//g; # make sure people aren't accidentally including spaces
-
 
146
      if (! Email::Valid->address (-address => $F->{email}, -mxcheck => 1, -tldcheck => 1)) { push @ERRORS, "Mal-formatted (or fake) Email Address!"; $F->{email} = ""; }
-
 
Line 147... Line 137...
147
    }
137
#    if (!$F->{derby_name}) { push @ERRORS, "Blank Derby Name!"; }
148
    if ($F->{email} ne $OG->{email} and checkDupes ('email', 'person', $F->{email})) { push @ERRORS, "Email Address already in use."; $F->{email} = ""; }
138
    
149
    
139
    
150
    if (exists $F->{newaffiliation}) {
140
    if (exists $F->{newaffiliation}) {
151
      push @ERRORS, "No League Selected." unless $F->{newaffiliation};
141
      push @ERRORS, "No League Selected." unless $F->{newaffiliation};
152
      push @ERRORS, "That's not a Member Org ID [$F->{newaffiliation}]!" if ($F->{newaffiliation} and $F->{newaffiliation} !~ /^\d+$/);
142
      push @ERRORS, "That's not a Member Org ID [$F->{newaffiliation}]!" if ($F->{newaffiliation} and $F->{newaffiliation} !~ /^\d+$/);
153
      push @ERRORS, "Already a member of ".getLeagueName ($F->{newaffiliation}) unless notInArray ($F->{newaffiliation}, [keys %{getLeagueAffiliation ($F->{person_id})}]);
143
      push @ERRORS, "Already a member of ".getLeagueName ($F->{newaffiliation}) unless notInArray ($F->{newaffiliation}, [keys %{getLeagueAffiliation ($F->{person_id})}]);
154
    } elsif (exists $F->{deleteaffiliation}) {
144
    } elsif (exists $F->{deleteaffiliation}) {
155
      push @ERRORS, "No League Selected." unless $F->{deleteaffiliation};
145
      push @ERRORS, "No League Selected." unless $F->{deleteaffiliation};
156
      push @ERRORS, "That's not a Member Org ID [$F->{deleteaffiliation}]!" if ($F->{deleteaffiliation} and $F->{deleteaffiliation} !~ /^\d+$/);
-
 
157
      push @ERRORS, "Not a member of ".getLeagueName ($F->{deleteaffiliation}) if ($F->{deleteaffiliation} and notInArray ($F->{deleteaffiliation}, [keys %{getLeagueAffiliation ($F->{person_id})}]));
146
      push @ERRORS, "That's not a Member Org ID [$F->{deleteaffiliation}]!" if ($F->{deleteaffiliation} and $F->{deleteaffiliation} !~ /^\d+$/);
-
 
147
      push @ERRORS, "Not a member of ".getLeagueName ($F->{deleteaffiliation}) if ($F->{deleteaffiliation} and notInArray ($F->{deleteaffiliation}, [keys %{getLeagueAffiliation ($F->{person_id})}]));
158
    } else {
148
    } else {
-
 
149
      if (!$F->{username})  { push @ERRORS, "Blank Username!"; }
-
 
150
      if ($F->{username} ne $OG->{username} and checkDupes ('username', 'authentication', $F->{username})) { push @ERRORS, "Username already in use."; $F->{username} = ""; }
-
 
151
      if (!$F->{name_first})  { push @ERRORS, "Blank First Name!"; }
-
 
152
      if (!$F->{name_last})  { push @ERRORS, "Blank Last Name!"; }
-
 
153
      if ($F->{default_jersey_number} and $F->{default_jersey_number} !~ /^\d{1,4}$/) { push @ERRORS, "Illegal Jersey Number! (Must be 1 to 4 digits, only.)"; }
-
 
154
      if (!$F->{email})      { push @ERRORS, "Blank Email!"; } else {
-
 
155
        $F->{email} =~ s/\s+//g; # make sure people aren't accidentally including spaces
159
      if ($F->{email} ne $OG->{email} and checkDupes ('email', 'person', $F->{email})) { push @ERRORS, "Email Address already in use. Pick a different one."; $F->{email} = ""; }
156
        if (! Email::Valid->address (-address => $F->{email}, -mxcheck => 1, -tldcheck => 1)) { push @ERRORS, "Mal-formatted (or fake) Email Address!"; $F->{email} = ""; }
Line 160... Line 157...
160
      if (!$F->{name_last})  { push @ERRORS, "Blank Last Name!"; }
157
      }
161
      if (!$F->{name_first})  { push @ERRORS, "Blank First Name!"; }
158
      if ($F->{email} ne $OG->{email} and checkDupes ('email', 'person', $F->{email})) { push @ERRORS, "Email Address already in use."; $F->{email} = ""; }
162
    }
159
    }