19 declare(strict_types=1);
50 $baseClass = $this->profile_request->getBaseClass();
51 if ($baseClass ===
'' || strtolower($baseClass) !==
'ildashboardgui') {
56 strtolower($this->
ctrl->getCmdClass()) ===
'ilpersonalprofilegui' 58 strtolower($this->
ctrl->getCmd()),
75 $prompt_settings = $user_prompt_service->data()->getSettings();
76 $user_prompt = $user_prompt_service->data()->getUserPrompt($this->
user->getId());
78 $user_log->debug(
'Check Profile');
85 if ($this->
user->getProfileIncomplete()) {
86 $user_log->debug(
'Is Incomplete');
90 if (in_array($this->
user->getPref(
'public_profile'), [
'y',
'g'])) {
94 $user_log->debug(
'Is not public');
97 $user_log->debug(
'Mode: X days after login');
99 if ($user_prompt->getFirstLogin() ===
'' || $user_prompt->getLastPrompt() !==
'') {
102 $user_log->debug(
'User has logged in and not prompted yet');
105 $deadline->increment(
IL_CAL_DAY, $prompt_settings->getDays());
106 $user_log->debug(
'Check Deadline: ' . $deadline->get(
IL_CAL_DATETIME) .
109 $user_log->debug(
'Deadline is due');
110 $this->update_prompt =
true;
117 $user_log->debug(
'Mode: Repeat all x days');
119 $deadline = max($user_prompt->getFirstLogin(), $user_prompt->getLastPrompt());
120 if ($deadline ==
'') {
123 $user_log->debug(
'User logged in already.');
125 $deadline_as_il_data->increment(
IL_CAL_DAY, $prompt_settings->getDays());
126 $user_log->debug(
'Check Deadline: ' . $deadline_as_il_data->get(
IL_CAL_DATETIME) .
129 $user_log->debug(
'Deadline is due');
130 $this->update_prompt =
true;
141 if ($this->update_prompt) {
142 $user_log->debug(
'Update last prompt date for user :' . $this->
user->getId());
144 $user_prompt_service->data()->saveLastUserPrompt($this->
user->getId());
147 $this->
ctrl->setParameterByClass(
'ilpersonalprofilegui',
'prompted',
'1');
148 $this->
ctrl->redirectByClass([
'ildashboardgui',
'ilpersonalprofilegui'],
'showPersonalData');
__construct(ilObjUser $user, ilCtrl $ctrl)
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static now()
Return current timestamp in Y-m-d H:i:s format.
ILIAS User ProfileGUIRequest $profile_request
shouldStoreRequestTarget()
const MODE_ONCE_AFTER_LOGIN