Addbugzilla.pl

From In The Wings
Revision as of 12:48, 16 August 2007 by Jka (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This was a quick script I whipped up in order to add user accounts to Bugzilla when we needed them. We had blocked account creation on the Bugzilla website from just anyone in order to block spammers.

#!/usr/bin/perl

# We use strict, because that is a good thing. LWP::Simple is for connections
# to the web.

use strict;
use LWP::Simple;

my $email = $ARGV[0];
if (!$email) {
    print "Usage: addbugzilla.pl <email>\n";
    exit;
}

print "User's full name: ";
my $name = <STDIN>;

$name =~ s/ /\%20/g;

my $url = 'http://bugzilla.hpc.ufl.edu/createaccount.cgi?login=' .
    $email . '&realname=' . $name;

my $content = get $url;

print $name . " has been added to Bugzilla.\n";