You've already forked pigallery2
mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-11-06 08:59:28 +02:00
Disable directory flattening if sharing is not available. fixes #601
This commit is contained in:
@@ -93,7 +93,7 @@ export class AuthenticationService {
|
||||
}
|
||||
|
||||
public canSearch(): boolean {
|
||||
return this.isAuthorized(UserRoles.Guest);
|
||||
return Config.Search.enabled && this.isAuthorized(UserRoles.Guest);
|
||||
}
|
||||
|
||||
public async logout(): Promise<void> {
|
||||
|
||||
@@ -120,8 +120,7 @@ export class GalleryComponent implements OnInit, OnDestroy {
|
||||
) {
|
||||
return this.navigation.toLogin();
|
||||
}
|
||||
this.showSearchBar =
|
||||
Config.Search.enabled && this.authService.canSearch();
|
||||
this.showSearchBar = this.authService.canSearch();
|
||||
this.showShare =
|
||||
Config.Sharing.enabled &&
|
||||
this.authService.isAuthorized(UserRoles.User);
|
||||
|
||||
@@ -51,8 +51,7 @@ export class GalleryPhotoComponent implements IRenderable, OnInit, OnDestroy {
|
||||
private thumbnailService: ThumbnailManagerService,
|
||||
private authService: AuthenticationService
|
||||
) {
|
||||
this.searchEnabled =
|
||||
Config.Search.enabled && this.authService.canSearch();
|
||||
this.searchEnabled = this.authService.canSearch();
|
||||
}
|
||||
|
||||
get ScrollListener(): boolean {
|
||||
|
||||
@@ -66,8 +66,7 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
|
||||
private authService: AuthenticationService,
|
||||
private cacheService: GalleryCacheService
|
||||
) {
|
||||
this.searchEnabled =
|
||||
Config.Search.enabled && this.authService.canSearch();
|
||||
this.searchEnabled = this.authService.canSearch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,8 +35,7 @@ export class InfoPanelLightboxComponent implements OnInit, OnChanges {
|
||||
private authService: AuthenticationService
|
||||
) {
|
||||
this.mapEnabled = Config.Map.enabled;
|
||||
this.searchEnabled =
|
||||
Config.Search.enabled && this.authService.canSearch();
|
||||
this.searchEnabled = this.authService.canSearch();
|
||||
this.baseLayer = tileLayer(mapService.MapLayer, {
|
||||
attribution: mapService.ShortAttributions,
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="divider"> </div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="config.Gallery.enableDirectoryFlattening && isDirectory">
|
||||
<ng-container *ngIf="config.Gallery.enableDirectoryFlattening && isDirectory && authService.canSearch()">
|
||||
<a
|
||||
[routerLink]="['/search', getDirectoryFlattenSearchQuery()]"
|
||||
class="btn btn-navbar">
|
||||
|
||||
@@ -39,7 +39,7 @@ export class GalleryNavigatorComponent {
|
||||
private readonly RootFolderName: string;
|
||||
|
||||
constructor(
|
||||
private authService: AuthenticationService,
|
||||
public authService: AuthenticationService,
|
||||
public queryService: QueryService,
|
||||
public galleryService: ContentService,
|
||||
public sortingService: GallerySortingService
|
||||
|
||||
Reference in New Issue
Block a user