diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc
index 25b8bd30daa089122b8ffc09382c2e13d1f5261b..77c6eb364a81306ab70508cbad81cafd843834d2 100644 (file)
require "tabs_server.inc";
require "tabs_component.inc";
require "tabs_winstation.inc";
+require "tabs_arpnewdevice.inc";
class systems extends plugin
/* Find out more about the object type */
$ldap= $this->config->get_ldap_link();
- $ldap->cat($this->dn, array('objectClass'));
+ $ldap->cat($this->dn, array('objectClass','gotoMode'));
$attrs= $ldap->fetch();
- $type= $this->get_system_type($attrs['objectClass']);
+ $type= $this->get_system_type($attrs);
/* Lock the current entry, so everyone will get the
above dialog */
"component" => array("CLASS"=>"COMPONENTTABS","TABCLASS" =>"componenttabs"));
- if($type == "NewDevice"){
+ if($type == "ArpNewDevice"){
+ $this->systab = new ArpNewDeviceTabs($this->config,$this->config->data['TABS']['ARPNEWDEVICETABS'],$this->dn);
+ }elseif($type == "NewDevice"){
$this->systab = new SelectDeviceType($this->config,$this->dn) ;
}elseif(isset($tabs[$type])){
<pre>';
/* Open process handle and check if it is a valid process */
- $process= proc_open($command, $dsc, $pipes);
+ $process= proc_open($command." '".$this->dn."'", $dsc, $pipes);
if (is_resource($process)) {
fclose($pipes[0]);
/* Find out more about the object type */
$ldap= $this->config->get_ldap_link();
- $ldap->cat($this->dn, array('objectClass'));
+ $ldap->cat($this->dn, array('objectClass','gotoMode'));
$attrs= $ldap->fetch();
- $type= $this->get_system_type($attrs['objectClass']);
+ $type= $this->get_system_type($attrs);
$tabs = array(
"terminal" => array("CLASS"=>"TERMTABS", "TABCLASS" =>"termtabs"),
}
}
if(!$found){
- print_red(sprintf(_("Can't set gotoMode to status 'avtice', the current object couldn't be identified.")));
+ print_red(sprintf(_("Can't set gotoMode to status 'active', the current object couldn't be identified.")));
}
}
/* Save, or display error message? */
if (count($message) == 0){
- /* Save terminal data to ldap */
- if(isset($_SESSION['SelectedSystemType']['ogroup']) && $_SESSION['SelectedSystemType']['ogroup'] != 'none'){
- foreach (array("workservice", "termservice") as $cls){
- if (isset($this->systab->by_object[$cls])){
- $this->systab->by_object[$cls]->gotoXMouseport= "";
- $this->systab->by_object[$cls]->gotoXMouseType= "";
- $this->systab->by_object[$cls]->gotoXResolution= "";
- $this->systab->by_object[$cls]->gotoXColordepth= "";
- }
- }
- }
-
- $this->systab->save();
- gosa_log ("System object'".$this->dn."' has been saved");
-
/* Incoming behavior; you can select a system type and an ogroup membership.
* If this object is an Incoming object, $_SESSION['SelectedSystemType'] isset.
* Check if we must add the new object to an object group.
$og->save();
}
}
+ }
+
+ /* Save terminal data to ldap */
+ if(isset($_SESSION['SelectedSystemType']['ogroup']) && $_SESSION['SelectedSystemType']['ogroup'] != 'none'){
+ foreach (array("workservice", "termservice") as $cls){
+ if (isset($this->systab->by_object[$cls])){
+ $this->systab->by_object[$cls]->gotoXMouseport= "";
+ $this->systab->by_object[$cls]->gotoXMouseType= "";
+ $this->systab->by_object[$cls]->gotoXResolution= "";
+ $this->systab->by_object[$cls]->gotoXColordepth= "";
+ }
+ }
+ }
+
+ $this->systab->save();
+ gosa_log ("System object'".$this->dn."' has been saved");
+
+ if(isset($_SESSION['SelectedSystemType'])){
if(!isset($ldap)){
$ldap = $this->config->get_ldap_link();
}
$ldap->cd($this->config->current['BASE']);
}
+
/* Terminal has been saved successfully, remove lock from
LDAP. */
if ($this->dn != "new"){
$responsible= array();
foreach ($this->config->departments as $key => $value){
if (get_module_permission(get_permissions ($value, $this->ui->subtreeACL),
- "terminal", $value) == "#all#"){
+ "systems", $value) != ""){
$responsible[$key]= $value;
}
}
if($this->DivListSystem->$checkBox){
if($this->DivListSystem->SubSearch){
if($oc['CLASS'] != ""){
- $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))";
+ $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";
$res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $base,
- array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT));
+ array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate","gotoMode"), GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT));
}
}else{
/* User filter? */
if($oc['CLASS'] != ""){
- $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))";
+ $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";
$res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $oc['TREE'].$base,
- array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SIZELIMIT));
+ array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate", "gotoMode"), GL_NONE | GL_SIZELIMIT));
}
}
}
/* Search for incoming objects */
$filter = "(|(&".$userregex."(objectClass=goHard)(cn=".$this->DivListSystem->Regex.")))";
$res = array_merge($res,get_list($filter,$this->ui->subtreeACL, "ou=incoming,".$base,
- array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), GL_NONE | GL_SIZELIMIT));
+ array("cn", "description", "macAddress", "objectClass", "sambaDomainName","gotoMode"), GL_NONE | GL_SIZELIMIT));
/* Get all gotoTerminal's */
foreach ($res as $value){
$add= "- "._("New terminal");
}elseif (in_array_ics('gotoWorkstation', $value['objectClass'])){
$add= "- "._("New workstation");
+ }elseif (in_array_ics('GOhard', $value['objectClass']) && !isset($value['gotoMode'])){
+ $add= "- "._("Unknown device");
}elseif (in_array_ics('GOhard', $value['objectClass'])){
$add= "- "._("New Device");
}
}
- function get_system_type($classes)
+ function get_system_type($attrs)
{
+ $enable_arp_device_handling = preg_match("/ArpNewDevice/i",search_config($this->config->data['TABS'], "ArpNewDevice", "CLASS"));
+ $classes = $attrs['objectClass'];
+
$type= "";
if (in_array_ics('ieee802Device', $classes)){
$type= "component";
$type= "phone";
}elseif (in_array_ics('goServer', $classes)){
$type= "server";
+ }elseif (in_array_ics('GOhard', $classes) && !isset($attrs['gotoMode']) && $enable_arp_device_handling){
+ $type= "ArpNewDevice";
}elseif (in_array_ics('GOhard', $classes)){
$type= "NewDevice";
}elseif (in_array_ics('sambaAccount', $classes) ||
$type= 'R'.$type;
break;
case 'install':
- $type= 'Y'.$type;
- break;
case 'sysinfo':
- $type= 'Y'.$type;
- break;
case 'softupdate':
+ case 'scheduledupdate':
$type= 'Y'.$type;
break;
}