summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 16f934b)
raw | patch | inline | side by side (parent: 16f934b)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 4 Jan 2007 10:14:37 +0000 (10:14 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 4 Jan 2007 10:14:37 +0000 (10:14 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5469 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/generic/class_user.inc | patch | blob | history | |
plugins/personal/posix/class_posixAccount.inc | patch | blob | history |
index 6ecd0e18c993d659f4318153943a78eb99d1508c..971bec20953d3c26495cee3d705d2b5634afc4b8 100644 (file)
} else {
if(is_array($this->dateOfBirth)){
$date = $this->dateOfBirth;
- }else{
+
+ // Trigger on dates like 1985-04-01, getdate only understands timestamps
+ } else if (!empty($this->dateOfBirth) && !is_numeric($this->dateOfBirth)){
+ $date= getdate(strtotime($this->dateOfBirth));
+
+ } else {
$date = getdate($this->dateOfBirth);
}
}
diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc
index 77ce8bfdfac81c1f59aaa845e671305229564c9f..de4160a841edf240afdbefbf7654c3520db4649d 100644 (file)
}
/* Adjust shadow checkboxes */
- foreach (array("shadowMin", "shadowMax", "shadowWarning", "shadowInactive",
- "shadowExpire") as $val){
-
+ foreach (array("shadowMin", "shadowMax", "shadowWarning", "shadowInactive") as $val){
if ($this->$val != 0){
$oval= "use_".$val;
$this->$oval= "1";
}
}
- $this->shadowExpire= $this->convertToSeconds($this->shadowExpire);
+ /* FIXME: NEED review of this section */
+ /* Need to check shadowExpire separately */
+
+ /*
+ * If shadowExpire is not enabled in the template, it's a UNIX timestamp - so don't convert it to seconds.
+ * The check is a hack - if difference between timestamp generated above and here is max 1 day.
+ */
+ if(abs($this->shadowExpire - time())>86400) {
+ $this->shadowExpire= $this->convertToSeconds($this->shadowExpire);
+ }
+
+ /* Only enable checkbox, if shadowExpire is in the future */
+ if($this->shadowExpire > time()) {
+ $this->use_shadowExpire= "1";
+ }
}