diff options
author | Gustav Eek <gustav.eek@fripost.org> | 2011-05-14 13:41:47 +0200 |
---|---|---|
committer | Gustav Eek <gustav.eek@fripost.org> | 2011-05-14 13:41:47 +0200 |
commit | e14bd8eea4ad519e36a56dc868ed2e9effe1295e (patch) | |
tree | 1f4e6441be3602fa596b8564cc893b464580c503 /fripost-newdomain | |
parent | 16ed1260dd2433d9c25cd550a06c175093416f58 (diff) | |
parent | ab34b78c7b247436a3d10d89b5f029fbe093ffe5 (diff) |
Merge branch 'master' of https://github.com/skangas/fripost-tools
Diffstat (limited to 'fripost-newdomain')
-rwxr-xr-x | fripost-newdomain | 10 |
1 files changed, 4 insertions, 6 deletions
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..."; |