Skip to content
Merged
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
9 changes: 6 additions & 3 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
matrix:
php-versions: ['8.2']
databases: ['sqlite']
server-versions: ['stable28', 'stable29', 'stable30', 'stable31', 'stable32']
server-versions: ['stable28', 'stable29', 'stable30', 'stable31', 'stable32', 'stable33']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

Expand Down Expand Up @@ -110,7 +110,10 @@ jobs:
matrix:
php-versions: ["8.1", "8.2"]
databases: ['mysql']
server-versions: ['stable28', 'stable29', 'stable30', 'stable31', 'stable32']
server-versions: ['stable28', 'stable29', 'stable30', 'stable31', 'stable32', 'stable33']
exclude:
- php-versions: "8.1"
server-versions: "stable33"

name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

Expand Down Expand Up @@ -194,7 +197,7 @@ jobs:
matrix:
php-versions: ['8.2']
databases: ['pgsql']
server-versions: ['stable28', 'stable29', 'stable30', 'stable31', 'stable32']
server-versions: ['stable28', 'stable29', 'stable30', 'stable31', 'stable32', 'stable33']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
server-versions: ['stable28', 'stable29', 'stable30', 'stable31', 'stable32']
server-versions: ['stable28', 'stable29', 'stable30', 'stable31', 'stable32', 'stable33']

name: Nextcloud ${{ matrix.server-versions }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ See [the website](https://www.certificate24.com) for further information.
<category>tools</category>

<dependencies>
<nextcloud min-version="28" max-version="32" />
<nextcloud min-version="28" max-version="33" />
</dependencies>

<types>
Expand Down
37 changes: 37 additions & 0 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1163,8 +1163,12 @@ public function search(string $search = '', string $type = ''): DataResponse {
$lookup = false; // Don't use lookup server.
[$result, $hasMoreResults] = $this->search->search($search, $shareTypes, $lookup, $limit, $offset);
if ($type === 'user') {
$user = $this->userSession->getUser();
// Filter out users not allowed to use the app.
$userCache = [];
if ($user) {
$userCache[$user->getUID()] = $user;
}
$filterFunc = function ($elem) use ($userCache) {
$userId = $elem['value']['shareWith'];
$user = $userCache[$userId] ?? null;
Expand Down Expand Up @@ -1204,6 +1208,39 @@ public function search(string $search = '', string $type = ''): DataResponse {
$result['users'] = array_merge($result['users'], $additional['users']);
$total = count($result['exact']['users'] ?? []) + count($result['users'] ?? []);
}

if ($user && $user->getUID() === $search) {
// Users may search for themselves.
$found = false;
if (isset($result['exact']['users'])) {
foreach ($result['exact']['users'] as $entry) {
if ($entry['value']['shareType'] === IShare::TYPE_USER && $entry['value']['shareWith'] === $user->getUID()) {
$found = true;
break;
}
}
}
if (!$found && isset($result['users'])) {
foreach ($result['users'] as $entry) {
if ($entry['value']['shareType'] === IShare::TYPE_USER && $entry['value']['shareWith'] === $user->getUID()) {
$found = true;
break;
}
}
}

if (!$found) {
$result['exact']['users'][] = [
'icon' => 'icon-user',
'label' => $user->getDisplayName(),
'shareWithDisplayNameUnique' => $user->getSystemEMailAddress() ?: $user->getUID(),
'value' => [
'shareType' => IShare::TYPE_USER,
'shareWith' => $user->getUID(),
],
];
}
}
}
$response = new DataResponse($result);
return $response;
Expand Down
3 changes: 1 addition & 2 deletions lib/TranslatedTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

use OC\Template\Base as TemplateBase;
use OC\Template\TemplateFileLocator;
use OC_App;
use OC_Util;
use OCP\Defaults;
use OCP\IL10N;
Expand Down Expand Up @@ -71,7 +70,7 @@ public function __construct(string $app, string $name, IL10N $l10n) {
protected function findTemplate($theme, $app, $name) {
// Check if it is a app template or not.
if ($app !== '') {
$dirs = $this->getAppTemplateDirs($theme, $app, \OC::$SERVERROOT, OC_App::getAppPath($app));
$dirs = $this->getAppTemplateDirs($theme, $app, \OC::$SERVERROOT, \OC::$server->getAppManager()->getAppPath($app));
} else {
$dirs = $this->getCoreTemplateDirs($theme, \OC::$SERVERROOT);
}
Expand Down
Loading
Loading