Subversion Repositories VORC

Rev

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

Rev 58 Rev 61
Line 11... Line 11...
11
use RollerCon;
11
use RollerCon;
12
use tableViewer;
12
use tableViewer;
13
use CGI qw/param cookie header start_html url/;
13
use CGI qw/param cookie header start_html url/;
14
use HTML::Tiny;
14
use HTML::Tiny;
15
my $h = HTML::Tiny->new( mode => 'html' );
15
my $h = HTML::Tiny->new( mode => 'html' );
-
 
16
$|=1;
Line 16... Line 17...
16
 
17
 
17
my $cookie_string = authenticate(3) || die;
18
my $cookie_string = authenticate(3) || die;
18
my ($EML, $PWD, $LVL) = split /&/, $cookie_string;
19
my ($EML, $PWD, $LVL) = split /&/, $cookie_string;
19
my $user = getUser($EML);
20
my $user = getUser($EML);
Line 26... Line 27...
26
#}
27
#}
27
my $change = param ('change');
28
my $change = param ('change');
28
my $RCid   = param ('RCid') // $user->{RCid};
29
my $RCid   = param ('RCid') // $user->{RCid};
29
my $MVPid     = param ('MVPid');
30
my $MVPid     = param ('MVPid');
Line -... Line 31...
-
 
31
 
-
 
32
my $targetUser = getUser $RCid;
30
 
33
 
Line 31... Line 34...
31
print start_html (-title => "vORC Update MVP Ticket Match", -style => {'src' => "/style.css"}), $h->open ("body");
34
print start_html (-title => "vORC Update MVP Ticket Match", -style => {'src' => "/style.css"}), $h->open ("body");
Line 32... Line 35...
32
 
35
 
Line 42... Line 45...
42
  ]);
45
  ]);
Line 43... Line 46...
43
 
46
 
44
} else {
47
} else {
Line 45... Line 48...
45
  print $h->p ("Making an MVP Ticket change...");
48
  print $h->p ("Making an MVP Ticket change...");
46
 
49
 
Line 47... Line 50...
47
  my $target = getUserDerbyName ($RCid);
50
  my $target = $targetUser->{derby_name};
48
  print $h->p ("So, <b>$user->{derby_name}</b>, you'd like to <b>$change</b> an MVP Ticket for <b>$target</b>: <b>$RCid</b>...");
51
  print $h->p ("So, <b>$user->{derby_name}</b>, you'd like to <b>$change</b> an MVP Ticket for <b>$target</b>: <b>$RCid</b>...");
49
 
52
 
Line 110... Line 113...
110
  
113
  
111
  if ($sth->execute ($rcid, $mvpid)) {
114
  if ($sth->execute ($rcid, $mvpid)) {
112
    logit ($user->{RCid}, "Updated MVP Ticket: $rcid $change $mvpid");
115
    logit ($user->{RCid}, "Updated MVP Ticket: $rcid $change $mvpid");
113
    logit ($rcid, "MVP Ticket Change: $user->{derby_name} $change");
116
    logit ($rcid, "MVP Ticket Change: $user->{derby_name} $change");
-
 
117
    print "SUCCESS!";
-
 
118
    ## Send the user an email...
114
    print "SUCCESS!";
119
    sendEmail ($targetUser) if $change eq "add";
115
    return;
120
    return;
116
  } else {
121
  } else {
117
    return "ERROR: Something failed. Maybe this will help:". $sth->errstr();
122
    return "ERROR: Something failed. Maybe this will help:". $sth->errstr();
118
  }  
-
 
119
}
123
  }  
-
 
124
}
-
 
125
 
-
 
126
 
-
 
127
sub sendEmail {
-
 
128
	use RCMailer;
-
 
129
	my $data = shift;
-
 
130
 
-
 
131
	my $email = $data->{email};
-
 
132
	my $subject = "RollerCon MVP Ticket Added to Account";
-
 
133
	my $body = $h->p (
-
 
134
    "Greetings,",
-
 
135
    "Your account to sign up for MVP Classes at RollerCon with the following information:",
-
 
136
 
-
 
137
    $h->ul ([
-
 
138
      $h->li ("Derby Name: $data->{derby_name}", "Real Name: 	$data->{real_name}", "Email Address: $data->{email}")
-
 
139
      ]),
-
 
140
 
-
 
141
    "Has been activated!",
-
 
142
 
-
 
143
    "You are now able to log in to view and sign up for classes (after June 16th)!  YAAAAAYYYY!!!!!  (Imagine Kermit the Frog doing muppet hands here.)",
-
 
144
 
-
 
145
    $h->a ({ href=>"https://volunteers.rollercon.com/schedule/classes.pl" }, "Take me to the classes!"),
-
 
146
 
-
 
147
    "Please note that you are limited to signing up for a limited number of classes.",
-
 
148
 
-
 
149
    "If you've already signed up for your limit of classes, but another class REALLY strikes your fancy, try dropping one of your current classes.  That should allow you to pick up a different one.",
-
 
150
 
-
 
151
    "The number of classes you're allowed to sign up for starts at two, but may increase as we get closer to RollerCon.",
-
 
152
 
-
 
153
    "If you're new to using vORC, you may want to read this:",
-
 
154
 
-
 
155
    $h->a ({ href=>"https://rollercon.com/about/mvp-class-reg/how-to-vorc/" }, "How to VORC"),
-
 
156
 
-
 
157
    "-RollerCon Management",
-
 
158
    "(this is an automated message, please don't reply)"
-
 
159
  );
-
 
160
 
-
 
161
	# send the message
-
 
162
	EmailUser($email, $subject, $body);
-
 
163
}