Skip to content

Commit

Permalink
Merge branch 'master' into fix/select-groups-display
Browse files Browse the repository at this point in the history
  • Loading branch information
yannicklescure authored Oct 3, 2024
2 parents 1abd28d + 8638a89 commit b1e95e5
Show file tree
Hide file tree
Showing 240 changed files with 433 additions and 376 deletions.
48 changes: 5 additions & 43 deletions apps/admin_audit/lib/Actions/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
namespace OCA\AdminAudit\Actions;

use OC\Files\Node\NonExistingFile;
use OCP\Files\Events\Node\BeforeNodeDeletedEvent;
use OCP\Files\Events\Node\BeforeNodeReadEvent;
use OCP\Files\Events\Node\BeforeNodeRenamedEvent;
use OCP\Files\Events\Node\BeforeNodeWrittenEvent;
use OCP\Files\Events\Node\NodeCopiedEvent;
use OCP\Files\Events\Node\NodeCreatedEvent;
use OCP\Files\Events\Node\NodeDeletedEvent;
use OCP\Files\Events\Node\NodeRenamedEvent;
use OCP\Files\Events\Node\NodeWrittenEvent;
use OCP\Files\InvalidPathException;
Expand All @@ -28,10 +27,9 @@
class Files extends Action {

private array $renamedNodes = [];

/**
* Logs file read actions
*
* @param BeforeNodeReadEvent $event
*/
public function read(BeforeNodeReadEvent $event): void {
try {
Expand All @@ -55,8 +53,6 @@ public function read(BeforeNodeReadEvent $event): void {

/**
* Logs rename actions of files
*
* @param BeforeNodeRenamedEvent $event
*/
public function beforeRename(BeforeNodeRenamedEvent $event): void {
try {
Expand All @@ -72,8 +68,6 @@ public function beforeRename(BeforeNodeRenamedEvent $event): void {

/**
* Logs rename actions of files
*
* @param NodeRenamedEvent $event
*/
public function afterRename(NodeRenamedEvent $event): void {
try {
Expand Down Expand Up @@ -101,8 +95,6 @@ public function afterRename(NodeRenamedEvent $event): void {

/**
* Logs creation of files
*
* @param NodeCreatedEvent $event
*/
public function create(NodeCreatedEvent $event): void {
try {
Expand All @@ -128,8 +120,6 @@ public function create(NodeCreatedEvent $event): void {

/**
* Logs copying of files
*
* @param NodeCopiedEvent $event
*/
public function copy(NodeCopiedEvent $event): void {
try {
Expand All @@ -154,14 +144,12 @@ public function copy(NodeCopiedEvent $event): void {

/**
* Logs writing of files
*
* @param BeforeNodeWrittenEvent $event
*/
public function write(BeforeNodeWrittenEvent $event): void {
public function write(NodeWrittenEvent $event): void {
$node = $event->getNode();
try {
$params = [
'id' => $node instanceof NonExistingFile ? null : $node->getId(),
'id' => $node->getId(),
'path' => mb_substr($node->getInternalPath(), 5),
];
} catch (InvalidPathException|NotFoundException $e) {
Expand All @@ -181,36 +169,10 @@ public function write(BeforeNodeWrittenEvent $event): void {
);
}

/**
* Logs update of files
*
* @param NodeWrittenEvent $event
*/
public function update(NodeWrittenEvent $event): void {
try {
$params = [
'id' => $event->getNode()->getId(),
'path' => mb_substr($event->getNode()->getInternalPath(), 5),
];
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
'Exception thrown in file update: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
$this->log(
'File with id "%s" updated: "%s"',
$params,
array_keys($params)
);
}

/**
* Logs deletions of files
*
* @param NodeDeletedEvent $event
*/
public function delete(NodeDeletedEvent $event): void {
public function delete(BeforeNodeDeletedEvent $event): void {
try {
$params = [
'id' => $event->getNode()->getId(),
Expand Down
16 changes: 4 additions & 12 deletions apps/admin_audit/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
use OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengePassed;
use OCP\Console\ConsoleEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Events\Node\BeforeNodeDeletedEvent;
use OCP\Files\Events\Node\BeforeNodeReadEvent;
use OCP\Files\Events\Node\BeforeNodeRenamedEvent;
use OCP\Files\Events\Node\BeforeNodeWrittenEvent;
use OCP\Files\Events\Node\NodeCopiedEvent;
use OCP\Files\Events\Node\NodeCreatedEvent;
use OCP\Files\Events\Node\NodeDeletedEvent;
use OCP\Files\Events\Node\NodeRenamedEvent;
use OCP\Files\Events\Node\NodeWrittenEvent;
use OCP\Group\Events\GroupCreatedEvent;
Expand Down Expand Up @@ -194,17 +193,10 @@ function (NodeCopiedEvent $event) use ($fileActions): void {
}
);

$eventDispatcher->addListener(
BeforeNodeWrittenEvent::class,
function (BeforeNodeWrittenEvent $event) use ($fileActions): void {
$fileActions->write($event);
}
);

$eventDispatcher->addListener(
NodeWrittenEvent::class,
function (NodeWrittenEvent $event) use ($fileActions): void {
$fileActions->update($event);
$fileActions->write($event);
}
);

Expand All @@ -216,8 +208,8 @@ function (BeforeNodeReadEvent $event) use ($fileActions): void {
);

$eventDispatcher->addListener(
NodeDeletedEvent::class,
function (NodeDeletedEvent $event) use ($fileActions): void {
BeforeNodeDeletedEvent::class,
function (BeforeNodeDeletedEvent $event) use ($fileActions): void {
$fileActions->delete($event);
}
);
Expand Down
2 changes: 1 addition & 1 deletion apps/files/l10n/ar.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ OC.L10N.register(
"Ownership transfer request sent" : "طلب نقل الملكية أرسل بنجاح",
"Cannot transfer ownership of a file or folder you do not own" : "لايمكنك نقل ملكية ملف أو مجلد لا تملكه",
"Select file or folder to link to" : "اختر ملف أو مجلد للربط معه",
"Choose file" : "إختَر ملفاً",
"Choose {file}" : "إختَر {file}",
"New" : "جديد",
"Loading current folder" : "تحميل المجلد الحالي",
Expand Down Expand Up @@ -385,6 +384,7 @@ OC.L10N.register(
"Name cannot be empty" : "لا يمكن أن يكون الاسم فارغاً",
"Another entry with the same name already exists" : "إدخال آخر بنفس الاسم موجود بالفعل",
"Storage informations" : "معلومات التخزين",
"Choose file" : "إختَر ملفاً",
"Open the files app settings" : "إفتح إعدادات تطبيق الملفات",
"You might not have have permissions to view it, ask the sender to share it" : "يمكن ألاّ تكون لديك صلاحية لعرضه، أطلب من المُرسل إن يشاركه معك",
"Destination is not a folder" : "المَقصَد ليس مُجلّداً",
Expand Down
2 changes: 1 addition & 1 deletion apps/files/l10n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
"Ownership transfer request sent" : "طلب نقل الملكية أرسل بنجاح",
"Cannot transfer ownership of a file or folder you do not own" : "لايمكنك نقل ملكية ملف أو مجلد لا تملكه",
"Select file or folder to link to" : "اختر ملف أو مجلد للربط معه",
"Choose file" : "إختَر ملفاً",
"Choose {file}" : "إختَر {file}",
"New" : "جديد",
"Loading current folder" : "تحميل المجلد الحالي",
Expand Down Expand Up @@ -383,6 +382,7 @@
"Name cannot be empty" : "لا يمكن أن يكون الاسم فارغاً",
"Another entry with the same name already exists" : "إدخال آخر بنفس الاسم موجود بالفعل",
"Storage informations" : "معلومات التخزين",
"Choose file" : "إختَر ملفاً",
"Open the files app settings" : "إفتح إعدادات تطبيق الملفات",
"You might not have have permissions to view it, ask the sender to share it" : "يمكن ألاّ تكون لديك صلاحية لعرضه، أطلب من المُرسل إن يشاركه معك",
"Destination is not a folder" : "المَقصَد ليس مُجلّداً",
Expand Down
2 changes: 1 addition & 1 deletion apps/files/l10n/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ OC.L10N.register(
"Ownership transfer request sent" : "Unvióse la solicitú de tresferencia de la propiedá",
"Cannot transfer ownership of a file or folder you do not own" : "Nun se pue tresferir la propiedá d'un ficheru o una carpeta que nun te pertenez",
"Select file or folder to link to" : "Seleicionar un ficheru o una carpeta a la qu'enllaciar",
"Choose file" : "Escoyer un ficheru",
"Choose {file}" : "Escoyer «{file}»",
"New" : "Nuevu",
"Loading current folder" : "Cargando la carpeta actual",
Expand Down Expand Up @@ -336,6 +335,7 @@ OC.L10N.register(
"Name cannot be empty" : "El nome nun pue tar baleru",
"Another entry with the same name already exists" : "Yá esiste otra entrada col mesmu nome",
"Storage informations" : "Información del almacenamientu",
"Choose file" : "Escoyer un ficheru",
"Open the files app settings" : "Abrir la configuración de Ficheros",
"You might not have have permissions to view it, ask the sender to share it" : "Quiciabes nun tengas permisu pa ver l'elementu, pidi al remitente que lu comparta",
"Destination is not a folder" : "El destín nun ye una carpeta",
Expand Down
2 changes: 1 addition & 1 deletion apps/files/l10n/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
"Ownership transfer request sent" : "Unvióse la solicitú de tresferencia de la propiedá",
"Cannot transfer ownership of a file or folder you do not own" : "Nun se pue tresferir la propiedá d'un ficheru o una carpeta que nun te pertenez",
"Select file or folder to link to" : "Seleicionar un ficheru o una carpeta a la qu'enllaciar",
"Choose file" : "Escoyer un ficheru",
"Choose {file}" : "Escoyer «{file}»",
"New" : "Nuevu",
"Loading current folder" : "Cargando la carpeta actual",
Expand Down Expand Up @@ -334,6 +333,7 @@
"Name cannot be empty" : "El nome nun pue tar baleru",
"Another entry with the same name already exists" : "Yá esiste otra entrada col mesmu nome",
"Storage informations" : "Información del almacenamientu",
"Choose file" : "Escoyer un ficheru",
"Open the files app settings" : "Abrir la configuración de Ficheros",
"You might not have have permissions to view it, ask the sender to share it" : "Quiciabes nun tengas permisu pa ver l'elementu, pidi al remitente que lu comparta",
"Destination is not a folder" : "El destín nun ye una carpeta",
Expand Down
2 changes: 1 addition & 1 deletion apps/files/l10n/ca.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ OC.L10N.register(
"Ownership transfer request sent" : "S'ha enviat la sol·licitud de transferència de propietat",
"Cannot transfer ownership of a file or folder you do not own" : "No es pot transferir la propietat d'un fitxer o carpeta que no és vostre",
"Select file or folder to link to" : "Seleccioneu el fitxer o la carpeta que voleu enllaçar",
"Choose file" : "Tria el fitxer",
"Choose {file}" : "Tria {file}",
"New" : "Crea",
"Loading current folder" : "S'està carregant la carpeta actual",
Expand Down Expand Up @@ -381,6 +380,7 @@ OC.L10N.register(
"Name cannot be empty" : "El nom no pot estar buit",
"Another entry with the same name already exists" : "Ja existeix una altra entrada amb aquest nom",
"Storage informations" : "Informació d'emmagatzematge",
"Choose file" : "Tria el fitxer",
"Open the files app settings" : "Obre els paràmetres de l'aplicació Fitxers",
"You might not have have permissions to view it, ask the sender to share it" : "És possible que no tingueu permisos per a visualitzar-lo; demaneu al remitent que el comparteixi",
"Destination is not a folder" : "La destinació no és una carpeta",
Expand Down
2 changes: 1 addition & 1 deletion apps/files/l10n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@
"Ownership transfer request sent" : "S'ha enviat la sol·licitud de transferència de propietat",
"Cannot transfer ownership of a file or folder you do not own" : "No es pot transferir la propietat d'un fitxer o carpeta que no és vostre",
"Select file or folder to link to" : "Seleccioneu el fitxer o la carpeta que voleu enllaçar",
"Choose file" : "Tria el fitxer",
"Choose {file}" : "Tria {file}",
"New" : "Crea",
"Loading current folder" : "S'està carregant la carpeta actual",
Expand Down Expand Up @@ -379,6 +378,7 @@
"Name cannot be empty" : "El nom no pot estar buit",
"Another entry with the same name already exists" : "Ja existeix una altra entrada amb aquest nom",
"Storage informations" : "Informació d'emmagatzematge",
"Choose file" : "Tria el fitxer",
"Open the files app settings" : "Obre els paràmetres de l'aplicació Fitxers",
"You might not have have permissions to view it, ask the sender to share it" : "És possible que no tingueu permisos per a visualitzar-lo; demaneu al remitent que el comparteixi",
"Destination is not a folder" : "La destinació no és una carpeta",
Expand Down
6 changes: 5 additions & 1 deletion apps/files/l10n/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ OC.L10N.register(
"Ownership transfer request sent" : "Žádost o převedení vlastnictví zaslána",
"Cannot transfer ownership of a file or folder you do not own" : "Není možné převést vlastnictví souboru či složky, kterých nejste vlastníky",
"Select file or folder to link to" : "Vyberte soubor nebo složku na kterou odkazovat",
"Choose file" : "Vyberte soubor",
"Choose {file}" : "Zvolit {file}",
"New" : "Nové",
"Loading current folder" : "Načítá se stávající složka",
Expand Down Expand Up @@ -272,6 +271,7 @@ OC.L10N.register(
"\"{segment}\" is a reserved name and not allowed for filenames." : "„{segment}“ je vyhrazeným názvem a není povoleno k použití pro názvy souborů.",
"\"{extension}\" is not an allowed filetype." : "„{extension}“ není povoleným typem souboru.",
"Filenames must not end with \"{extension}\"." : "Je třeba, aby názvy souborů nekončily na „{extension}“.",
"List of favorite files and folders." : "Seznam oblíbených souborů a složek.",
"No favorites yet" : "Zatím nic oblíbeného",
"Files and folders you mark as favorite will show up here" : "Zde budou zobrazeny soubory a složky, které označíte jako oblíbené",
"All files" : "Všechny soubory",
Expand Down Expand Up @@ -374,10 +374,14 @@ OC.L10N.register(
"An error occurred while trying to update the tags" : "Při pokusu o úpravu štítků došlo k chybě",
"\"remote user\"" : "„federovaný uživatel“",
"{newName} already exists." : "{newName} už existuje.",
"\"{segment}\" is not allowed inside a filename." : "„{segment}“ není v názvu souboru možné použít.",
"\"{segment}\" is a forbidden file or folder name." : "„{segment}“ je zakázané jméno souboru nebo složky.",
"\"{segment}\" is not an allowed filetype." : "„{segment}“ není povoleným typem souboru.",
"Filenames must not end with \"{segment}\"." : "Jména souborů nesmí končit na \"{segment}\".",
"Name cannot be empty" : "Je třeba zadat název",
"Another entry with the same name already exists" : "Už existuje jiná položka se stejným názevm",
"Storage informations" : "Informace o úložišti",
"Choose file" : "Vyberte soubor",
"Open the files app settings" : "Otevřít nastavení aplikace soubory",
"You might not have have permissions to view it, ask the sender to share it" : "Může být, že nemáte oprávnění pro jeho zobrazení – požádejte odesilatele aby vám ho nasdílel",
"Destination is not a folder" : "Cíl není složka",
Expand Down
6 changes: 5 additions & 1 deletion apps/files/l10n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
"Ownership transfer request sent" : "Žádost o převedení vlastnictví zaslána",
"Cannot transfer ownership of a file or folder you do not own" : "Není možné převést vlastnictví souboru či složky, kterých nejste vlastníky",
"Select file or folder to link to" : "Vyberte soubor nebo složku na kterou odkazovat",
"Choose file" : "Vyberte soubor",
"Choose {file}" : "Zvolit {file}",
"New" : "Nové",
"Loading current folder" : "Načítá se stávající složka",
Expand Down Expand Up @@ -270,6 +269,7 @@
"\"{segment}\" is a reserved name and not allowed for filenames." : "„{segment}“ je vyhrazeným názvem a není povoleno k použití pro názvy souborů.",
"\"{extension}\" is not an allowed filetype." : "„{extension}“ není povoleným typem souboru.",
"Filenames must not end with \"{extension}\"." : "Je třeba, aby názvy souborů nekončily na „{extension}“.",
"List of favorite files and folders." : "Seznam oblíbených souborů a složek.",
"No favorites yet" : "Zatím nic oblíbeného",
"Files and folders you mark as favorite will show up here" : "Zde budou zobrazeny soubory a složky, které označíte jako oblíbené",
"All files" : "Všechny soubory",
Expand Down Expand Up @@ -372,10 +372,14 @@
"An error occurred while trying to update the tags" : "Při pokusu o úpravu štítků došlo k chybě",
"\"remote user\"" : "„federovaný uživatel“",
"{newName} already exists." : "{newName} už existuje.",
"\"{segment}\" is not allowed inside a filename." : "„{segment}“ není v názvu souboru možné použít.",
"\"{segment}\" is a forbidden file or folder name." : "„{segment}“ je zakázané jméno souboru nebo složky.",
"\"{segment}\" is not an allowed filetype." : "„{segment}“ není povoleným typem souboru.",
"Filenames must not end with \"{segment}\"." : "Jména souborů nesmí končit na \"{segment}\".",
"Name cannot be empty" : "Je třeba zadat název",
"Another entry with the same name already exists" : "Už existuje jiná položka se stejným názevm",
"Storage informations" : "Informace o úložišti",
"Choose file" : "Vyberte soubor",
"Open the files app settings" : "Otevřít nastavení aplikace soubory",
"You might not have have permissions to view it, ask the sender to share it" : "Může být, že nemáte oprávnění pro jeho zobrazení – požádejte odesilatele aby vám ho nasdílel",
"Destination is not a folder" : "Cíl není složka",
Expand Down
2 changes: 1 addition & 1 deletion apps/files/l10n/da.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ OC.L10N.register(
"Ownership transfer request sent" : "Anmodning om ejerskabsoverdragelse sendt",
"Cannot transfer ownership of a file or folder you do not own" : "Kan ikke overføre ejerskab af en fil eller mappe, du ikke ejer",
"Select file or folder to link to" : "Vælg fil eller mappe at linke til",
"Choose file" : "Vælg fil",
"Choose {file}" : "Vælg {file}",
"New" : "Ny",
"Loading current folder" : "Indlæser aktuelle mappe",
Expand Down Expand Up @@ -373,6 +372,7 @@ OC.L10N.register(
"Name cannot be empty" : "Navn må ikke være tomt",
"Another entry with the same name already exists" : "Dette navn er allerede i brug",
"Storage informations" : "Lagerinformationer",
"Choose file" : "Vælg fil",
"Open the files app settings" : "Åbn fil-app indstillinger",
"You might not have have permissions to view it, ask the sender to share it" : "Du har muligvis ikke tilladelser til at se.... Bed afsenderen om at dele...",
"Destination is not a folder" : "Destinationen er ikke en mappe",
Expand Down
2 changes: 1 addition & 1 deletion apps/files/l10n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
"Ownership transfer request sent" : "Anmodning om ejerskabsoverdragelse sendt",
"Cannot transfer ownership of a file or folder you do not own" : "Kan ikke overføre ejerskab af en fil eller mappe, du ikke ejer",
"Select file or folder to link to" : "Vælg fil eller mappe at linke til",
"Choose file" : "Vælg fil",
"Choose {file}" : "Vælg {file}",
"New" : "Ny",
"Loading current folder" : "Indlæser aktuelle mappe",
Expand Down Expand Up @@ -371,6 +370,7 @@
"Name cannot be empty" : "Navn må ikke være tomt",
"Another entry with the same name already exists" : "Dette navn er allerede i brug",
"Storage informations" : "Lagerinformationer",
"Choose file" : "Vælg fil",
"Open the files app settings" : "Åbn fil-app indstillinger",
"You might not have have permissions to view it, ask the sender to share it" : "Du har muligvis ikke tilladelser til at se.... Bed afsenderen om at dele...",
"Destination is not a folder" : "Destinationen er ikke en mappe",
Expand Down
2 changes: 1 addition & 1 deletion apps/files/l10n/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ OC.L10N.register(
"Ownership transfer request sent" : "Anforderung für die Übertragung des Besitzes gesendet",
"Cannot transfer ownership of a file or folder you do not own" : "Der Besitz an einer Datei oder einem Ordner, der dir nicht gehört, kann nicht übertragen werden",
"Select file or folder to link to" : "Datei oder Ordner zum Verknüpfen auswählen",
"Choose file" : "Datei auswählen",
"Choose {file}" : "{file} auswählen",
"New" : "Neu",
"Loading current folder" : "Lade aktuellen Ordner",
Expand Down Expand Up @@ -383,6 +382,7 @@ OC.L10N.register(
"Name cannot be empty" : "Der Name darf nicht leer sein",
"Another entry with the same name already exists" : "Ein anderer Eintrag mit diesem Namen existiert bereits.",
"Storage informations" : "Speicherinformationen",
"Choose file" : "Datei auswählen",
"Open the files app settings" : "Einstellungen der Dateien-App öffnen",
"You might not have have permissions to view it, ask the sender to share it" : "Möglicherweise hast du nicht die Berechtigung zur Anzeige. Bitte den Absender, die Datei freizugeben.",
"Destination is not a folder" : "Ziel ist kein Ordner",
Expand Down
Loading

0 comments on commit b1e95e5

Please sign in to comment.