summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 97952a7)
raw | patch | inline | side by side (parent: 97952a7)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 11 May 2009 07:44:29 +0000 (07:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 11 May 2009 07:44:29 +0000 (07:44 +0000) |
- Tunneling GOsa via ssh and editing printers led into broken gotoPrinterPdd entries.
- Fixed error when removing and adding ppds.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13643 594d385d-05f5-0310-b6e9-bd551577e9d8
- Fixed error when removing and adding ppds.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13643 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc | patch | blob | history | |
gosa-plugins/goto/admin/systems/goto/printer.tpl | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc
index 377f6c4b1c5029e83c90211e85d3f3ceac232bd4..88bc20956e3b83dab580e5695caf8715bb8e8009 100644 (file)
var $AdminMembers =array();
var $AdminMemberKeys =array();
+ var $ppdServerPart = "";
+
var $PPDdialogToSave = NULL;
var $BelongsTo = "unknown"; // Specifies if this is a standalone printer, or belongs to a terminal / WS
}
}
+ /* If no ppd is selected, remove this attribute */
+ if(!empty($this->gotoPrinterPPD) && $this->initially_was_account) {
+ $this->ppdServerPart = preg_replace("/^(http.*ppd)\/.*$/i","\\1",$this->gotoPrinterPPD);
+ }else{
+
+ /* Detect PPD server part */
+ if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
+ $method="https://";
+ }else{
+ $method="http://";
+ }
+
+ /* Get servername */
+ $server = $_SERVER['SERVER_NAME'];
+ if(tests::is_ip($server)){
+ $server_name = @gethostbyaddr($server);
+ }else{
+ $server_name = @gethostbyaddr(gethostbyname($server));
+ }
+ $this->ppdServerPart = $method.str_replace("//","/",$server_name."/ppd");
+ }
+
/* Extract selected ppd */
if(isset($this->gotoPrinterPPD)){
$this->gotoPrinterPPD = preg_replace("/^http.*ppd\//i","",$this->gotoPrinterPPD);
new log("view","printer/".get_class($this),$this->dn);
}
-
/* If type of printer couldn't be detected (because of missing parent object in construction)
* hide this tab.
*/
if($this->PPDdialogToSave && is_object($this->PPDdialogToSave)){
$this->dialog = $this->PPDdialogToSave;
}else{
- $this->dialog = new printerPPDDialog($this->config, $this->dn,$this->gotoPrinterPPD);
+
+ if(is_array($this->gotoPrinterPPD)){
+ $this->dialog = new printerPPDDialog($this->config, $this->dn,"");
+ }else{
+ $this->dialog = new printerPPDDialog($this->config, $this->dn,$this->gotoPrinterPPD);
+ }
$this->dialog->cn= $this->cn;
}
}
/* remove ppd */
if(isset($_POST['RemoveDriver'])){
+ /* Detect PPD server part */
+ if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
+ $method="https://";
+ }else{
+ $method="http://";
+ }
+
+ /* Get servername */
+ $server = $_SERVER['SERVER_NAME'];
+ if(tests::is_ip($server)){
+ $server_name = @gethostbyaddr($server);
+ }else{
+ $server_name = @gethostbyaddr(gethostbyname($server));
+ }
+ $this->ppdServerPart = $method.str_replace("//","/",$server_name."/ppd");
$this->gotoPrinterPPD = array();
$this->PPDdialogToSave = NULL;
}
}
$ppdManager= new ppdManager($path);
+ $smarty->assign("displayServerPath",true);
if(!empty($this->gotoPrinterPPD)){
if((!file_exists($path.$this->gotoPrinterPPD))){
$smarty->assign("driverInfo", "<b>".sprintf(_("Your currently selected PPD file '%s' doesn't exist."),$path.$this->gotoPrinterPPD)."</b>");
}
}else{
$smarty->assign("driverInfo", _("Not defined"));
+ $smarty->assign("displayServerPath",false);
}
}else{
$smarty->assign("driverInfo",_("Can't get ppd informations."));
+ $smarty->assign("displayServerPath",true);
}
+ $smarty->assign("ppdServerPart",$this->ppdServerPart);
+
/* Create user & admin user list */
$list=$this->generateList();
plugin::save_object();
$this->base = $base_tmp;
+ if(isset($_POST['ppdServerPart'])){
+ $this->ppdServerPart = get_post('ppdServerPart');
+ }
+
if(is_object($this->netConfigDNS)){
$this->netConfigDNS->save_object();
}
}
}
- if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
- $method="https://";
- }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_name."/ppd/".$this->gotoPrinterPPD);
+ $this->gotoPrinterPPD = $this->ppdServerPart.'/'.$this->gotoPrinterPPD;
}else{
$this->gotoPrinterPPD = array();
}
diff --git a/gosa-plugins/goto/admin/systems/goto/printer.tpl b/gosa-plugins/goto/admin/systems/goto/printer.tpl
index 25de9728cc68d2b1ec0a493349f5b6bdf9fb0d2c..f8622bc58fb63991ca6c29bf69b604a2b5f186ba 100644 (file)
<td><LABEL for="l">{t}Printer location{/t}</LABEL></td>
<td>
{render acl=$lACL}
- <input id="l" name="l" size=25 maxlength=80 value="{$l}">
+ <input id="l" name="l" size=30 maxlength=80 value="{$l}">
{/render}
</td>
</tr>
<td><LABEL for="labeledURI">{t}Printer URL{/t}</LABEL>{$must}</td>
<td>
{render acl=$labeledURIACL}
- <input id="labeledURI" name="labeledURI" size=25 maxlength=80 value="{$labeledURI}">
+ <input id="labeledURI" name="labeledURI" size=30 maxlength=80 value="{$labeledURI}">
{/render}
</td>
</tr>
+{if $displayServerPath && 0}
+ <tr>
+ <td>{t}PPD Provider{/t}
+ </td>
+ <td>
+ <input size=30 type='text' value='{$ppdServerPart}' name='ppdServerPart'>
+ </td>
+ </tr>
+{/if}
</table>
<table summary="">
<tr>