#!/usr/bin/perl -w
#
-# $Id: registerd.Pg,v 1.5 2001-04-26 02:18:15 ivan Exp $
+# $Id: registerd.Pg,v 1.11 2001-10-24 15:29:30 ivan Exp $
use strict;
use vars qw(
my $username = $row->{'username'};
my $email = $row->{'passwd'};
- $pdbh = DBI->connect( 'DBI:Pg:host=localhost;database=demo_template', 'freeside', 'maelcolm' )
+ my $pdbh = DBI->connect( 'DBI:Pg:host=localhost;dbname=demo_template', 'freeside', 'maelcolm' )
or do { &myerr("$username: ". $DBI::errstr); next; };
- $psth = $pdbh->prepare("CREATE DATABASE demo_$username")
- or do { &myerr("$username: ". $pdbh->errstr;); next; };
+ my $psth = $pdbh->prepare("CREATE DATABASE demo_$username")
+ or do { &myerr("$username: ". $pdbh->errstr); next; };
$psth->execute()
- or do { &myerr("$username: ". $psth->errstr;); next; };
+ or do { &myerr("$username: ". $psth->errstr); next; };
+
+ $pdbh->disconnect
+ or do { &myerr("fatal: $DBI::errstr"); die; };
open(PSQL,"|psql -U freeside demo_$username")
or do { &myerr("|psql -U freeside demo_$username: $!"); next; };
print LPR "mail $email";
close LPR;
- open(FROM, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from")
- or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from: $!";
- print FROM "$email\n";
- close FROM;
-
- open(TO, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to")
- or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to: $!";
- print TO "$email\n";
- close TO;
+# open(FROM, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from")
+# or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from: $!";
+# print FROM "$email\n";
+# close FROM;
+#
+# open(TO, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to")
+# or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to: $!";
+# print TO "$email\n";
+# close TO;
open(SECRETS, ">${freeside_conf}secrets.demo_$username")
or die "Can\'t open ${freeside_conf}secrets.demo_$username: $!";
"\n",
"Your sample Freeside database has been setup.\n",
"\n",
+ "Your login and database will be automatically deleted in 1-2 months.\n",
+ "\n",
"Point your web browswer at http://freeside.sisd.com/ and use the following\n",
"authentication information:\n",
"\n",
sub myerr {
my $msg = shift;
- open(MAIL,"|mail ivan-fsdemoerr@420.am");
+ open(MAIL,"|mail ivan-fsdemoerr\@420.am");
print MAIL $msg, "\n\n";
print MAIL $msg, "\n\n";
close MAIL;