diff options
author | Russ Allbery <rra@stanford.edu> | 2008-01-17 22:55:17 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-01-17 22:55:17 +0000 |
commit | 275cc7eac5d693bffec19884bf37322df59a871c (patch) | |
tree | efa1359a78376b1c4976a5674a37e75093c61094 /perl/Wallet/Server.pm | |
parent | 8dd5883b8497e4dcc7cf4f0577e45040c5f43430 (diff) |
Support enforcing a naming policy for wallet objects via a Perl
function in the wallet server configuration file.
Diffstat (limited to 'perl/Wallet/Server.pm')
-rw-r--r-- | perl/Wallet/Server.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/perl/Wallet/Server.pm b/perl/Wallet/Server.pm index 87a5bab..6be7e59 100644 --- a/perl/Wallet/Server.pm +++ b/perl/Wallet/Server.pm @@ -23,7 +23,7 @@ use Wallet::Schema; # This version should be increased on any code change to this module. Always # use two digits for the minor version with a leading zero if necessary so # that it will sort properly. -$VERSION = '0.04'; +$VERSION = '0.05'; ############################################################################## # Utility methods @@ -247,6 +247,13 @@ sub create { unless ($acl) { return unless $self->{admin}->check ($user); } + if (defined (&Wallet::Config::verify_name)) { + my $error = Wallet::Config::verify_name ($type, $name, $user); + if ($error) { + $self->error ("${type}:${name} rejected: $error"); + return; + } + } my $object = eval { $class->create ($type, $name, $dbh, $user, $host) }; if ($@) { $self->error ($@); |