summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb3a5dd)
raw | patch | inline | side by side (parent: eb3a5dd)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Dec 2010 14:19:00 +0000 (14:19 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Dec 2010 14:19:00 +0000 (14:19 +0000) |
-Readded sambaKickoffTime option
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20558 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20558 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/samba/personal/samba/class_sambaAccount.inc | patch | blob | history | |
gosa-plugins/samba/personal/samba/samba3.tpl | patch | blob | history |
diff --git a/gosa-plugins/samba/personal/samba/class_sambaAccount.inc b/gosa-plugins/samba/personal/samba/class_sambaAccount.inc
index b97e8349795b283fe9af87d8cd7b0bdfda740ff8..6549bbdbbc533b1c201af711d568b57473bf5130 100644 (file)
var $sambaPwdLastSet= "0";
var $sambaLogonTime= "0";
var $sambaLogoffTime= "2147483647";
- var $sambaKickoffTime= "2147483647";
+ var $sambaKickoffTime= "";
var $sambaPwdCanChange= "0";
var $sambaPwdMustChange= "0";
var $flag_noPasswordRequired = FALSE;
var $flag_temporaryDisabled = FALSE;
var $flag_cannotChangePassword = FALSE;
+ var $flag_sambaKickoffTime = FALSE;
// String values
var $sambaHomePath= "";
// Load flags
$this->loadFlagsFromSource($this->attrs);
+
+ // Set kickOffTime to date
+ if(isset($this->attrs['sambaKickoffTime'][0])){
+ $this->sambaKickoffTime = date("d.m.Y", $this->sambaKickoffTime);
+ $this->flag_sambaKickoffTime = TRUE;
+ }
}
"CtxMaxDisconnectionTime","CtxMaxIdleTimeF","CtxMaxIdleTime","connectclientdrives",
"onnectclientprinters","defaultprinter","shadow","brokenconn",
"reconn","connectclientprinters","SetSambaLogonHours",
- "workstation_list",
+ "workstation_list","sambaKickoffTime",
"enforcePasswordChange", "passwordNeverExpires", "noPasswordRequired",
"temporaryDisabled","cannotChangePassword") as $attr){
// Assign flags
foreach(array("flag_enforcePasswordChange", "flag_passwordNeverExpires", "flag_noPasswordRequired",
- "flag_temporaryDisabled","flag_cannotChangePassword") as $attr){
+ "flag_temporaryDisabled","flag_cannotChangePassword","flag_sambaKickoffTime") as $attr){
$smarty->assign($attr, set_post($this->$attr));
}
/* Call common method to give check the hook */
$message= plugin::check();
+ if($this->flag_sambaKickoffTime){
+ if(!preg_match("/^[0-3][0-9]\.[0-1][0-9]\.([0-9]){4}$/",$this->sambaKickoffTime)){
+ $message[] = msgPool::invalid(_("Account expires after"));
+ }elseif(!strtotime($this->sambaKickoffTime) || strtotime($this->sambaKickoffTime) >= 2147483647){
+ $message[] = msgPool::invalid(_("Account expires after"));
+ }
+ }
+
/* sambaHomePath requires sambaHomeDrive and vice versa */
if(!empty($this->sambaHomePath) && empty($this->sambaHomeDrive)){
$message[]= msgPool::required(_("Home drive"));
// Get posted flags.
foreach(array("enforcePasswordChange", "passwordNeverExpires", "noPasswordRequired",
- "temporaryDisabled","cannotChangePassword") as $name){
+ "temporaryDisabled","cannotChangePassword","sambaKickoffTime") as $name){
$flag = "flag_{$name}";
if($this->acl_is_writeable($name)){
$tmp = isset($_POST[$flag]);
}
$this->attrs['objectClass']= $tmp;
+ // Handle "sambaKickoffTime" flag.
+ if($this->flag_sambaKickoffTime){
+ $this->attrs['sambaKickoffTime'] = strtotime($this->sambaKickoffTime);
+ }else{
+ $this->attrs['sambaKickoffTime']= array();
+ }
// Handle "enforce password change" flag.
if($this->flag_enforcePasswordChange){
"sambaProfilePath" => _("Generic profile path") ,
"AllowLoginOnTerminalServer" => _("Allow login on terminal server"),
"InheritClientConfig" => _("Inherit client configuration"),
-
+ "sambaKickoffTime" => _("Account expires"),
"enforcePasswordChange" => _("Enforce password change"),
"cannotChangePassword" => _("Disallow password change") ,
"noPasswordRequired" => _("Login from windows client requires no password"),
"onnectclientprinters","defaultprinter","shadow","brokenconn",
"reconn","connectclientprinters","SetSambaLogonHours","workstation_list",
"enforcePasswordChange", "passwordNeverExpires", "noPasswordRequired",
- "temporaryDisabled","cannotChangePassword"
+ "temporaryDisabled","cannotChangePassword","sambaKickoffTime"
) as $attr){
if(isset($_POST["use_".$attr]) || isset($_POST["use_flag_".$attr]) ){
$this->multi_boxes[] = $attr;
if (substr_count($this->sambaUserWorkstations, ",") >= 8){
$message[]= _("The windows user manager only allows eight clients. You've specified more than eight.");
}
+
+
+ if(in_array("sambaKickoffTime", $this->multi_boxes) && $this->flag_sambaKickoffTime){
+ if(!preg_match("/^[0-3][0-9]\.[0-1][0-9]\.([0-9]){4}$/",$this->sambaKickoffTime)){
+ $message[] = msgPool::invalid(_("Account expires after"));
+ }elseif(!strtotime($this->sambaKickoffTime) || strtotime($this->sambaKickoffTime) >= 2147483647){
+ $message[] = msgPool::invalid(_("Account expires after"));
+ }
+ }
return($message);
}
$this->multiple_sambaUserWorkstations[$station] = array("Name" => $station, "UsedByAllUsers" => TRUE);
}
}
+
+ // Set kickOffTime to date
+ if(isset($attrs['sambaKickoffTime'][0])){
+ $this->sambaKickoffTime = date("d.m.Y", $this->sambaKickoffTime);
+ $this->flag_sambaKickoffTime = TRUE;
+ }
}
function multiple_execute()
// Handle Flags.
foreach(array("flag_enforcePasswordChange", "flag_passwordNeverExpires", "flag_noPasswordRequired",
- "flag_temporaryDisabled","flag_cannotChangePassword") as $attr){
+ "flag_temporaryDisabled","flag_cannotChangePassword","flag_sambaKickoffTime") as $attr){
$ret[$attr] = $this->$attr;
}
if(in_array("workstation_list",$this->multi_boxes)){
$ret['multiple_sambaUserWorkstations'] = $this->multiple_sambaUserWorkstations;
}
+
return($ret);
}
diff --git a/gosa-plugins/samba/personal/samba/samba3.tpl b/gosa-plugins/samba/personal/samba/samba3.tpl
index b0a3ae8b97c9947de1683c29dfe3db31f5eb9f03..c6eba890936841792c7382d6a6014cab53159634 100644 (file)
</tr>
</table>
+ <table>
+ <tr>
+ <td colspan=2>
+ {render acl=$sambaKickoffTimeACL checkbox=$multiple_support checked=$use_sambaKickoffTime}
+ <input id="flag_sambaKickoffTime" type=checkbox name="flag_sambaKickoffTime" value="1"
+ {if $flag_sambaKickoffTime} checked {/if} class="center">
+ {/render}
+ <label for="flag_sambaKickoffTime">{t}Account expires after{/t}</label>
+ </td>
+ <td style='width:200px;'>
+ {render acl=$sambaKickoffTimeACL}
+ <input type="text" id="sambaKickoffTime" name="sambaKickoffTime"
+ class="date" style='width:100px' value="{$sambaKickoffTime}">
+ {if $sambaKickoffTimeACL|regex_replace:"/[cdmr]/":"" == "w"}
+ <script type="text/javascript">
+ {literal}
+ var datepicker2 = new DatePicker({
+ relative : 'sambaKickoffTime',
+ language : '{/literal}{$lang}{literal}',
+ keepFieldEmpty : true,
+ enableCloseEffect : false,
+ enableShowEffect : false });
+ {/literal}
+ </script>
+ {/if}
+ {/render}
+ </td>
+ </tr>
+ </table>
+
+
<hr>
{render acl=$sambaLogonHoursACL mode=read_active checkbox=$multiple_support checked=$use_SetSambaLogonHours}