summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e5705d6)
raw | patch | inline | side by side (parent: e5705d6)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 4 Jan 2007 08:35:10 +0000 (08:35 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 4 Jan 2007 08:35:10 +0000 (08:35 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5467 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/generic/class_user.inc | patch | blob | history | |
plugins/personal/posix/class_posixAccount.inc | patch | blob | history |
index 46ecbc77d434db966131cb7fe6910dbc588d2228..063a974c3c93875a999d9bde394dbec8c93702a7 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 (!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 901caa244e5d18596c7d8e0372d679611bd349f6..847f8dafe7ae9ee55505b65dd6cd14155e74f21d 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";
+ }
}
function get_next_id($attrib)