sub web_manual_grouping { my $type = cgi_param ('type') || ""; my $group = cgi_param ('group') || ""; my $mode = cgi_param ('mode') || ""; my $device = cgi_param ('device') || ""; my $child = cgi_param ('child') || ""; my $entity; if ($type eq "") { errlog ($ERR_DEBUG, "type is missing"); return; } elsif ($group eq "") { errlog ($ERR_DEBUG, "group is missing"); return; } elsif ($mode eq "") { errlog ($ERR_DEBUG, "mode is missing"); return; } if ($mode eq "assign" || $mode eq "clear") { if ($device ne "" && $child ne "") { $entity = $device." ".$child; } else { if ($device ne "") { $entity = $device; } else { errlog ($ERR_DEBUG, "device is missing"); return; } } } group_manual_load_cfg (); given ($mode) { when ("add") { group_manual_add ($type, $group); } when ("assign") { group_manual_assign ($type, $entity, $group); } when ("clear") { group_manual_clear ($type, $entity, $group); } when ("delete") { group_manual_delete ($type, $group); } } group_manual_save_cfg (); adb_flush (); }