Commit e96838e2 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5746-using-date-modifier-not-work-for-unix-password-expiration' into '1.3-dev'

Resolve "Using date modifier not work for unix password expiration"

See merge request fusiondirectory/fd!101

(cherry picked from commit 9d3163f9)

37dba370 :sparkles: feat(template): Add special epoch format for date modifier
Showing with 4 additions and 0 deletions
+4 -0
...@@ -364,6 +364,10 @@ class templateHandling ...@@ -364,6 +364,10 @@ class templateHandling
$args[] = 'd.m.Y'; $args[] = 'd.m.Y';
} }
$dateObject = new DateTime($args[0], new DateTimeZone('UTC')); $dateObject = new DateTime($args[0], new DateTimeZone('UTC'));
if ($args[1] == 'epoch') {
/* Special handling for shadowExpire: days since epoch */
return array(floor($dateObject->format('U') / 86400));
}
return array($dateObject->format($args[1])); return array($dateObject->format($args[1]));
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment