summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 849827d)
raw | patch | inline | side by side (parent: 849827d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Dec 2007 09:11:32 +0000 (09:11 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Dec 2007 09:11:32 +0000 (09:11 +0000) |
-Added LogonScripts
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8125 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8125 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/personal/environment/class_environment.inc | patch | blob | history | |
gosa-core/plugins/personal/environment/environment.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/personal/environment/class_environment.inc b/gosa-core/plugins/personal/environment/class_environment.inc
index 25de2cb6d07c2c8f585989c147c199e71c12db16..dc410f4bff0c48d6e4f52a6a46fe6a74ba24acf0 100644 (file)
unset($this->dialog);
$this->dialog=FALSE;
$this->is_dialog=false;
+
+ if($this->multiple_support_active){
+ $tmp['UsedByAllUsers'] = TRUE;
+ }
$this->gotoLogonScripts[$tmp['LogonName']]=$tmp;
}
}
}
/* Append List to smarty*/
- $ls = $this->printOutLogonScripts();
- $smarty->assign("gotoLogonScripts", $ls);
- $smarty->assign("gotoLogonScriptKeys",array_flip($ls));
- $smarty->assign("gotoLogonScriptKeysCnt",count($ls));
+ if($this->multiple_support_active){
+ $smarty->assign("gotoLogonScripts", $this->gotoLogonScripts);
+ $smarty->assign("gotoLogonScriptKeysCnt",count($this->gotoLogonScripts));
+ }else{
+ $ls = $this->printOutLogonScripts();
+ $smarty->assign("gotoLogonScripts", $ls);
+ $smarty->assign("gotoLogonScriptKeys",array_flip($ls));
+ $smarty->assign("gotoLogonScriptKeysCnt",count($ls));
+ }
/* In this section server shares will be defined
* A user can select one of the given shares and a mount point
$this->gotoShares[$tmp[1]."|".$tmp[0]]=$tmp2;
}
}
+
+
+ /* prepare LogonScripts */
+ if((isset($this->multi_attrs_all['gotoLogonScript']))&&(is_array($this->multi_attrs_all['gotoLogonScript']))){
+ unset($this->multi_attrs_all['gotoLogonScript']['count']);
+ foreach($this->multi_attrs_all['gotoLogonScript'] as $device){
+ $tmp = $tmp2 = array();
+ $tmp = split("\|",$device);
+ $tmp2['LogonName'] = $tmp[0];
+ $tmp2['LogonPriority'] = $tmp[2];
+ if(preg_match("/O/i",$tmp[1])){
+ $tmp2['LogonOverload'] = "O";
+ }else{
+ $tmp2['LogonOverload'] = "";
+ }
+ if(preg_match("/L/i",$tmp[1])){
+ $tmp2['LogonLast'] = "L";
+ }else{
+ $tmp2['LogonLast'] = "";
+ }
+ $tmp2['LogonData'] = base64_decode($tmp[3]);
+ $tmp2['LogonDescription'] = $tmp[4];
+ $tmp2['UsedByAllUsers'] = FALSE;
+ $this->gotoLogonScripts[$tmp[0]]=$tmp2;
+ }
+ }
+
+ /* prepare LogonScripts */
+ if((isset($this->multi_attrs['gotoLogonScript']))&&(is_array($this->multi_attrs['gotoLogonScript']))){
+ unset($this->multi_attrs['gotoLogonScript']['count']);
+ foreach($this->multi_attrs['gotoLogonScript'] as $device){
+ $tmp = $tmp2 = array();
+ $tmp = split("\|",$device);
+ $tmp2['LogonName'] = $tmp[0];
+ $tmp2['LogonPriority'] = $tmp[2];
+ if(preg_match("/O/i",$tmp[1])){
+ $tmp2['LogonOverload'] = "O";
+ }else{
+ $tmp2['LogonOverload'] = "";
+ }
+ if(preg_match("/L/i",$tmp[1])){
+ $tmp2['LogonLast'] = "L";
+ }else{
+ $tmp2['LogonLast'] = "";
+ }
+ $tmp2['LogonData'] = base64_decode($tmp[3]);
+ $tmp2['LogonDescription'] = $tmp[4];
+ $tmp2['UsedByAllUsers'] = TRUE;
+ $this->gotoLogonScripts[$tmp[0]]=$tmp2;
+ }
+ }
}
function set_multi_edit_values($attrs)
{
$shares = $this->gotoShares;
+ $scripts= $this->gotoLogonScripts;
plugin::set_multi_edit_values($attrs);
$this->gotoShares = $shares;
+ $this->gotoLogonScripts = $scripts;
foreach($attrs['gotoShares'] as $name => $share){
if($share['UsedByAllUsers'] == TRUE){
$this->gotoShares[$name] = $share;
unset($this->gotoShares[$name]);
}
}
+ foreach($attrs['gotoLogonScripts'] as $name => $share){
+ if($share['UsedByAllUsers'] == TRUE){
+ $this->gotoLogonScripts[$name] = $share;
+ }
+ }
+ foreach($this->gotoLogonScripts as $name => $share){
+ if(!isset($attrs['gotoLogonScripts'][$name])){
+ unset($this->gotoLogonScripts[$name]);
+ }
+ }
}
{
$ret = plugin::get_multi_edit_values();
$ret['gotoShares'] = $this->gotoShares;
+ $ret['gotoLogonScripts'] = $this->gotoLogonScripts;
return($ret);
}
diff --git a/gosa-core/plugins/personal/environment/environment.tpl b/gosa-core/plugins/personal/environment/environment.tpl
index ba6c35623c42e15c68c0a74b3db49cd397f468fd..3fdbead4b6653d49667bd39d18aec1efeb0d6af5 100644 (file)
<td>
{render acl=$gotoLogonScriptACL}
<select style="width:100%;" name="gotoLogonScript" multiple size=5 id="gotoLogonScript">
- {html_options values=$gotoLogonScriptKeys output=$gotoLogonScripts }
- <option disabled> </option>
+
+ {if $multiple_support}
+ {foreach from=$gotoLogonScripts item=item key=key}
+ {if $item.UsedByAllUsers}
+ <option value="{$key}">{$item.LogonPriority} {$item.LogonName} [{$item.LogonDescription}]</option>
+ {else}
+ <option style='color: #888888; background: #DDDDDD;background-color: #DDDDDD;' value="{$key}">{$item.LogonPriority} {$item.LogonName} [{$item.LogonDescription}]</option>
+ {/if}
+ {/foreach}
+ {else}
+ {html_options values=$gotoLogonScriptKeys output=$gotoLogonScripts }
+ <option disabled> </option>
+ {/if}
</select>
{/render}