X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/0038d2a7a4bb627191ee20942bab28c45b54fa17..9636227ee0ce9cb050db33573e523d68764ebde8:/SL/DB/AuthClient.pm?ds=inline diff --git a/SL/DB/AuthClient.pm b/SL/DB/AuthClient.pm index bf016a646..9e3d3e8ef 100644 --- a/SL/DB/AuthClient.pm +++ b/SL/DB/AuthClient.pm @@ -4,6 +4,7 @@ use strict; use SL::DB::MetaSetup::AuthClient; use SL::DB::Manager::AuthClient; +use SL::DB::Helper::Util; __PACKAGE__->meta->add_relationship( users => { @@ -22,4 +23,19 @@ __PACKAGE__->meta->add_relationship( __PACKAGE__->meta->initialize; +sub validate { + my ($self) = @_; + + my @errors; + push @errors, $::locale->text('The name is missing.') if !$self->name; + push @errors, $::locale->text('The database name is missing.') if !$self->dbname; + push @errors, $::locale->text('The database host is missing.') if !$self->dbhost; + push @errors, $::locale->text('The database port is missing.') if !$self->dbport; + push @errors, $::locale->text('The database user is missing.') if !$self->dbuser; + push @errors, $::locale->text('The name is not unique.') if !SL::DB::Helper::Util::is_unique($self, 'name'); + push @errors, $::locale->text('The combination of database host, port and name is not unique.') if !SL::DB::Helper::Util::is_unique($self, 'dbhost', 'dbport', 'dbname'); + + return @errors; +} + 1;