mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/site_users.git
synced 2026-05-07 03:15:30 -03:00
Melhorias no microsite e sincronização de fotos LDAP
Fotos LDAP:
- Ignora sync quando conta ainda não tem UID (evitava URI compartilhada)
- Filtra fotos abaixo do tamanho mínimo configurável (padrão 10 KB)
- Adiciona campo ldap_min_photo_size nas configurações e schema
- Update 10010: remove fotos placeholder já existentes
- Update 10011: remove mídias com URI ldap_photo_.{ext} sem UID
Bloco de cabeçalho do microsite:
- Exibe departamento abaixo do nome, sem label, com link para a entidade
- Exibe telefone de trabalho (work_phone) no lugar de phone (restrito)
Página de perfil:
- Título fixo "Perfil de @name" via callback profileTitle()
- Exclui rota profile da substituição de título pelo nó homepage
Subpáginas com URL amigável:
- Adiciona MicrositeSubpagePathProcessor (inbound + outbound)
- Inbound: /user/{username}/{subpage} → /user/{uid}/{subpage}
- Outbound: /user/{uid}/{subpage} → /user/{username}/{subpage}
- Busca alias em todos os idiomas para contornar limitação do AliasManager
Tema do microsite em rotas externas:
- MicrositeThemeNegotiator cobre rotas com parâmetro user sob /user/{user}/
- Cobre nós do structural_pages cujo alias começa com /user/{uid}/
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -118,6 +118,20 @@ class SiteUsersSettingsForm extends ConfigFormBase {
|
||||
],
|
||||
];
|
||||
|
||||
$form['photos']['photos_ldap_min_photo_size'] = [
|
||||
'#type' => 'number',
|
||||
'#title' => $this->t('Minimum LDAP photo size (bytes)'),
|
||||
'#description' => $this->t('Photos smaller than this size are ignored during LDAP sync, avoiding placeholder images. Default: 10240 (10 KB).'),
|
||||
'#default_value' => $config->get('photos.ldap_min_photo_size') ?? 10240,
|
||||
'#min' => 0,
|
||||
'#required' => TRUE,
|
||||
'#states' => [
|
||||
'visible' => [
|
||||
':input[name="photos_ldap_sync_enabled"]' => ['checked' => TRUE],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
// Fieldset para campos editáveis pelo próprio usuário.
|
||||
$form['user_editable_fields'] = [
|
||||
'#type' => 'fieldset',
|
||||
@@ -270,7 +284,8 @@ class SiteUsersSettingsForm extends ConfigFormBase {
|
||||
$config
|
||||
->set('photos.max_count', $form_state->getValue('photos_max_count'))
|
||||
->set('photos.ldap_sync_enabled', (bool) $form_state->getValue('photos_ldap_sync_enabled'))
|
||||
->set('photos.ldap_attribute', $form_state->getValue('photos_ldap_attribute'));
|
||||
->set('photos.ldap_attribute', $form_state->getValue('photos_ldap_attribute'))
|
||||
->set('photos.ldap_min_photo_size', (int) $form_state->getValue('photos_ldap_min_photo_size'));
|
||||
|
||||
$definitions = \Drupal::service('entity_field.manager')
|
||||
->getFieldDefinitions('user', 'user');
|
||||
|
||||
Reference in New Issue
Block a user