Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1e79301 authored by theronakpatel's avatar theronakpatel
Browse files

add all username summary in logs

parent be778694
Loading
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -230,11 +230,36 @@ class RecoveryWarningNotificationCommand extends Command {
					// Set the disable date using config variable
					$disableDate = date('Y-m-d', $firstRunDate + ($this->disableUserAfterUnverifiedDays * 24 * 60 * 60));
					$this->recoveryEmailService->setUnverifiedUserDisableAt($uid, $disableDate);
				} else {
					$disableDate = $existingDisableDate;
				}

				// Calculate age and process
				$age = (int) ((time() - $firstRunDate) / (24 * 60 * 60));

				// Calculate delete date (disable date + days after disable)
				$deleteDate = null;
				$disabledAt = (int) $this->config->getUserValue($uid, Application::APP_ID, 'account-disabled-at', '0');
				if ($disabledAt > 0) {
					// User is already disabled, calculate delete date from disabled timestamp
					$deleteDate = date('Y-m-d', $disabledAt + ($this->deleteUserAfterDisableDays * 24 * 60 * 60));
				} else {
					// User not yet disabled, calculate delete date from scheduled disable date
					$disableTimestamp = strtotime($disableDate);
					if ($disableTimestamp !== false) {
						$deleteDate = date('Y-m-d', $disableTimestamp + ($this->deleteUserAfterDisableDays * 24 * 60 * 60));
					}
				}

				// Log user information
				$output->writeln(sprintf(
					"User: %s | Age: %d days | Disable date: %s | Delete date: %s",
					$username,
					$age,
					$disableDate,
					$deleteDate ?: 'N/A'
				));

				if (in_array($age, $this->reminderDaysSinceStart)) {
					$this->uids[] = $uid;
				}