summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae46768)
raw | patch | inline | side by side (parent: ae46768)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 17 Sep 2010 13:39:51 +0000 (13:39 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 17 Sep 2010 13:39:51 +0000 (13:39 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19758 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc | patch | blob | history | |
gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc b/gosa-plugins/goto/admin/systems/goto/Device/DeviceTab.inc
index 50fdafe6760014084a253bea279462652447f212..4775ed0d697543587312f9b0a6b21bf56b0df076 100644 (file)
$baseobject= $this->by_object['Device'];
$uuid = preg_replace('/,/', '\,', $baseobject->deviceUUID);
+ $rdn = get_ou('Device','DeviceRDN');
if(empty($uuid)){
$cn = preg_replace('/,/', '\,', $baseobject->cn);
$cn = preg_replace('/"/', '\"', $cn);
- $this->dn= "cn=".$cn.",ou=systems,".$baseobject->base;
+ $this->dn= "cn=".$cn.",".$rdn.$baseobject->base;
}else{
- $this->dn= "deviceUUID=".$uuid.",ou=systems,".$baseobject->base;
+ $this->dn= "deviceUUID=".$uuid.",".$rdn.$baseobject->base;
}
$baseobject->dn= $this->dn;
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc
index b333c5a42de42f23a0a7529b88716bdd1a7d6151..7995b8b7c509fbfc73cf0fbf76adbf20e738c4b2 100644 (file)
function __construct(&$config, $dn)
{
plugin::plugin($config, $dn);
- $this->base = $this->config->current['BASE'];
$this->orig_dn = $this->dn;
+ // Initialize the object base
+ if ($this->dn == "new"){
+ $ui= get_userinfo();
+ $this->base= dn2base(session::global_is_set("CurrentMainBase")?"cn=dummy,".session::global_get("CurrentMainBase"):$ui->dn);
+ } else {
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("Device", "DeviceRDN"), '/')."/i", "", $this->dn);
+ }
+
// Prepare the base selector
$this->baseSelector= new baseSelector($this->get_allowed_bases(), $this->base);
$this->baseSelector->setSubmitButton(false);
"plDepends" => array(),
"plPriority" => 1,
"plSection" => array("administration"),
- "plCategory" => array(
+ "plCategory" =>
+ array(
"Device" => array(
"description" => _("Device"),
- "objectClass" => "Device")),
- "plProvidedAcls" => array(
+ "objectClass" => "Device")
+ ),
+ "plProvidedAcls" =>
+ array(
"base" => _("Base"),
"cn" => _("Name"),
"serialNumber" => _("Serial number"),
"deviceType" => _("Type"),
"macAddress" => _("MAC address"),
"ipHostNumber" => _("IP address")
- )
- )
- );
+ ),
+ "plProperties" =>
+ array(
+ array(
+ "name" => "DeviceRDN",
+ "type" => "rdn",
+ "default" => "ou=devices,ou=systems,",
+ "description" => _("The 'deviceRDN' statement defines the location where new devices will be created. The default is 'ou=device,ou=systems,'."),
+ "check" => "gosaProperty::isRdn",
+ "migrate" => "migrate_deviceRDN",
+ "group" => "plugin",
+ "mandatory" => FALSE
+ ),
+
+ )
+ )
+ );
}
}