diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc
index 01c9c349cd0339bcd1d5efc92c97a8d455486e0a..d2b3af58c071a1491980767fd8185679caab1daa 100644 (file)
/* attribute list for save action */
var $attributes = array("cn", "description", "l", "labeledURI", "gotoPrinterPPD","gotoUserPrinter", "macAddress",
- "gotoUserAdminPrinter","gotoGroupAdminPrinter","gotoUserPrinter","gotoGroupPrinter");
+ "gotoUserAdminPrinter","gotoGroupAdminPrinter","gotoUserPrinter","gotoGroupPrinter","gosaUnitTag");
var $objectclasses = array("top", "gotoPrinter");
var $view_logged = FALSE;
var $parent;
/* $this->members contains all members */
$this->member[$type]=array();
- if (isset($this->attrs[$attr]['count'])) {
- unset($this->attrs[$attr]['count']);
- }
-
if(isset($this->attrs[$attr])){
- foreach($this->attrs[$attr] as $mem){
+ $ldap->cd($this->config->current['BASE']) ;
+ for($i = 0 ; $i < $this->attrs[$attr]['count']; $i++){
+
+ $mem = $this->attrs[$attr][$i];
if(preg_match("/Group/",$type)){
$ldap->search("(&(objectClass=posixGroup)(cn=".$mem."))",array("cn","description"));
if($ldap->count()){
/* Do we represent a valid printer? */
if (!$this->is_account && $this->parent === NULL){
- $display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
+ $display= "<img alt=\"\" src=\"images/small-error.png\" align=middle> <b>".
msgPool::noValidExtension(_("printer"))."</b>";
return($display);
}
if($this->parent->by_object['workgeneric']->cn == "wdefault"){
return;
}
+
+ /* Adapt IP & mac from parent object */
+ $this->netConfigDNS->ipHostNumber = $this->parent->by_object['workgeneric']->netConfigDNS->ipHostNumber;
+ $this->netConfigDNS->macAddress = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
+
}elseif(isset($this->parent->by_object['termgeneric'])){
if($this->parent->by_object['termgeneric']->cn == "default"){
return;
}
+
+ /* Adapt IP & mac from parent object */
+ $this->netConfigDNS->ipHostNumber = $this->parent->by_object['termgeneric']->netConfigDNS->ipHostNumber;
+ $this->netConfigDNS->macAddress = $this->parent->by_object['termgeneric']->netConfigDNS->macAddress;
}
/* If type is still unknown, the initialisation of this printer failed, abort. */
}else{
$method="http://";
}
+
+ /* Get servername */
+ $server = $_SERVER['SERVER_NAME'];
+ if(tests::is_ip($server)){
+ $server_name = gethostbyaddr($server);
+ }else{
+ $server_name = gethostbyaddr(gethostbyname($server));
+ }
/* If no ppd is selected, remove this attribute */
if(!empty($this->gotoPrinterPPD) && $this->initially_was_account) {
- $this->gotoPrinterPPD = $method.str_replace("//","/",$_SERVER['SERVER_NAME']."/ppd/".$this->gotoPrinterPPD);
+ $this->gotoPrinterPPD = $method.str_replace("//","/",$server_name."/ppd/".$this->gotoPrinterPPD);
}else{
$this->gotoPrinterPPD = array();
}
$dn= $this->dn;
- plugin::save();
- $ldap= $this->config->get_ldap_link();
/* reduce objectClasses to minimun */
$this->attrs['objectClass']= $this->objectclasses;
+ plugin::save();
+ $ldap= $this->config->get_ldap_link();
+
/* Remove all empty values */
if ($this->orig_dn == 'new'){
$attrs= array();
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
}
- if(preg_match("/printer/i",$this->BelongsTo)){
+ #if(preg_match("/printer/i",$this->BelongsTo)){
$this->netConfigDNS->cn = $this->cn;
$this->netConfigDNS->dn = $this->dn;
$this->netConfigDNS->save();
- }
+ #}
}
function generateList(){
{
$types = array("AddUser","AddGroup","AddAdminUser","AddAdminGroup");
if(!in_array_ics($type, $types)){
- msg_dialog::display(_("Internal error"), sprintf(_("Illegal member type type '%s'!"), $type), ERROR_DIALOG);
+ msg_dialog::display(_("Internal error"), sprintf(_("Illegal member type '%s'!"), $type), ERROR_DIALOG);
return(FALSE);
}