From: hickert Date: Fri, 22 Jan 2010 10:22:57 +0000 (+0000) Subject: Removed unused class X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8dee102ec5b215a9695e61abc3ec1827df80be3d;p=gosa.git Removed unused class git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15252 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/addons/goto/class_target_list.inc b/gosa-plugins/goto/addons/goto/class_target_list.inc deleted file mode 100644 index 5ae70c23b..000000000 --- a/gosa-plugins/goto/addons/goto/class_target_list.inc +++ /dev/null @@ -1,334 +0,0 @@ -AddCheckBox */ - var $ogroups ; - var $servers ; - var $workstations ; - var $incoming ; - - - /* Subsearch checkbox */ - var $SubSearch ; - var $IPMatch ; - var $parent ; - var $ui ; - - - function target_list(&$config,$Targets_used) - { - MultiSelectWindow::MultiSelectWindow($config, "Targetselection", array("ogroup","server","incoming","workstation","gotomasses")); - - $this->Targets_used = $Targets_used; - - $this->SetInformation( _("Select the target objects for your scheduled action.")); - $this->SetTitle( _("Available targets")); - $this->SetSummary( _("Available targets")); - $this->SetHeadpageMode(FALSE); - - /* set Page header */ - $chk = ""; - $this->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'")); - - $this->AddHeader(array("string" => " ", "attach" => "style='text-align:center;width:20px;'")); - $this->AddHeader(array("string" => _("Object name"), "attach" => "style=''")); - - /* Text ,Value, Name, Is selected */ - $this->AddCheckBox("ogroups", _("Select to see object groups"), _("Show object groups"), true); - $this->AddCheckBox("servers", _("Select to see servers") , _("Show servers"), true); - $this->AddCheckBox("workstations", _("Select to see workstations"),_("Show workstations"), true); - $this->AddCheckBox("incoming", _("Select to see incoming objects") , _("Show new objects"), true); - - /* Add SubSearch checkbox */ - $this->AddCheckBox(SEPERATOR); - $this->AddCheckBox("SubSearch", msgPool::selectToView("","subsearch"), msgPool::selectToView("","subsearch_small"), false); - $this->AddCheckBox("IPMatch", _("Select to search for a specific IP range only"), _("Match IP range"), false); - - /* Name,Text,Default , Connect with alphabet */ - $this->AddRegex ("Regex", _("Regular expression for matching group names"), "*" , true); - $this->AddRegex ("IP_start", _("IP range start"), "0.0.0.0" , true); - $this->AddRegex ("IP_end", _("IP range end"), "255.255.255.255" , true); - $this->EnableAplhabet(TRUE); - } - - - function GenHeader() - { - $options= ""; - - /* Get all departments within this subtree */ - $ui= get_userinfo(); - $first = ""; - $found = FALSE; - $base = $this->config->current['BASE']; - - /* Add base */ - $tmp = array(); - $tmp[] = array("dn"=>$this->config->current['BASE']); - $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, - array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); - - $deps = array(); - foreach($tmp as $tm){ - $deps[$tm['dn']] = $tm['dn']; - } - - /* Load possible departments */ - $ui= get_userinfo(); - $tdeps= $ui->get_module_departments("ogroups"); - $ids = $this->config->idepartments; - $first = ""; - $found = FALSE; - foreach($ids as $dep => $name){ - if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ - - /* Keep first base dn in mind, we could need this - * info if no valid base was found - */ - if(empty($first)) { - $first = $dep['dn']; - } - - $value = $ids[$dep]; - if ($this->selectedBase == $dep){ - $found = TRUE; - $options.= ""; - } else { - $options.= ""; - } - } - } - - /* The currently used base is not visible with your acl setup. - * Set base to first useable base. - */ - if(!$found){ - $this->selectedBase = $first; - } - - /* Get copy & paste icon */ - $acls = $ui->get_permissions($this->selectedBase,"ogroups/ogroup"); - $acl_all= $ui->has_complete_category_acls($this->selectedBase,"ogroups"); - - /* Add default header */ - $listhead = MultiSelectWindow::get_default_header(); - - /* Add department selector */ - $listhead .= _("Base")." ". - "  "; - $listhead .=""; - - $this->SetListHeader($listhead); - } - - - function execute() - { - $this->ClearElementsList(); - $this->GenHeader(); - $this->reload(); - $this->SetEntries($this->list); - return($this->Draw()); - } - - - function SetEntries($list) - { - /* Add Copy & Paste buttons if copy&paste is enabled - */ - // Defining Links - $editlink = "%s"; - - $ui = get_userinfo(); - - // Assigning ogroups - foreach($list as $key => $val){ - - if(in_array($val['cn'][0],$this->Targets_used) || - isset($val['macAddress'][0]) && in_array($val['macAddress'][0],$this->Targets_used)) continue; - - $title = "title='".preg_replace('/ /', ' ', LDAP::fix($val['dn']))."'"; - if(!isset($val['description'][0])){ - $desc = ""; - }else{ - $desc = " - [ ".$val['description'][0]." ]"; - } - if(!isset($val['ipHostNumber'][0])){ - $desc.= ""; - }else{ - $desc.= " - ".$val['ipHostNumber'][0].""; - } - - - $img ="Hmm"; - if(in_array("goServer",$val['objectClass'])){ - $img = ""._("Server").""; - }elseif(in_array("gotoWorkstation",$val['objectClass'])){ - $img = ""._("Workstation").""; - }elseif(in_array("gosaGroupOfNames",$val['objectClass'])){ - $img = ""._("Object group").""; - } - - /* Create each field */ - $field0 = array("string" => "" , - "attach" => "style='width:20px;'"); - $field1 = array("string" => $img, - "attach" => "style='text- align:center;width: 20px;'"); - $field2 = array("string" => $val['cn'][0].$desc, - "attach" => "style='border-right:0px;' ".$title); - - $this->AddElement(array($field0,$field1,$field2)); - } - } - - - function save() - { - $ret = array(); - $items = $this->list_get_selected_items(); - foreach($items as $item){ - $ret[] = $this->list[$item]; - } - return($ret); - } - - - function save_object() - { - MultiSelectWindow::save_object(); - } - - - function reload() - { - /* Set base for all searches && initialise some vars */ - $this->list= array(); - $base = $this->selectedBase; - $filter = ""; - $Regex = $this->Regex; - $IP_start = $this->IP_start; - $IP_end = $this->IP_end; - - if($this->IPMatch){ - if(!tests::is_ip($IP_start)){ - msg_dialog::display(_("Error"), msgPool::invalid(_("IP range")), ERROR_DIALOG); - return; - } - if(!tests::is_ip($IP_end)){ - msg_dialog::display(_("Error"), msgPool::invalid(_("IP range")), ERROR_DIALOG); - return; - } - } - - - $chk = array( - "ogroups" => "(&(objectClass=gosaGroupOfNames)(|(gosaGroupObjects=*S*)(gosaGroupObjects=*W*)))" , - "servers" => "(objectClass=goServer)" , - "incoming" => "(objectClass=GOhard)" , - "workstations" => "(objectClass=gotoWorkstation)"); - - /* Create filter */ - foreach($chk as $chkBox => $FilterPart){ - if($this->$chkBox){ - $filter .= $FilterPart; - } - } - $filter= "(&(cn=".$Regex.")(|".$filter."))"; - - if($this->SubSearch){ - $res= get_list($filter, array("ogroups","workstations","servers"), $base, - array("cn","objectClass","gosaGroupObjects","ipHostNumber","description"), GL_SIZELIMIT | GL_SUBSEARCH); - }else{ - $res= get_list($filter, "ogroups", get_groups_ou().$base, - array("cn","objectClass","ipHostNumber","description"), GL_SIZELIMIT ); - $res= array_merge($res,get_list($filter, "workstation", get_ou('workstationRDN').$base, - array("cn","objectClass","ipHostNumber","description"), GL_SIZELIMIT )); - $res= array_merge($res,get_list($filter, "server", get_ou('serverRDN').$base, - array("cn","objectClass","ipHostNumber","description"), GL_SIZELIMIT )); - - $deps_a = array( - get_ou("workstationRDN"), - get_ou("incominou"), - get_ou("serverRDN"), - get_ou("ogroupRDN")); - - $res = get_sub_list($filter,array("server","incoming","workstation","ogroup"), - $deps_a,get_ou("systemRDN").$base,array("cn","objectClass","ipHostNumber","description"),GL_SIZELIMIT); - } - - $this->list= $res; - ksort ($this->list); - reset ($this->list); - $tmp=array(); - foreach($this->list as $tkey => $val ){ - - if($this->IPMatch){ - if(isset($val['ipHostNumber'][0])){ - if(tests::is_ip_range($IP_start,$val['ipHostNumber'][0]) && tests::is_ip_range($val['ipHostNumber'][0],$IP_end)){ - $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; - } - } - }else{ - $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; - } - } - ksort($tmp); - $this->list=array(); - foreach($tmp as $val){ - $this->list[]=$val; - } - reset ($this->list); - } - - function list_get_selected_items() - { - $ids = array(); - foreach($_POST as $name => $value){ - if(preg_match("/^item_selected_[0-9]*$/",$name)){ - $id = preg_replace("/^item_selected_/","",$name); - $ids[$id] = $id; - } - } - return($ids); - } -} - - -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?>