diff --git a/gosa-plugins/goto/personal/environment/class_environment.inc b/gosa-plugins/goto/personal/environment/class_environment.inc
index b7a3198164cdce9f8adc56d390c1c9cecd377d95..5e8448abca8cbb8b6b4cc739f1a62beba0bbb0e2 100644 (file)
}
}
- /* Are we editing from MyAccount and not editing a user */
- $WriteOnly = (!isset($this->parent)|| !$this->parent) && !session::is_set('edit');
-
/* Check profile server */
- if($this->acl_is_writeable("gotoProfileServer",$WriteOnly)){
+ if($this->acl_is_writeable("gotoProfileServer")){
if(!empty($this->gotoProfileServer) && !isset($this->gotoProfileServers[$this->gotoProfileServer])){
}
/* Prepare ACL settings*/
- $smarty->assign($s_attr."ACL",$this->getacl($s_attr,$WriteOnly));
+ $smarty->assign($s_attr."ACL",$this->getacl($s_attr));
}
/* Is accout enabled | are we editing from usermenu or admin menu
}
/* Prepare ACL settings*/
- $smarty->assign($s_attr."ACL",$this->getacl($s_attr,$WriteOnly));
+ $smarty->assign($s_attr."ACL",$this->getacl($s_attr));
}
foreach(array("gotoHotplugDevice","gotoProfileFlagC","gotoProfileFlagL") as $s_attr){
- $smarty->assign($s_attr."ACL",$this->getacl($s_attr,$WriteOnly));
+ $smarty->assign($s_attr."ACL",$this->getacl($s_attr));
}
- if($WriteOnly) {
+ if($this->read_only) {
$smarty->assign("gotoPrinterACL","r");
}else{
$smarty->assign("gotoPrinterACL","rw");
$smarty->assign("useProfile",$this->useProfile);
if(empty($this->useProfile) && !$this->multiple_support_active){
$smarty->assign("useProfileCHK","");
- $smarty->assign("gotoProfileServerACL" , preg_replace("/w/","",$this->getacl("gotoProfileServer",$WriteOnly)));
- $smarty->assign("gotoProfileQuotaACL" , preg_replace("/w/","",$this->getacl("gotoProfileQuota",$WriteOnly)));
- $smarty->assign("gotoProfileFlagCACL" , preg_replace("/w/","",$this->getacl("gotoProfileFlagC",$WriteOnly)));
+ $smarty->assign("gotoProfileServerACL" , preg_replace("/w/","",$this->getacl("gotoProfileServer")));
+ $smarty->assign("gotoProfileQuotaACL" , preg_replace("/w/","",$this->getacl("gotoProfileQuota")));
+ $smarty->assign("gotoProfileFlagCACL" , preg_replace("/w/","",$this->getacl("gotoProfileFlagC")));
}else{
$smarty->assign("useProfileCHK"," checked ");
}
- $smarty->assign("gotoProfileServerWriteable", $this->acl_is_writeable("gotoProfileServer",$WriteOnly));
- $smarty->assign("gotoProfileACL", $this->getacl("gotoProfileServer",$WriteOnly).$this->getacl("gotoProfileQuota",$WriteOnly));
+ $smarty->assign("gotoProfileServerWriteable", $this->acl_is_writeable("gotoProfileServer"));
+ $smarty->assign("gotoProfileACL", $this->getacl("gotoProfileServer").$this->getacl("gotoProfileQuota"));
/* HANDLE Profile Settings here
* Assign available Quota and resolution settings
foreach($this->gotoHotplugDevices as $plugs){
$tmp[] = $plugs['name'];
}
- $this->dialog = new hotplugDialog($this->config,$tmp);
+ $this->dialog = new hotplugSelect($this->config, get_userinfo());
$this->is_dialog = true;
}
/* Dialog Aborted */
- if(isset($_POST['HotPlugCancel'])){
- unset($this->dialog);
+ if(isset($_POST['hotplugSelect_cancel'])){
$this->dialog= FALSE;
$this->is_dialog = false;
}
/* Dialod saved */
- if(isset($_POST['HotPlugSave'])){
+ if(isset($_POST['hotplugSelect_save'])){
- $this->dialog->save_object();
- if(count($this->dialog->check())!=0){
- foreach($this->dialog->check() as $msg){
- msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
- }
- }else{
- $this->dialog->save_object();
- $a_tmp = $this->dialog->save();
-
- if(is_array($a_tmp)){
- foreach($a_tmp as $name => $hotplug){
- if($this->multiple_support_active){
- $hotplug['UsedByAllUsers'] = TRUE;
- }
- $this->gotoHotplugDevices[$name]= $hotplug;
- }
+ $res = $this->dialog->save();
+ foreach($res as $hotplug){
+ $name = $hotplug['cn'][0];
+ $entry['dn'] = $hotplug['dn'];
+
+ /* Set class values */
+ $tmp = preg_split("/\|/",$hotplug['gotoHotplugDevice'][0]);
+ $entry['name'] = $hotplug['cn'][0];
+ $entry['description'] = $tmp[0];
+ $entry['id'] = $tmp[1];
+ $entry['produkt'] = $tmp[2];
+ $entry['vendor'] = $tmp[3];
+ if($this->multiple_support_active){
+ $entry['UsedByAllUsers'] = TRUE;
}
- unset($this->dialog);
- $this->dialog= FALSE;
- $this->is_dialog = false;
+ $this->gotoHotplugDevices[$name]= $entry;
}
+ $this->dialog= FALSE;
+ $this->is_dialog = false;
+ }
+
+ if($this->dialog instanceOf hotplugSelect){
+
+ // Build up blocklist
+ session::set('filterBlacklist', array('cn' => array_keys($this->gotoHotplugDevices)));
+ return($this->dialog->execute());
}
if($this->multiple_support_active){
$this->is_dialog=true;
}
- if(isset($_POST['selectPrinter_cancel']) && $this->dialog instanceOf printerSelect){
+ if(isset($_POST['printerSelect_cancel']) && $this->dialog instanceOf printerSelect){
$this->is_dialog=false;
$this->dialog=FALSE;
}
- if(isset($_POST['selectPrinter_save']) && $this->dialog instanceOf printerSelect){
+ if(isset($_POST['printerSelect_save']) && $this->dialog instanceOf printerSelect){
$res = $this->dialog->save();
foreach($res as $printer){
$this->dialog =FALSE;
}
+ // Display printer selection dialog
+ if($this->dialog instanceOf printerSelect){
+
+ // Build up blocklist
+ session::set('filterBlacklist',array('cn' => array_keys($this->gotoPrinter)));
+ return($this->dialog->execute());
+ }
+
+
if((isset($_POST['gotoPrinterDel']))&&(isset($_POST['gotoPrinterSel']))&&(!empty($_POST['gotoPrinterSel']))){
$printer = $_POST['gotoPrinterSel'];
foreach($printer as $pname){
/* Get all Posted vars
* Setup checkboxes
*/
- $WriteOnly = (!isset($this->parent)|| !$this->parent) && !session::is_set('edit');
if(isset($_POST['iamposted'])){
- $PACL = $this->getacl("gotoProfileServer",$WriteOnly).$this->getacl("gotoProfileQuota",$WriteOnly);
+ $PACL = $this->getacl("gotoProfileServer").$this->getacl("gotoProfileQuota");
if(isset($_POST['kiosk_server'])){
$tmp = $_POST['kiosk_server'];