Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions components/ILIAS/AuthShibboleth/classes/User/class.shibUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*********************************************************************/

use ILIAS\Refinery\String\UTFNormal;
use ILIAS\Data\Privacy\Source\Sources;

/**
* Class shibUser
Expand Down Expand Up @@ -71,13 +72,13 @@ public function updateFields(): void
$this->setDepartment($this->shibServerData->getDepartment());
}
if ($shibConfig->getUpdateStreet()) {
$this->setStreet($this->shibServerData->getStreet());
$this->setAddressFieldFromShibServer('street', $this->shibServerData->getStreet());
}
if ($shibConfig->getUpdateZipcode()) {
$this->setZipcode($this->shibServerData->getZipcode());
$this->setAddressFieldFromShibServer('zipcode', $this->shibServerData->getZipcode());
}
if ($shibConfig->getUpdateCountry()) {
$this->setCountry($this->shibServerData->getCountry());
$this->setAddressFieldFromShibServer('country', $this->shibServerData->getCountry());
}
if ($shibConfig->getUpdatePhoneOffice()) {
$this->setPhoneOffice($this->shibServerData->getPhoneOffice());
Expand Down Expand Up @@ -118,9 +119,9 @@ public function createFields(): void
$this->setUTitle($this->shibServerData->getTitle());
$this->setInstitution($this->shibServerData->getInstitution());
$this->setDepartment($this->shibServerData->getDepartment());
$this->setStreet($this->shibServerData->getStreet());
$this->setZipcode($this->shibServerData->getZipcode());
$this->setCountry($this->shibServerData->getCountry());
$this->setAddressFieldFromShibServer('street', $this->shibServerData->getStreet());
$this->setAddressFieldFromShibServer('zipcode', $this->shibServerData->getZipcode());
$this->setAddressFieldFromShibServer('country', $this->shibServerData->getCountry());
$this->setPhoneOffice($this->shibServerData->getPhoneOffice());
$this->setPhoneHome($this->shibServerData->getPhoneHome());
$this->setPhoneMobile($this->shibServerData->getPhoneMobile());
Expand Down Expand Up @@ -226,4 +227,31 @@ protected static function getUsrIdByExtId(string $ext_id): ?int

return ($usr !== null && isset($usr->usr_id)) ? (int) $usr->usr_id : null;
}

private function setAddressFieldFromShibServer(string $field, string $value): void
{
$profile_data = $this->getProfileData();
$address = $profile_data->getPostalAddress();
if ($address === null) {
// bare instance without a bound postal address — deprecated setter path
match ($field) {
'street' => $this->setStreet($value),
'zipcode' => $this->setZipcode($value),
'country' => $this->setCountry($value),
};
return;
}

global $DIC;
$source = $DIC[Sources::class]->externalApi('shibboleth', $field);
$this->replaceProfileData(
$profile_data->withPostalAddress(
match ($field) {
'street' => $address->withStreet($value, $source),
'zipcode' => $address->withZipcode($value, $source),
'country' => $address->withCountry($value, $source),
}
)
);
}
}
31 changes: 31 additions & 0 deletions components/ILIAS/Certificate/PRIVACY_DATA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Privacy Data Usage – Certificate

> Auto-generated by `scripts/Privacy/generate-privacy-docs.php` on 2026-07-23.
> Do not edit manually – re-run the generator after code changes.

## Summary

| Category | Count |
|---|---|
| Stored in DB | 0 |
| Displayed to user | 0 |
| Passed to component | 1 |
| Technical processing | 0 |
| Unmigrated (legacy access) | 0 |

## Passed to other components

_Data resolved and forwarded to another component._

| Type | Target component | Reason | File |
|---|---|---|---|
| `PostalAddress` | `Certificate` | certificate_placeholders | `Certificate/classes/Placeholder/Values/class.ilDefaultPlaceholderValues.php:146` |

## GDPR relevance

| GDPR aspect | Details |
|---|---|
| Personal data categories | `PostalAddress` |
| Data recipients | `Certificate` |
| Legal basis | _To be filled in manually_ |
| Retention period | _To be filled in manually_ |
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ilDefaultPlaceholderValues implements ilCertificatePlaceholderValues
private readonly ilCertificateUtilHelper $utilHelper;
private readonly ilUserDefinedFieldsPlaceholderValues $userDefinedFieldsPlaceholderValues;
private readonly Factory $uuid_factory;
private readonly \ILIAS\Data\Privacy\Purpose\Purposes $purposes;
private ?ilLanguage $user_language = null;


Expand All @@ -48,7 +49,8 @@ public function __construct(
?ilCertificateUtilHelper $utilHelper = null,
?ilUserDefinedFieldsPlaceholderValues $userDefinedFieldsPlaceholderValues = null,
?ILIAS\Data\UUID\Factory $uuid_factory = null,
?int $birthdayDateFormat = null
?int $birthdayDateFormat = null,
?ILIAS\Data\Privacy\Purpose\Purposes $purposes = null
) {
$this->objectHelper = $objectHelper ?? new ilCertificateObjectHelper();
$this->dateHelper = $dateHelper ?? new ilCertificateDateHelper();
Expand Down Expand Up @@ -76,6 +78,7 @@ public function __construct(
new ilCertificateUtilHelper()
);
$this->uuid_factory = $uuid_factory ?? new ILIAS\Data\UUID\Factory();
$this->purposes = $purposes ?? $DIC[\ILIAS\Data\Privacy\Purpose\Purposes::class];

$this->placeholder = [
'CERTIFICATE_ID' => '',
Expand Down Expand Up @@ -140,10 +143,13 @@ public function getPlaceholderValues(int $userId, int $objId): array
$placeholder['USER_BIRTHDAY'] = $this->utilHelper->prepareFormOutput((trim($birthday)));
$placeholder['USER_INSTITUTION'] = $this->utilHelper->prepareFormOutput((trim($user->getInstitution())));
$placeholder['USER_DEPARTMENT'] = $this->utilHelper->prepareFormOutput((trim($user->getDepartment())));
$placeholder['USER_STREET'] = $this->utilHelper->prepareFormOutput((trim($user->getStreet())));
$placeholder['USER_CITY'] = $this->utilHelper->prepareFormOutput((trim($user->getCity())));
$placeholder['USER_ZIPCODE'] = $this->utilHelper->prepareFormOutput((trim($user->getZipcode())));
$placeholder['USER_COUNTRY'] = $this->utilHelper->prepareFormOutput((trim($user->getCountry())));
$postal_address = $user->getProfileData()->getPostalAddress()?->resolve(
$this->purposes->passToComponent('Certificate', 'certificate_placeholders')
);
$placeholder['USER_STREET'] = $this->utilHelper->prepareFormOutput(trim($postal_address?->street ?? ''));
$placeholder['USER_CITY'] = $this->utilHelper->prepareFormOutput(trim($postal_address?->city ?? ''));
$placeholder['USER_ZIPCODE'] = $this->utilHelper->prepareFormOutput(trim($postal_address?->zipcode ?? ''));
$placeholder['USER_COUNTRY'] = $this->utilHelper->prepareFormOutput(trim($postal_address?->country ?? ''));
$placeholder['USER_MATRICULATION'] = $this->utilHelper->prepareFormOutput((trim($user->getMatriculation())));
$placeholder['DATE'] = $this->utilHelper->prepareFormOutput((trim($this->dateHelper->formatDate(
time(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ public function testGetPlaceholderValues(): void
'getBirthday',
'getInstitution',
'getDepartment',
'getStreet',
'getCity',
'getZipcode',
'getCountry',
'getProfileData',
'getMatriculation'
]
)
Expand Down Expand Up @@ -83,20 +80,8 @@ public function testGetPlaceholderValues(): void
->willReturn('');

$objectMock->expects($this->once())
->method('getStreet')
->willReturn('');

$objectMock->expects($this->once())
->method('getCity')
->willReturn('');

$objectMock->expects($this->once())
->method('getZipcode')
->willReturn('');

$objectMock->expects($this->once())
->method('getCountry')
->willReturn('');
->method('getProfileData')
->willReturn(new ILIAS\User\Profile\Data());

$objectMock->expects($this->once())
->method('getMatriculation')
Expand Down Expand Up @@ -164,7 +149,8 @@ public function testGetPlaceholderValues(): void
$utilHelper,
$userDefinePlaceholderMock,
$uuid_factory_mock,
2
2,
new ILIAS\Data\Privacy\Purpose\Purposes()
);
$placeHolderObject->setUserLanguage($language);

Expand Down Expand Up @@ -253,7 +239,8 @@ public function testGetPlaceholderValuesForPreview(): void
$utilHelper,
$userDefinePlaceholderMock,
$uuid_factory_mock,
2
2,
new ILIAS\Data\Privacy\Purpose\Purposes()
);

$result = $placeHolderObject->getPlaceholderValuesForPreview(
Expand Down
26 changes: 26 additions & 0 deletions components/ILIAS/Data/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,31 @@ public function init(
): void {
$provide[\ILIAS\Data\Factory::class] = static fn() =>
new \ILIAS\Data\Factory();

$define[] = \ILIAS\Data\Privacy\Services::class;

$implement[\ILIAS\Data\Privacy\Services::class] = static fn() =>
new \ILIAS\Data\Privacy\ServicesImpl(
$internal[\ILIAS\Data\Privacy\Logger\CompositeLogger::class],
$internal[\ILIAS\Data\Privacy\Source\Sources::class],
$internal[\ILIAS\Data\Privacy\Purpose\Purposes::class],
);

$internal[\ILIAS\Data\Privacy\Logger\CompositeLogger::class] = static fn() =>
new \ILIAS\Data\Privacy\Logger\CompositeLogger(
$seek[\ILIAS\Data\Privacy\Logger\PrivacyLogger::class]
);

$internal[\ILIAS\Data\Privacy\Source\Sources::class] = static fn() =>
new \ILIAS\Data\Privacy\Source\Sources();

$internal[\ILIAS\Data\Privacy\Purpose\Purposes::class] = static fn() =>
new \ILIAS\Data\Privacy\Purpose\Purposes();

$provide[\ILIAS\Data\Privacy\Source\Sources::class] = static fn() =>
$internal[\ILIAS\Data\Privacy\Source\Sources::class];

$provide[\ILIAS\Data\Privacy\Purpose\Purposes::class] = static fn() =>
$internal[\ILIAS\Data\Privacy\Purpose\Purposes::class];
}
}
Loading
Loading