summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7718bf7)
raw | patch | inline | side by side (parent: 7718bf7)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 18 Oct 2005 05:24:32 +0000 (05:24 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 18 Oct 2005 05:24:32 +0000 (05:24 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1593 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/environment/class_environment.inc | patch | blob | history | |
plugins/personal/environment/environment.tpl | patch | blob | history |
diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc
index 8e0943def79ff622a171e2f7e3b2fae3594da9ae..a61c658c84651cea38cbdc5ca5d5d2dab43c1e23 100644 (file)
var $gotoLogonScript = ""; // The selected Logon Script
/* Printer */
- var $gotoPrinters = array();// All available Printer
- var $gotoPrinter = ""; // The selected Printer
+ var $gotoPrinter = array();// All available Printer
+ var $gotoPrinterSel = ""; // The selected Printer
/* Share */
var $gotoShares = array();// Current Share Options
var $attributes = array("uid","gotoProfileServer","gotoProfileFlags",
"gotoXResolution","gotoProfileQuota",
"gotoLogonScripts","gotoLogonScript",
- "gotoPrinters",
+ "gotoPrinter",
"gotoShares","gotoShare",
"gotoKioskProfile","gotoKioskProfiles",
"gotoHotplugDevices");
$ldap->cd($this->config->current['BASE']);
$ldap->search("(&(objectClass=gotoPrinter)(goto".$suffix."Printer=".$this->uid."))",array("*"));
while($printer = $ldap->fetch()){
- $this->gotoPrinters[$printer['cn'][0]]=$printer;
- $this->gotoPrinters[$printer['cn'][0]]['mode']="user";
+ $this->gotoPrinter[$printer['cn'][0]]=$printer;
+ $this->gotoPrinter[$printer['cn'][0]]['mode']="user";
}
$ldap->search("(&(objectClass=gotoPrinter)(goto".$suffix."AdminPrinter=".$this->uid."))",array("*"));
while($printer = $ldap->fetch()){
- $this->gotoPrinters[$printer['cn'][0]]=$printer;
- $this->gotoPrinters[$printer['cn'][0]]['mode']="admin";
+ $this->gotoPrinter[$printer['cn'][0]]=$printer;
+ $this->gotoPrinter[$printer['cn'][0]]['mode']="admin";
}
/* prepare hotplugs */
}
- foreach(array("gotoHotplugDevice","gotoPrinter") as $s_attr){
+ foreach(array("gotoHotplugDevice","gotoPrinterSel") as $s_attr){
if(chkacl($this->acl,$s_attr)=="") {
$smarty->assign($s_attr."ACL","");
}else{
$this->dialog->save_object();
$tmp = $this->dialog->save();
$tmp2= $this->dialog->getPrinter(true);
- $this->gotoPrinters[$tmp]=$tmp2[$tmp];
- $this->gotoPrinters[$tmp]['mode']="user";
+ $this->gotoPrinter[$tmp]=$tmp2[$tmp];
+ $this->gotoPrinter[$tmp]['mode']="user";
$this->is_dialog=false;
unset($this->dialog);
$this->dialog =NULL;
}
}
- if((isset($_POST['gotoPrinterDel']))&&(isset($_POST['gotoPrinter']))&&(!empty($_POST['gotoPrinter']))){
- $printer = $_POST['gotoPrinter'];
- unset($this->gotoPrinters[$printer]);
+ if((isset($_POST['gotoPrinterDel']))&&(isset($_POST['gotoPrinterSel']))&&(!empty($_POST['gotoPrinterSel']))){
+ $printer = $_POST['gotoPrinterSel'];
+ unset($this->gotoPrinter[$printer]);
}
- if((isset($_POST['gotoPrinterEdit']))&&(isset($_POST['gotoPrinter']))&&(!empty($_POST['gotoPrinter']))){
- $printer = $_POST['gotoPrinter'];
- if($this->gotoPrinters[$printer]['mode']=="user"){
- $this->gotoPrinters[$printer]['mode']="admin";
+ if((isset($_POST['gotoPrinterEdit']))&&(isset($_POST['gotoPrinterSel']))&&(!empty($_POST['gotoPrinterSel']))){
+ $printer = $_POST['gotoPrinterSel'];
+ if($this->gotoPrinter[$printer]['mode']=="user"){
+ $this->gotoPrinter[$printer]['mode']="admin";
}else{
- $this->gotoPrinters[$printer]['mode']="user";
+ $this->gotoPrinter[$printer]['mode']="user";
}
}
- $smarty->assign("gotoPrinters",$this->printOutPrinterDevices());
+ $smarty->assign("gotoPrinter",$this->printOutPrinterDevices());
$smarty->assign("gotoPrinterKeys",array_flip($this->printOutPrinterDevices()));
/* General behavior */
/* Don't save our template variables */
$skip = array("uid",
- "gotoLogonScripts","gotoPrinters","gotoShares","gotoKioskProfiles","gotoHotplugDevices",
- "gotoPrinter");
+ "gotoLogonScripts","gotoPrinter","gotoShares","gotoKioskProfiles","gotoHotplugDevices" );
/* Skip all these attributes */
foreach($skip as $del){
unset($this->attrs[$del]);
plugin::save_object();
foreach($this->attributes as $s_attr){
- if(in_array($s_attr,array("gotoShares","gotoHotplugDevices","gotoPrinters","gotoLogonScripts","uid"))) continue;
+ if(in_array($s_attr,array("gotoShares","gotoHotplugDevices","gotoPrinter","gotoLogonScripts","uid"))) continue;
if(isset($_POST[$s_attr])){
$this->$s_attr = $_POST[$s_attr];
}else{
/* Save usersettings to Printer */
if(chkacl($this->acl,"gotoPrinter")!=""){
- $this->gotoPrinters = array();
+ $this->gotoPrinter = array();
}
if($this->is_group){
/* Deleted printer settings wasn't deleted from ldap ...
*/
- //if(count($this->gotoPrinters)==0){
+ //if(count($this->gotoPrinter)==0){
if(1==1){
$ldap->search("(&(objectClass=gotoPrinter)(|(goto".$s_suffix."Printer=".$this->uid.")(goto".$s_suffix."AdminPrinter=".$this->uid.")))",array("*"));
while($attr = $ldap->fetch()){
}
}
- foreach($this->gotoPrinters as $printer) {
+ foreach($this->gotoPrinter as $printer) {
$ldap->cd($printer['dn']);
$ldap->cat($printer['dn']);
$attrs= $ldap->fetch();
$printer[$attribute2]=array();
}else{
if(in_array($this->uid,$printer[$attribute2])){
- $tmp = array_flip($attrs[$attribute2]);
+ $tmp = array_flip($printer[$attribute2]);
unset($tmp[$this->uid]);
$attrs[$attribute2]=array_flip($tmp);
}
function printOutPrinterDevices()
{
$a_return = array();
- if(is_array($this->gotoPrinters)){
- foreach($this->gotoPrinters as $printer){
+ if(is_array($this->gotoPrinter)){
+ foreach($this->gotoPrinter as $printer){
if($printer['mode'] == "admin"){
$a_return[$printer['cn'][0]]= $printer['cn'][0]." - "._("Admin");
}else{
diff --git a/plugins/personal/environment/environment.tpl b/plugins/personal/environment/environment.tpl
index 447eb359fc3a203d2e6335dd6e7f99d71d9eed23..4da9e5f9fc987e8c8eae8fcd9dc2c999018ad0ba 100644 (file)
<table summary="{t}Printer settings{/t}">
<tr>
<td>
- <select style="width:350px;" name="gotoPrinter" multiple size=4 {$gotoPrinterACL} id="gotoPrinter">
- {html_options values=$gotoPrinterKeys output=$gotoPrinters}
+ <select style="width:350px;" name="gotoPrinterSel" multiple size=4 {$gotoPrinterACL} id="gotoPrinter">
+ {html_options values=$gotoPrinterKeys output=$gotoPrinter}
<option disabled> </option>
</select>
<br>