summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6268625)
raw | patch | inline | side by side (parent: 6268625)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 May 2010 13:33:19 +0000 (13:33 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 May 2010 13:33:19 +0000 (13:33 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18277 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc
index c420b2f1d5d93f893d7002ac93fa0271c5a46c02..39746e916a0c643fb1a7a57da9a91d2ce7a065f1 100644 (file)
/* Update dn, to ensure storing as printer instead of WS / terminal */
if(preg_match("/Terminal/i",$this->BelongsTo) || preg_match("/TerminalTemplate/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/')."/i",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",get_ou("workgeneric", "workstationRDN") ,$this->dn);
}
if(preg_match("/Workstation/i",$this->BelongsTo) || preg_match("/WorkstationTemplate/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/i",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",get_ou("workgeneric", "workstationRDN") ,$this->dn);
}
$this->orig_dn = $this->dn;
} else {
/* Set base and check if the extracted base exists */
- if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'), '/')."/i",$this->dn)){
- $this->base= preg_replace("/".preg_quote(get_ou('systemIncomingRDN'), '/')."/i","",dn2base($this->dn));
+ if(preg_match("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",$this->dn)){
+ $this->base= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i","",dn2base($this->dn));
}else{
- $this->base= preg_replace("/".preg_quote(get_ou('printerRDN'), '/')."/i","",dn2base($this->dn));
+ $this->base= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i","",dn2base($this->dn));
}
if(!isset($this->config->idepartments[$this->base])){
/* Update dn, to ensure storing as printer instead of WS / terminal
*/
if(preg_match("/terminal/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/')."/i",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",get_ou("workgeneric", "workstationRDN") ,$this->dn);
}
if(preg_match("/workstation/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/i",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",get_ou("workgeneric", "workstationRDN") ,$this->dn);
}
/* Detect if this is a valid printer account;
/* Update dn, to ensure storing as printer instead of WS / terminal
*/
if(preg_match("/terminal/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/').",/i",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/').",/i",get_ou("workgeneric", "workstationRDN") ,$this->dn);
}
if(preg_match("/workstation/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/i",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",get_ou("workgeneric", "workstationRDN") ,$this->dn);
}
/* Check if this dn points to a printer, to avoid deleting something else */
}
}
- $dn= "cn=".$this->cn.get_ou('printerRDN').",".$this->base;
+ $dn= "cn=".$this->cn.get_ou("workgeneric", "workstationRDN") .",".$this->base;
/* must: cn */
if(($this->BelongsTo == "Printer") && $this->cn == ""){
if (($this->orig_dn != $dn)&&( preg_match("/printer/i",$this->BelongsTo))){
$ldap= $this->config->get_ldap_link();
$ldap->cd ($this->base);
- $ldap->ls("(cn=".$this->cn.")",get_ou('printerRDN').$this->base, array("cn"));
+ $ldap->ls("(cn=".$this->cn.")",get_ou("workgeneric", "workstationRDN") .$this->base, array("cn"));
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
if(preg_match("/cn=dhcp,/",$attrs['dn'])){
/* Update dn, to ensure storing as printer instead of WS / terminal
*/
if(preg_match("/terminal/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/')."/i",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",get_ou("workgeneric", "workstationRDN") ,$this->dn);
}
if(preg_match("/workstation/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/i",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",get_ou("workgeneric", "workstationRDN") ,$this->dn);
}
if(!$this->is_account) return;
}
/* Ensure to create a new object */
- if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'), '/')."/i",$this->orig_dn)){
+ if(preg_match("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",$this->orig_dn)){
$this->orig_dn = "new";
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
index 6564b864c05b8af0695e334be69ae61e635bf09b..374b411339443a6bc62f105e04b43f542c72113b 100644 (file)
if ($this->dn == "new"){
$ui= get_userinfo();
$this->base= dn2base(session::global_is_set("CurrentMainBase")?"cn=dummy,".session::global_get("CurrentMainBase"):$ui->dn);
- } elseif(preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i", $this->dn)){
- $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("systemIncomingRDN"), '/')."/i", "", $this->dn);
+ } elseif(preg_match("/".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN") , '/')."/i", $this->dn)){
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN") , '/')."/i", "", $this->dn);
} else {
- $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("terminalRDN"), '/')."/i", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN") , '/')."/i", "", $this->dn);
}
/* Create an array of all Syslog servers */
}
/* Permissions for that base? */
- $this->dn= "cn=".$this->cn.",".get_ou('terminalRDN').$this->base;
+ $this->dn= "cn=".$this->cn.",".get_ou("ArpNewDevice", "systemIncomingRDN") .$this->base;
if ($this->cn == ""){
$message[]= msgPool::required(_("Name"));
}
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
- if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/i", $ldap->getDN())){
+ if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN") , '/')."/i", $ldap->getDN())){
continue;
} else {
if ($attrs['dn'] != $this->orig_dn){
$ldap= $this->config->get_ldap_link();
/* Strip relevant part from dn, keep trailing ',' */
- $tmp= preg_replace("/^cn=[^,]+,".preg_quote(get_ou('terminalRDN'), '/')."/i", "", $this->dn);
+ $tmp= preg_replace("/^cn=[^,]+,".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN") , '/')."/i", "", $this->dn);
$tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp);
/* Walk from top to base and try to load default values for
while (TRUE){
$tmp= preg_replace ("/^[^,]+,/", "", $tmp);
- $ldap->cat("cn=default,".get_ou('terminalRDN').$tmp.
+ $ldap->cat("cn=default,".get_ou("ArpNewDevice", "systemIncomingRDN") .$tmp.
$this->config->current['BASE'], array('gotoTerminalPath'));
$attrs= $ldap->fetch();
if (isset($attrs['gotoTerminalPath'])){
diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc
index 28846fd5049d62352e1918fbde38063deb774000..a7d91c1ddb742433f16dea36b118433a3a0fd924 100644 (file)
/* Load phone hardware list
*/
- $tmp = get_sub_list("(objectClass=goFonHardware)","",array(get_ou("phoneRDN")),
+ $tmp = get_sub_list("(objectClass=goFonHardware)","",array(get_ou("group", "ogroupRDN") ),
$this->config->current['BASE'],array("cn","description"), GL_NO_ACL_CHECK);
foreach($tmp as $attrs){
$cn= $attrs['cn'][0];
*/
$deps_a = array(
get_people_ou(),
- get_ou("ogroupRDN"),
- get_ou("serverRDN"),
- get_ou("terminalRDN"),
- get_ou("workstationRDN"),
- get_ou("printerRDN"),
- get_ou("componentRDN"),
- get_ou("phoneRDN"));
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") );
$tmp = get_sub_list("(goFonHardware=*)","",$deps_a,$this->config->current['BASE'],
array('cn','dn','goFonHardware'),GL_NO_ACL_CHECK);
*/
$p = $this->parent->by_object['ogroup'];
foreach($p->memberList as $dn => $obj){
- if(preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$dn)) continue;
+ if(preg_match("/".preg_quote(get_ou("group", "ogroupRDN") , '/')."/",$dn)) continue;
if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){
$macs[] = $p->objcache[$dn]['macAddress'];
}
/* We are a workstation. Add current mac.
*/
$mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
- if(!empty($mac) && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$this->orig_dn)){
+ if(!empty($mac) && !preg_match("/".preg_quote(get_ou("group", "ogroupRDN") , '/')."/",$this->orig_dn)){
$macs[] = $mac;
}
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc
index b5ff4338ccee2d54b42253e8b04a8157c10400a4..53f4324dd571df535e96071a502afa034f3b805b 100644 (file)
if ($this->dn == "new"){
$ui= get_userinfo();
$this->base= dn2base(session::global_is_set("CurrentMainBase")?"cn=dummy,".session::global_get("CurrentMainBase"):$ui->dn);
- } elseif(preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i", $this->dn)){
- $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("systemIncomingRDN"), '/')."/i", "", $this->dn);
+ } elseif(preg_match("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i", $this->dn)){
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i", "", $this->dn);
}else{
- $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("workstationRDN"), '/')."/i", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i", "", $this->dn);
}
/* Create an array of all Syslog servers */
$message= array_merge($message, $this->netConfigDNS->check());
}
- $this->dn= "cn=".$this->cn.",".get_ou('workstationRDN').$this->base;
+ $this->dn= "cn=".$this->cn.",".get_ou("workgeneric", "workstationRDN") .$this->base;
if ($this->cn == ""){
$message[]= msgPool::required(_("Name"));
}
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
- if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/i", $ldap->getDN())){
+ if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i", $ldap->getDN())){
continue;
} else {
if ($attrs['dn'] != $this->orig_dn){
}else{
/* Warn the user, that this host is currently installing */
if($this->currently_installing && !$this->currently_installing_warned &&
- !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i",$this->orig_dn)){
+ !preg_match("/".preg_quote(get_ou("workgeneric", "workstationRDN") , '/')."/i",$this->orig_dn)){
/* Force aborting without message dialog */
$message[] = "";
diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc
index 4b131ec53ee2d3e83809d10751cecb9a8337ada9..b2e4cc281a9eb5cf68eaad51f298a74d11421ee1 100644 (file)
/* Load phone hardware list
*/
- $tmp = get_sub_list("(objectClass=goFonHardware)","",array(get_ou("phoneRDN")),
+ $tmp = get_sub_list("(objectClass=goFonHardware)","",array(get_ou("group", "ogroupRDN") ),
$this->config->current['BASE'],array("cn","description"), GL_NO_ACL_CHECK);
foreach($tmp as $attrs){
$cn= $attrs['cn'][0];
*/
$deps_a = array(
get_people_ou(),
- get_ou("ogroupRDN"),
- get_ou("serverRDN"),
- get_ou("terminalRDN"),
- get_ou("workstationRDN"),
- get_ou("printerRDN"),
- get_ou("componentRDN"),
- get_ou("phoneRDN"));
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") ,
+ get_ou("group", "ogroupRDN") );
$tmp = get_sub_list("(goFonHardware=*)","",$deps_a,$this->config->current['BASE'],
array('cn','dn','goFonHardware'),GL_NO_ACL_CHECK);
*/
$p = $this->parent->by_object['ogroup'];
foreach($p->memberList as $dn => $obj){
- if(preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$dn)) continue;
+ if(preg_match("/".preg_quote(get_ou("group", "ogroupRDN") , '/')."/",$dn)) continue;
if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){
$macs[] = $p->objcache[$dn]['macAddress'];
}
/* We are a workstation. Add current mac.
*/
$mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
- if(!empty($mac) && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$this->orig_dn)){
+ if(!empty($mac) && !preg_match("/".preg_quote(get_ou("group", "ogroupRDN") , '/')."/",$this->orig_dn)){
$macs[] = $mac;
}
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc
index d28a4b20149209c3da65e5e72d8f4dd056c12062..894f5e7588da8c12bc5ca466f8a851d052787033 100644 (file)
$ldap= $this->config->get_ldap_link();
/* Strip relevant part from dn, keep trailing ',' */
- $tmp= preg_replace("/^cn=[^,]+,".preg_quote(get_ou('terminalRDN'), '/')."/i", "", $this->dn);
+ $tmp= preg_replace("/^cn=[^,]+,".preg_quote(get_ou("termgeneric", "terminalRDN") , '/')."/i", "", $this->dn);
$tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp);
/* Walk from top to base and try to load default values for
while (TRUE){
$tmp= preg_replace ("/^[^,]+,/", "", $tmp);
- $ldap->cat("cn=default,".get_ou('terminalRDN').$tmp.
+ $ldap->cat("cn=default,".get_ou("termgeneric", "terminalRDN") .$tmp.
$this->config->current['BASE'], array('gotoTerminalPath'));
$attrs= $ldap->fetch();
if (isset($attrs['gotoTerminalPath'])){
*/
function dn_to_release_name($dn)
{
- $relevant = preg_replace("/,".preg_quote(get_ou("faiBaseRDN"), '/').".*$/i","",$dn);
+ $relevant = preg_replace("/,".preg_quote(get_ou("termgeneric", "terminalRDN") , '/').".*$/i","",$dn);
$parts = array_reverse(explode(",",$relevant));
$str ="";
foreach($parts as $part){
diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_printers.inc b/gosa-plugins/goto/admin/systems/goto/tabs_printers.inc
index 6a7e0e02d4323b767aa355e05fa1793f68e543c2..cd93fa1b4346f2f53441e664fe55d9f86e98e5a8 100644 (file)
/* Check for new 'dn', in order to propagate the
'dn' to all plugins */
$baseobject= $this->by_object['printgeneric'];
- $this->dn= "cn=$baseobject->cn,".get_ou('printerRDN').$baseobject->base;
+ $this->dn= "cn=$baseobject->cn,".get_ou("printgeneric", "printerRDN") .$baseobject->base;
$baseobject->dn= $this->dn;
foreach ($this->by_object as $key => $obj){
diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc b/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc
index b1adb932836e4177e9f932b1fe2ff037c623630b..b016331a5b0aad2cfc9fd6652c290cc1ffd4ed10 100644 (file)
/* Check for new 'dn', in order to propagate the
'dn' to all plugins */
$baseobject= $this->by_object['termgeneric'];
- $this->dn= "cn=".$baseobject->cn.",".get_ou('terminalRDN').$baseobject->base;
+ $this->dn= "cn=".$baseobject->cn.",".get_ou("termgeneric", "terminalRDN") .$baseobject->base;
$baseobject->dn= $this->dn;
if($this->dn != $baseobject->orig_dn && $baseobject->orig_dn != "new"){
diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc b/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc
index 32bcaea5c2ba75c7d882c25452dfbd628153d5b7..4d0a4e80a7f03e82af4db92876dac2e1857d3933 100644 (file)
/* Check for new 'dn', in order to propagate the
'dn' to all plugins */
$baseobject= $this->by_object['workgeneric'];
- $this->dn= "cn=".$baseobject->cn.",".get_ou('workstationRDN').$baseobject->base;
+ $this->dn= "cn=".$baseobject->cn.",".get_ou("workgeneric", "workstationRDN") .$baseobject->base;
if($this->dn != $baseobject->orig_dn && $baseobject->orig_dn != "new"){