From c7701570975feab6dd268802c6f552381d691529 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 21 Mar 2011 22:31:02 +0100 Subject: Updates --- fripost-newdomain | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'fripost-newdomain') diff --git a/fripost-newdomain b/fripost-newdomain index cf781ed..99c2ce3 100755 --- a/fripost-newdomain +++ b/fripost-newdomain @@ -3,6 +3,7 @@ use 5.010_000; use warnings; use strict; +use utf8; =head1 NAME @@ -10,8 +11,6 @@ fripost-newdomain - Add a new domain to the system =cut -our $VERSION = '0.01'; - use FindBin qw($Bin); use lib "$Bin/lib"; @@ -27,7 +26,7 @@ use YAML::Syck; our $conf = LoadFile('default.yml'); GetOptions( - 'dbi_dsn' => \$conf->{dbi_dsn}, + 'dbi_dsn' => \$conf->{dbi_dsn}, 'admuser=s' => \$conf->{admuser}, 'admpass=s' => \$conf->{admpass}, 'pretend' => \$conf->{pretend}, @@ -38,13 +37,12 @@ my $schema = Fripost::Schema->connect( $conf->{dbi_dsn}, $conf->{admuser}, $conf->{admpass}, {} #\%dbi_params ); -say "Adding a new domain."; - my %domain; $domain{domain} = prompt "Domain name: "; -$domain{description} = prompt_username("User to associate domain with: "); +$domain{description} = prompt_email("Belongs to user: ", 'is_user'); ## TODO: Make sure the user does exists +## TODO: Warn if the user has a domain already if ($conf->{pretend}) { say "Nothing to do since we are only pretending..."; -- cgit v1.2.3