summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea84311)
raw | patch | inline | side by side (parent: ea84311)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 21 Jan 2010 16:27:32 +0000 (16:27 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 21 Jan 2010 16:27:32 +0000 (16:27 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15240 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto/addons/goto/events/class_EventTargetAddList.inc b/gosa-plugins/goto/addons/goto/events/class_EventTargetAddList.inc
index 01a1cabe0b58e8f48d2438526967063761d44fb1..06ab8c7ae13b71195464d4f22ae9ea34fee61642 100644 (file)
$this->storagePoints = array(
get_ou("serverRDN"),
get_ou("workstationRDN"),
+ get_ou("ogroupRDN"),
get_ou('terminalRDN'));
// Build filter
- if (session::global_is_set(get_class($this)."_filter")){
- $filter= session::global_get(get_class($this)."_filter");
- } else {
+# if (session::global_is_set(get_class($this)."_filter")){
+ # $filter= session::global_get(get_class($this)."_filter");
+ # } else {
$filter = new filter(get_template_path("../../addons/goto/events/eventTargetSystems-filter.xml", TRUE));
$filter->setObjectStorage($this->storagePoints);
- }
+ # }
$this->setFilter($filter);
// Build headpage
function get_selected_targets()
{
+ // Collect mac addresses
$entries = $this->save();
$macs = array();
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
+ $member_dns = array();
foreach($entries as $entry){
if(isset($entry['macAddress'][0])){
$macs[] = $entry['macAddress'][0];
}
+ if(in_array("gosaGroupOfNames", $entry['objectClass'])){
+ $ldap->cat($entry['dn']);
+ if($ldap->count()){
+ $attrs = $ldap->fetch();
+ if(isset($attrs['member'])){
+ for($i =0 ; $i< $attrs['member']['count']; $i++){
+ $member_dns[] = $attrs['member'][$i];
+ }
+ }
+ }
+ }
+ }
+ foreach($member_dns as $dn){
+ $ldap->cat($dn, array('macAddress'));
+ if($ldap->count()){
+ $attrs = $ldap->fetch();
+ if(isset($attrs['macAddress'])){
+ $macs[] = $attrs['macAddress'][0];
+ }
+ }
}
return($macs);
}
diff --git a/gosa-plugins/goto/addons/goto/events/eventTargetSystems-filter.xml b/gosa-plugins/goto/addons/goto/events/eventTargetSystems-filter.xml
index 7aa75de8d11eb9c2bdeac2a130b7c8deb7151df6..9ccd976da1f57fb44cacd53bafe8ac88e1dc5a4e 100644 (file)
<search>
<query>
<backend>SystemByIp</backend>
- <filter>(&(|$SERVER $WORKSTATION $TERMINAL ) $NAME) $IPSTART $IPSTOP $BYIP</filter>
+ <filter>(&(|$SERVER $WORKSTATION $TERMINAL $OGROUP) $NAME) $IPSTART $IPSTOP $BYIP</filter>
<attribute>dn</attribute>
<attribute>objectClass</attribute>
<attribute>cn</attribute>
</autocomplete>
</element>
+ <element>
+ <type>checkbox</type>
+ <tag>OGROUP</tag>
+ <default>true</default>
+ <set>(objectClass=gosaGroupOfNames)</set>
+ <unset></unset>
+ </element>
+
<element>
<type>checkbox</type>
<tag>SERVER</tag>
diff --git a/gosa-plugins/goto/addons/goto/events/eventTargetSystems-list.xml b/gosa-plugins/goto/addons/goto/events/eventTargetSystems-list.xml
index b863f795e06a27e0c33495df98e2349fdf28f8e1..4ef82076b216bc23543c05c1fdebe81e7c38bbbe 100644 (file)
<image>plugins/systems/images/select_terminal.png</image>
</objectType>
+ <objectType>
+ <label>Object Group</label>
+ <objectClass>gosaGroupOfNames</objectClass>
+ <category>ogroups</category>
+ <class>ogroup</class>
+ <image>plugins/ogroups/images/ogroup.png</image>
+ </objectType>
+
</definition>
<table>
- <layout>|20px;c|220px||</layout>
+ <layout>|20px;c|220px||||</layout>
<department>
<value>%{filter:objectType(dn,objectClass)}</value>
<department>
<value>%{filter:departmentLink(row,dn,description)}</value>
- <span>1</span>
+ <span>3</span>
</department>
<column>
<export>true</export>
</column>
+ <column>
+ <label>IP</label>
+ <sortAttribute>ipHostNumber</sortAttribute>
+ <sortType>string</sortType>
+ <value>%{ipHostNumber}</value>
+ <export>true</export>
+ </column>
+
+ <column>
+ <label>Mac</label>
+ <sortAttribute>macAddress</sortAttribute>
+ <sortType>string</sortType>
+ <value>%{macAddress}</value>
+ <export>true</export>
+ </column>
+
</table>
<actionmenu>