3 # Find a shared network with a certain name and re-direct to its editing form
5 require './dhcpd-lib.pl';
7 $in{'shared'} || &error($text{'lookup_esharedname'});
9 # Recursively find shared nets
10 $conf = &get_config();
11 @shareds = &find_recursive("shared-network", $conf);
14 %access = &get_module_acl();
15 foreach $s (@shareds) {
16 local $can_view = &can('r', \%access, $s);
17 next if !$can_view && $access{'hide'};
18 if (&search_re($s->{'values'}->[0], $in{'shared'})) {
24 # Go to the shared network or show an error
26 ($gidx, $uidx, $sidx) = &find_parents($shared);
27 &redirect("edit_shared.cgi?idx=$shared->{'index'}".
28 (defined($gidx) ? "&gidx=$gidx" : "").
29 (defined($uidx) ? "&uidx=$uidx" : "").
30 (defined($sidx) ? "&sidx=$sidx" : ""));
33 &error(&text('lookup_eshared', $in{'shared'}));