diff options
author | ivan <ivan> | 2003-09-29 05:51:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2003-09-29 05:51:50 +0000 |
commit | b59a412755582d30b4f7be2147b6ad32037e6f59 (patch) | |
tree | 141edb3dba7f8271adb4e87413c428c844ab3bbb /FS/FS/agent.pm | |
parent | e17e58178d528e16d45c333996f763afda55e054 (diff) |
agents can be disabled (auto-sensing based on schema)
Diffstat (limited to 'FS/FS/agent.pm')
-rw-r--r-- | FS/FS/agent.pm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index 6de15ae..bcba602 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -50,6 +50,12 @@ from FS::Record. The following fields are currently supported: =item freq - For future use. +=item disabled - Disabled flag, empty or 'Y' + +=item username - Username for the Agent interface + +=item _password - Password for the Agent interface + =back =head1 METHODS @@ -110,6 +116,21 @@ sub check { ; return $error if $error; + if ( $self->dbdef_table->column('disabled') ) { + $error = $self->ut_enum('disabled', [ '', 'Y' ] ); + return $error if $error; + } + + if ( $self->dbdef_table->column('username') ) { + $error = $self->ut_alphan('username'); + return $error if $error; + if ( length($self->username) ) { + $error = $self->ut_text('password'); # ut_text... arbitrary choice + } else { + $self->_password(''); + } + } + return "Unknown typenum!" unless $self->agent_type; @@ -144,7 +165,7 @@ sub pkgpart_hashref { =head1 VERSION -$Id: agent.pm,v 1.4 2003-08-05 00:20:40 khoff Exp $ +$Id: agent.pm,v 1.5 2003-09-29 05:51:50 ivan Exp $ =head1 BUGS |