#!/usr/bin/perl -w
#
-# $Id: registerd.Pg,v 1.6 2001-04-26 02:20:41 ivan Exp $
+# $Id: registerd.Pg,v 1.9 2001-04-26 02:28:40 ivan Exp $
use strict;
use vars qw(
my $username = $row->{'username'};
my $email = $row->{'passwd'};
- my $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; };
my $psth = $pdbh->prepare("CREATE DATABASE demo_$username")
- or do { &myerr("$username: ". $pdbh->errstr;); next; };
+ 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; };
+ or do { &myerr("fatal: $DBI::errstr"); die; };
open(PSQL,"|psql -U freeside demo_$username")
or do { &myerr("|psql -U freeside demo_$username: $!"); next; };
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;