Rev | Line | |
---|
[1371] | 1 | package LATMOS::Accounts::Bases::OCHelper::Nethost; |
---|
| 2 | |
---|
| 3 | # $Id: OCHelper.pm 2932 2010-08-10 17:19:21Z nanardon $ |
---|
| 4 | |
---|
| 5 | use strict; |
---|
| 6 | use warnings; |
---|
| 7 | |
---|
| 8 | use base qw(LATMOS::Accounts::Bases::OCHelper); |
---|
| 9 | |
---|
| 10 | =head1 NAME |
---|
| 11 | |
---|
| 12 | LATMOS::Accounts::Bases::OCHelper - Object creation helper |
---|
| 13 | |
---|
| 14 | =head1 DESCRIPTION |
---|
| 15 | |
---|
| 16 | This module is designed to be subclassed. |
---|
| 17 | |
---|
| 18 | =head1 FUNCTIONS |
---|
| 19 | |
---|
| 20 | =cut |
---|
| 21 | |
---|
| 22 | # just return status, $info is reference |
---|
| 23 | sub _step { |
---|
| 24 | my ($self, $info) = @_; |
---|
| 25 | |
---|
| 26 | if ($info->{step} == 0) { |
---|
| 27 | $info->{name}{ask} = 1; |
---|
| 28 | @{$info->{ask}} = qw( |
---|
| 29 | description |
---|
| 30 | ip |
---|
| 31 | ipFrom |
---|
| 32 | macaddr |
---|
| 33 | owner |
---|
| 34 | user |
---|
| 35 | unexported |
---|
| 36 | ); |
---|
| 37 | $info->{step} = 1; |
---|
| 38 | return 'NEEDINFO'; |
---|
| 39 | } elsif ($info->{step} == 1) { |
---|
| 40 | if ($self->base->create_c_object($self->otype, |
---|
| 41 | $info->{name}{content}, |
---|
| 42 | %{$info->{contents} || {}}, |
---|
| 43 | )) { |
---|
| 44 | return 'CREATED'; |
---|
| 45 | } else { |
---|
| 46 | return 'ERROR'; |
---|
| 47 | } |
---|
| 48 | } else { |
---|
| 49 | return undef; |
---|
| 50 | } |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | 1; |
---|
| 54 | |
---|
| 55 | __END__ |
---|
| 56 | |
---|
| 57 | =head1 SEE ALSO |
---|
| 58 | |
---|
| 59 | L<LATMOS::Accounts::Bases>, L<LATMOS::Accounts::Bases::Objects> |
---|
| 60 | |
---|
| 61 | =head1 AUTHOR |
---|
| 62 | |
---|
| 63 | Olivier Thauvin, E<lt>olivier.thauvin@latmos.ipsl.frE<gt> |
---|
| 64 | |
---|
| 65 | =head1 COPYRIGHT AND LICENSE |
---|
| 66 | |
---|
| 67 | Copyright (C) 2012 CNRS SA/CETP/LATMOS |
---|
| 68 | |
---|
| 69 | This library is free software; you can redistribute it and/or modify |
---|
| 70 | it under the same terms as Perl itself, either Perl version 5.10.0 or, |
---|
| 71 | at your option, any later version of Perl 5 you may have available. |
---|
| 72 | |
---|
| 73 | =cut |
---|
Note: See
TracBrowser
for help on using the repository browser.