Modify

Ticket #11 (closed task: fixed)

Opened 8 years ago

Last modified 3 years ago

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

Attachments

Change History

comment:1 Changed 7 years ago by dbaeyens@…

  • Reporter changed from dbaeyens@… to juruen@…

comment:2 Changed 7 years ago by dbaeyens@…

  • Owner changed from gontanon@… to juruen@…

comment:3 Changed 7 years ago by juruen@…

  • Milestone changed from 0.7.1 to 0.8

comment:4 Changed 7 years ago by juruen@…

  • Type changed from defect to task

comment:7 Changed 6 years ago by juruen@…

  • Milestone changed from 0.9 to 0.12
  • billable set to 0

comment:9 Changed 4 years ago by juruen@…

  • Status changed from new to closed
  • Resolution set to fixed
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.