summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3c43fb2)
raw | patch | inline | side by side (parent: 3c43fb2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 29 Nov 2006 05:54:39 +0000 (05:54 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 29 Nov 2006 05:54:39 +0000 (05:54 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5237 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_printGeneric.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 4a475c6dedce506ad658693936939ecafe0c65c7..9b7d83051f9d432315255059704a98b8acc8a596 100644 (file)
}
/* Update dn, to ensure storing as printer instead of WS / terminal */
- if($this->BelongsTo == "Terminal" || $this->BelongsTo == "TerminalTemplate"){
+ if(preg_match("/Terminal/i",$this->BelongsTo) || preg_match("/TerminalTemplate/i",$this->BelongsTo)){
$this->dn= preg_replace("/ou=terminals,/","ou=printers,",$this->dn);
}
- if($this->BelongsTo == "Workstation"){
+ if(preg_match("/Workstation/i",$this->BelongsTo) || preg_match("/WorkstationTemplate/i",$this->BelongsTo)){
$this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn);
}
/* If is printer it must be a true account.
*/
- if($this->BelongsTo == "Printer"){
+ if(preg_match("/printer/i",$this->BelongsTo)){
$this->is_account = true;
}
/* Update dn, to ensure storing as printer instead of WS / terminal
*/
- if($this->BelongsTo == "Terminal"){
+ if(preg_match("/terminal/i",$this->BelongsTo)){
$this->dn= preg_replace("/ou=terminals,/","ou=printers,",$this->dn);
}
- if($this->BelongsTo == "Workstation"){
+ if(preg_match("/workstation/i",$this->BelongsTo)){
$this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn);
}
/* If type of printer couldn't be detected (because of missing parent object in construction)
* hide this tab.
*/
- if($this->BelongsTo == "unknown"){
+ if(preg_match("/unknown/i",$this->BelongsTo)){
$display= $this->show_enable_header(_("Add printer extension"),
_("Could not intialize printer tab, parameter parent was missing while construction."),TRUE,TRUE);
return($display);
/* Templates can't have printer extensions
*/
- if($this->BelongsTo == "WorkstationTemplate"){
+ if(preg_match("/WorkstationTemplate/i",$this->BelongsTo)){
$display= $this->show_enable_header(_("Add printer extension"),
_("This is a workstation template, printer tab is disabled."),TRUE,TRUE);
return($display);
}
- if($this->BelongsTo == "TerminalTemplate"){
+ if(preg_match("/TerminalTemplate/i",$this->BelongsTo)){
$display= $this->show_enable_header(_("Add printer extension"),
_("This is a terminal template, printer tab is disabled."),TRUE,TRUE);
return($display);
}
/* Get cn from base object */
- if($this->BelongsTo == "Workstation"){
+ if(preg_match("/^Workstation$/i",$this->BelongsTo)){
$this->cn = $this->parent->by_object['workgeneric']->cn;
}
- if($this->BelongsTo == "Terminal"){
+ if(preg_match("/^Terminal$/i",$this->BelongsTo)){
$this->cn = $this->parent->by_object['termgeneric']->cn;
}
$display="";
/* Tell smarty if this is a standalone object or a terminal / WS depending printer */
- if($this->BelongsTo == "Printer"){
+ if(preg_match("/^Printer$/i",$this->BelongsTo)){
$smarty->assign("StandAlone",true);
}else{
$smarty->assign("StandAlone",false);
}
/* If this is a WS / Terminal depending printer, display account state button */
- if($this->BelongsTo != "Printer"){
+ if(!preg_match("/^Printer$/i",$this->BelongsTo)){
if((empty($this->cn)) && ($this->dn != "new")){
$display= $this->show_enable_header(_("Add printer extension"),
_("This object has printer extension disabled. You can't enable it while 'cn' is not present in entry. Possibly you are currently creating a new terminal template"),TRUE,TRUE);
}
if (($this->is_account)){
- if($this->BelongsTo=="Workstation"){
+ if(preg_match("/^Workstation$/i",$this->BelongsTo)){
$display= $this->show_disable_header(_("Remove printer extension"),
_("This workstation has printer extension enabled.You can disable it by clicking below."));
- }elseif($this->BelongsTo=="Terminal"){
+ }elseif(preg_match("/^Terminal$/i",$this->BelongsTo)){
$display= $this->show_disable_header(_("Remove printer extension"),
_("This terminal has printer extension enabled. You can disable it by clicking below."));
}
}else{
- if($this->BelongsTo=="Workstation"){
+ if(preg_match("/^Workstation$/i",$this->BelongsTo)){
$display= $this->show_disable_header(_("Add printer extension"),
_("This workstation has printer extension disabled. You can enable it by clicking below."));
- }elseif($this->BelongsTo=="Terminal"){
+ }elseif(preg_match("/^Terminal$/i",$this->BelongsTo)){
$display= $this->show_enable_header(_("Add printer extension"),
_("This terminal has printer extension disabled. You can enable it by clicking below."));
}
asort($userlist);
asort($adminlist);
- if($this->BelongsTo != "Printer"){
- if($this->BelongsTo == "Terminal"){
+ if(!preg_match("/Printer/i",$this->BelongsTo)){
+ if(preg_match("/Terminal/i",$this->BelongsTo)){
$smarty->assign("desc" ,sprintf(_("This printer belongs to terminal %s. You can't rename this printer."),"<b>".$this->cn."</b>"));
}else{
$smarty->assign("desc" ,sprintf(_("This printer belongs to workstation %s. You can't rename this printer."),"<b>".$this->cn."</b>"));
$smarty->assign("AdminMember" ,$this->AdminMember);
$smarty->assign("AdminMembers" ,$adminlist);
$smarty->assign("AdminMemberKeys",array_flip($adminlist));
- if($this->BelongsTo == "Printer"){
+ if(preg_match("/Printer/i",$this->BelongsTo)){
$smarty->assign("netconfig", $this->netConfigDNS->execute());
} else {
$smarty->assign("netconfig", "");
/* Update dn, to ensure storing as printer instead of WS / terminal
*/
- if($this->BelongsTo == "Terminal"){
+ if(preg_match("/terminal/i",$this->BelongsTo)){
$this->dn= preg_replace("/ou=terminals,/","ou=printers,",$this->dn);
}
- if($this->BelongsTo == "Workstation"){
+ if(preg_match("/workstation/i",$this->BelongsTo)){
$this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn);
}
{
/* Call common method to give check the hook */
$message= plugin::check();
- if ($this->BelongsTo == 'printer'){
+ if (preg_match("/printer/i",$this->BelongsTo)){
$message= array_merge($message, $this->netConfigDNS->check());
}
$dn= "cn=".$this->cn.",ou=printers,ou=systems,".$this->base;
/* must: cn */
- if(($this->BelongsTo == "Printer") && (empty($this->cn))){
+ if(preg_match("/printer/i",$this->BelongsTo) && (empty($this->cn))){
$message[]= "The required field 'Printer name' is not set.";
}
$this->set_acl_base($this->base);
}
- if($this->BelongsTo == "Printer"){
+ if(preg_match("/printer/i",$this->BelongsTo)){
if ($this->orig_dn == "new" && !$this->acl_is_createable()){
$message[]= _("You have no permissions to create a group on this 'Base'.");
}
}
/* Check if there is already an entry with this cn*/
- if (($this->orig_dn != $dn)&&($this->BelongsTo == "Printer")){
+ 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.")","ou=printers,ou=systems,".$this->base, array("cn"));
{
/* Update dn, to ensure storing as printer instead of WS / terminal
*/
- if($this->BelongsTo == "Terminal"){
+ if(preg_match("/terminal/i",$this->BelongsTo)){
$this->dn= preg_replace("/ou=terminals,/","ou=printers,",$this->dn);
}
- if($this->BelongsTo == "Workstation"){
+ if(preg_match("/workstation/i",$this->BelongsTo)){
$this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn);
}
}
/* If type is still unknown, the initialisation of this printer failed, abort. */
- if($this->BelongsTo == "unknown"){
+ if(preg_match("/unknown/i",$this->BelongsTo)){
return;
}
}
show_ldap_error($ldap->get_error(), sprintf(_("Saving of system print/generic with dn '%s' failed."),$this->dn));
- if($this->BelongsTo == "Printer"){
+ if(preg_match("/printer/i",$this->BelongsTo)){
$this->netConfigDNS->cn = $this->cn;
$this->netConfigDNS->dn = $this->dn;
$this->netConfigDNS->save($this->dn);