/** * Extend account * @param ilECSSetting $server * @param ilObjUser $user */ protected static function extendAccount(ilECSSetting $settings, ilObjUser $user) { $end = new ilDateTime(time(), IL_CAL_UNIX); $end->increment(IL_CAL_MONTH, $settings->getDuration()); $GLOBALS['ilLog']->write(__METHOD__ . ': account extension ' . (string) $end); if ($user->getTimeLimitUntil() < $end->get(IL_CAL_UNIX)) { $user->setTimeLimitUntil($end->get(IL_CAL_UNIX)); $user->update(); } }