Skip to content

Commit

Permalink
Add condition whereby a user creation date of '0000-00-00 00:00:00' i…
Browse files Browse the repository at this point in the history
…s considered null
  • Loading branch information
ywarnier committed Jan 10, 2016
1 parent c1ddde5 commit bc90310
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main/inc/lib/usermanager.lib.php
Expand Up @@ -309,10 +309,13 @@ public static function create_user(
$currentDate = api_get_utc_datetime();
$now = new DateTime($currentDate);

if (empty($expirationDate)) {
if (empty($expirationDate) || $expirationDate == '0000-00-00 00:00:00') {
// Default expiration date
// if there is a default duration of a valid account then
// we have to change the expiration_date accordingly
// Accept 0000-00-00 00:00:00 as a null value to avoid issues with
// third party code using this method with the previous (pre-1.10)
// value of 0000...
if (api_get_setting('account_valid_duration') != '') {
$expirationDate = new DateTime($currentDate);
$days = intval(api_get_setting('account_valid_duration'));
Expand Down

0 comments on commit bc90310

Please sign in to comment.