Merge remote-tracking branch 'origin/main' into next-rc

This commit is contained in:
Stefan Benz 2024-06-28 15:50:18 +02:00
commit 406fa44b63
No known key found for this signature in database
GPG Key ID: 9D2FE4EA50BEFE68
22 changed files with 67 additions and 31 deletions

View File

@ -34,7 +34,7 @@
<button mat-stroked-button type="button" (click)="reset()">{{ 'ACTIONS.RESET' | translate }}</button> <button mat-stroked-button type="button" (click)="reset()">{{ 'ACTIONS.RESET' | translate }}</button>
<span class="filter-middle">{{ 'FILTER.TITLE' | translate }}</span> <span class="filter-middle">{{ 'FILTER.TITLE' | translate }}</span>
<button mat-raised-button color="primary" type="button" (click)="finish()" data-e2e="filter-finish-button"> <button mat-raised-button color="primary" type="button" (click)="finish()" data-e2e="filter-finish-button">
{{ 'ACTIONS.FINISH' | translate }} {{ 'ACTIONS.APPLY' | translate }}
</button> </button>
</div> </div>
<form *ngIf="form" [formGroup]="form" (ngSubmit)="emitChange()"> <form *ngIf="form" [formGroup]="form" (ngSubmit)="emitChange()">

View File

@ -23,7 +23,7 @@
<div class="filter-top"> <div class="filter-top">
<button mat-stroked-button (click)="resetted.emit()">{{ 'ACTIONS.RESET' | translate }}</button> <button mat-stroked-button (click)="resetted.emit()">{{ 'ACTIONS.RESET' | translate }}</button>
<span class="filter-middle">{{ 'FILTER.TITLE' | translate }}</span> <span class="filter-middle">{{ 'FILTER.TITLE' | translate }}</span>
<button mat-raised-button color="primary" (click)="emitFilter()">{{ 'ACTIONS.FINISH' | translate }}</button> <button mat-raised-button color="primary" (click)="emitFilter()">{{ 'ACTIONS.APPLY' | translate }}</button>
</div> </div>
<ng-content></ng-content> <ng-content></ng-content>
</div> </div>

View File

@ -53,6 +53,10 @@
overflow: hidden; // prevents multi-line errors from overlapping the control overflow: hidden; // prevents multi-line errors from overlapping the control
} }
mat-dialog-container .cnsl-form-field-subscript-wrapper {
width: auto;
}
.cnsl-form-field-hint-wrapper, .cnsl-form-field-hint-wrapper,
.cnsl-form-field-error-wrapper { .cnsl-form-field-error-wrapper {
display: flex; display: flex;

View File

@ -1,4 +1,4 @@
<h1 class="title"> <h1 mat-dialog-title class="title">
<span>{{ data.title | translate }}</span> <span>{{ data.title | translate }}</span>
</h1> </h1>
<div mat-dialog-content> <div mat-dialog-content>

View File

@ -96,7 +96,10 @@ export class UserTableComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.route.queryParams.pipe(take(1)).subscribe((params) => { this.route.queryParams.pipe(take(1)).subscribe((params) => {
this.getData(this.INITIAL_PAGE_SIZE, 0, this.type); if (!params['filter']) {
this.getData(this.INITIAL_PAGE_SIZE, 0, this.type, this.searchQueries);
}
if (params['deferredReload']) { if (params['deferredReload']) {
setTimeout(() => { setTimeout(() => {
this.getData(this.paginator.pageSize, this.paginator.pageIndex * this.paginator.pageSize, this.type); this.getData(this.paginator.pageSize, this.paginator.pageIndex * this.paginator.pageSize, this.type);
@ -116,7 +119,7 @@ export class UserTableComponent implements OnInit {
queryParamsHandling: 'merge', queryParamsHandling: 'merge',
skipLocationChange: false, skipLocationChange: false,
}); });
this.getData(this.paginator.pageSize, this.paginator.pageIndex * this.paginator.pageSize, this.type); this.getData(this.paginator.pageSize, this.paginator.pageIndex * this.paginator.pageSize, this.type, this.searchQueries);
} }
public isAllSelected(): boolean { public isAllSelected(): boolean {
@ -131,7 +134,7 @@ export class UserTableComponent implements OnInit {
public changePage(event: PageEvent): void { public changePage(event: PageEvent): void {
this.selection.clear(); this.selection.clear();
this.getData(event.pageSize, event.pageIndex * event.pageSize, this.type); this.getData(event.pageSize, event.pageIndex * event.pageSize, this.type, this.searchQueries);
} }
public deactivateSelectedUsers(): void { public deactivateSelectedUsers(): void {

View File

@ -497,7 +497,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Покажи потребител {{value}}" "SHOWUSER": "Покажи потребител {{value}}"
}, },
"DOWNLOAD": "Изтегляне" "DOWNLOAD": "Изтегляне",
"APPLY": "Прилагам"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Има контрол върху цялата инстанция, включително всички организации", "IAM_OWNER": "Има контрол върху цялата инстанция, включително всички организации",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Zobrazit uživatele {{value}}" "SHOWUSER": "Zobrazit uživatele {{value}}"
}, },
"DOWNLOAD": "Stáhnout" "DOWNLOAD": "Stáhnout",
"APPLY": "Platit"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Má kontrolu nad celou instancí, včetně všech organizací", "IAM_OWNER": "Má kontrolu nad celou instancí, včetně všech organizací",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Zeige Benutzer {{value}}" "SHOWUSER": "Zeige Benutzer {{value}}"
}, },
"DOWNLOAD": "Herunterladen" "DOWNLOAD": "Herunterladen",
"APPLY": "Anwenden"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Hat die Kontrolle über die gesamte Instanz, einschließlich aller Organisationen", "IAM_OWNER": "Hat die Kontrolle über die gesamte Instanz, einschließlich aller Organisationen",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Show user {{value}}" "SHOWUSER": "Show user {{value}}"
}, },
"DOWNLOAD": "Download" "DOWNLOAD": "Download",
"APPLY": "Apply"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Has control over the whole instance, including all organizations", "IAM_OWNER": "Has control over the whole instance, including all organizations",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Mostrar usuario {{value}}" "SHOWUSER": "Mostrar usuario {{value}}"
}, },
"DOWNLOAD": "Descargar" "DOWNLOAD": "Descargar",
"APPLY": "Aplicar"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Tiene control sobre toda la instancia, incluyendo todas las organizaciones", "IAM_OWNER": "Tiene control sobre toda la instancia, incluyendo todas las organizaciones",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Afficher l'utilisateur {{value}}" "SHOWUSER": "Afficher l'utilisateur {{value}}"
}, },
"DOWNLOAD": "Télécharger" "DOWNLOAD": "Télécharger",
"APPLY": "Appliquer"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "A le contrôle de toute l'instance, y compris toutes les organisations", "IAM_OWNER": "A le contrôle de toute l'instance, y compris toutes les organisations",

View File

@ -497,7 +497,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Mostra utente {{value}}" "SHOWUSER": "Mostra utente {{value}}"
}, },
"DOWNLOAD": "Scarica" "DOWNLOAD": "Scarica",
"APPLY": "Applicare"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Ha il controllo sull'intera istanza, comprese tutte le organizzazioni", "IAM_OWNER": "Ha il controllo sull'intera istanza, comprese tutte le organizzazioni",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "ユーザー {{value}} を表示する" "SHOWUSER": "ユーザー {{value}} を表示する"
}, },
"DOWNLOAD": "ダウンロード" "DOWNLOAD": "ダウンロード",
"APPLY": "アプライ"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "すべての組織を含むインスタンス全体を管理する権限を持ちます", "IAM_OWNER": "すべての組織を含むインスタンス全体を管理する権限を持ちます",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Прикажи корисник {{value}}" "SHOWUSER": "Прикажи корисник {{value}}"
}, },
"DOWNLOAD": "Преземи" "DOWNLOAD": "Преземи",
"APPLY": "Пријавете се"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Има контрола врз целата инстанца, вклучувајќи ги сите организации", "IAM_OWNER": "Има контрола врз целата инстанца, вклучувајќи ги сите организации",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Toon gebruiker {{value}}" "SHOWUSER": "Toon gebruiker {{value}}"
}, },
"DOWNLOAD": "Download" "DOWNLOAD": "Download",
"APPLY": "Toepassen"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Heeft controle over de hele instantie, inclusief alle organisaties", "IAM_OWNER": "Heeft controle over de hele instantie, inclusief alle organisaties",

View File

@ -497,7 +497,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Pokaż użytkownika {{value}}" "SHOWUSER": "Pokaż użytkownika {{value}}"
}, },
"DOWNLOAD": "Pobierz" "DOWNLOAD": "Pobierz",
"APPLY": "Stosować"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Ma kontrolę nad całą instancją, włącznie z wszystkimi organizacjami", "IAM_OWNER": "Ma kontrolę nad całą instancją, włącznie z wszystkimi organizacjami",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Mostrar usuário {{value}}" "SHOWUSER": "Mostrar usuário {{value}}"
}, },
"DOWNLOAD": "Baixar" "DOWNLOAD": "Baixar",
"APPLY": "Aplicar"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Tem controle sobre toda a instância, incluindo todas as organizações", "IAM_OWNER": "Tem controle sobre toda a instância, incluindo todas as organizações",

View File

@ -497,7 +497,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Показать пользователя {{value}}" "SHOWUSER": "Показать пользователя {{value}}"
}, },
"DOWNLOAD": "Скачать" "DOWNLOAD": "Скачать",
"APPLY": "Применять"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Имеет контроль над всем экземпляром, включая все организации", "IAM_OWNER": "Имеет контроль над всем экземпляром, включая все организации",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Visa användare {{value}}" "SHOWUSER": "Visa användare {{value}}"
}, },
"DOWNLOAD": "Ladda ner" "DOWNLOAD": "Ladda ner",
"APPLY": "Tillämpa"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "Har kontroll över hela instansen, inklusive alla organisationer", "IAM_OWNER": "Har kontroll över hela instansen, inklusive alla organisationer",

View File

@ -498,7 +498,8 @@
"TABLE": { "TABLE": {
"SHOWUSER": "Show user {{value}}" "SHOWUSER": "Show user {{value}}"
}, },
"DOWNLOAD": "下载" "DOWNLOAD": "下载",
"APPLY": "申请"
}, },
"MEMBERROLES": { "MEMBERROLES": {
"IAM_OWNER": "控制整个实例,包括所有组织", "IAM_OWNER": "控制整个实例,包括所有组织",

View File

@ -3,11 +3,13 @@ package ldap
import ( import (
"context" "context"
"crypto/tls" "crypto/tls"
"encoding/base64"
"errors" "errors"
"net" "net"
"net/url" "net/url"
"strconv" "strconv"
"time" "time"
"unicode/utf8"
"github.com/go-ldap/ldap/v3" "github.com/go-ldap/ldap/v3"
"github.com/zitadel/logging" "github.com/zitadel/logging"
@ -262,12 +264,12 @@ func mapLDAPEntryToUser(
} }
return NewUser( return NewUser(
user.GetAttributeValue(idAttribute), getAttributeValue(user, idAttribute),
user.GetAttributeValue(firstNameAttribute), getAttributeValue(user, firstNameAttribute),
user.GetAttributeValue(lastNameAttribute), getAttributeValue(user, lastNameAttribute),
user.GetAttributeValue(displayNameAttribute), getAttributeValue(user, displayNameAttribute),
user.GetAttributeValue(nickNameAttribute), getAttributeValue(user, nickNameAttribute),
user.GetAttributeValue(preferredUsernameAttribute), getAttributeValue(user, preferredUsernameAttribute),
domain.EmailAddress(user.GetAttributeValue(emailAttribute)), domain.EmailAddress(user.GetAttributeValue(emailAttribute)),
emailVerified, emailVerified,
domain.PhoneNumber(user.GetAttributeValue(phoneAttribute)), domain.PhoneNumber(user.GetAttributeValue(phoneAttribute)),
@ -277,3 +279,15 @@ func mapLDAPEntryToUser(
user.GetAttributeValue(profileAttribute), user.GetAttributeValue(profileAttribute),
), nil ), nil
} }
func getAttributeValue(user *ldap.Entry, attribute string) string {
// return an empty string if no attribute is needed
if attribute == "" {
return ""
}
value := user.GetAttributeValue(attribute)
if utf8.ValidString(value) {
return value
}
return base64.StdEncoding.EncodeToString(user.GetRawAttributeValue(attribute))
}

View File

@ -34,7 +34,7 @@ func (msg *Email) GetContent() (string, error) {
headers := make(map[string]string) headers := make(map[string]string)
from := msg.SenderEmail from := msg.SenderEmail
if msg.SenderName != "" { if msg.SenderName != "" {
from = fmt.Sprintf("%s <%s>", msg.SenderName, msg.SenderEmail) from = fmt.Sprintf("%s <%s>", bEncodeWord(msg.SenderName), msg.SenderEmail)
} }
headers["From"] = from headers["From"] = from
if msg.ReplyToAddress != "" { if msg.ReplyToAddress != "" {
@ -55,7 +55,7 @@ func (msg *Email) GetContent() (string, error) {
if !isHTML(msg.Content) { if !isHTML(msg.Content) {
mime = "MIME-Version: 1.0" + lineBreak + "Content-Type: text/plain; charset=\"UTF-8\"" + lineBreak + lineBreak mime = "MIME-Version: 1.0" + lineBreak + "Content-Type: text/plain; charset=\"UTF-8\"" + lineBreak + lineBreak
} }
subject := "Subject: " + bEncodeSubject(msg.Subject) + lineBreak subject := "Subject: " + bEncodeWord(msg.Subject) + lineBreak
message += subject + mime + lineBreak + msg.Content message += subject + mime + lineBreak + msg.Content
return message, nil return message, nil
@ -70,6 +70,6 @@ func isHTML(input string) bool {
} }
// returns a RFC1342 "B" encoded string to allow non-ascii characters // returns a RFC1342 "B" encoded string to allow non-ascii characters
func bEncodeSubject(subject string) string { func bEncodeWord(word string) string {
return mime.BEncoding.Encode("UTF-8", subject) return mime.BEncoding.Encode("UTF-8", word)
} }