summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a37fbf0)
raw | patch | inline | side by side (parent: a37fbf0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 13 Dec 2007 10:54:53 +0000 (10:54 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 13 Dec 2007 10:54:53 +0000 (10:54 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8118 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/personal/posix/class_posixAccount.inc | patch | blob | history | |
gosa-core/plugins/personal/posix/posix_shadow.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc
index 5fad0db19c56ea3baa40c6a638992a8dfd763704..bbcebfdcd94a7e38c8da64d05280199cbab694e9 100644 (file)
var $savedGroupMembership= array();
var $savedUidNumber= "";
var $savedGidNumber= "";
- var $use_shadowMin= "0";
- var $use_shadowMax= "0";
- var $use_shadowWarning= "0";
- var $use_shadowInactive= "0";
- var $use_shadowExpire= "0";
+ var $activate_shadowMin= "0";
+ var $activate_shadowMax= "0";
+ var $activate_shadowWarning= "0";
+ var $activate_shadowInactive= "0";
+ var $activate_shadowExpire= "0";
var $mustchangepassword= "0";
var $force_ids= 0;
var $group_dialog= FALSE;
/* attribute list for save action */
var $CopyPasteVars =
- array("grouplist","groupMembership","use_shadowMin",
- "use_shadowMax","use_shadowWarning","use_shadowInactive","use_shadowExpire",
+ array("grouplist","groupMembership","activate_shadowMin",
+ "activate_shadowMax","activate_shadowWarning","activate_shadowInactive","activate_shadowExpire",
"must_change_password","printerList","grouplist","savedGidNumber","savedUidNumber");
var $attributes = array("homeDirectory", "loginShell", "uidNumber", "gidNumber", "gecos",
"shadowExpire") as $val){
if ($this->$val != 0){
- $oval= "use_".$val;
+ $oval= "activate_".$val;
$this->$oval= "1";
}
}
$smarty->assign("shadowwarnings", sprintf(_("Warn user %s days before password expiery"),
"<input name=\"shadowWarning\" size=3 maxlength=4 value=\"".$this->shadowWarning."\">"));
- foreach( array("use_shadowMin", "use_shadowMax",
- "use_shadowExpire", "use_shadowInactive","use_shadowWarning") as $val){
+ foreach( array("activate_shadowMin", "activate_shadowMax",
+ "activate_shadowExpire", "activate_shadowInactive","activate_shadowWarning") as $val){
if ($this->$val == 1){
$smarty->assign("$val", "checked");
} else {
$smarty->assign("$val"."ACL", $this->getacl($val,$SkipWrite));
}
- if($this->mustchangepassword){
- $smarty->assign("mustchangepassword", "checked");
- } else {
- $smarty->assign("mustchangepassword", "");
- }
$smarty->assign("mustchangepasswordACL", $this->getacl("mustchangepassword",$SkipWrite));
}
$smarty->assign("force_idsACL", $this->getacl("uidNumber",$SkipWrite).$this->getacl("gidNumber",$SkipWrite));
- foreach(array("primaryGroup","trustmode") as $val){
+ foreach(array("primaryGroup","trustmode","activate_shadowWarning","activate_shadowInactive","activate_shadowMin","activate_shadowMax","activate_shadowExpire","mustchangepassword") as $val){
if(in_array($val,$this->multi_boxes)){
$smarty->assign("use_".$val,TRUE);
}else{
else
$smarty->assign("emptyArrAccess",false);
-
+ if($this->mustchangepassword){
+ $smarty->assign("mustchangepassword", " checked ");
+ } else {
+ $smarty->assign("mustchangepassword", "");
+ }
$smarty->assign("workstations", $this->accessTo);
$this->primaryGroup= $_POST['primaryGroup'];
}
- foreach(array("shadowMin","shadowMax","shadowExpire","shadowInactive","shadowWarning","mustchangepassword") as $var) {
+ /* Get seelcted shadow checkboxes */
+ foreach(array("shadowMin","shadowMax","shadowExpire","shadowInactive","shadowWarning") as $var) {
if($this->acl_is_writeable($var)){
- $use_var = "use_".$var;
- if(isset($_POST['use_'.$var])){
- $this->$use_var = true;
+ $activate_var = "activate_".$var;
+ if(isset($_POST['activate_'.$var])){
+ $this->$activate_var = true;
$this->$var = $_POST[$var];
}else{
- $this->$use_var = false;
+ $this->$activate_var = false;
$this->$var = 0;
}
}
}
+ /* Force change password ? */
+ if(isset($_POST['mustchangepassword'])){
+ $this->mustchangepassword = TRUE;
+ }else{
+ $this->mustchangepassword = FALSE;
+ }
+
/* Trust mode - special handling */
if($this->acl_is_writeable("trustModel")){
if (isset($_POST['trustmode'])){
$ldap= $this->config->get_ldap_link();
/* Adapt shadow values */
- if (!$this->use_shadowExpire){
+ if (!$this->activate_shadowExpire){
$this->shadowExpire= "0";
} else {
/* Transform seconds to days here */
$this->shadowExpire= (int)($this->shadowExpire / (60 * 60 * 24)) ;
}
- if (!$this->use_shadowMax){
+ if (!$this->activate_shadowMax){
$this->shadowMax= "0";
}
if ($this->mustchangepassword){
} else {
$this->shadowLastChange= (int)(date("U") / 86400);
}
- if (!$this->use_shadowWarning){
+ if (!$this->activate_shadowWarning){
$this->shadowWarning= "0";
}
}
}
- if ($this->use_shadowMin != "1" ) {
+ if ($this->activate_shadowMin != "1" ) {
$this->shadowMin = "";
}
- if (($this->use_shadowMax != "1") && ($this->mustchangepassword != "1")) {
+ if (($this->activate_shadowMax != "1") && ($this->mustchangepassword != "1")) {
$this->shadowMax = "";
}
- if ($this->use_shadowWarning != "1" ) {
+ if ($this->activate_shadowWarning != "1" ) {
$this->shadowWarning = "";
}
- if ($this->use_shadowInactive != "1" ) {
+ if ($this->activate_shadowInactive != "1" ) {
$this->shadowInactive = "";
}
- if ($this->use_shadowExpire != "1" ) {
+ if ($this->activate_shadowExpire != "1" ) {
$this->shadowExpire = "";
}
}
/* Check shadow settings, well I like spaghetties... */
- if ($this->use_shadowMin){
+ if ($this->activate_shadowMin){
if (!is_id($this->shadowMin)){
$message[]= _("Value specified as 'shadowMin' is not valid.");
}
}
- if ($this->use_shadowMax){
+ if ($this->activate_shadowMax){
if (!is_id($this->shadowMax)){
$message[]= _("Value specified as 'shadowMax' is not valid.");
}
}
- if ($this->use_shadowWarning){
+ if ($this->activate_shadowWarning){
if (!is_id($this->shadowWarning)){
$message[]= _("Value specified as 'shadowWarning' is not valid.");
}
- if (!$this->use_shadowMax){
+ if (!$this->activate_shadowMax){
$message[]= _("'shadowWarning' without 'shadowMax' makes no sense.");
}
if ($this->shadowWarning > $this->shadowMax){
$message[]= _("Value specified as 'shadowWarning' should be smaller than 'shadowMax'.");
}
- if ($this->use_shadowMin && $this->shadowWarning < $this->shadowMin){
+ if ($this->activate_shadowMin && $this->shadowWarning < $this->shadowMin){
$message[]= _("Value specified as 'shadowWarning' should be greater than 'shadowMin'.");
}
}
- if ($this->use_shadowInactive){
+ if ($this->activate_shadowInactive){
if (!is_id($this->shadowInactive)){
$message[]= _("Value specified as 'shadowInactive' is not valid.");
}
- if (!$this->use_shadowMax){
+ if (!$this->activate_shadowMax){
$message[]= _("'shadowInactive' without 'shadowMax' makes no sense.");
}
}
- if ($this->use_shadowMin && $this->use_shadowMax){
+ if ($this->activate_shadowMin && $this->activate_shadowMax){
if ($this->shadowMin > $this->shadowMax){
$message[]= _("Value specified as 'shadowMin' should be smaller than 'shadowMax'.");
}
/* Adjust shadow checkboxes */
foreach (array("shadowMin", "shadowMax", "shadowWarning", "shadowInactive") as $val){
if ($this->$val != 0){
- $oval= "use_".$val;
+ $oval= "activate_".$val;
$this->$oval= "1";
}
}
/* Only enable checkbox, if shadowExpire is in the future */
if($this->shadowExpire > time()) {
- $this->use_shadowExpire= "1";
+ $this->activate_shadowExpire= "1";
}
}
$ret['trustModel'] = $this->trustModel;
$ret['accessTo'] = $this->accessTo;
}
+ foreach(array("shadowWarning","shadowInactive","shadowMin","shadowMax", "shadowExpire") as $entry){
+ $active = "activate_".$entry;
+ if(in_array($active,$this->multi_boxes)){
+ $ret[$entry] = $this->$entry;
+ $ret[$active] = $this->$active;
+ }
+ }
+ if(in_array("mustchangepassword",$this->multi_boxes)){
+ $ret['mustchangepassword'] = $this->mustchangepassword;
+ }
+ print_a($this->multi_boxes);
+ print_a($ret);
return($ret);
}
{
if(isset($_POST['posix_mulitple_edit'])){
plugin::multiple_save_object();
- foreach(array("primaryGroup","trustmode") as $val){
+ foreach(array("primaryGroup","trustmode","mustchangepassword","activate_shadowWarning","activate_shadowInactive","activate_shadowMin", "activate_shadowMax","activate_shadowExpire") as $val){
if(isset($_POST["use_".$val])){
$this->multi_boxes[] = $val;
}
}
+ /* Get selected shadow checkboxes */
+ foreach(array("shadowMin","shadowMax","shadowExpire","shadowInactive","shadowWarning") as $var) {
+ if($this->acl_is_writeable($var)){
+ $activate_var = "activate_".$var;
+ if(isset($_POST['activate_'.$var])){
+ $this->$activate_var = true;
+ $this->$var = $_POST[$var];
+ }else{
+ $this->$activate_var = false;
+ $this->$var = 0;
+ }
+ }
+ }
+
+ /* Force change password ? */
+ if(isset($_POST['mustchangepassword'])){
+ $this->mustchangepassword = TRUE;
+ }else{
+ $this->mustchangepassword = FALSE;
+ }
+
/* Trust mode - special handling */
if($this->acl_is_writeable("trustModel")){
if (isset($_POST['trustmode'])){
diff --git a/gosa-core/plugins/personal/posix/posix_shadow.tpl b/gosa-core/plugins/personal/posix/posix_shadow.tpl
index bd7862c6dde1961f505dfec8894ec107a81e70d8..79c0ebe33444a6545d2270cdc104107b21d6fe33 100644 (file)
<td style="width:50%; vertical-align:top;">
<!-- must_change_password -->
-{render acl=$mustchangepasswordACL}
- <input type=checkbox name="mustchangepassword" value="1" {$mustchangepassword}>
+{render acl=$mustchangepasswordACL checkbox=$multiple_support checked=$use_mustchangepassword}
+ <input type="checkbox" class="center" name="mustchangepassword" value="1" {$mustchangepassword}>
{/render}
{t}User must change password on first login{/t}
<br>
<!-- shadowMin -->
-{render acl=$shadowMinACL}
- <input type=checkbox name="use_shadowMin" value="1" {$use_shadowMin}>
+{render acl=$shadowMinACL checkbox=$multiple_support checked=$use_activate_shadowMin}
+ <input type="checkbox" class="center" name="activate_shadowMin" value="1" {$activate_shadowMin}>
{/render}
{render acl=$shadowMinACL}
{$shadowmins}
{/render}
<br>
-<!-- use_shadowMax -->
-{render acl=$shadowMaxACL}
- <input type=checkbox name="use_shadowMax" value="1" {$use_shadowMax}>
+<!-- activate_shadowMax -->
+{render acl=$shadowMaxACL checkbox=$multiple_support checked=$use_activate_shadowMax}
+ <input type="checkbox" class="center" name="activate_shadowMax" value="1" {$activate_shadowMax}>
{/render}
{render acl=$shadowMaxACL}
{$shadowmaxs}
{/render}
<br>
-<!-- use_shadowExpire -->
-{render acl=$shadowExpireACL}
- <input type=checkbox name="use_shadowExpire" value="1" {$use_shadowExpire}>
+<!-- activate_shadowExpire -->
+{render acl=$shadowExpireACL checkbox=$multiple_support checked=$use_activate_shadowExpire}
+ <input type="checkbox" class="center" name="activate_shadowExpire" value="1" {$activate_shadowExpire}>
{/render}
{t}Password expires on{/t}
{render acl=$shadowExpireACL}
<br>
<!-- shadowInactive -->
-{render acl=$shadowInactiveACL}
- <input type=checkbox name="use_shadowInactive" value="1" {$use_shadowInactive}>
+{render acl=$shadowInactiveACL checkbox=$multiple_support checked=$use_activate_shadowInactive}
+ <input type="checkbox" class="center" name="activate_shadowInactive" value="1" {$activate_shadowInactive}>
{/render}
{render acl=$shadowInactiveACL}
{$shadowinactives}
{/render}
<br>
-<!-- use_shadowWarning -->
-{render acl=$shadowWarningACL}
- <input type=checkbox name="use_shadowWarning" value="1" {$use_shadowWarning}>
+<!-- activate_shadowWarning -->
+{render acl=$shadowWarningACL checkbox=$multiple_support checked=$use_activate_shadowWarning}
+ <input type="checkbox" class="center" name="activate_shadowWarning" value="1" {$activate_shadowWarning}>
{/render}
{render acl=$shadowWarningACL}
{$shadowwarnings}