Ticket #11 (closed task: fixed)
hi-world cup
| Reported by: | juruen@… | Owned by: | juruen@… |
|---|---|---|---|
| Milestone: | Component: | base | |
| Severity: | minor | Keywords: | rthml tab space editor js |
| Cc: | hi-world cup |
Description
Just now there are functions like removeFromObject (Objects.pm) or removePortRedirection (Firewall.pm) which receive several parameters and compare them to all of the existing members in the directory to see which one should they remove:
sub removePortRedirection # (protocol, ext_port, interface) ...
my @reds = $self->all_dirs("redirections"); foreach (@reds) {
($self->get_string("$_/protocol") eq $proto) or next; ($self->get_int("$_/eport") eq $eport) or next; ($self->get_string("$_/iface") eq $iface) or next; $self->delete_dir($_); return 1;
}
It would be easier and nicer to use the id to remove this kind of data, so function can look like:
sub removePortRedirection # (id) ...
$self->delete_dir($id);
I've changed array_from_dir_function from GConfModule to include on its hash the subdirectory (id on these cases), so templates can write this id as a hidden attribute and use it as a parameter for that kind of functions.
Task for this ticket is: a) to change existing functions b) apply this to newly created functions