19 declare(strict_types=1);
41 private readonly \
ilCtrl $ctrl,
66 $baseClass = $this->profile_request->getBaseClass();
67 if ($baseClass ===
'' || strtolower($baseClass) !==
'ildashboardgui') {
72 strtolower($this->
ctrl->getCmdClass()) ===
'ilpersonalprofilegui' 74 strtolower($this->
ctrl->getCmd()),
88 $prompt_settings = $this->
repository->getSettings();
89 $user_prompt = $this->
repository->getUserPrompt($this->
user->getId());
91 $this->
logger->debug(
'Check Profile');
97 if ($this->
user->getProfileIncomplete()) {
98 $this->
logger->debug(
'Is Incomplete');
102 if (in_array($this->
user->getPref(
'public_profile'), [
'y',
'g'])) {
106 $this->
logger->debug(
'Is not public');
108 $this->
logger->debug(
'Mode: X days after login');
109 if ($user_prompt->getFirstLogin() ===
null || $user_prompt->getLastPrompt() !==
null) {
112 $this->
logger->debug(
'User has logged in and not prompted yet');
113 $deadline = $user_prompt->getFirstLogin()
114 ->add(
new \
DateInterval(
"P{$prompt_settings->getDays()}D"));
115 if ($deadline->getTimestamp() < time()) {
116 $this->
logger->debug(
'Deadline is due');
117 $this->update_prompt =
true;
123 $this->
logger->debug(
'Mode: Repeat all x days');
125 $last_interaction_date = max($user_prompt->getFirstLogin(), $user_prompt->getLastPrompt());
126 if ($last_interaction_date ===
null) {
129 $this->
logger->debug(
'User logged in already.');
130 $deadline = $last_interaction_date->add(
new \
DateInterval(
"P{$prompt_settings->getDays()}D"));
131 if ($deadline->getTimestamp() < time()) {
132 $this->
logger->debug(
'Deadline is due');
133 $this->update_prompt =
true;
142 if ($this->update_prompt) {
143 $this->
logger->debug(
'Update last prompt date for user :' . $this->
user->getId());
147 $this->
ctrl->setParameterByClass(
'ilpersonalprofilegui',
'prompted',
'1');
148 $this->
ctrl->redirectByClass([
'ildashboardgui',
'ilpersonalprofilegui'],
'showPersonalData');
static getLogger(string $a_component_id)
Get component logger.
repository()
description: > Example for rendering a repository card
shouldStoreRequestTarget()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
readonly GUIRequest $profile_request
const MODE_ONCE_AFTER_LOGIN
__construct(private readonly \ilObjUser $user, private readonly \ilCtrl $ctrl, \ilDBInterface $db, Language $lng, HTTPServices $http, Refinery $refinery)
const LOGGING_DATE_TIME_FORMAT
readonly Repository $repository