[Netpass-devel] NetPass/lib/NetPass Config.pm,1.46,1.47 DB.pm,1.45,1.46
Brought to you by:
jeffmurphy
From: jeff m. <jef...@us...> - 2005-06-08 16:35:50
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4634/lib/NetPass Modified Files: Config.pm DB.pm Log Message: bug fixes to editor, auth methods UI feature Index: Config.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/Config.pm,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- Config.pm 3 Jun 2005 19:41:22 -0000 1.46 +++ Config.pm 8 Jun 2005 16:35:41 -0000 1.47 @@ -761,6 +761,46 @@ return 0; } +=head2 $cfg-E<gt>delNetwork(-network => '') + +Given a network, delete it from the config. + +RETURNS + +0 on success +"no such network" no such network +"..." on failure + +=cut + + +sub delNetwork { + my $self = shift; + + my $parms = parse_parms({ + -parms => \@_, + -legal => [qw(-network)], + -required => [qw(-network)], + -defaults => { -network => '' } + } + ); + + if (!defined($parms)) { + return "invalid parameters: ".Carp::longmess("invalid parameters ".Class::ParmList->error); + } + + my ($network) = $parms->get('-network'); + + $self->reloadIfChanged(); + + if( $self->{'cfg'}->obj('network')->exists($network) ) { + $self->{'cfg'}->obj('network')->delete($network); + return 0; + } + + return "no such network"; +} + =head2 $cfg-E<gt>setHA(-network => '', -enabled => 0|1, -primary => '', -secondary => '', -virtualip => '', -servers => []) Enable, disable and set High Availability related info. All parameters are required except for 'secondary'. Index: DB.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/DB.pm,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- DB.pm 2 Jun 2005 20:34:49 -0000 1.45 +++ DB.pm 8 Jun 2005 16:35:41 -0000 1.46 @@ -1720,12 +1720,12 @@ Example $dbh->audit(-mac => 112233445566, -ip => '1.2.3.4', -user => 'foo', - "this user", "did something"); + -msg => ["this user", "did something"]); results in "this user did something" being inserted. $dbh->audit(-mac => 112233445566, -ip => '1.2.3.4', -user => 'foo', - "this user %s something", "did"); + -msg => ["this user %s something", "did"]); results in "this user did something" being inserted. @@ -1786,7 +1786,7 @@ if (! $self->{'dbh'}->do($sql) ) { - _log "ERROR", "failed to submit audit entry ".$self->{'dbh'}->errstr." ($sql)\n"; + _log("ERROR", "failed to submit audit entry ".$self->{'dbh'}->errstr." ($sql)\n"); return 0; } |