Subversion Repositories PEEPS

Rev

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

Rev 42 Rev 47
Line 6... Line 6...
6
#open STDERR, '>>', $error_log_path.'vorc_error.log' or warn "Failed to open redirected logfile ($0): $!";
6
#open STDERR, '>>', $error_log_path.'vorc_error.log' or warn "Failed to open redirected logfile ($0): $!";
7
#warn "Redirecting errors to ${error_log_path}vorc_error.log";
7
#warn "Redirecting errors to ${error_log_path}vorc_error.log";
Line 8... Line 8...
8
 
8
 
9
use strict;
9
use strict;
10
use PEEPS;
10
use PEEPS;
11
use tableViewer qw/inArray notInArray/;
11
#use tableViewer qw/inArray notInArray/;
12
use CGI qw/param cookie header start_html url url_param redirect/;
12
use CGI qw/param cookie header start_html url url_param redirect/;
13
use Email::Valid;
13
use Email::Valid;
14
use WebDB;
14
use WebDB;
15
use HTML::Tiny;
15
use HTML::Tiny;
Line 138... Line 138...
138
    
138
    
139
    
139
    
140
    if (exists $F->{newaffiliation}) {
140
    if (exists $F->{newaffiliation}) {
141
      push @ERRORS, "No League Selected." unless $F->{newaffiliation};
141
      push @ERRORS, "No League Selected." unless $F->{newaffiliation};
142
      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+$/);
143
      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 tableViewer::notInArray ($F->{newaffiliation}, [keys %{getLeagueAffiliation ($F->{person_id})}]);
144
    } elsif (exists $F->{deleteaffiliation}) {
144
    } elsif (exists $F->{deleteaffiliation}) {
145
      push @ERRORS, "No League Selected." unless $F->{deleteaffiliation};
145
      push @ERRORS, "No League Selected." unless $F->{deleteaffiliation};
146
      push @ERRORS, "That's not a Member Org ID [$F->{deleteaffiliation}]!" if ($F->{deleteaffiliation} and $F->{deleteaffiliation} !~ /^\d+$/);
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})}]));
147
      push @ERRORS, "Not a member of ".getLeagueName ($F->{deleteaffiliation}) if ($F->{deleteaffiliation} and tableViewer::notInArray ($F->{deleteaffiliation}, [keys %{getLeagueAffiliation ($F->{person_id})}]));
148
    } else {
148
    } else {
149
      if (!$F->{username})  { push @ERRORS, "Blank Username!"; }
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} = ""; }
150
      if ($F->{username} ne $OG->{username} and checkDupes ('username', 'authentication', $F->{username})) { push @ERRORS, "Username already in use."; $F->{username} = ""; }
Line 206... Line 206...
206
          if ($F->{$field} eq $OG->{$field} or (($field eq "access" or $field eq "showme") and $F->{$field} == $OG->{$field}) or ($field eq "password" and !$F->{$field})) {
206
          if ($F->{$field} eq $OG->{$field} or (($field eq "access" or $field eq "showme") and $F->{$field} == $OG->{$field}) or ($field eq "password" and !$F->{$field})) {
207
            # No changes to this field, move on...
207
            # No changes to this field, move on...
208
            next;
208
            next;
209
          }
209
          }
Line 210... Line 210...
210
          
210
          
211
          if ($AL < PEEPS::SYSADMIN and inArray ($field, \@PRIVFIELDS)) {
211
          if ($AL < PEEPS::SYSADMIN and tableViewer::inArray ($field, \@PRIVFIELDS)) {
212
            push @ERRORS, "ERROR: Only SysAdmins are allowed to change the $field field";
212
            push @ERRORS, "ERROR: Only SysAdmins are allowed to change the $field field";
213
            logit ($F->{person_id}, "SECURITY: Only SysAdmins are allowed to change the $field field");
213
            logit ($F->{person_id}, "SECURITY: Only SysAdmins are allowed to change the $field field");
214
            next;
214
            next;
Line 405... Line 405...
405
  
405
  
406
  # Display the list of roles per League Affiliation.  If the viewing user is a league (or wftda) admin, include a button to manage roles.
406
  # Display the list of roles per League Affiliation.  If the viewing user is a league (or wftda) admin, include a button to manage roles.
407
  my $leagues = getLeagueAffiliation($person_id);
407
  my $leagues = getLeagueAffiliation($person_id);
408
  my @leagueroles;
408
  my @leagueroles;
409
  foreach (sort keys %{$leagues}) {
409
  foreach (sort keys %{$leagues}) {
Line 410... Line 410...
410
    my ($isALeagueAdmin) = inArray ($_, isLeagueAdmin ($ORCUSER->{person_id}));
410
    my ($isALeagueAdmin) = tableViewer::inArray ($_, isLeagueAdmin ($ORCUSER->{person_id}));
411
    
411
    
412
    push @leagueroles, $h->div ({ class=>"rTableRow shaded", onClick=>"window.location.href='view_league?id=$_'" },[ 
412
    push @leagueroles, $h->div ({ class=>"rTableRow shaded", onClick=>"window.location.href='view_league?id=$_'" },[ 
413
                         $h->div ({ class=>"rTableCellr".($leagues->{$_}->[0] eq "Pending" ? " highlighted" : ""), style=>"font-size: smaller;".($leagues->{$_}->[0] eq "Pending" ? " font-style: italic;" : "") },
413
                         $h->div ({ class=>"rTableCellr".($leagues->{$_}->[0] eq "Pending" ? " highlighted" : ""), style=>"font-size: smaller;".($leagues->{$_}->[0] eq "Pending" ? " font-style: italic;" : "") },