Subversion Repositories ORC

Rev

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

Rev 34 Rev 35
Line 10... Line 10...
10
 
10
 
11
my $cookie_string = authenticate(1) || die;
11
my $cookie_string = authenticate(1) || die;
12
my ($EML, $PWD, $LVL) = split /&/, $cookie_string;
12
my ($EML, $PWD, $LVL) = split /&/, $cookie_string;
13
my $user = getUser($EML);
13
my $user = getUser($EML);
-
 
14
$user->{department} = convertDepartments $user->{department};
14
$user->{department} = convertDepartments $user->{department};
15
my $activated = max (values %{ $user->{department} });
15
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
16
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
Line 16... Line 17...
16
my $DEPTS = getDepartments;
17
my $DEPTS = getDepartments;
Line 17... Line 18...
17
 
18
 
18
print CGI::header(-cookie=>$RCAUTH_cookie);
19
print CGI::header(-cookie=>$RCAUTH_cookie);
19
 
20
 
Line 20... Line 21...
20
#foreach (sort keys %ENV) {
21
#foreach (sort keys %ENV) {
21
#	print "$_: $ENV{$_}\n<br>";
22
#	print "$_: $ENV{$_}\n<br>";
-
 
23
#}
Line 22... Line 24...
22
#}
24
 
23
 
25
#use DBI;
24
#use DBI;
26
#my $dbh = WebDB->connect ();
Line 38... Line 40...
38
push @everyone, $h->li ($h->a ({ href=>"/schedule/officiating_shifts.pl" }, "View and Sign Up for Officiating Shifts")) if $user->{department}->{OFF} > 0;
40
push @everyone, $h->li ($h->a ({ href=>"/schedule/officiating_shifts.pl" }, "View and Sign Up for Officiating Shifts")) if $user->{department}->{OFF} > 0;
39
push @everyone, $h->li ($h->a ({ href=>"/schedule/announcer_shifts.pl" }, "View and Sign Up to Announce Games")) if $user->{department}->{ANN} > 0;
41
push @everyone, $h->li ($h->a ({ href=>"/schedule/announcer_shifts.pl" }, "View and Sign Up to Announce Games")) if $user->{department}->{ANN} > 0;
40
push @everyone, $h->li ($h->a ({ href=>"/schedule/manage_personal_time.pl" }, "Block Personal Time"));
42
push @everyone, $h->li ($h->a ({ href=>"/schedule/manage_personal_time.pl" }, "Block Personal Time"));
41
push @everyone, $h->li ($h->a ({ href=>"/schedule/manage_user.pl?submit=Edit&RCid=$user->{RCid}" }, "Edit your profile"));
43
push @everyone, $h->li ($h->a ({ href=>"/schedule/manage_user.pl?submit=Edit&RCid=$user->{RCid}" }, "Edit your profile"));
Line -... Line 44...
-
 
44
 
-
 
45
my @mvppass;
-
 
46
if ($user->{department}->{CLA} > 0) {
-
 
47
	push @mvppass, $h->li ($h->a ({ href=>"/schedule/mvpclasses.pl" }, "View and Sign Up for MVP Classes"))
Line 42... Line 48...
42
 
48
}
43
 
49
 
44
my @leads = ();
50
my @leads = ();
45
if ($LVL > 1) {
51
if ($LVL > 1) {
Line 75... Line 81...
75
 
81
 
76
my @sysadmins;
82
my @sysadmins;
77
if ($LVL >= 5) {
83
if ($LVL >= 5) {
78
  push @sysadmins, $h->li ($h->a ({ href=>"/schedule/bulk_upload.pl" }, "Upload a CSV of Department Shifts"));
84
  push @sysadmins, $h->li ($h->a ({ href=>"/schedule/bulk_upload.pl" }, "Upload a CSV of Department Shifts"));
-
 
85
 	push @sysadmins, $h->li ($h->a ({ href=>"/schedule/manage_shifts.pl" }, "Update department shift schedule"));
-
 
86
 	
-
 
87
 	my ($signupcount) = $dbh->selectrow_array ("select count(*) from v_shift where dept = ? and RCid <> ''", undef, "CLA");
-
 
88
 	my ($mvpcount)    = $dbh->selectrow_array ("select count(*) from official where department REGEXP ?", undef, "CLA-1");
-
 
89
 	
-
 
90
 	$mvpcount = 265 unless $mvpcount;
-
 
91
 	
-
 
92
 	push @sysadmins, $h->li ($mvpcount." MVP Passholders have signed up for ".$signupcount." spots (".sprintf("%.2f", ($signupcount / ($mvpcount*4)) * 100)."\%).");
-
 
93
 	
-
 
94
 	my ($active) = $dbh->selectrow_array ("select count(distinct RCid) as users from log where timestamp > (now() - interval 30 minute) and event not like 'Updated User Details%' and event not like 'Activated to work%'");
-
 
95
 	#my ($active) = $dbh->selectrow_array ("select * from official where last_login > (now() - interval 150 minute) order by last_login desc");
79
 	push @sysadmins, $h->li ($h->a ({ href=>"/schedule/manage_shifts.pl" }, "Update department shift schedule"));
96
 	push @sysadmins, $h->li ("There seem to be about $active user session(s) right now.");
80
#  push @sysadmins, $h->li ($h->a ({ href=>"/schedule/volhours.pl" }, "View Volunteer Hours by Department"));
97
#  push @sysadmins, $h->li ($h->a ({ href=>"/schedule/volhours.pl" }, "View Volunteer Hours by Department"));
Line 81... Line 98...
81
}
98
}
82
 
99
 
Line 95... Line 112...
95
printRCHeader("Home");
112
printRCHeader("Home");
96
print $h->close ("table");
113
print $h->close ("table");
Line 97... Line 114...
97
 
114
 
Line -... Line 115...
-
 
115
print $h->form ({ name=>"Req", action=>url });
-
 
116
 
98
print $h->form ({ name=>"Req", action=>url });
117
print $h->div ({ class=>"index" }, [$h->p ({ class=>"heading" }, "Note:"), "<b>Your account is being reviewed.</b>", $h->br, "You won't have access to view or sign-up for things until you've been approved / added to a department.", $h->br, "Please watch your email for notifications." ]) unless $activated;
Line -... Line 118...
-
 
118
 
-
 
119
print $h->div ({ class=>"index" }, [$h->p ({ class=>"heading" }, "Your up-coming schedule (as of $dt):"), $schedule, $h->h5 ("[".$h->a ({ href=>"export_ics.pl?RCid=$user->{RCid}" }, "use this link for iCal")."]") ]) if $schedule;
99
 
120
 
Line 100... Line 121...
100
print $h->div ({ class=>"index" }, [$h->p ({ class=>"heading" }, "Your up-coming schedule (as of $dt):"), $schedule, $h->h5 ("[".$h->a ({ href=>"export_ics.pl?RCid=$user->{RCid}" }, "use this link for iCal")."]") ]) if $schedule;
121
print $h->div ({ class=>"index" }, [$h->p ({ class=>"heading" }, "MVP Pass Holders:"), $h->ul ([ @mvppass ]) ]) if (scalar @mvppass);
Line 101... Line 122...
101
 
122