Subversion Repositories ORC

Rev

Rev 18 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/usr/bin/perl

use strict;
use cPanelUserConfig;
use RollerCon;
use CGI;
use CGI::Cookie;
use DBI;
use WebDB;

my $dbh = WebDB->connect ();
my $act_han = $dbh->prepare("update official set access = 1 where RCid = ?");
my $users   = $dbh->prepare("select * from official where access = 0 order by RCid");

my $cookie_string = authenticate(5) || die;
my ($EML, $PWD, $LVL) = split /&/, $cookie_string;
my $user = getUser($EML);
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");

print CGI::header(-cookie=>$RCAUTH_cookie);

logit($user->{RCid}, "Activated All Accounts");

printRCHeader("");
print<<page1;
<TR><TD colspan=2>
Activating registered users without access...<br>
Retrieving list of users who need to be activated...<br>
page1

$users->execute() || print $dbh->errstr && die("Failed to get users from database."); 
while (my $U = $users->fetchrow_hashref()) {
        print "&nbsp;&nbsp;&nbsp;&nbsp;Activating $U->{derby_name}...";
        $act_han->execute($U->{RCid}) || print $dbh->errstr;
        logit($U->{RCid}, "Account Activated (by ".getUser($EML)->{derby_name}.")");
        logit($user->{RCid}, "Activated ".$U->{derby_name}." (".$U->{RCid}.")");
        sendEmail($U);
        print "Done.<br>\n";
}

print "<br><br><a href='/schedule/'>[Home]</a>";


sub sendEmail {
        use RCMailer;
        my $data = shift;

        my $email = $data->{email};
        my $subject = 'Officiating RollerCon Schedule Manager - User Activated';
        my $body = "Greetings,

This should hopefully be the second automated message you've received from us.  Your new account to Volunteer at RollerCon with the following information:

                Derby Name: $data->{derby_name} 
                Real Name:      $data->{real_name}
                Email Address: $data->{email}
                Phone: $data->{phone}
                Type: $data->{type}
                Level:  $data->{level}

Has been activated!

You are now able to log in to view and sign up for shifts!  YAAAAAYYYY!!!!!  (Imagine Kermit the Frog doing muppet hands here.)

https://volunteers.rollercon.com/schedule/

Please note that for now, you are limited to signing up to two shifts per day.  (Meaning, once you sign up for two shifts, you'll have to wait until tomorrow to sign up for two more.)  Please understand, while you are a nice, concientious, and good-looking person yourself, who knows how to share, there are others out there that will hogger up all of the shifts.  As time goes by and we get closer to the event, we may lift the limit.  Who knows?

If you've already signed up for two, and another shift REALLY strikes your fancy, try dropping one of your shifts.  That should allow you to pick up a different one.

We'll be adding shifts over time, again to throttle how fast some people (not you, mind you) gobble up the shifts.  Check back, maybe even daily.

If you didn't make this request, well, you're still the only one who received this email, and you now have an active account.  You should probably let us know that someone is messing with you, or just sign up for shifts (if you're actually coming to RollerCon, that is).

-RollerCon Officiating Management
";

        # send the message
        EmailUser($email, $subject, $body);
}