diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 2ed5f19c9e1fb505637876dab96dd84c876a654a..fc743ce969414ae6b89fe9511a60c69e73967518 100644 (file)
$this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
}
+ if(isset($this->gotoPrinterPPD)){
+ $this->gotoPrinterPPD = preg_replace("/^http.*ppd\//i","",$this->gotoPrinterPPD);
+ }
/* In case of gotoWorkstation this tab is calles from workstation plugin
* in case of gotoTerminal it is called from a terminal tab
/* $this->members contains all members */
$this->member[$type]=array();
- unset($this->attrs[$attr]['count']);
+ if (isset($this->attrs[$attr]['count'])) {
+ unset($this->attrs[$attr]['count']);
+ }
if(isset($this->attrs[$attr])){
foreach($this->attrs[$attr] as $mem){
$this->dialog=NULL;
}
+
+
if((isset($_POST['DelUser']))&&(isset($_POST['UserMember']))){
if(isset($this->member['AddUser'][$_POST['UserMember']])){
unset($this->member['AddUser'][$_POST['UserMember']]);
}
if((isset($_POST['DelAdmin']))&&(isset($_POST['AdminMember']))){
- if(isset($this->member['AddAdmingroup'][$_POST['AdminMember']])){
+ if(isset($this->member['AddAdminGroup'][$_POST['AdminMember']])){
unset($this->member['AddAdminGroup'][$_POST['AdminMember']]);
}
}
require_once ("class_ppdManager.inc");
- $ppdManager= new ppdManager('/var/spool/ppd/');
- if(!empty($this->gotoPrinterPPD)){
- if((!file_exists($this->gotoPrinterPPD))){
- $smarty->assign("driverInfo", "<b>".sprintf(_("Your currently selected PPD file '%s' doesn't exists."),$this->gotoPrinterPPD))."</b>";
+
+ if((isset($_SESSION['config']->data['MAIN']['PPD_PATH']))&&(is_dir($_SESSION['config']->data['MAIN']['PPD_PATH']))){
+
+ $path = $_SESSION['config']->data['MAIN']['PPD_PATH'];
+ if(!preg_match("/\/$/",$path)){
+ $path = $path."/";
+ }
+
+ $ppdManager= new ppdManager($path);
+ if(!empty($this->gotoPrinterPPD)){
+ if((!file_exists($path.$this->gotoPrinterPPD))){
+ $smarty->assign("driverInfo", "<b>".sprintf(_("Your currently selected PPD file '%s' doesn't exist."),$this->gotoPrinterPPD))."</b>";
+ }else{
+ $smarty->assign("driverInfo", $ppdManager->loadDescription($path.$this->gotoPrinterPPD));
+ }
}else{
- $smarty->assign("driverInfo", $ppdManager->loadDescription($this->gotoPrinterPPD));
+ $smarty->assign("driverInfo", _("not defined"));
}
}else{
- $smarty->assign("driverInfo", _("not defined"));
+ $smarty->assign("driverInfo",_("can't get ppd informations."));
}
+
$list=$this->generateList();
$userlist = array_merge($list['AddUser'],$list['AddGroup']);
$adminlist = array_merge($list['AddAdminUser'],$list['AddAdminGroup']);
if($this->PPDdialogToSave){
$this->PPDdialogToSave->save_ppd();
}
-
$dn= $this->dn;
plugin::save();
$ldap= $this->config->get_ldap_link();
$this->attrs= $attrs;
}
+ if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
+ $method="https://";
+ }else{
+ $method="http://";
+ }
+
+ if(!is_array($this->attrs['gotoPrinterPPD'])) {
+ $this->attrs['gotoPrinterPPD'] = $this->attrs['gotoPrinterPPD'];
+ $this->attrs['gotoPrinterPPD'] = $method.str_replace("//","/",$_SERVER['SERVER_NAME']."/ppd/".$this->attrs['gotoPrinterPPD']);
+ }
/* Append printer user
*/