Compare commits

...

87 Commits
1.0.8 ... 1.5.1

Author SHA1 Message Date
Chris Collins
1ece55d6a0 Merge branch 'prerel-1.5.1' into 'main'
Prerel 1.5.1

See merge request personal/wedding-share!35
2025-02-09 21:46:59 +00:00
Chris Collins
a63019fd2d Prerel 1.5.1 2025-02-09 21:46:59 +00:00
Chris
5b6987227a Bumped version number as this is a major release version 2025-02-07 16:44:47 +00:00
Chris Collins
6447e5eb79 Merge branch 'prerel-1.4.16' into 'main'
Prerel 1.4.16

See merge request personal/wedding-share!34
2025-02-07 16:35:48 +00:00
Chris Collins
5bd6de3875 Prerel 1.4.16 2025-02-07 16:35:48 +00:00
Chris Collins
a1dc295b68 Merge branch 'prerel-1.4.15' into 'main'
Prerel 1.4.15

See merge request personal/wedding-share!33
2025-02-02 12:23:46 +00:00
Chris Collins
dd390280fb Prerel 1.4.15 2025-02-02 12:23:46 +00:00
Cirx08
ce510d8d21 Added issue templates 2025-02-01 10:07:08 +00:00
Chris Collins
d1b7867b37 Merge branch 'prerel-1.4.14' into 'main'
Prerel 1.4.14

See merge request personal/wedding-share!32
2025-02-01 00:52:36 +00:00
Chris Collins
8498414fb0 Prerel 1.4.14 2025-02-01 00:52:36 +00:00
Chris Collins
e2162300f0 Merge branch 'prerel-1.4.13.2' into 'main'
Edit media-viewer.js

See merge request personal/wedding-share!31
2025-01-30 23:16:11 +00:00
Chris Collins
d4512eef97 Edit media-viewer.js 2025-01-30 23:16:11 +00:00
Chris Collins
cb71b09aad Merge branch 'prerel-1.4.13' into 'main'
Prerel 1.4.13

See merge request personal/wedding-share!30
2025-01-30 21:41:04 +00:00
Chris Collins
d982c64aa7 Prerel 1.4.13 2025-01-30 21:41:04 +00:00
Cirx08
5a541b78f1 Updated pipeline 2025-01-26 21:29:43 +00:00
Cirx08
7f8692ee29 Updated pipeline 2025-01-26 21:23:37 +00:00
Cirx08
716bb0dbce Updated pipeline 2025-01-26 20:56:02 +00:00
Chris Collins
a5414ed424 Merge branch 'prerel-1.4.12' into 'main'
Prerel 1.4.12

See merge request personal/wedding-share!29
2025-01-26 20:49:52 +00:00
Chris Collins
67e0d0c8a5 Prerel 1.4.12 2025-01-26 20:49:52 +00:00
Chris Collins
85caccc899 Merge branch 'prerel-1.4.11' into 'main'
Prerel 1.4.11

See merge request personal/wedding-share!28
2025-01-19 17:18:17 +00:00
Chris Collins
060cccdcf9 Prerel 1.4.11 2025-01-19 17:18:16 +00:00
Cirx08
abbd6ceb48 Updated pipeline trigger 2025-01-13 22:23:17 +00:00
Cirx08
f02e6b8e5a Updated pipeline 2025-01-13 22:18:44 +00:00
Chris Collins
a30f602b65 Merge branch '1.4.10' into 'main'
1.4.10

See merge request personal/wedding-share!27
2025-01-13 22:12:46 +00:00
Chris Collins
06e20737d0 1.4.10 2025-01-13 22:12:46 +00:00
Chris Collins
bd335509ff Merge branch 'prerel-1.4.9' into 'main'
Prerel 1.4.9

See merge request personal/wedding-share!26
2025-01-11 21:26:06 +00:00
Chris Collins
6ad6662e01 Prerel 1.4.9 2025-01-11 21:26:06 +00:00
Chris Collins
a632cf3a2f Merge branch 'prerel-1.4.8' into 'main'
Prerel 1.4.8

See merge request personal/wedding-share!25
2025-01-09 22:09:34 +00:00
Chris Collins
0e09b8db39 Prerel 1.4.8 2025-01-09 22:09:34 +00:00
Chris Collins
04ef6d63bb Merge branch 'prerel-1.4.7' into 'main'
Prerel 1.4.7

See merge request personal/wedding-share!24
2025-01-07 20:55:49 +00:00
Chris Collins
aa5d1af299 Prerel 1.4.7 2025-01-07 20:55:49 +00:00
Chris Collins
c4ab287ba7 Update readme.md 2025-01-07 09:41:33 +00:00
Chris Collins
5a16c6f800 Update readme.md 2025-01-07 09:36:49 +00:00
Cirx08
a3a74d23c4 Fixed bug to prevent default title leaking to the homepage 2025-01-06 20:11:16 +00:00
Chris Collins
6a05fadd45 Merge branch 'prerel-1.4.6' into 'main'
Prerel 1.4.6

See merge request personal/wedding-share!23
2025-01-06 18:59:15 +00:00
Chris Collins
e182597d8f Prerel 1.4.6 2025-01-06 18:59:15 +00:00
Chris Collins
4bc22a94eb Merge branch 'prerel-1.4.5' into 'main'
Prerel 1.4.5

See merge request personal/wedding-share!22
2024-12-28 13:15:31 +00:00
Chris Collins
a5afe90267 Prerel 1.4.5 2024-12-28 13:15:31 +00:00
Chris Collins
a3e1e62082 Merge branch 'prerel-1.4.4' into 'main'
Added gallery specific overrides

See merge request personal/wedding-share!21
2024-12-26 18:02:51 +00:00
Cirx08
b90d24e5de Added gallery specific overrides 2024-12-26 17:57:00 +00:00
Cirx08
39fe7b58a4 Updated screenshots and added dark mode screenshots to readme 2024-12-24 16:30:57 +00:00
Cirx08
217a0294ac Added support message to readme 2024-12-24 15:58:10 +00:00
Cirx08
2c21d76245 Bumped version number 2024-12-23 21:53:44 +00:00
Cirx08
83de634df1 Changed to both bulk approve and reject 2024-12-23 21:53:04 +00:00
Chris Collins
7861eeeb07 Merge branch 'prerel-1.4.2' into 'main'
Prerel 1.4.2

See merge request personal/wedding-share!20
2024-12-23 21:32:36 +00:00
Chris Collins
9f5baf2aa1 Prerel 1.4.2 2024-12-23 21:32:36 +00:00
Cirx08
8de5223dfc Moved account settings in readme 2024-12-23 12:29:04 +00:00
Chris Collins
64200cc48f Merge branch 'prerel-1.4.1' into 'main'
Prerel 1.4.1

See merge request personal/wedding-share!19
2024-12-23 12:10:47 +00:00
Chris Collins
8ff4c8360f Prerel 1.4.1 2024-12-23 12:10:47 +00:00
Chris Collins
13fe2ec7ed Merge branch 'prerel-1.4.0' into 'main'
Prerel 1.4.0

See merge request personal/wedding-share!18
2024-12-19 22:44:38 +00:00
Chris Collins
57bae97ad7 Prerel 1.4.0 2024-12-19 22:44:38 +00:00
Chris Collins
c4df0914d9 Merge branch 'prerel-1.3.1' into 'main'
Prerel 1.3.1

See merge request personal/wedding-share!16
2024-12-17 16:32:16 +00:00
Chris Collins
9dd9fe9d9c Prerel 1.3.1 2024-12-17 16:32:16 +00:00
Chris Collins
75dbef8196 Merge branch 'prerel-1.3.0' into 'main'
Prerel 1.3.0

See merge request personal/wedding-share!15
2024-12-16 21:08:01 +00:00
Chris Collins
5f53228113 Prerel 1.3.0 2024-12-16 21:08:01 +00:00
Cirx08
24114c1281 Prevent caching on gallery 2024-12-15 11:32:22 +00:00
Chris Collins
9702908b4d Merge branch 'prerel-1.2.4' into 'main'
Fixed secret key case

See merge request personal/wedding-share!14
2024-12-15 11:23:36 +00:00
Cirx08
4e96d4f48e Fixed secret key case 2024-12-15 11:22:32 +00:00
Cirx08
8f3be09c9a Updated screenshots and added missing config default 2024-12-14 18:46:26 +00:00
Chris Collins
8360f6f4f7 Merge branch 'prerel-1.2.3' into 'main'
Prerel 1.2.3

See merge request personal/wedding-share!13
2024-12-14 18:33:44 +00:00
Chris Collins
e9c7412227 Prerel 1.2.3 2024-12-14 18:33:44 +00:00
Cirx08
c105921694 Bug fix 2024-12-12 23:23:50 +00:00
Chris Collins
20f6283fe4 Merge branch 'prerel-1.2.2' into 'main'
Prerel 1.2.2

See merge request personal/wedding-share!12
2024-12-12 23:09:46 +00:00
Chris Collins
16bdafd44b Prerel 1.2.2 2024-12-12 23:09:46 +00:00
Cirx08
b10e46554f Fixed title size on mobile devices 2024-12-12 21:54:04 +00:00
Chris Collins
334ba3f178 Merge branch 'prerel-1.2.1' into 'main'
Moved admin login

See merge request personal/wedding-share!11
2024-12-12 21:30:48 +00:00
Cirx08
2fcd62df7c Moved admin login 2024-12-12 21:23:03 +00:00
Cirx08
4166d08be1 Updated screenshots 2024-12-11 21:49:57 +00:00
Chris Collins
60b70082ba Merge branch 'prerel-1.2.0' into 'main'
Prerel 1.2.0

See merge request personal/wedding-share!10
2024-12-11 21:37:24 +00:00
Chris Collins
c02eb1d02c Prerel 1.2.0 2024-12-11 21:37:24 +00:00
Cirx08
69a802af55 Removed DeviceDetector.NET 2024-12-06 17:19:21 +00:00
Chris Collins
14654b1033 Merge branch 'prerel-1.1.1' into 'main'
Fix for thumbnail orientation

See merge request personal/wedding-share!9
2024-12-05 19:34:22 +00:00
Cirx08
1265b35d8f Fix for thumbnail orientation 2024-12-05 19:29:27 +00:00
Chris Collins
f5e2ab423d Update readme.md 2024-12-05 00:05:59 +00:00
Chris Collins
05c6407298 Merge branch 'rel-banner-test' into 'main'
Added banner to readme

See merge request personal/wedding-share!8
2024-12-04 23:29:58 +00:00
Chris Collins
0d2ac63c61 Added banner to readme 2024-12-04 23:29:58 +00:00
Chris Collins
1bd6f39650 Delete banner_image_2.png 2024-12-04 23:23:12 +00:00
Chris Collins
5478728253 Upload New File 2024-12-04 23:22:10 +00:00
Cirx08
4ed8b57674 Updated docker compose scripts 2024-12-04 21:58:55 +00:00
Cirx08
a2500d45d7 Updated screenshots 2024-12-04 21:51:11 +00:00
Chris Collins
d7306d3fe9 Merge branch 'prerel-1.1.0' into 'main'
Prerel 1.1.0

See merge request personal/wedding-share!7
2024-12-04 21:24:27 +00:00
Chris Collins
20dc64834a Prerel 1.1.0 2024-12-04 21:24:27 +00:00
Chris Collins
16faf90989 Merge branch 'prerel-1.0.10' into 'main'
Prerel 1.0.10

See merge request personal/wedding-share!6
2024-12-01 18:04:10 +00:00
Chris Collins
f320d28f37 Prerel 1.0.10 2024-12-01 18:04:10 +00:00
Chris Collins
1a1bff7287 Merge branch 'prerel-1.0.9' into 'main'
Prerel 1.0.9

See merge request personal/wedding-share!5
2024-11-29 23:34:40 +00:00
Chris Collins
9aedb0280b Prerel 1.0.9 2024-11-29 23:34:39 +00:00
Chris Collins
75e0d16ac5 Add gpl-3.0 license file 2024-11-28 15:53:05 +00:00
207 changed files with 16678 additions and 3621 deletions

39
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

@@ -0,0 +1,39 @@
---
name: Bug Report
about: Create a report to help us improve
title: "[Bug] - "
labels: bug
assignees: ''
---
**Description:**
A clear and concise description of what the bug is.
**Expected Behaviour:**
A clear and concise description of what you expected to happen.
**Reproduction Steps:**
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Cache Cleared:**
If the issue is a front end issue please confirm you have first attempted to clear the cache and the issue still persists.
**Docker Compose:**
If possible please provide your compose setup or a list of environment variables to help debug the issue.
**Device:**
Pleases tell me some more details about the device you are having the issue on. Is the issue isolated to the device or can you reproduce on multiple devices?
- Desktop: [e.g. 1080p Chrome, 2K Safari, 4K Brave]
- Mobile [e.g. iPhone 16, Samsung S24 Ultra]
**Screenshots:**
If applicable, add screenshots to help explain your problem.
**Additional Details:**
Add any other context about the problem here.

View File

@@ -0,0 +1,17 @@
---
name: Feature Request
about: Suggest an idea or enhancement for this project
title: "[Feature] "
labels: enhancement, feature
assignees: ''
---
**Description:**
A clear and concise description of what you want to happen.
**Examples:**
A clear and concise description of any alternative solutions you've used that have similar functionality.
**Additional Details:**
Add any other context or screenshots about the feature request here.

6
.gitignore vendored
View File

@@ -15,3 +15,9 @@
!/WeddingShare/wwwroot/uploads/default
/WeddingShare/wwwroot/uploads/default/*
/release notes
/WeddingShare/weddingshare.db
/WeddingShare/wedding-share.db
/WeddingShare/config/wedding-share.db
/WeddingShare/wwwroot/thumbnails
/WeddingShare/wwwroot/temp
/WeddingShare/ffmpeg

View File

@@ -1,12 +1,15 @@
image: mcr.microsoft.com/dotnet/sdk:latest
stages:
- build
- test
- push
- release
variables:
BUILD_DOCKERFILE: 'WeddingShare/Dockerfile'
BUILD_CONFIGURATION: 'Release'
BUILD_PLATFORMS: 'linux/arm/v7,linux/arm64/v8,linux/amd64'
BUILD_BUILDER_NAME: 'wedding-share-builder'
OBJECTS_DIRECTORY: 'obj'
NUGET_PACKAGES_DIRECTORY: '.nuget'
SOURCE_CODE_PATH: '*/*/'
@@ -21,26 +24,25 @@ cache:
before_script:
- 'docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY'
# - 'docker buildx rm --all-inactive --force'
# - 'docker buildx create --name $BUILD_BUILDER_NAME --driver=docker-container'
build:
stage: build
test:
stage: test
script:
- 'docker build -t $CI_REGISTRY_IMAGE:dev -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA -f WeddingShare/Dockerfile .'
- 'docker push $CI_REGISTRY_IMAGE:dev'
- 'docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA'
- 'dotnet restore'
- 'dotnet test'
push_pre_release:
variables:
GIT_STRATEGY: none
stage: push
only:
- /^(prerel|rc|release)-[0-9]+\.[0-9]+\.[0-9]+$/
- /^(prerel|rc|release)-[0-9]+\.[0-9]+\.[0-9]+/
script:
- 'docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA'
- 'docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH'
- 'docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH'
- 'docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE:pre_release'
- 'docker push $CI_REGISTRY_IMAGE:pre_release'
- 'docker buildx build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH --tag $CI_REGISTRY_IMAGE:pre_release --platform $BUILD_PLATFORMS --builder $BUILD_BUILDER_NAME --push -f $BUILD_DOCKERFILE .'
needs:
- test
push_latest:
variables:
@@ -50,9 +52,9 @@ push_latest:
- main
- master
script:
- 'docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA'
- 'docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE:latest'
- 'docker push $CI_REGISTRY_IMAGE:latest'
- 'docker buildx build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH --tag $CI_REGISTRY_IMAGE:latest --platform $BUILD_PLATFORMS --builder $BUILD_BUILDER_NAME --push -f $BUILD_DOCKERFILE .'
needs:
- test
push_tag:
variables:
@@ -61,20 +63,18 @@ push_tag:
only:
- tags
script:
- 'docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA'
- 'docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME'
- 'docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME'
- 'docker buildx build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME --platform $BUILD_PLATFORMS --builder $BUILD_BUILDER_NAME --push -f $BUILD_DOCKERFILE .'
needs:
- test
push_docker_hub:
variables:
GIT_STRATEGY: none
stage: push
stage: release
only:
- tags
script:
- 'docker pull $CI_REGISTRY_IMAGE:latest'
- 'docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_TOKEN'
- 'docker tag $CI_REGISTRY_IMAGE:latest $DOCKERHUB_USERNAME/wedding_share:latest'
- 'docker push $DOCKERHUB_USERNAME/wedding_share:latest'
- 'docker tag $CI_REGISTRY_IMAGE:latest $DOCKERHUB_USERNAME/wedding_share:$CI_COMMIT_REF_NAME'
- 'docker push $DOCKERHUB_USERNAME/wedding_share:$CI_COMMIT_REF_NAME'
- 'docker buildx build --tag $DOCKERHUB_USERNAME/wedding_share:$CI_COMMIT_REF_NAME --tag $DOCKERHUB_USERNAME/wedding_share:latest --platform $BUILD_PLATFORMS --builder $BUILD_BUILDER_NAME --push -f $BUILD_DOCKERFILE .'
needs:
- push_tag

674
LICENSE Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -0,0 +1,2 @@
global using NUnit.Framework;
global using NSubstitute;

View File

@@ -0,0 +1,14 @@
using Microsoft.Extensions.Configuration;
namespace WeddingShare.UnitTests.Helpers
{
internal class ConfigurationHelper
{
public static IConfiguration MockConfiguration(IDictionary<string, string?> settings)
{
return new ConfigurationBuilder()
.AddInMemoryCollection(settings ?? new Dictionary<string, string?>())
.Build();
}
}
}

View File

@@ -0,0 +1,23 @@
namespace WeddingShare.UnitTests.Helpers
{
internal class JsonResponseHelper
{
public static T GetPropertyValue<T>(object? obj, string propertyName, T defaultValue)
{
if (obj != null)
{
try
{
var val = obj?.GetType()?.GetProperty(propertyName)?.GetValue(obj, null);
if (val != null)
{
return (T)val;
}
}
catch { }
}
return defaultValue;
}
}
}

View File

@@ -0,0 +1,73 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives;
using WeddingShare.Enums;
using WeddingShare.Models.Database;
namespace WeddingShare.UnitTests.Helpers
{
internal class MockData
{
public static DefaultHttpContext MockHttpContext(Dictionary<string, StringValues>? form = null, IFormFileCollection? files = null, MockSession session = null)
{
var ctx = new DefaultHttpContext()
{
Session = session ?? new MockSession()
};
ctx.Request.Form = new FormCollection(form, files);
return ctx;
}
public static List<GalleryItemModel> MockGalleryItems(int count = 10, int? galleryId = null, GalleryItemState state = GalleryItemState.All)
{
var result = new List<GalleryItemModel>();
for (var i = 0; i < count; i++)
{
result.Add(MockGalleryItem(galleryId, state));
}
return result;
}
public static GalleryItemModel MockGalleryItem(int? galleryId = null, GalleryItemState state = GalleryItemState.All)
{
var rand = new Random();
return new GalleryItemModel()
{
Id = rand.Next(),
GalleryId = galleryId != null ? (int)galleryId : rand.Next(),
Title = $"{Guid.NewGuid()}.{MockFileExtension()}",
UploadedBy = rand.Next(2) % 2 == 0 ? Guid.NewGuid().ToString() : null,
MediaType = (MediaType)rand.Next(3),
State = state == GalleryItemState.All ? (GalleryItemState)rand.Next(2) : state
};
}
public static string MockFileExtension()
{
var rand = new Random();
string extension;
switch (rand.Next(4))
{
case 0:
extension = "jpg";
break;
case 1:
extension = "jpeg";
break;
case 2:
extension = "png";
break;
default:
extension = "ffff";
break;
}
return rand.Next(2) % 2 == 0 ? extension.ToUpper() : extension.ToLower();
}
}
}

View File

@@ -0,0 +1,26 @@
using System.Net;
using System.Net.Http.Json;
namespace WeddingShare.UnitTests.Helpers
{
public class MockHttpMessageHandler : HttpMessageHandler
{
private readonly HttpStatusCode _statusCode;
private readonly object? _responseContent;
public MockHttpMessageHandler(HttpStatusCode statusCode, object? responseContent = null)
{
_statusCode = statusCode;
_responseContent = responseContent;
}
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
return await Task.FromResult(new HttpResponseMessage
{
StatusCode = _statusCode,
Content = JsonContent.Create(_responseContent)
});
}
}
}

View File

@@ -0,0 +1,65 @@
using System.Diagnostics.CodeAnalysis;
using System.Text;
using Microsoft.AspNetCore.Http;
namespace WeddingShare.UnitTests.Helpers
{
internal class MockSession : ISession
{
private IDictionary<string, string> Values = new Dictionary<string, string>();
public bool IsAvailable => throw new NotImplementedException();
public string Id => throw new NotImplementedException();
public IEnumerable<string> Keys => throw new NotImplementedException();
public void Clear()
{
this.Values.Clear();
}
public Task CommitAsync(CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}
public Task LoadAsync(CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}
public void Remove(string key)
{
this.Values.Remove(key);
}
public void Set(string key, string value)
{
this.Set(key, Encoding.UTF8.GetBytes(value));
}
public void Set(string key, byte[] value)
{
if (this.Values.ContainsKey(key))
{
this.Values.Remove(key);
}
this.Values.Add(key, Encoding.UTF8.GetString(value));
}
public bool TryGetValue(string key, [NotNullWhen(true)] out byte[]? value)
{
if (this.Values.ContainsKey(key))
{
value = Encoding.UTF8.GetBytes(this.Values[key]);
return true;
}
value = null;
return false;
}
}
}

View File

@@ -0,0 +1,370 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;
using NSubstitute;
using NSubstitute.ReturnsExtensions;
using System.Net;
using System.Text.Json;
using WeddingShare.Controllers;
using WeddingShare.Enums;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Database;
using WeddingShare.Helpers.Notifications;
using WeddingShare.Models;
using WeddingShare.Models.Database;
using WeddingShare.UnitTests.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class GalleryControllerTests
{
private readonly IWebHostEnvironment _env = Substitute.For<IWebHostEnvironment>();
private readonly IConfigHelper _config = Substitute.For<IConfigHelper>();
private readonly IGalleryHelper _gallery = Substitute.For<IGalleryHelper>();
private readonly IDatabaseHelper _database = Substitute.For<IDatabaseHelper>();
private readonly IFileHelper _file = Substitute.For<IFileHelper>();
private readonly IDeviceDetector _deviceDetector = Substitute.For<IDeviceDetector>();
private readonly IImageHelper _image = Substitute.For<IImageHelper>();
private readonly INotificationHelper _notification = Substitute.For<INotificationHelper>();
private readonly IEncryptionHelper _encryption = Substitute.For<IEncryptionHelper>();
private readonly WeddingShare.Helpers.IUrlHelper _url = Substitute.For<WeddingShare.Helpers.IUrlHelper>();
private readonly ILogger<GalleryController> _logger = Substitute.For<ILogger<GalleryController>>();
private readonly IStringLocalizer<Lang.Translations> _localizer = Substitute.For<IStringLocalizer<Lang.Translations>>();
public GalleryControllerTests()
{
}
[SetUp]
public void Setup()
{
_env.WebRootPath.Returns("/app/wwwroot");
_database.GetGallery("default").Returns(Task.FromResult<GalleryModel?>(new GalleryModel()
{
Id = 1,
Name = "default",
SecretKey = "password",
ApprovedItems = 32,
PendingItems = 50,
TotalItems = 72
}));
_database.GetGallery("blaa").Returns(Task.FromResult<GalleryModel?>(new GalleryModel()
{
Id = 2,
Name = "blaa",
SecretKey = "456789",
ApprovedItems = 2,
PendingItems = 1,
TotalItems = 3
}));
_database.GetGallery("missing").Returns(Task.FromResult<GalleryModel?>(null));
_database.AddGallery(Arg.Any<GalleryModel>()).Returns(Task.FromResult<GalleryModel?>(new GalleryModel()
{
Id = 101,
Name = "missing",
SecretKey = "123456",
ApprovedItems = 0,
PendingItems = 0,
TotalItems = 0
}));
_database.AddGalleryItem(Arg.Any<GalleryItemModel>()).Returns(Task.FromResult<GalleryItemModel?>(MockData.MockGalleryItem()));
_database.GetAllGalleryItems(Arg.Any<int>(), GalleryItemState.All, Arg.Any<MediaType>(), Arg.Any<GalleryOrder>(), Arg.Any<int>(), Arg.Any<int>()).Returns(Task.FromResult(MockData.MockGalleryItems(10, 1, GalleryItemState.All)));
_database.GetAllGalleryItems(Arg.Any<int>(), GalleryItemState.Pending, Arg.Any<MediaType>(), Arg.Any<GalleryOrder>(), Arg.Any<int>(), Arg.Any<int>()).Returns(Task.FromResult(MockData.MockGalleryItems(10, 1, GalleryItemState.Pending)));
_database.GetAllGalleryItems(Arg.Any<int>(), GalleryItemState.Approved, Arg.Any<MediaType>(), Arg.Any<GalleryOrder>(), Arg.Any<int>(), Arg.Any<int>()).Returns(Task.FromResult(MockData.MockGalleryItems(10, 1, GalleryItemState.Approved)));
_database.GetGalleryItemByChecksum(Arg.Any<int>(), Arg.Any<string>()).ReturnsNull();
_gallery.GetSecretKey(Arg.Any<string>()).Returns("password");
_gallery.GetSecretKey("blaa").Returns("456789");
_gallery.GetSecretKey("missing").Returns("123456");
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Upload", Arg.Any<bool>()).Returns(true);
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Download", Arg.Any<bool>()).Returns(true);
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Upload_Period", Arg.Any<string>()).Returns("1970-01-01 00:00:00");
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Prevent_Duplicates", Arg.Any<bool>()).Returns(true);
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Default_View", Arg.Any<int>()).Returns((int)ViewMode.Default);
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Allowed_File_Types", Arg.Any<string>()).Returns(".jpg,.jpeg,.png,.mp4,.mov");
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Require_Review", Arg.Any<bool>()).Returns(true);
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Max_File_Size_Mb", Arg.Any<int>()).Returns(10);
_file.GetChecksum(Arg.Any<string>()).Returns(Guid.NewGuid().ToString());
_notification.Send(Arg.Any<string>(), Arg.Any<string>()).Returns(Task.FromResult(true));
_localizer[Arg.Any<string>()].Returns(new LocalizedString("UnitTest", "UnitTest"));
}
[TestCase(DeviceType.Desktop, 1, "default", "password", ViewMode.Default, GalleryOrder.None)]
[TestCase(DeviceType.Mobile, 2, "blaa", "456789", ViewMode.Presentation, GalleryOrder.UploadedAsc)]
[TestCase(DeviceType.Tablet, 101, "missing", "123456", ViewMode.Slideshow, GalleryOrder.NameAsc)]
public async Task GalleryController_Index(DeviceType deviceType, int id, string name, string? key, ViewMode? mode, GalleryOrder order)
{
_deviceDetector.ParseDeviceType(Arg.Any<string>()).Returns(deviceType);
_config.GetOrDefault("Settings:Single_Gallery_Mode", Arg.Any<bool>()).Returns(false);
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext();
ViewResult actual = (ViewResult)await controller.Index(name, key, mode, order);
Assert.That(actual, Is.TypeOf<ViewResult>());
Assert.That(actual?.Model, Is.Not.Null);
PhotoGallery model = (PhotoGallery)actual.Model;
Assert.That(model?.GalleryId, Is.EqualTo(id));
Assert.That(model?.GalleryName, Is.EqualTo(name));
Assert.That(model.ViewMode, Is.EqualTo(mode));
Assert.That(model?.FileUploader?.GalleryId, Is.EqualTo(name));
Assert.That(model?.FileUploader?.SecretKey, Is.EqualTo(key));
Assert.That(model?.FileUploader?.UploadUrl, Is.EqualTo("/Gallery/UploadImage"));
}
[TestCase(true, true)]
[TestCase(false, false)]
public async Task GalleryController_UploadDisabled(bool disabled, bool expected)
{
_deviceDetector.ParseDeviceType(Arg.Any<string>()).Returns(DeviceType.Desktop);
_config.GetOrDefault("Settings:Single_Gallery_Mode", Arg.Any<bool>()).Returns(false);
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Upload", Arg.Any<bool>()).Returns(disabled);
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext();
ViewResult actual = (ViewResult)await controller.Index("default", "password", ViewMode.Default, GalleryOrder.None);
Assert.That(actual, Is.TypeOf<ViewResult>());
Assert.That(actual?.Model, Is.Not.Null);
PhotoGallery model = (PhotoGallery)actual.Model;
Assert.That(model?.FileUploader, expected ? Is.Not.Null : Is.Null);
}
[TestCase("1970-01-01 00:00", true)]
[TestCase("3000-01-01 00:00", false)]
[TestCase("1970-01-01 00:00 / 1980-01-01 00:00", false)]
[TestCase("2999-01-01 00:00 / 3000-01-01 00:00", false)]
[TestCase("1970-01-01 00:00 / 3000-01-01 00:00", true)]
public async Task GalleryController_UploadDisabled(string uploadPeriod, bool expected)
{
_deviceDetector.ParseDeviceType(Arg.Any<string>()).Returns(DeviceType.Desktop);
_config.GetOrDefault("Settings:Single_Gallery_Mode", Arg.Any<bool>()).Returns(false);
_gallery.GetConfig(Arg.Any<string>(), "Gallery:Upload_Period", Arg.Any<string>()).Returns(uploadPeriod);
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext();
ViewResult actual = (ViewResult)await controller.Index("default", "password", ViewMode.Default, GalleryOrder.None);
Assert.That(actual, Is.TypeOf<ViewResult>());
Assert.That(actual?.Model, Is.Not.Null);
PhotoGallery model = (PhotoGallery)actual.Model;
Assert.That(model?.FileUploader, expected ? Is.Not.Null : Is.Null);
}
[TestCase(DeviceType.Desktop, ViewMode.Default, GalleryOrder.None)]
[TestCase(DeviceType.Mobile, ViewMode.Presentation, GalleryOrder.UploadedAsc)]
[TestCase(DeviceType.Tablet, ViewMode.Slideshow, GalleryOrder.NameAsc)]
public async Task GalleryController_Index_SingleGalleryMode(DeviceType deviceType, ViewMode? mode, GalleryOrder order)
{
_deviceDetector.ParseDeviceType(Arg.Any<string>()).Returns(deviceType);
_config.GetOrDefault("Settings:Single_Gallery_Mode", Arg.Any<bool>()).Returns(true);
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext();
ViewResult actual = (ViewResult)await controller.Index("default", "password", mode, order);
Assert.That(actual, Is.TypeOf<ViewResult>());
Assert.That(actual?.Model, Is.Not.Null);
PhotoGallery model = (PhotoGallery)actual.Model;
Assert.That(model?.GalleryId, Is.EqualTo(1));
Assert.That(model?.GalleryName, Is.EqualTo("default"));
Assert.That(model.ViewMode, Is.EqualTo(mode));
Assert.That(model?.FileUploader?.GalleryId, Is.EqualTo("default"));
Assert.That(model?.FileUploader?.SecretKey, Is.EqualTo("password"));
Assert.That(model?.FileUploader?.UploadUrl, Is.EqualTo("/Gallery/UploadImage"));
}
[TestCase(true, 1, null)]
[TestCase(true, 3, "Bob")]
[TestCase(false, 1, "")]
[TestCase(false, 3, "Unit Testing")]
public async Task GalleryController_UploadImage(bool requiresReview, int fileCount, string? uploadedBy)
{
_config.GetOrDefault("Settings:Gallery:Require_Review", Arg.Any<bool>()).Returns(requiresReview);
var files = new FormFileCollection();
for (var i = 0; i < fileCount; i++)
{
files.Add(new FormFile(null, 0, 0, "TestFile_001", $"{Guid.NewGuid()}.jpg"));
}
var session = new MockSession();
session.Set(SessionKey.ViewerIdentity, uploadedBy ?? string.Empty);
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext(
session: session,
form: new Dictionary<string, StringValues>
{
{ "Id", "default" },
{ "SecretKey", "password" }
},
files: files);
JsonResult actual = (JsonResult)await controller.UploadImage();
Assert.That(actual, Is.TypeOf<JsonResult>());
Assert.That(actual?.Value, Is.Not.Null);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "success", false), Is.True);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "uploaded", 0), Is.EqualTo(files.Count));
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "uploadedBy", string.Empty), Is.EqualTo(!string.IsNullOrWhiteSpace(uploadedBy) ? uploadedBy : string.Empty));
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "errors", new List<string>()).Count, Is.EqualTo(0));
}
[TestCase]
public async Task GalleryController_UploadImage_Duplicate()
{
_database.GetGalleryItemByChecksum(Arg.Any<int>(), Arg.Any<string>()).Returns(Task.FromResult(MockData.MockGalleryItems(1, 1, GalleryItemState.Approved).FirstOrDefault()));
var files = new FormFileCollection();
files.Add(new FormFile(null, 0, 0, "TestFile_001", $"{Guid.NewGuid()}.jpg"));
var session = new MockSession();
session.Set(SessionKey.ViewerIdentity, string.Empty);
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext(
session: session,
form: new Dictionary<string, StringValues>
{
{ "Id", "default" },
{ "SecretKey", "password" }
},
files: files);
JsonResult actual = (JsonResult)await controller.UploadImage();
Assert.That(actual, Is.TypeOf<JsonResult>());
Assert.That(actual?.Value, Is.Not.Null);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "success", false), Is.False);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "uploaded", 0), Is.EqualTo(0));
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "errors", new List<string>()).Count, Is.GreaterThan(0));
}
[TestCase(null)]
[TestCase("")]
public async Task GalleryController_UploadImage_InvalidGallery(string? id)
{
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext(form: new Dictionary<string, StringValues>
{
{ "Id", id }
});
JsonResult actual = (JsonResult)await controller.UploadImage();
Assert.That(actual, Is.TypeOf<JsonResult>());
Assert.That(actual?.Value, Is.Not.Null);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "success", false), Is.False);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "uploaded", 0), Is.EqualTo(0));
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "errors", new List<string>()).Count, Is.GreaterThan(0));
}
[TestCase(null)]
[TestCase("")]
public async Task GalleryController_UploadImage_InvalidSecretKey(string? key)
{
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext(form: new Dictionary<string, StringValues>
{
{ "Id", "default" },
{ "SecretKey", key }
});
JsonResult actual = (JsonResult)await controller.UploadImage();
Assert.That(actual, Is.TypeOf<JsonResult>());
Assert.That(actual?.Value, Is.Not.Null);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "success", false), Is.False);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "uploaded", 0), Is.EqualTo(0));
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "errors", new List<string>()).Count, Is.GreaterThan(0));
}
[TestCase()]
public async Task GalleryController_UploadImage_MissingGallery()
{
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext(form: new Dictionary<string, StringValues>
{
{ "Id", Guid.NewGuid().ToString() }
});
JsonResult actual = (JsonResult)await controller.UploadImage();
Assert.That(actual, Is.TypeOf<JsonResult>());
Assert.That(actual?.Value, Is.Not.Null);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "success", false), Is.False);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "uploaded", 0), Is.EqualTo(0));
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "errors", new List<string>()).Count, Is.GreaterThan(0));
}
[TestCase()]
public async Task GalleryController_UploadImage_NoFiles()
{
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext(form: new Dictionary<string, StringValues>
{
{ "Id", "default" },
{ "SecretKey", "password" }
});
JsonResult actual = (JsonResult)await controller.UploadImage();
Assert.That(actual, Is.TypeOf<JsonResult>());
Assert.That(actual?.Value, Is.Not.Null);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "success", false), Is.False);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "uploaded", 0), Is.EqualTo(0));
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "errors", new List<string>()).Count, Is.GreaterThan(0));
}
[TestCase()]
public async Task GalleryController_UploadImage_FileTooBig()
{
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext(
form: new Dictionary<string, StringValues>
{
{ "Id", "default" },
{ "SecretKey", "password" }
},
files: new FormFileCollection() {
new FormFile(null, 0, int.MaxValue, "TestFile_001", $"{Guid.NewGuid()}.jpg")
});
JsonResult actual = (JsonResult)await controller.UploadImage();
Assert.That(actual, Is.TypeOf<JsonResult>());
Assert.That(actual?.Value, Is.Not.Null);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "success", false), Is.False);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "uploaded", 0), Is.EqualTo(0));
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "errors", new List<string>()).Count, Is.GreaterThan(0));
}
[TestCase()]
public async Task GalleryController_UploadImage_InvalidFileType()
{
var controller = new GalleryController(_env, _config, _database, _file, _gallery, _deviceDetector, _image, _notification, _encryption, _url, _logger, _localizer);
controller.ControllerContext.HttpContext = MockData.MockHttpContext(
form: new Dictionary<string, StringValues>
{
{ "Id", "default" },
{ "SecretKey", "password" }
},
files: new FormFileCollection() {
new FormFile(null, 0, int.MaxValue, "TestFile_001", $"{Guid.NewGuid()}.blaa")
});
JsonResult actual = (JsonResult)await controller.UploadImage();
Assert.That(actual, Is.TypeOf<JsonResult>());
Assert.That(actual?.Value, Is.Not.Null);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "success", false), Is.False);
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "uploaded", 0), Is.EqualTo(0));
Assert.That(JsonResponseHelper.GetPropertyValue(actual.Value, "errors", new List<string>()).Count, Is.GreaterThan(0));
}
}
}

View File

@@ -0,0 +1,66 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using WeddingShare.Controllers;
using WeddingShare.Enums;
using WeddingShare.Helpers;
using WeddingShare.UnitTests.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class HomeControllerTests
{
private readonly IConfigHelper _config = Substitute.For<IConfigHelper>();
private readonly IGalleryHelper _gallery = Substitute.For<IGalleryHelper>();
private readonly IDeviceDetector _deviceDetector = Substitute.For<IDeviceDetector>();
private readonly ILogger<HomeController> _logger = Substitute.For<ILogger<HomeController>>();
private readonly IStringLocalizer<Lang.Translations> _localizer = Substitute.For<IStringLocalizer<Lang.Translations>>();
public HomeControllerTests()
{
}
[SetUp]
public void Setup()
{
}
[TestCase(DeviceType.Desktop, true, "", true)]
[TestCase(DeviceType.Desktop, false, "", false)]
[TestCase(DeviceType.Mobile, true, "", true)]
[TestCase(DeviceType.Mobile, false, "", false)]
[TestCase(DeviceType.Desktop, true, "123456", false)]
[TestCase(DeviceType.Desktop, false, "Abc123!", false)]
[TestCase(DeviceType.Mobile, true, "abc123!", false)]
[TestCase(DeviceType.Mobile, false, "adsbsds", false)]
public async Task HomeController_Index(DeviceType deviceType, bool singleGalleryMode, string secretKey, bool isRedirect)
{
_deviceDetector.ParseDeviceType(Arg.Any<string>()).Returns(deviceType);
_config.GetOrDefault("Settings:Single_Gallery_Mode", Arg.Any<bool>()).Returns(singleGalleryMode);
_gallery.GetSecretKey(Arg.Any<string>()).Returns(secretKey);
var controller = new HomeController(_config, _gallery, _deviceDetector, _logger, _localizer);
controller.ControllerContext.HttpContext = new DefaultHttpContext()
{
Session = new MockSession()
};
if (!isRedirect)
{
ViewResult actual = (ViewResult)await controller.Index();
Assert.That(actual, Is.TypeOf<ViewResult>());
}
else
{
RedirectToActionResult actual = (RedirectToActionResult)await controller.Index();
Assert.That(actual, Is.TypeOf<RedirectToActionResult>());
Assert.That(actual.Permanent, Is.EqualTo(false));
Assert.That(actual.ControllerName, Is.EqualTo("Gallery"));
Assert.That(actual.ActionName, Is.EqualTo("Index"));
Assert.That(actual.RouteValues, Is.Null);
Assert.That(actual.Fragment, Is.Null);
}
}
}
}

View File

@@ -0,0 +1,39 @@
using WeddingShare.Extensions;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class StringExtensionsTests
{
public StringExtensionsTests()
{
}
[SetUp]
public void Setup()
{
}
[TestCase("abcdefgh", new [] { "g" }, "+", "abcdef+h")]
[TestCase("abcdefgh", new [] { "b", "e" }, "-", "a-cd-fgh")]
[TestCase("abcdefgh", new [] { "bc", "e" }, "-", "a-d-fgh")]
[TestCase("abcdefgeh", new [] { "bc", "e" }, "$", "a$d$fg$h")]
[TestCase("abcdefgeh", new[] { "ee", "z" }, "$", "abcdefgeh")]
public void StringExtensions_Replace(string input, string[] oldChars, string newChar, string expected)
{
var actual = input.Replace(oldChars, newChar);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("abcdefge", "c", "abdefge")]
[TestCase("abcdefge", "cd", "abefge")]
[TestCase("abcdefge", "def", "abcge")]
[TestCase("abcdefge", "e", "abcdfg")]
[TestCase("abcdefg", "g", "abcdef")]
[TestCase("abcdefg", "a", "bcdefg")]
public void StringExtensions_Remove(string input, string value, string expected)
{
var actual = input.Remove(value);
Assert.That(actual, Is.EqualTo(expected));
}
}
}

View File

@@ -0,0 +1,167 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using WeddingShare.Helpers;
using WeddingShare.UnitTests.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class ConfigHelperTests
{
private readonly IConfiguration _configuration;
private readonly IEnvironmentWrapper _environment = Substitute.For<IEnvironmentWrapper>();
private readonly ILogger<ConfigHelper> _logger = Substitute.For<ILogger<ConfigHelper>>();
public ConfigHelperTests()
{
_environment.GetEnvironmentVariable("VERSION").Returns("v2.0.0");
_environment.GetEnvironmentVariable("ENVKEY_1").Returns("EnvValue1");
_environment.GetEnvironmentVariable("ENVKEY_2").Returns("EnvValue2");
_environment.GetEnvironmentVariable("ENVKEY_3").Returns("EnvValue3");
_configuration = ConfigurationHelper.MockConfiguration(new Dictionary<string, string?>()
{
{ "Release:Version", "v1.0.0" },
{ "Release:Plugin:Version", "v3.0.0" },
{ "String1:Key1", "Value1" },
{ "String1:Key2", "Value2" },
{ "String2:Key1", "Value3" },
{ "Int1:Key1", "1" },
{ "Int1:Key2", "2" },
{ "Int2:Key1", "3" },
{ "Long1:Key1", "4" },
{ "Long1:Key2", "5" },
{ "Long2:Key1", "6" },
{ "Decimal1:Key1", "4.12" },
{ "Decimal1:Key2", "5.45" },
{ "Decimal2:Key1", "6.733" },
{ "Double1:Key1", "4.12" },
{ "Double1:Key2", "5.45" },
{ "Double2:Key1", "6.733" },
{ "Boolean1:Key1", "true" },
{ "Boolean1:Key2", "false" },
{ "Boolean2:Key1", "true" },
{ "DateTime1:Key1", "1987-11-20 08:00:00" },
{ "DateTime1:Key2", "2000-08-12 12:00:00" },
{ "DateTime2:Key1", "2018-01-01 20:30:10" },
});
}
[SetUp]
public void Setup()
{
}
[TestCase("SETTINGS:ENVKEY:1", "EnvValue1")]
[TestCase("SETTINGS:ENVKEY:2", "EnvValue2")]
[TestCase("SETTINGS:ENVKEY:3", "EnvValue3")]
[TestCase("SETTINGS:ENVKEY:4", null)]
[TestCase("RELEASE:VERSION", null)]
public void ConfigHelper_GetEnvironmentVariable(string section, string? expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).GetEnvironmentVariable(section);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("String1:Key1", "Value1")]
[TestCase("String1:Key2", "Value2")]
[TestCase("String2:Key1", "Value3")]
[TestCase("String2:Key2", null)]
[TestCase("Release:Version", "v1.0.0")]
public void ConfigHelper_GetConfigValue(string key, string? expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).GetConfigValue(key);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("String1:Key1", "Value1")]
[TestCase("String1:Key2", "Value2")]
[TestCase("String2:Key1", "Value3")]
[TestCase("String2:Key2", null)]
[TestCase("Release:Version", "v1.0.0")]
public void ConfigHelper_Get(string key, string? expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).Get(key);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("String1:Key1", "Default", "Value1")]
[TestCase("String1:Key2", "Default", "Value2")]
[TestCase("String2:Key1", "Default", "Value3")]
[TestCase("String2:Key2", "Default", "Default")]
[TestCase("Release:Version", "v0.0.0", "v1.0.0")]
[TestCase("Release:Plugin:Version", "v0.0.0", "v3.0.0")]
public void ConfigHelper_GetOrDefault(string key, string defaultValue, string expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).GetOrDefault(key, defaultValue);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("Int1:Key1", 999, 1)]
[TestCase("Int1:Key2", 999, 2)]
[TestCase("Int2:Key1", 999, 3)]
[TestCase("Int2:Key2", 999, 999)]
public void ConfigHelper_GetOrDefault(string key, int defaultValue, int expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).GetOrDefault(key, defaultValue);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("Long1:Key1", 999, 4)]
[TestCase("Long1:Key2", 999, 5)]
[TestCase("Long2:Key1", 999, 6)]
[TestCase("Long2:Key2", 999, 999)]
public void ConfigHelper_GetOrDefault(string key, long defaultValue, long expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).GetOrDefault(key, defaultValue);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("Decimal1:Key1", 999, 4.12)]
[TestCase("Decimal1:Key2", 999, 5.45)]
[TestCase("Decimal2:Key1", 999, 6.733)]
[TestCase("Decimal2:Key2", 999, 999)]
public void ConfigHelper_GetOrDefault(string key, decimal defaultValue, decimal expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).GetOrDefault(key, defaultValue);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("Double1:Key1", 999, 4.12)]
[TestCase("Double1:Key2", 999, 5.45)]
[TestCase("Double2:Key1", 999, 6.733)]
[TestCase("Double2:Key2", 999, 999)]
public void ConfigHelper_GetOrDefault(string key, double defaultValue, double expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).GetOrDefault(key, defaultValue);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("Boolean1:Key1", false, true)]
[TestCase("Boolean1:Key2", false, false)]
[TestCase("Boolean2:Key1", false, true)]
[TestCase("Boolean2:Key2", true, true)]
public void ConfigHelper_GetOrDefault(string key, bool defaultValue, bool expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).GetOrDefault(key, defaultValue);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("DateTime1:Key1", null, "1987-11-20 08:00:00")]
[TestCase("DateTime1:Key2", null, "2000-08-12 12:00:00")]
[TestCase("DateTime2:Key1", null, "2018-01-01 20:30:10")]
[TestCase("DateTime2:Key2", null, null)]
[TestCase("DateTime3:Key3", "2350-05-05 00:05:12", "2350-05-05 00:05:12")]
public void ConfigHelper_GetOrDefault(string key, DateTime? defaultValue, string? expected)
{
var actual = new ConfigHelper(_environment, _configuration, _logger).GetOrDefault(key, defaultValue);
Assert.That(actual, Is.EqualTo(!string.IsNullOrWhiteSpace(expected) ? DateTime.Parse(expected) : null));
}
}
}

View File

@@ -0,0 +1,23 @@
using WeddingShare.Enums;
using WeddingShare.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class DeviceDetectorTests
{
[SetUp]
public void Setup()
{
}
[TestCase("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36", DeviceType.Desktop)]
[TestCase("Mozilla/5.0 (Linux; Android 7.0; SM-T827R4 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.116 Safari/537.36", DeviceType.Tablet)]
[TestCase("Mozilla/5.0 (Linux; Android 13; SM-G998B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36", DeviceType.Mobile)]
[TestCase("Googlebot-Image/1.0", DeviceType.Desktop)]
public async Task DeviceDetector_ParseDeviceType(string userAgent, DeviceType expected)
{
var actual = await new DeviceDetector().ParseDeviceType(userAgent);
Assert.That(actual, Is.EqualTo(expected));
}
}
}

View File

@@ -0,0 +1,108 @@
using System.Net.Mail;
using Microsoft.Extensions.Logging;
using NSubstitute;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Notifications;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class EmailHelperTests
{
private readonly IConfigHelper _config = Substitute.For<IConfigHelper>();
private readonly ISmtpClientWrapper _smtp = Substitute.For<ISmtpClientWrapper>();
private readonly ILogger<EmailHelper> _logger = Substitute.For<ILogger<EmailHelper>>();
public EmailHelperTests()
{
}
[SetUp]
public void Setup()
{
_smtp.SendMailAsync(Arg.Any<SmtpClient>(), Arg.Any<MailMessage>()).Returns(Task.FromResult(true));
_config.GetOrDefault("Notifications:Smtp:Enabled", Arg.Any<bool>()).Returns(true);
_config.GetOrDefault("Notifications:Smtp:Recipient", Arg.Any<string>()).Returns("unit@test.com");
_config.GetOrDefault("Notifications:Smtp:Host", Arg.Any<string>()).Returns("https://unit.test.com/");
_config.GetOrDefault("Notifications:Smtp:Port", Arg.Any<int>()).Returns(999);
_config.GetOrDefault("Notifications:Smtp:Username", Arg.Any<string>()).Returns("Unit");
_config.GetOrDefault("Notifications:Smtp:Password", Arg.Any<string>()).Returns("Test");
_config.GetOrDefault("Notifications:Smtp:From", Arg.Any<string>()).Returns("unittest@test.com");
_config.GetOrDefault("Notifications:Smtp:DisplayName", Arg.Any<string>()).Returns("UnitTest");
_config.GetOrDefault("Notifications:Smtp:UseSSL", Arg.Any<bool>()).Returns(true);
}
[TestCase("unit", "test")]
public async Task EmailHelper_Success(string title, string message)
{
var actual = await new EmailHelper(_config, _smtp, _logger).Send(title, message);
Assert.That(actual, Is.EqualTo(true));
}
[TestCase(true, true)]
[TestCase(false, false)]
public async Task EmailHelper_Enabled(bool enabled, bool expected)
{
_config.GetOrDefault("Notifications:Smtp:Enabled", Arg.Any<bool>()).Returns(enabled);
var actual = await new EmailHelper(_config, _smtp, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(null, false)]
[TestCase("", false)]
[TestCase("blaa@blaa.com", true)]
public async Task EmailHelper_Recipient(string recipient, bool expected)
{
_config.GetOrDefault("Notifications:Smtp:Recipient", Arg.Any<string>()).Returns(recipient);
var actual = await new EmailHelper(_config, _smtp, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(null, false)]
[TestCase("", false)]
[TestCase("https://unit.test.com/", true)]
public async Task EmailHelper_Host(string host, bool expected)
{
_config.GetOrDefault("Notifications:Smtp:Host", Arg.Any<string>()).Returns(host);
var actual = await new EmailHelper(_config, _smtp, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(-100, false)]
[TestCase(-1, false)]
[TestCase(0, false)]
[TestCase(1, true)]
public async Task EmailHelper_Port(int port, bool expected)
{
_config.GetOrDefault("Notifications:Smtp:Port", Arg.Any<int>()).Returns(port);
var actual = await new EmailHelper(_config, _smtp, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(null, false)]
[TestCase("", false)]
[TestCase("blaa@blaa.com", true)]
public async Task EmailHelper_From(string from, bool expected)
{
_config.GetOrDefault("Notifications:Smtp:From", Arg.Any<string>()).Returns(from);
var actual = await new EmailHelper(_config, _smtp, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(null, true)]
[TestCase("", true)]
[TestCase("UnitTest", true)]
public async Task EmailHelper_DisplayName(string displayName, bool expected)
{
_config.GetOrDefault("Notifications:Smtp:DisplayName", Arg.Any<string>()).Returns(displayName);
var actual = await new EmailHelper(_config, _smtp, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
}
}

View File

@@ -0,0 +1,85 @@
using WeddingShare.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class EncrytpionHelper
{
private readonly IConfigHelper _config = Substitute.For<IConfigHelper>();
public EncrytpionHelper()
{
_config.GetOrDefault("Security:Encryption:HashType", Arg.Any<string>()).Returns("SHA256");
_config.GetOrDefault("Security:Encryption:Iterations", Arg.Any<int>()).Returns(1000);
}
[SetUp]
public void Setup()
{
}
[TestCase("Test", "Key1", "Salt1", "ZMw15YpZ+uph9psdR6tEZg==")]
[TestCase("Test", "Key2", "Salt2", "p/fwjLVXvJ2dRKbXDNhxDA==")]
[TestCase("Test", "Key3", "Salt3", "47VYeotX2C8GPuhaQlrWXg==")]
public void EncrytpionHelper_ValidDetails(string value, string key, string salt, string expected)
{
_config.GetOrDefault("Security:Encryption:Key", Arg.Any<string>()).Returns(key);
_config.GetOrDefault("Security:Encryption:Salt", Arg.Any<string>()).Returns(salt);
var actual = new EncryptionHelper(_config).Encrypt(value);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("Test1", "Salt1")]
[TestCase("Test2", "Salt2")]
[TestCase("Test3", "Salt3")]
public void EncrytpionHelper_NoKey(string value, string salt)
{
_config.GetOrDefault("Security:Encryption:Key", Arg.Any<string>()).Returns(string.Empty);
_config.GetOrDefault("Security:Encryption:Salt", Arg.Any<string>()).Returns(salt);
var actual = new EncryptionHelper(_config).Encrypt(value);
Assert.That(actual, Is.EqualTo(value));
}
[TestCase("Test1", "Key1")]
[TestCase("Test2", "Key2")]
[TestCase("Test3", "Key3")]
public void EncrytpionHelper_NoSalt(string value, string key)
{
_config.GetOrDefault("Security:Encryption:Key", Arg.Any<string>()).Returns(key);
_config.GetOrDefault("Security:Encryption:Salt", Arg.Any<string>()).Returns(string.Empty);
var actual = new EncryptionHelper(_config).Encrypt(value);
Assert.That(actual, Is.EqualTo(value));
}
[TestCase("Test1", "Key1", "Salt1")]
[TestCase("Test2", "Key2", "Salt2")]
[TestCase("Test3", "Key3", "Salt3")]
public void EncrytpionHelper_DifferentHashes(string value, string key, string salt)
{
_config.GetOrDefault("Security:Encryption:Key", Arg.Any<string>()).Returns(key);
_config.GetOrDefault("Security:Encryption:Salt", Arg.Any<string>()).Returns(salt);
var helper1 = new EncryptionHelper(_config).Encrypt(value);
_config.GetOrDefault("Security:Encryption:Key", Arg.Any<string>()).Returns("Unit");
_config.GetOrDefault("Security:Encryption:Salt", Arg.Any<string>()).Returns("Test");
var helper2 = new EncryptionHelper(_config).Encrypt(value);
Assert.That(helper1, Is.Not.EqualTo(helper2));
}
[TestCase("Key", "", false)]
[TestCase("", "Salt", false)]
[TestCase("Key", "Salt", true)]
public void EncrytpionHelper_IsEncryptionEnabled(string key, string salt, bool expected)
{
_config.GetOrDefault("Security:Encryption:Key", Arg.Any<string>()).Returns(key);
_config.GetOrDefault("Security:Encryption:Salt", Arg.Any<string>()).Returns(salt);
var actual = new EncryptionHelper(_config).IsEncryptionEnabled();
Assert.That(actual, Is.EqualTo(expected));
}
}
}

View File

@@ -0,0 +1,136 @@
using Microsoft.Extensions.Logging;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Database;
using WeddingShare.Models.Database;
using WeddingShare.UnitTests.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class GalleryHelperTests
{
private readonly IDatabaseHelper _database = Substitute.For<IDatabaseHelper>();
public GalleryHelperTests()
{
_database.GetGallery("Gallery1").Returns(new GalleryModel() { SecretKey = "001" });
_database.GetGallery("Gallery2").Returns(new GalleryModel() { SecretKey = "002" });
}
[SetUp]
public void Setup()
{
}
[TestCase()]
public async Task GalleryHelper_GetSecretKey_DefaultEnvKey()
{
var environment = Substitute.For<IEnvironmentWrapper>();
environment.GetEnvironmentVariable("GALLERY_SECRET_KEY").Returns("123");
var configuration = ConfigurationHelper.MockConfiguration(new Dictionary<string, string?>()
{
{ "Gallery:Secret_Key_Gallery2", "002" }
});
var config = new ConfigHelper(environment, configuration, Substitute.For<ILogger<ConfigHelper>>());
var actual = await new GalleryHelper(config, _database).GetSecretKey("Gallery3");
Assert.That(actual, Is.EqualTo("123"));
}
[TestCase()]
public async Task GalleryHelper_GetSecretKey_GalleryEnvKey()
{
var environment = Substitute.For<IEnvironmentWrapper>();
environment.GetEnvironmentVariable("GALLERY_SECRET_KEY").Returns("123");
environment.GetEnvironmentVariable("GALLERY_SECRET_KEY_GALLERY1").Returns("001");
var configuration = ConfigurationHelper.MockConfiguration(new Dictionary<string, string?>()
{
{ "Gallery:Secret_Key_Gallery2", "002" }
});
var config = new ConfigHelper(environment, configuration, Substitute.For<ILogger<ConfigHelper>>());
var actual = await new GalleryHelper(config, _database).GetSecretKey("Gallery1");
Assert.That(actual, Is.EqualTo("001"));
}
[TestCase("Gallery1", "001")]
[TestCase("Gallery2", "002")]
[TestCase("Gallery3", null)]
public async Task GalleryHelper_GetSecretKey_Database(string galleryId, string key)
{
var environment = Substitute.For<IEnvironmentWrapper>();
environment.GetEnvironmentVariable(Arg.Any<string>()).Returns(string.Empty);
var configuration = ConfigurationHelper.MockConfiguration(new Dictionary<string, string?>());
var config = new ConfigHelper(environment, configuration, Substitute.For<ILogger<ConfigHelper>>());
var actual = await new GalleryHelper(config, _database).GetSecretKey(galleryId);
Assert.That(actual, Is.EqualTo(key));
}
[TestCase()]
public void GalleryHelper_GetConfig_DefaultEnvKey()
{
var environment = Substitute.For<IEnvironmentWrapper>();
environment.GetEnvironmentVariable("GALLERY_SECRET_KEY").Returns("123");
var configuration = ConfigurationHelper.MockConfiguration(new Dictionary<string, string?>()
{
{ "Gallery:Secret_Key_Gallery2", "002" }
});
var config = new ConfigHelper(environment, configuration, Substitute.For<ILogger<ConfigHelper>>());
var actual = new GalleryHelper(config, _database).GetConfig("Gallery3", "Gallery:Secret_Key");
Assert.That(actual, Is.EqualTo("123"));
}
[TestCase("Gallery:Secret_Key", "001")]
[TestCase("Gallery:Columns", "001")]
public void GalleryHelper_GetConfig_GalleryEnvKey(string key, string expected)
{
var environment = Substitute.For<IEnvironmentWrapper>();
environment.GetEnvironmentVariable("SECRET_KEY").Returns("123");
environment.GetEnvironmentVariable("SECRET_KEY_GALLERY1").Returns("001");
environment.GetEnvironmentVariable("GALLERY_COLUMNS").Returns("123");
environment.GetEnvironmentVariable("GALLERY_COLUMNS_GALLERY1").Returns("001");
var configuration = ConfigurationHelper.MockConfiguration(new Dictionary<string, string?>()
{
{ "Gallery:Secret_Key_Gallery2", "002" },
{ "Gallery:Columns_Gallery2", "002" }
});
var config = new ConfigHelper(environment, configuration, Substitute.For<ILogger<ConfigHelper>>());
var actual = new GalleryHelper(config, _database).GetConfig("Gallery1", key);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("Disable_QR_Code", "true")]
[TestCase("Gallery:QR_Code", "false")]
public void GalleryHelper_GetConfig_Migrated_GalleryEnvKey(string key, string expected)
{
var environment = Substitute.For<IEnvironmentWrapper>();
environment.GetEnvironmentVariable("DISABLE_QR_CODE").Returns("false");
environment.GetEnvironmentVariable("DISABLE_QR_CODE_GALLERY1").Returns("true");
environment.GetEnvironmentVariable("GALLERY_QR_CODE").Returns("true");
environment.GetEnvironmentVariable("GALLERY_QR_CODE_GALLERY1").Returns("false");
var configuration = ConfigurationHelper.MockConfiguration(new Dictionary<string, string?>()
{
{ "Disable_QR_Code_Gallery2", "false" },
{ "Gallery:QR_Code_Gallery2", "true" }
});
var config = new ConfigHelper(environment, configuration, Substitute.For<ILogger<ConfigHelper>>());
var actual = new GalleryHelper(config, _database).GetConfig("Gallery1", key);
Assert.That(actual, Is.EqualTo(expected));
}
}
}

View File

@@ -0,0 +1,88 @@
using System.Net;
using Microsoft.Extensions.Logging;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Notifications;
using WeddingShare.UnitTests.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class GotifyHelperTests
{
private readonly IConfigHelper _config = Substitute.For<IConfigHelper>();
private readonly IHttpClientFactory _clientFactory = Substitute.For<IHttpClientFactory>();
private readonly ILogger<GotifyHelper> _logger = Substitute.For<ILogger<GotifyHelper>>();
public GotifyHelperTests()
{
}
[SetUp]
public void Setup()
{
var client = new HttpClient(new MockHttpMessageHandler(HttpStatusCode.OK));
client.BaseAddress = new Uri("https://unit.test.com/");
_clientFactory.CreateClient(Arg.Any<string>()).Returns(client);
_config.GetOrDefault("Notifications:Gotify:Enabled", Arg.Any<bool>()).Returns(true);
_config.GetOrDefault("Notifications:Gotify:Endpoint", Arg.Any<string>()).Returns("https://unit.test.com/");
_config.GetOrDefault("Notifications:Gotify:Token", Arg.Any<string>()).Returns("UnitTest");
_config.GetOrDefault("Notifications:Gotify:Priority", Arg.Any<int>()).Returns(4);
}
[TestCase("unit", "test")]
public async Task GotifyHelper_Success(string title, string message)
{
var actual = await new GotifyHelper(_config, _clientFactory, _logger).Send(title, message);
Assert.That(actual, Is.EqualTo(true));
}
[TestCase(true, true)]
[TestCase(false, false)]
public async Task GotifyHelper_Enabled(bool enabled, bool expected)
{
_config.GetOrDefault("Notifications:Gotify:Enabled", Arg.Any<bool>()).Returns(enabled);
var actual = await new GotifyHelper(_config, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(null, false)]
[TestCase("http://unittest.com", true)]
[TestCase("https://unittest.com", true)]
public async Task GotifyHelper_Endpoint(string? endpoint, bool expected)
{
var client = new HttpClient(new MockHttpMessageHandler(HttpStatusCode.OK));
client.BaseAddress = endpoint != null ? new Uri(endpoint) : null;
_clientFactory.CreateClient(Arg.Any<string>()).Returns(client);
var actual = await new GotifyHelper(_config, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(null, false)]
[TestCase("", false)]
[TestCase("UnitTest", true)]
public async Task GotifyHelper_Token(string? token, bool expected)
{
_config.GetOrDefault("Notifications:Gotify:Token", Arg.Any<string>()).Returns(token);
var actual = await new GotifyHelper(_config, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(-100, false)]
[TestCase(-1, false)]
[TestCase(0, false)]
[TestCase(1, true)]
[TestCase(100, true)]
public async Task GotifyHelper_Priority(int priority, bool expected)
{
_config.GetOrDefault("Notifications:Gotify:Priority", Arg.Any<int>()).Returns(priority);
var actual = await new GotifyHelper(_config, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
}
}

View File

@@ -0,0 +1,44 @@
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using WeddingShare.Enums;
using WeddingShare.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class ImageHelperTests
{
private readonly IFileHelper _fileHelper = Substitute.For<IFileHelper>();
private readonly ILogger<ImageHelper> _logger = Substitute.For<ILogger<ImageHelper>>();
private readonly IStringLocalizer<Lang.Translations> _localizer = Substitute.For<IStringLocalizer<Lang.Translations>>();
private readonly IDictionary<ImageOrientation, Image?> _imageCollection;
public ImageHelperTests()
{
_imageCollection = new Dictionary<ImageOrientation, Image?>()
{
{ ImageOrientation.Square, new Image<Rgba32>(100, 100) },
{ ImageOrientation.Landscape, new Image<Rgba32>(200, 100) },
{ ImageOrientation.Portrait, new Image<Rgba32>(100, 200) }
};
}
[SetUp]
public void Setup()
{
}
[TestCase(ImageOrientation.Square)]
[TestCase(ImageOrientation.Landscape)]
[TestCase(ImageOrientation.Portrait)]
public void ImageHelper_GetOrientation(ImageOrientation orientation)
{
var image = _imageCollection[orientation];
Assert.IsNotNull(image);
var actual = new ImageHelper(_fileHelper, _logger, _localizer).GetOrientation(image);
Assert.That(actual, Is.EqualTo(orientation));
}
}
}

View File

@@ -0,0 +1,95 @@
using System.Net;
using System.Net.Mail;
using Microsoft.Extensions.Logging;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Notifications;
using WeddingShare.UnitTests.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class NotificationBrokerTests
{
private readonly IConfigHelper _config = Substitute.For<IConfigHelper>();
private readonly IHttpClientFactory _clientFactory = Substitute.For<IHttpClientFactory>();
private readonly ISmtpClientWrapper _smtp = Substitute.For<ISmtpClientWrapper>();
private readonly ILoggerFactory _logger = Substitute.For<ILoggerFactory>();
public NotificationBrokerTests()
{
}
[SetUp]
public void Setup()
{
var client = new HttpClient(new MockHttpMessageHandler(HttpStatusCode.OK));
client.BaseAddress = new Uri("https://unit.test.com/");
_clientFactory.CreateClient(Arg.Any<string>()).Returns(client);
_smtp.SendMailAsync(Arg.Any<SmtpClient>(), Arg.Any<MailMessage>()).Returns(Task.FromResult(true));
_config.GetOrDefault("Notifications:Smtp:Enabled", Arg.Any<bool>()).Returns(true);
_config.GetOrDefault("Notifications:Smtp:Recipient", Arg.Any<string>()).Returns("unit@test.com");
_config.GetOrDefault("Notifications:Smtp:Host", Arg.Any<string>()).Returns("https://unit.test.com/");
_config.GetOrDefault("Notifications:Smtp:Port", Arg.Any<int>()).Returns(999);
_config.GetOrDefault("Notifications:Smtp:Username", Arg.Any<string>()).Returns("Unit");
_config.GetOrDefault("Notifications:Smtp:Password", Arg.Any<string>()).Returns("Test");
_config.GetOrDefault("Notifications:Smtp:From", Arg.Any<string>()).Returns("unittest@test.com");
_config.GetOrDefault("Notifications:Smtp:DisplayName", Arg.Any<string>()).Returns("UnitTest");
_config.GetOrDefault("Notifications:Smtp:UseSSL", Arg.Any<bool>()).Returns(true);
_config.GetOrDefault("Notifications:Ntfy:Enabled", Arg.Any<bool>()).Returns(true);
_config.GetOrDefault("Notifications:Ntfy:Endpoint", Arg.Any<string>()).Returns("https://unit.test.com/");
_config.GetOrDefault("Notifications:Ntfy:Token", Arg.Any<string>()).Returns("UnitTest");
_config.GetOrDefault("Notifications:Ntfy:Topic", Arg.Any<string>()).Returns("UnitTest");
_config.GetOrDefault("Notifications:Ntfy:Priority", Arg.Any<int>()).Returns(4);
_config.GetOrDefault("Notifications:Gotify:Enabled", Arg.Any<bool>()).Returns(true);
_config.GetOrDefault("Notifications:Gotify:Endpoint", Arg.Any<string>()).Returns("https://unit.test.com/");
_config.GetOrDefault("Notifications:Gotify:Token", Arg.Any<string>()).Returns("UnitTest");
_config.GetOrDefault("Notifications:Gotify:Priority", Arg.Any<int>()).Returns(4);
}
[TestCase(false, false, false, true)]
[TestCase(true, false, false, true)]
[TestCase(false, true, false, true)]
[TestCase(false, false, true, true)]
[TestCase(true, true, true, true)]
public async Task NotificationBroker_Success(bool smtp, bool ntfy, bool gotify, bool expected)
{
_config.GetOrDefault("Notifications:Smtp:Enabled", Arg.Any<bool>()).Returns(smtp);
_config.GetOrDefault("Notifications:Ntfy:Enabled", Arg.Any<bool>()).Returns(ntfy);
_config.GetOrDefault("Notifications:Gotify:Enabled", Arg.Any<bool>()).Returns(gotify);
var actual = await new NotificationBroker(_config, _smtp, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase()]
public async Task NotificationBroker_Issue_Smtp()
{
_config.GetOrDefault("Notifications:Smtp:Host", Arg.Any<string>()).Returns(string.Empty);
var actual = await new NotificationBroker(_config, _smtp, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(false));
}
[TestCase()]
public async Task NotificationBroker_Issue_Ntfy()
{
_config.GetOrDefault("Notifications:Ntfy:Endpoint", Arg.Any<string>()).Returns(string.Empty);
var actual = await new NotificationBroker(_config, _smtp, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(false));
}
[TestCase()]
public async Task NotificationBroker_Issue_Gotify()
{
_config.GetOrDefault("Notifications:Gotify:Endpoint", Arg.Any<string>()).Returns(string.Empty);
var actual = await new NotificationBroker(_config, _smtp, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(false));
}
}
}

View File

@@ -0,0 +1,101 @@
using System.Net;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Notifications;
using WeddingShare.UnitTests.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class NtfyHelperTests
{
private readonly IConfigHelper _config = Substitute.For<IConfigHelper>();
private readonly IHttpClientFactory _clientFactory = Substitute.For<IHttpClientFactory>();
private readonly ILogger<NtfyHelper> _logger = Substitute.For<ILogger<NtfyHelper>>();
public NtfyHelperTests()
{
}
[SetUp]
public void Setup()
{
var client = new HttpClient(new MockHttpMessageHandler(HttpStatusCode.OK));
client.BaseAddress = new Uri("https://unit.test.com/");
_clientFactory.CreateClient(Arg.Any<string>()).Returns(client);
_config.GetOrDefault("Notifications:Ntfy:Enabled", Arg.Any<bool>()).Returns(true);
_config.GetOrDefault("Notifications:Ntfy:Endpoint", Arg.Any<string>()).Returns("https://unit.test.com/");
_config.GetOrDefault("Notifications:Ntfy:Token", Arg.Any<string>()).Returns("UnitTest");
_config.GetOrDefault("Notifications:Ntfy:Topic", Arg.Any<string>()).Returns("UnitTest");
_config.GetOrDefault("Notifications:Ntfy:Priority", Arg.Any<int>()).Returns(4);
}
[TestCase("unit", "test")]
public async Task NtfyHelper_Success(string title, string message)
{
var actual = await new NtfyHelper(_config, _clientFactory, _logger).Send(title, message);
Assert.That(actual, Is.EqualTo(true));
}
[TestCase(true, true)]
[TestCase(false, false)]
public async Task NtfyHelper_Enabled(bool enabled, bool expected)
{
_config.GetOrDefault("Notifications:Ntfy:Enabled", Arg.Any<bool>()).Returns(enabled);
var actual = await new NtfyHelper(_config, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(null, false)]
[TestCase("http://unittest.com", true)]
[TestCase("https://unittest.com", true)]
public async Task NtfyHelper_Endpoint(string? endpoint, bool expected)
{
var client = new HttpClient(new MockHttpMessageHandler(HttpStatusCode.OK));
client.BaseAddress = endpoint != null ? new Uri(endpoint) : null;
_clientFactory.CreateClient(Arg.Any<string>()).Returns(client);
var actual = await new NtfyHelper(_config, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(null, false)]
[TestCase("", false)]
[TestCase("UnitTest", true)]
public async Task NtfyHelper_Token(string? token, bool expected)
{
_config.GetOrDefault("Notifications:Ntfy:Token", Arg.Any<string>()).Returns(token);
var actual = await new NtfyHelper(_config, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(null, false)]
[TestCase("", false)]
[TestCase("UnitTest", true)]
public async Task NtfyHelper_Topic(string? topic, bool expected)
{
_config.GetOrDefault("Notifications:Ntfy:Topic", Arg.Any<string>()).Returns(topic);
var actual = await new NtfyHelper(_config, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase(-100, false)]
[TestCase(-1, false)]
[TestCase(0, false)]
[TestCase(1, true)]
[TestCase(100, true)]
public async Task NtfyHelper_Priority(int priority, bool expected)
{
_config.GetOrDefault("Notifications:Ntfy:Priority", Arg.Any<int>()).Returns(priority);
var actual = await new NtfyHelper(_config, _clientFactory, _logger).Send("unit", "test");
Assert.That(actual, Is.EqualTo(expected));
}
}
}

View File

@@ -0,0 +1,136 @@
using Microsoft.AspNetCore.Http;
using WeddingShare.Helpers;
using WeddingShare.UnitTests.Helpers;
namespace WeddingShare.UnitTests.Tests.Helpers
{
public class UrlHelperTests
{
private readonly IConfigHelper _config = Substitute.For<IConfigHelper>();
private readonly IGalleryHelper _gallery = Substitute.For<IGalleryHelper>();
public UrlHelperTests()
{
}
[SetUp]
public void Setup()
{
_config.GetOrDefault("Settings:Force_Https", Arg.Any<bool>()).Returns(false);
}
[TestCase("http", "unittest.com", null, "http://unittest.com/")]
[TestCase("https", "unittest.org", null, "https://unittest.org/")]
[TestCase("http", "www.unittest.com", null, "http://www.unittest.com/")]
[TestCase("https", "mobile.unittest.org", null, "https://mobile.unittest.org/")]
[TestCase("http", "unittest.com", "", "http://unittest.com/")]
[TestCase("https", "unittest.org", "", "https://unittest.org/")]
[TestCase("http", "www.unittest.com", "", "http://www.unittest.com/")]
[TestCase("https", "mobile.unittest.org", "", "https://mobile.unittest.org/")]
[TestCase("http", "unittest.com", "/unittest", "http://unittest.com/unittest")]
[TestCase("https", "unittest.org", "?unit=test", "https://unittest.org/?unit=test")]
[TestCase("http", "www.unittest.com", "?unit=test&blaa=test", "http://www.unittest.com/?unit=test&blaa=test")]
[TestCase("https", "mobile.unittest.org", "/unittest?unit=test&blaa=test", "https://mobile.unittest.org/unittest?unit=test&blaa=test")]
public void UrlHelper_GenerateBaseUrl(string scheme, string host, string? querystring, string expected)
{
_config.GetOrDefault("Settings:Base_Url", Arg.Any<string>()).Returns(host);
var mockContext = MockData.MockHttpContext();
mockContext.Request.Scheme = scheme;
mockContext.Request.Host = new HostString(host);
var actual = new UrlHelper(_config).GenerateBaseUrl(mockContext?.Request, querystring);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("?a=123&b=456&c=789", "d=111", "", "?a=123&b=456&c=789&d=111")]
[TestCase("?a=123&b=456&c=789", "d=111,e=222", "", "?a=123&b=456&c=789&d=111&e=222")]
[TestCase("?a=123&b=456&c=789", "e=222,f=333,d=111", "", "?a=123&b=456&c=789&e=222&f=333&d=111")]
[TestCase("?a=123&b=456&c=789", "d=t$&", "", "?a=123&b=456&c=789&d=t%24%26")]
public void UrlHelper_GenerateQueryString_Append(string queryString, string append, string exclude, string expected)
{
var mockContext = MockData.MockHttpContext();
mockContext.Request.Scheme = "https";
mockContext.Request.Host = new HostString("unit.test.com");
mockContext.Request.QueryString = new QueryString(queryString);
var include = append?.Split(',', StringSplitOptions.RemoveEmptyEntries)?.Select(x => {
var val = x.Split('=');
return new KeyValuePair<string, string>(val.FirstOrDefault() ?? "default", val.LastOrDefault() ?? "default");
})?.ToList();
var actual = new UrlHelper(_config).GenerateQueryString(mockContext?.Request, include, exclude?.Split(',', StringSplitOptions.RemoveEmptyEntries)?.ToList());
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("?a=123&b=456&c=789", "", "", "?a=123&b=456&c=789")]
[TestCase("?a=123&b=456&c=789", "", "d", "?a=123&b=456&c=789")]
[TestCase("?a=123&b=456&c=789", "", "a", "?b=456&c=789")]
[TestCase("?a=123&b=456&c=789", "", "b", "?a=123&c=789")]
[TestCase("?a=123&b=456&c=789", "", "c", "?a=123&b=456")]
public void UrlHelper_GenerateQueryString_Exclude(string queryString, string append, string exclude, string expected)
{
var mockContext = MockData.MockHttpContext();
mockContext.Request.Scheme = "https";
mockContext.Request.Host = new HostString("unit.test.com");
mockContext.Request.QueryString = new QueryString(queryString);
var include = append?.Split(',', StringSplitOptions.RemoveEmptyEntries)?.Select(x => {
var val = x.Split('=');
return new KeyValuePair<string, string>(val.FirstOrDefault() ?? "default", val.LastOrDefault() ?? "default");
})?.ToList();
var actual = new UrlHelper(_config).GenerateQueryString(mockContext?.Request, include, exclude?.Split(',', StringSplitOptions.RemoveEmptyEntries)?.ToList());
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("?a=123&b=456&c=789", "d=111", "a", "?b=456&c=789&d=111")]
[TestCase("?a=123&b=456&c=789", "d=111,e=222", "b", "?a=123&c=789&d=111&e=222")]
[TestCase("?a=123&b=456&c=789", "e=222,f=333,d=111", "c", "?a=123&b=456&e=222&f=333&d=111")]
[TestCase("?a=123&b=456&c=789", "d=111,e=222,f=333", "e", "?a=123&b=456&c=789&d=111&e=222&f=333")]
public void UrlHelper_GenerateQueryString_AppendExclude(string queryString, string append, string exclude, string expected)
{
var mockContext = MockData.MockHttpContext();
mockContext.Request.Scheme = "https";
mockContext.Request.Host = new HostString("unit.test.com");
mockContext.Request.QueryString = new QueryString(queryString);
var include = append?.Split(',', StringSplitOptions.RemoveEmptyEntries)?.Select(x => {
var val = x.Split('=');
return new KeyValuePair<string, string>(val.FirstOrDefault() ?? "default", val.LastOrDefault() ?? "default");
})?.ToList();
var actual = new UrlHelper(_config).GenerateQueryString(mockContext?.Request, include, exclude?.Split(',', StringSplitOptions.RemoveEmptyEntries)?.ToList());
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("unit.test.com", "unit.test.com")]
[TestCase("unit.test.com/", "unit.test.com")]
[TestCase("http://unit.test.com", "unit.test.com")]
[TestCase("http://unit.test.com/", "unit.test.com")]
[TestCase("https://unit.test.com", "unit.test.com")]
[TestCase("https://unit.test.com/", "unit.test.com")]
[TestCase("http://test.com/", "test.com")]
[TestCase("https://test.com/", "test.com")]
public void UrlHelper_ExtractHost(string host, string expected)
{
var actual = new UrlHelper(_config).ExtractHost(host);
Assert.That(actual, Is.EqualTo(expected));
}
[TestCase("?a=123&b=456&c=789", "a", "123")]
[TestCase("?a=123&b=456&c=789", "b", "456")]
[TestCase("?a=123&b=456&c=789", "c", "789")]
[TestCase("?a=123&b=456&c=789", "d", "")]
public void UrlHelper_ExtractHost(string queryString, string key, string expected)
{
var mockContext = MockData.MockHttpContext();
mockContext.Request.Scheme = "https";
mockContext.Request.Host = new HostString("unit.test.com");
mockContext.Request.QueryString = new QueryString(queryString);
var actual = new UrlHelper(_config).ExtractQueryValue(mockContext?.Request, key);
Assert.That(actual, Is.EqualTo(expected));
}
}
}

View File

@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WeddingShare\WeddingShare.csproj" />
</ItemGroup>
</Project>

View File

@@ -5,6 +5,8 @@ VisualStudioVersion = 17.8.34511.84
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WeddingShare", "WeddingShare\WeddingShare.csproj", "{1E5B4227-C87D-42DA-9946-4F86C9034F35}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeddingShare.UnitTests", "WeddingShare.UnitTests\WeddingShare.UnitTests.csproj", "{B1BAAF2F-454D-4B57-AD6B-9701D73EB8C6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
{1E5B4227-C87D-42DA-9946-4F86C9034F35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E5B4227-C87D-42DA-9946-4F86C9034F35}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E5B4227-C87D-42DA-9946-4F86C9034F35}.Release|Any CPU.Build.0 = Release|Any CPU
{B1BAAF2F-454D-4B57-AD6B-9701D73EB8C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1BAAF2F-454D-4B57-AD6B-9701D73EB8C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1BAAF2F-454D-4B57-AD6B-9701D73EB8C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1BAAF2F-454D-4B57-AD6B-9701D73EB8C6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -0,0 +1,52 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Database;
namespace WeddingShare.Attributes
{
public class AllowGuestCreateAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
try
{
var request = filterContext.HttpContext.Request;
var galleryId = (request.Query.ContainsKey("id") && !string.IsNullOrWhiteSpace(request.Query["id"])) ? request.Query["id"].ToString().ToLower() : "default";
if (!string.Equals("default", galleryId, StringComparison.OrdinalIgnoreCase))
{
var user = filterContext?.HttpContext?.User;
if (user?.Identity == null || !user.Identity.IsAuthenticated)
{
var configHelper = filterContext.HttpContext.RequestServices.GetService<IConfigHelper>();
if (configHelper != null)
{
if (configHelper.GetOrDefault("Settings:Disable_Guest_Gallery_Creation", true))
{
var databaseHelper = filterContext.HttpContext.RequestServices.GetService<IDatabaseHelper>();
if (databaseHelper != null)
{
var gallery = databaseHelper.GetGallery(galleryId).Result;
if (gallery == null)
{
filterContext.Result = new RedirectToActionResult("Index", "Error", new { Reason = ErrorCode.GalleryCreationNotAllowed }, false);
}
}
}
}
}
}
}
catch (Exception ex)
{
var logger = filterContext.HttpContext.RequestServices.GetService<ILogger<RequiresSecretKeyAttribute>>();
if (logger != null)
{
logger.LogError(ex, $"Failed to check guest creation - {ex?.Message}");
}
}
}
}
}

View File

@@ -0,0 +1,66 @@
using System.Web;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using WeddingShare.Helpers;
namespace WeddingShare.Attributes
{
public class RequiresSecretKeyAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
try
{
var request = filterContext.HttpContext.Request;
var galleryHelper = filterContext.HttpContext.RequestServices.GetService<IGalleryHelper>();
if (galleryHelper != null)
{
var galleryId = (request.Query.ContainsKey("id") && !string.IsNullOrWhiteSpace(request.Query["id"])) ? request.Query["id"].ToString().ToLower() : "default";
var encryptionHelper = filterContext.HttpContext.RequestServices.GetService<IEncryptionHelper>();
if (encryptionHelper != null)
{
var key = request.Query.ContainsKey("key") ? request.Query["key"].ToString() : string.Empty;
var isEncrypted = request.Query.ContainsKey("enc") ? bool.Parse(request.Query["enc"].ToString().ToLower()) : false;
if (!isEncrypted && !string.IsNullOrWhiteSpace(key) && encryptionHelper.IsEncryptionEnabled())
{
var queryString = HttpUtility.ParseQueryString(request.QueryString.ToString());
queryString.Set("enc", "true");
queryString.Set("key", encryptionHelper.Encrypt(key));
filterContext.Result = new RedirectResult($"/Gallery?{queryString.ToString()}");
}
else
{
var secretKey = galleryHelper.GetSecretKey(galleryId).Result ?? string.Empty;
if (!string.IsNullOrWhiteSpace(secretKey))
{
secretKey = encryptionHelper.IsEncryptionEnabled() ? encryptionHelper.Encrypt(secretKey) : secretKey;
if (!string.IsNullOrWhiteSpace(secretKey) && !string.Equals(secretKey, key))
{
var logger = filterContext.HttpContext.RequestServices.GetService<ILogger<RequiresSecretKeyAttribute>>();
if (logger != null)
{
logger.LogWarning($"A request was made to an endpoint with an invalid secure key");
}
filterContext.Result = new RedirectToActionResult("Index", "Error", new { Reason = ErrorCode.InvalidSecretKey }, false);
}
}
}
}
}
}
catch (Exception ex)
{
var logger = filterContext.HttpContext.RequestServices.GetService<ILogger<RequiresSecretKeyAttribute>>();
if (logger != null)
{
logger.LogError(ex, $"Failed to validate secure key - {ex?.Message}");
}
}
}
}
}

View File

@@ -0,0 +1,52 @@
using NCrontab;
using WeddingShare.Helpers;
namespace WeddingShare.BackgroundWorkers
{
public sealed class CleanupService(IWebHostEnvironment hostingEnvironment, IConfigHelper configHelper, IFileHelper fileHelper, ILogger<CleanupService> logger) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
var cron = configHelper.GetOrDefault("BackgroundServices:Schedules:Cleanup", "0 4 * * *");
var schedule = CrontabSchedule.Parse(cron, new CrontabSchedule.ParseOptions() { IncludingSeconds = cron.Split(new[] { ' ' }, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).Length == 6 });
await Task.Delay((int)TimeSpan.FromSeconds(10).TotalMilliseconds, stoppingToken);
while (!stoppingToken.IsCancellationRequested)
{
var now = DateTime.Now;
var nextExecutionTime = schedule.GetNextOccurrence(now);
var waitTime = nextExecutionTime - now;
await Task.Delay(waitTime, stoppingToken);
await Cleanup();
}
}
private async Task Cleanup()
{
await Task.Run(() =>
{
var paths = new List<string>()
{
Path.Combine(hostingEnvironment.WebRootPath, "temp")
};
if (paths != null)
{
foreach (var path in paths)
{
try
{
fileHelper.DeleteDirectoryIfExists(path);
}
catch (Exception ex)
{
logger.LogError(ex, $"An error occurred while running cleanup of '{path}'");
}
}
}
});
}
}
}

View File

@@ -0,0 +1,163 @@
using NCrontab;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using WeddingShare.Enums;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Database;
using WeddingShare.Models.Database;
namespace WeddingShare.BackgroundWorkers
{
public sealed class DirectoryScanner(IWebHostEnvironment hostingEnvironment, IConfigHelper configHelper, IGalleryHelper galleryHelper, IDatabaseHelper databaseHelper, IFileHelper fileHelper, IImageHelper imageHelper, ILogger<DirectoryScanner> logger) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
var cron = configHelper.GetOrDefault("BackgroundServices:Schedules:Directory_Scanner", "*/30 * * * *");
var schedule = CrontabSchedule.Parse(cron, new CrontabSchedule.ParseOptions() { IncludingSeconds = cron.Split(new[] { ' ' }, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).Length == 6 });
await Task.Delay((int)TimeSpan.FromSeconds(10).TotalMilliseconds, stoppingToken);
await ScanForFiles();
while (!stoppingToken.IsCancellationRequested)
{
var now = DateTime.Now;
var nextExecutionTime = schedule.GetNextOccurrence(now);
var waitTime = nextExecutionTime - now;
await Task.Delay(waitTime, stoppingToken);
await ScanForFiles();
}
}
private async Task ScanForFiles()
{
await Task.Run(async () =>
{
if (Startup.Ready)
{
var thumbnailsDirectory = Path.Combine(hostingEnvironment.WebRootPath, "thumbnails");
fileHelper.CreateDirectoryIfNotExists(thumbnailsDirectory);
var uploadsDirectory = Path.Combine(hostingEnvironment.WebRootPath, "uploads");
if (fileHelper.DirectoryExists(uploadsDirectory))
{
var searchPattern = !configHelper.GetOrDefault("Settings:Single_Gallery_Mode", false) ? "*" : "default";
var galleries = fileHelper.GetDirectories(uploadsDirectory, searchPattern, SearchOption.TopDirectoryOnly)?.Where(x => !Path.GetFileName(x).StartsWith("."));
if (galleries != null)
{
foreach (var gallery in galleries)
{
try
{
var id = Path.GetFileName(gallery).ToLower();
var galleryItem = await databaseHelper.GetGallery(id);
if (galleryItem == null)
{
galleryItem = await databaseHelper.AddGallery(new GalleryModel()
{
Name = id
});
}
if (galleryItem != null)
{
var allowedFileTypes = galleryHelper.GetConfig(galleryItem.Name, "Gallery:Allowed_File_Types", ".jpg,.jpeg,.png,.mp4,.mov").Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
var galleryItems = await databaseHelper.GetAllGalleryItems(galleryItem.Id);
if (Path.Exists(gallery))
{
var approvedFiles = fileHelper.GetFiles(gallery, "*.*", SearchOption.TopDirectoryOnly).Where(x => allowedFileTypes.Any(y => string.Equals(Path.GetExtension(x).Trim('.'), y.Trim('.'), StringComparison.OrdinalIgnoreCase)));
if (approvedFiles != null)
{
foreach (var file in approvedFiles)
{
try
{
var filename = Path.GetFileName(file);
if (!galleryItems.Exists(x => string.Equals(x.Title, filename, StringComparison.OrdinalIgnoreCase)))
{
await databaseHelper.AddGalleryItem(new GalleryItemModel()
{
GalleryId = galleryItem.Id,
Title = filename,
Checksum = await fileHelper.GetChecksum(file),
MediaType = imageHelper.GetMediaType(file),
State = GalleryItemState.Approved
});
}
var thumbnailPath = Path.Combine(thumbnailsDirectory, $"{Path.GetFileNameWithoutExtension(file)}.webp");
if (!fileHelper.FileExists(thumbnailPath))
{
await imageHelper.GenerateThumbnail(file, thumbnailPath, configHelper.GetOrDefault("Settings:Thumbnail_Size", 720));
}
else
{
using (var img = await Image.LoadAsync(thumbnailPath))
{
var width = img.Width;
img.Mutate(x => x.AutoOrient());
if (width != img.Width)
{
await img.SaveAsWebpAsync(thumbnailPath);
}
}
}
}
catch (Exception ex)
{
logger.LogError(ex, $"An error occurred while scanning file '{file}'");
}
}
}
if (Path.Exists(Path.Combine(gallery, "Pending")))
{
var pendingFiles = fileHelper.GetFiles(Path.Combine(gallery, "Pending"), "*.*", SearchOption.TopDirectoryOnly).Where(x => allowedFileTypes.Any(y => string.Equals(Path.GetExtension(x).Trim('.'), y.Trim('.'), StringComparison.OrdinalIgnoreCase)));
if (pendingFiles != null)
{
foreach (var file in pendingFiles)
{
try
{
var filename = Path.GetFileName(file);
if (!galleryItems.Exists(x => string.Equals(x.Title, filename, StringComparison.OrdinalIgnoreCase)))
{
await databaseHelper.AddGalleryItem(new GalleryItemModel()
{
GalleryId = galleryItem.Id,
Title = filename,
Checksum = await fileHelper.GetChecksum(file),
MediaType = imageHelper.GetMediaType(file),
State = GalleryItemState.Pending
});
}
}
catch (Exception ex)
{
logger.LogError(ex, $"An error occurred while scanning file '{file}'");
}
}
}
}
}
}
}
catch (Exception ex)
{
logger.LogError(ex, $"An error occurred while scanning directory '{gallery}'");
}
}
}
}
}
else
{
logger.LogInformation($"Skipping directory scan, application not ready yet");
}
});
}
}
}

View File

@@ -0,0 +1,61 @@
using System.Text;
using NCrontab;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Database;
using WeddingShare.Helpers.Notifications;
namespace WeddingShare.BackgroundWorkers
{
public sealed class NotificationReport(IConfigHelper configHelper, IDatabaseHelper databaseHelper, ISmtpClientWrapper smtpHelper, ILoggerFactory loggerFactory) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
if (configHelper.GetOrDefault("Settings:Email_Report", true) && configHelper.GetOrDefault("Notifications:Smtp:Enabled", false))
{
var cron = configHelper.GetOrDefault("BackgroundServices:Schedules:Email_Report", "0 0 * * *");
var schedule = CrontabSchedule.Parse(cron, new CrontabSchedule.ParseOptions() { IncludingSeconds = cron.Split(new[] { ' ' }, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries).Length == 6 });
while (!stoppingToken.IsCancellationRequested)
{
var now = DateTime.Now;
var nextExecutionTime = schedule.GetNextOccurrence(now);
var waitTime = nextExecutionTime - now;
await Task.Delay(waitTime, stoppingToken);
await SendReport();
}
}
}
private async Task SendReport()
{
await Task.Run(async () =>
{
var pendingItems = await databaseHelper.GetPendingGalleryItems();
if (pendingItems != null && pendingItems.Any())
{
var builder = new StringBuilder();
builder.AppendLine($"<h1>You have items pending review!</h1>");
foreach (var item in pendingItems.GroupBy(x => x.GalleryName).OrderBy(x => x.Key))
{
try
{
builder.AppendLine($"<p style=\"font-size: 16pt;\">{item.Key} - Pending Items ({item.Count()})</p>");
}
catch (Exception ex)
{
loggerFactory.CreateLogger<NotificationReport>().LogError(ex, $"Failed to build gallery report for id '{item?.Key}' - {ex?.Message}");
}
}
var sent = await new EmailHelper(configHelper, smtpHelper, loggerFactory.CreateLogger<EmailHelper>()).Send("Pending Items Report", builder.ToString());
if (!sent)
{
loggerFactory.CreateLogger<NotificationReport>().LogWarning($"Failed to send notification report");
}
}
});
}
}
}

View File

@@ -0,0 +1,26 @@
using WeddingShare.Helpers;
using WeddingShare.Helpers.Database;
using WeddingShare.Helpers.Dbup;
namespace WeddingShare.Configurations
{
internal static class DatabaseConfiguration
{
public static void AddDatabaseConfiguration(this IServiceCollection services, ConfigHelper config)
{
switch (config.GetOrDefault("Settings:Database:Type", "sqlite")?.ToLower())
{
case "sqlite":
services.AddSingleton<IDatabaseHelper, SQLiteDatabaseHelper>();
break;
case "mysql":
services.AddSingleton<IDatabaseHelper, MySqlDatabaseHelper>();
break;
default:
break;
}
services.AddHostedService<DbupMigrator>();
}
}
}

View File

@@ -0,0 +1,20 @@
using WeddingShare.Helpers;
namespace WeddingShare.Configurations
{
internal static class DependencyInjectionConfiguration
{
public static void AddDependencyInjectionConfiguration(this IServiceCollection services)
{
services.AddSingleton<IConfigHelper, ConfigHelper>();
services.AddSingleton<IEnvironmentWrapper, EnvironmentWrapper>();
services.AddSingleton<IGalleryHelper, GalleryHelper>();
services.AddSingleton<IImageHelper, ImageHelper>();
services.AddSingleton<IFileHelper, FileHelper>();
services.AddSingleton<IDeviceDetector, DeviceDetector>();
services.AddSingleton<ISmtpClientWrapper, SmtpClientWrapper>();
services.AddSingleton<IEncryptionHelper, EncryptionHelper>();
services.AddSingleton<IUrlHelper, UrlHelper>();
}
}
}

View File

@@ -0,0 +1,66 @@
using Microsoft.AspNetCore.Localization;
using System.Globalization;
using WeddingShare.Helpers;
namespace WeddingShare.Configurations
{
public static class LocalizationConfiguration
{
public static string CurrentCulture = "en-GB";
public static void AddLocalizationConfiguration(this IServiceCollection services, ConfigHelper config)
{
services.AddLocalization(options =>
{
options.ResourcesPath = "Resources";
});
services.Configure<RequestLocalizationOptions>(options => {
var language = config.GetOrDefault("Settings:Language", string.Empty);
var supportedCultures = new[]
{
new CultureInfo("en-GB"),
new CultureInfo("fr-FR"),
new CultureInfo("de-DE"),
new CultureInfo("nl-NL"),
new CultureInfo("es-ES"),
new CultureInfo("sv-SE")
};
CurrentCulture = GetDefaultCulture(supportedCultures, language);
if (!string.IsNullOrWhiteSpace(language) && !string.Equals("en-GB", CurrentCulture, StringComparison.OrdinalIgnoreCase))
{
supportedCultures = supportedCultures?.Where(x => CultureMatches(x, CurrentCulture))?.ToArray();
}
options.DefaultRequestCulture = new RequestCulture(CurrentCulture);
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
});
}
private static string GetDefaultCulture(CultureInfo[] supported, string key)
{
try
{
foreach (var culture in supported)
{
if (CultureMatches(culture, key))
{
return culture.Name;
}
}
}
catch
{
}
return "en-GB";
}
private static bool CultureMatches(CultureInfo culture, string key)
{
return string.Equals(culture.Name, key, StringComparison.OrdinalIgnoreCase) || string.Equals(culture.ThreeLetterISOLanguageName, key, StringComparison.OrdinalIgnoreCase) || string.Equals(culture.TwoLetterISOLanguageName, key, StringComparison.OrdinalIgnoreCase);
}
}
}

View File

@@ -0,0 +1,50 @@
using System.Net.Http.Headers;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Notifications;
namespace WeddingShare.Configurations
{
internal static class NotificationConfiguration
{
private const int CLIENT_DEFAULT_TIMEOUT = 10;
public static void AddNotificationConfiguration(this IServiceCollection services, ConfigHelper config)
{
services.AddSingleton<INotificationHelper, NotificationBroker>();
services.AddNtfyConfiguration(config);
services.AddGotifyConfiguration(config);
}
public static void AddNtfyConfiguration(this IServiceCollection services, ConfigHelper config)
{
services.AddHttpClient("NtfyClient", (serviceProvider, httpClient) =>
{
var endpoint = config.GetOrDefault("Notifications:Ntfy:Endpoint", string.Empty);
if (!string.IsNullOrWhiteSpace(endpoint))
{
var token = config.GetOrDefault("Notifications:Ntfy:Token", string.Empty);
if (!string.IsNullOrWhiteSpace(token))
{
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
}
httpClient.BaseAddress = new Uri(endpoint);
httpClient.Timeout = TimeSpan.FromSeconds(CLIENT_DEFAULT_TIMEOUT);
}
});
}
public static void AddGotifyConfiguration(this IServiceCollection services, ConfigHelper config)
{
services.AddHttpClient("GotifyClient", (serviceProvider, httpClient) =>
{
var endpoint = config.GetOrDefault("Notifications:Gotify:Endpoint", string.Empty);
if (!string.IsNullOrWhiteSpace(endpoint))
{
httpClient.BaseAddress = new Uri(endpoint);
httpClient.Timeout = TimeSpan.FromSeconds(CLIENT_DEFAULT_TIMEOUT);
}
});
}
}
}

View File

@@ -1,13 +1,18 @@
using System.IO.Compression;
using System.Security.Claims;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using TwoFactorAuthNet;
using WeddingShare.Enums;
using WeddingShare.Helpers;
using WeddingShare.Views.Admin;
using WeddingShare.Helpers.Database;
using WeddingShare.Helpers.Notifications;
using WeddingShare.Models;
using WeddingShare.Models.Database;
using WeddingShare.Views.Admin;
namespace WeddingShare.Controllers
{
@@ -16,40 +21,80 @@ namespace WeddingShare.Controllers
{
private readonly IWebHostEnvironment _hostingEnvironment;
private readonly IConfigHelper _config;
private readonly IDatabaseHelper _database;
private readonly IDeviceDetector _deviceDetector;
private readonly IFileHelper _fileHelper;
private readonly INotificationHelper _notificationHelper;
private readonly Helpers.IUrlHelper _url;
private readonly ILogger _logger;
private readonly IStringLocalizer<AdminController> _localizer;
private readonly IStringLocalizer<Lang.Translations> _localizer;
private readonly string TempDirectory;
private readonly string UploadsDirectory;
private readonly string ThumbnailsDirectory;
public AdminController(IWebHostEnvironment hostingEnvironment, IConfigHelper config, ILogger<AdminController> logger, IStringLocalizer<AdminController> localizer)
public AdminController(IWebHostEnvironment hostingEnvironment, IConfigHelper config, IDatabaseHelper database, IDeviceDetector deviceDetector, IFileHelper fileHelper, INotificationHelper notificationHelper, Helpers.IUrlHelper url, ILogger<AdminController> logger, IStringLocalizer<Lang.Translations> localizer)
{
_hostingEnvironment = hostingEnvironment;
_config = config;
_database = database;
_deviceDetector = deviceDetector;
_fileHelper = fileHelper;
_notificationHelper = notificationHelper;
_url = url;
_logger = logger;
_localizer = localizer;
TempDirectory = Path.Combine(_hostingEnvironment.WebRootPath, "temp");
UploadsDirectory = Path.Combine(_hostingEnvironment.WebRootPath, "uploads");
ThumbnailsDirectory = Path.Combine(_hostingEnvironment.WebRootPath, "thumbnails");
}
[AllowAnonymous]
[HttpGet]
public IActionResult Login()
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
return RedirectToAction("Index", "Admin");
}
return View();
}
[AllowAnonymous]
[ValidateAntiForgeryToken]
[HttpPost]
public async Task<IActionResult> Login(LoginModel model)
{
try
{
var passkey = _config.Get("Settings", "Admin_Password");
if (string.IsNullOrEmpty(passkey) || string.Equals(passkey, model?.Password))
var user = await _database.GetUser(model.Username);
if (user != null && !user.IsLockedOut)
{
var claims = new List<Claim>
if (await _database.ValidateCredentials(user.Username, model.Password))
{
new Claim(ClaimTypes.Name, "Admin")
};
if (user.FailedLogins > 0)
{
await _database.ResetLockoutCount(user.Id);
}
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
var mfaSet = !string.IsNullOrEmpty(user.MultiFactorToken);
HttpContext.Session.SetString(SessionKey.MultiFactorTokenSet, mfaSet.ToString().ToLower());
await this.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(claimsIdentity));
return Json(new { success = true });
if (mfaSet)
{
return Json(new { success = true, mfa = true });
}
else
{
return Json(new { success = await this.SetUserClaims(this.HttpContext, user), mfa = false });
}
}
else
{
await this.FailedLoginDetected(model, user);
}
}
}
catch (Exception ex)
@@ -57,7 +102,57 @@ namespace WeddingShare.Controllers
_logger.LogError(ex, $"{_localizer["Login_Failed"].Value} - {ex?.Message}");
}
return Json(new { success = false, message = "Invalid password" });
return Json(new { success = false });
}
[AllowAnonymous]
[ValidateAntiForgeryToken]
[HttpPost]
public async Task<IActionResult> ValidateMultifactorAuth(LoginModel model)
{
if (!string.IsNullOrWhiteSpace(model?.Code))
{
try
{
var user = await _database.GetUser(model.Username);
if (user != null && !user.IsLockedOut)
{
if (await _database.ValidateCredentials(user.Username, model.Password))
{
if (user.FailedLogins > 0)
{
await _database.ResetLockoutCount(user.Id);
}
var mfaSet = !string.IsNullOrWhiteSpace(user.MultiFactorToken);
HttpContext.Session.SetString(SessionKey.MultiFactorTokenSet, (!string.IsNullOrEmpty(user.MultiFactorToken)).ToString().ToLower());
if (mfaSet)
{
var tfa = new TwoFactorAuth(_config.GetOrDefault("Settings:Title", "WeddingShare"));
if (tfa.VerifyCode(user.MultiFactorToken, model.Code))
{
return Json(new { success = await this.SetUserClaims(this.HttpContext, user) });
}
}
else
{
return Json(new { success = await this.SetUserClaims(this.HttpContext, user) });
}
}
else
{
await this.FailedLoginDetected(model, user);
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Login_Failed"].Value} - {ex?.Message}");
}
}
return Json(new { success = false });
}
[Authorize]
@@ -69,7 +164,7 @@ namespace WeddingShare.Controllers
}
[HttpGet]
public IActionResult Index()
public async Task<IActionResult> Index()
{
if (User?.Identity == null || !User.Identity.IsAuthenticated)
{
@@ -78,12 +173,43 @@ namespace WeddingShare.Controllers
var model = new IndexModel();
var deviceType = HttpContext.Session.GetString(SessionKey.DeviceType);
if (string.IsNullOrWhiteSpace(deviceType))
{
deviceType = (await _deviceDetector.ParseDeviceType(Request.Headers["User-Agent"].ToString())).ToString();
HttpContext.Session.SetString(SessionKey.DeviceType, deviceType ?? "Desktop");
}
try
{
if (Directory.Exists(UploadsDirectory))
{
model.Galleries = Directory.GetDirectories(UploadsDirectory)?.Select(x => new KeyValuePair<string, string>(Path.GetFileName(x), x))?.ToList();
model.PendingRequests = model.Galleries?.SelectMany(x => Directory.GetFiles(Path.Combine(x.Value, "Pending"), "*.*", SearchOption.TopDirectoryOnly))?.Select(x => x.Replace(UploadsDirectory, string.Empty))?.ToList();
var user = await _database.GetUser(int.Parse(((ClaimsIdentity)User.Identity).Claims.FirstOrDefault(x => string.Equals(ClaimTypes.Sid, x.Type, StringComparison.OrdinalIgnoreCase))?.Value ?? "-1"));
if (user != null)
{
if (!_config.GetOrDefault("Settings:Single_Gallery_Mode", false))
{
model.Galleries = await _database.GetAllGalleries();
if (model.Galleries != null)
{
var all = await _database.GetGallery(0);
if (all != null)
{
model.Galleries.Add(all);
}
}
model.PendingRequests = await _database.GetPendingGalleryItems();
}
else
{
var gallery = await _database.GetGallery("default");
if (gallery != null)
{
model.Galleries = new List<GalleryModel>() { gallery };
model.PendingRequests = await _database.GetPendingGalleryItems(gallery.Id);
}
}
model.Users = await _database.GetAllUsers();
}
}
catch (Exception ex)
@@ -94,24 +220,148 @@ namespace WeddingShare.Controllers
return View(model);
}
[HttpGet]
public async Task<IActionResult> AvailableGalleries()
{
if (User?.Identity == null || !User.Identity.IsAuthenticated)
{
return Redirect("/");
}
List<GalleryModel>? result = null;
try
{
var user = await _database.GetUser(int.Parse(((ClaimsIdentity)User.Identity).Claims.FirstOrDefault(x => string.Equals(ClaimTypes.Sid, x.Type, StringComparison.OrdinalIgnoreCase))?.Value ?? "-1"));
if (user != null)
{
if (!_config.GetOrDefault("Settings:Single_Gallery_Mode", false))
{
result = await _database.GetAllGalleries();
if (result != null)
{
var all = await _database.GetGallery(0);
if (all != null)
{
result.Add(all);
}
}
}
else
{
var gallery = await _database.GetGallery("default");
if (gallery != null)
{
result = new List<GalleryModel>() { gallery };
}
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Gallery_List_Failed"].Value} - {ex?.Message}");
}
return PartialView(result ?? new List<GalleryModel>());
}
[HttpGet]
public async Task<IActionResult> PendingReviews()
{
if (User?.Identity == null || !User.Identity.IsAuthenticated)
{
return Redirect("/");
}
List<GalleryItemModel>? result = null;
try
{
var user = await _database.GetUser(int.Parse(((ClaimsIdentity)User.Identity).Claims.FirstOrDefault(x => string.Equals(ClaimTypes.Sid, x.Type, StringComparison.OrdinalIgnoreCase))?.Value ?? "-1"));
if (user != null)
{
if (!_config.GetOrDefault("Settings:Single_Gallery_Mode", false))
{
result = await _database.GetPendingGalleryItems();
}
else
{
var gallery = await _database.GetGallery("default");
if (gallery != null)
{
result = await _database.GetPendingGalleryItems(gallery.Id);
}
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Pending_Uploads_Failed"].Value} - {ex?.Message}");
}
return PartialView(result ?? new List<GalleryItemModel>());
}
[HttpGet]
public async Task<IActionResult> UsersList()
{
if (User?.Identity == null || !User.Identity.IsAuthenticated)
{
return Redirect("/");
}
List<UserModel>? result = null;
try
{
var user = await _database.GetUser(int.Parse(((ClaimsIdentity)User.Identity).Claims.FirstOrDefault(x => string.Equals(ClaimTypes.Sid, x.Type, StringComparison.OrdinalIgnoreCase))?.Value ?? "-1"));
if (user != null)
{
result = await _database.GetAllUsers();
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Users_List_Failed"].Value} - {ex?.Message}");
}
return PartialView(result ?? new List<UserModel>());
}
[HttpPost]
public IActionResult ReviewPhoto(string galleryId, string photoId, ReviewAction action)
public async Task<IActionResult> ReviewPhoto(int id, ReviewAction action)
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
try
{
var galleryDir = Path.Combine(UploadsDirectory, galleryId);
var reviewFile = Path.Combine(galleryDir, "Pending", photoId);
if (System.IO.File.Exists(reviewFile))
{
var review = await _database.GetPendingGalleryItem(id);
if (review != null)
{
var galleryDir = Path.Combine(UploadsDirectory, review.GalleryName);
var reviewFile = Path.Combine(galleryDir, "Pending", review.Title);
if (action == ReviewAction.APPROVED)
{
System.IO.File.Move(reviewFile, Path.Combine(galleryDir, Path.GetFileName(reviewFile)));
_fileHelper.MoveFileIfExists(reviewFile, Path.Combine(galleryDir, review.Title));
review.State = GalleryItemState.Approved;
await _database.EditGalleryItem(review);
}
else if (action == ReviewAction.REJECTED)
{
System.IO.File.Delete(reviewFile);
var retain = _config.GetOrDefault("Settings:Gallery:Retain_Rejected_Items", false);
if (retain)
{
var rejectedDir = Path.Combine(galleryDir, "Rejected");
_fileHelper.CreateDirectoryIfNotExists(rejectedDir);
_fileHelper.MoveFileIfExists(reviewFile, Path.Combine(rejectedDir, review.Title));
}
else
{
_fileHelper.DeleteFileIfExists(reviewFile);
}
await _database.DeleteGalleryItem(review);
}
else if (action == ReviewAction.UNKNOWN)
{
@@ -127,11 +377,543 @@ namespace WeddingShare.Controllers
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Reviewing_Photo"].Value} - {ex?.Message}");
_logger.LogError(ex, $"{_localizer["Failed_Reviewing_Media"].Value} - {ex?.Message}");
}
}
return Json(new { success = false });
}
[HttpPost]
public async Task<IActionResult> BulkReview(ReviewAction action)
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
try
{
var items = await _database.GetPendingGalleryItems();
if (items != null && items.Any())
{
foreach (var review in items)
{
var galleryDir = Path.Combine(UploadsDirectory, review.GalleryName);
var reviewFile = Path.Combine(galleryDir, "Pending", review.Title);
if (action == ReviewAction.APPROVED)
{
_fileHelper.MoveFileIfExists(reviewFile, Path.Combine(galleryDir, review.Title));
review.State = GalleryItemState.Approved;
await _database.EditGalleryItem(review);
}
else if (action == ReviewAction.REJECTED)
{
var retain = _config.GetOrDefault("Settings:Gallery:Retain_Rejected_Items", false);
if (retain)
{
var rejectedDir = Path.Combine(galleryDir, "Rejected");
_fileHelper.CreateDirectoryIfNotExists(rejectedDir);
_fileHelper.MoveFileIfExists(reviewFile, Path.Combine(rejectedDir, review.Title));
}
else
{
_fileHelper.DeleteFileIfExists(reviewFile);
}
await _database.DeleteGalleryItem(review);
}
else if (action == ReviewAction.UNKNOWN)
{
throw new Exception(_localizer["Unknown_Review_Action"].Value);
}
}
}
return Json(new { success = true, action });
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Reviewing_Media"].Value} - {ex?.Message}");
}
}
return Json(new { success = false });
}
[HttpPost]
public async Task<IActionResult> AddGallery(GalleryModel model)
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
if (!string.IsNullOrWhiteSpace(model?.Name))
{
try
{
var check = await _database.GetGallery(model.Name);
if (check == null)
{
return Json(new { success = string.Equals(model?.Name, (await _database.AddGallery(model))?.Name, StringComparison.OrdinalIgnoreCase) });
}
else
{
return Json(new { success = false, message = _localizer["Gallery_Name_Already_Exists"].Value });
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Add_Gallery"].Value} - {ex?.Message}");
}
}
else
{
return Json(new { success = false, message = _localizer["Name_Cannot_Be_Blank"].Value });
}
}
return Json(new { success = false });
}
[HttpPut]
public async Task<IActionResult> EditGallery(GalleryModel model)
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
if (!string.IsNullOrWhiteSpace(model?.Name))
{
try
{
var check = await _database.GetGallery(model.Name);
if (check == null || model.Id == check.Id)
{
var gallery = await _database.GetGallery(model.Id);
if (gallery != null)
{
gallery.Name = model.Name;
gallery.SecretKey = model.SecretKey;
return Json(new { success = string.Equals(model?.Name, (await _database.EditGallery(gallery))?.Name, StringComparison.OrdinalIgnoreCase) });
}
else
{
return Json(new { success = false, message = _localizer["Failed_Edit_Gallery"].Value });
}
}
else
{
return Json(new { success = false, message = _localizer["Gallery_Name_Already_Exists"].Value });
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Edit_Gallery"].Value} - {ex?.Message}");
}
}
else
{
return Json(new { success = false, message = _localizer["Name_Cannot_Be_Blank"].Value });
}
}
return Json(new { success = false });
}
[HttpDelete]
public async Task<IActionResult> WipeGallery(int id)
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
try
{
var gallery = await _database.GetGallery(id);
if (gallery != null)
{
var galleryDir = Path.Combine(UploadsDirectory, gallery.Name);
if (_fileHelper.DirectoryExists(galleryDir))
{
foreach (var photo in _fileHelper.GetFiles(galleryDir, "*.*", SearchOption.AllDirectories))
{
var thumbnail = Path.Combine(ThumbnailsDirectory, $"{Path.GetFileNameWithoutExtension(photo)}.webp");
_fileHelper.DeleteFileIfExists(thumbnail);
}
_fileHelper.DeleteDirectoryIfExists(galleryDir);
_fileHelper.CreateDirectoryIfNotExists(galleryDir);
if (_config.GetOrDefault("Notifications:Alerts:Destructive_Action", true))
{
await _notificationHelper.Send("Destructive Action Performed", $"The destructive action 'Wipe' was performed on gallery '{gallery.Name}'.", _url.GenerateBaseUrl(HttpContext?.Request, "/Admin"));
}
}
return Json(new { success = await _database.WipeGallery(gallery) });
}
else
{
return Json(new { success = false, message = _localizer["Failed_Wipe_Gallery"].Value });
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Wipe_Gallery"].Value} - {ex?.Message}");
}
}
return Json(new { success = false });
}
[HttpDelete]
public async Task<IActionResult> WipeAllGalleries()
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
try
{
if (_fileHelper.DirectoryExists(UploadsDirectory))
{
foreach (var gallery in _fileHelper.GetDirectories(UploadsDirectory, "*", SearchOption.TopDirectoryOnly))
{
_fileHelper.DeleteDirectoryIfExists(gallery);
}
foreach (var thumbnail in _fileHelper.GetFiles(ThumbnailsDirectory, "*.*", SearchOption.AllDirectories))
{
_fileHelper.DeleteFileIfExists(thumbnail);
}
_fileHelper.CreateDirectoryIfNotExists(Path.Combine(UploadsDirectory, "default"));
if (_config.GetOrDefault("Notifications:Alerts:Destructive_Action", true))
{
await _notificationHelper.Send("Destructive Action Performed", $"The destructive action 'Wipe' was performed on all galleries'.", _url.GenerateBaseUrl(HttpContext?.Request, "/Admin"));
}
}
return Json(new { success = await _database.WipeAllGalleries() });
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Wipe_Galleries"].Value} - {ex?.Message}");
}
}
return Json(new { success = false });
}
[HttpDelete]
public async Task<IActionResult> DeleteGallery(int id)
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
try
{
var gallery = await _database.GetGallery(id);
if (gallery != null && gallery.Id > 1)
{
var galleryDir = Path.Combine(UploadsDirectory, gallery.Name);
_fileHelper.DeleteDirectoryIfExists(galleryDir);
if (_config.GetOrDefault("Notifications:Alerts:Destructive_Action", true))
{
await _notificationHelper.Send("Destructive Action Performed", $"The destructive action 'Delete' was performed on gallery '{gallery.Name}'.", _url.GenerateBaseUrl(HttpContext?.Request, "/Admin"));
}
return Json(new { success = await _database.DeleteGallery(gallery) });
}
else
{
return Json(new { success = false, message = _localizer["Failed_Delete_Gallery"].Value });
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Delete_Gallery"].Value} - {ex?.Message}");
}
}
return Json(new { success = false });
}
[HttpDelete]
public async Task<IActionResult> DeletePhoto(int id)
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
try
{
var photo = await _database.GetGalleryItem(id);
if (photo != null)
{
var gallery = await _database.GetGallery(photo.GalleryId);
if (gallery != null)
{
var photoPath = Path.Combine(UploadsDirectory, gallery.Name, photo.Title);
_fileHelper.DeleteFileIfExists(photoPath);
return Json(new { success = await _database.DeleteGalleryItem(photo) });
}
}
else
{
return Json(new { success = false, message = _localizer["Failed_Delete_Gallery"].Value });
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Delete_Gallery"].Value} - {ex?.Message}");
}
}
return Json(new { success = false });
}
[HttpDelete]
public async Task<IActionResult> DeleteUser(int id)
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
try
{
var user = await _database.GetUser(id);
if (user != null && user.Id > 1)
{
if (_config.GetOrDefault("Notifications:Alerts:Destructive_Action", true))
{
await _notificationHelper.Send("Destructive Action Performed", $"The destructive action 'Delete' was performed on user '{user.Username}'.", _url.GenerateBaseUrl(HttpContext?.Request, "/Admin"));
}
return Json(new { success = await _database.DeleteUser(user) });
}
else
{
return Json(new { success = false, message = _localizer["Failed_Delete_User"].Value });
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Delete_User"].Value} - {ex?.Message}");
}
}
return Json(new { success = false });
}
[HttpGet]
public async Task<IActionResult> ExportBackup()
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
var exportDir = Path.Combine(TempDirectory, "Export");
try
{
if (_fileHelper.DirectoryExists(UploadsDirectory))
{
_fileHelper.CreateDirectoryIfNotExists(TempDirectory);
_fileHelper.DeleteDirectoryIfExists(exportDir);
_fileHelper.CreateDirectoryIfNotExists(exportDir);
var dbExport = Path.Combine(exportDir, $"WeddingShare.bak");
var exported = await _database.Export($"Data Source={dbExport}");
if (exported)
{
var uploadsZip = Path.Combine(exportDir, $"Uploads.bak");
ZipFile.CreateFromDirectory(UploadsDirectory, uploadsZip, CompressionLevel.Optimal, false);
var thumbnailsZip = Path.Combine(exportDir, $"Thumbnails.bak");
ZipFile.CreateFromDirectory(ThumbnailsDirectory, thumbnailsZip, CompressionLevel.Optimal, false);
var exportZipFile = Path.Combine(TempDirectory, $"WeddingShare-{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.zip");
_fileHelper.DeleteFileIfExists(exportZipFile);
ZipFile.CreateFromDirectory(exportDir, exportZipFile, CompressionLevel.Optimal, false);
_fileHelper.DeleteFileIfExists(dbExport);
_fileHelper.DeleteFileIfExists(uploadsZip);
_fileHelper.DeleteFileIfExists(thumbnailsZip);
return Json(new { success = true, filename = $"/temp/{Path.GetFileName(exportZipFile)}" });
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Export"].Value} - {ex?.Message}");
}
finally
{
_fileHelper.DeleteDirectoryIfExists(exportDir);
}
}
return Json(new { success = false });
}
[HttpPost]
public async Task<IActionResult> ImportBackup()
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
var importDir = Path.Combine(TempDirectory, "Import");
try
{
var files = Request?.Form?.Files;
if (files != null && files.Count > 0)
{
foreach (IFormFile file in files)
{
var extension = Path.GetExtension(file.FileName)?.Trim('.');
if (string.Equals("zip", extension, StringComparison.OrdinalIgnoreCase))
{
_fileHelper.CreateDirectoryIfNotExists(TempDirectory);
var filePath = Path.Combine(TempDirectory, "Import.zip");
if (!string.IsNullOrWhiteSpace(filePath))
{
await _fileHelper.SaveFile(file, filePath, FileMode.Create);
_fileHelper.DeleteDirectoryIfExists(importDir);
_fileHelper.CreateDirectoryIfNotExists(importDir);
ZipFile.ExtractToDirectory(filePath, importDir, true);
_fileHelper.DeleteFileIfExists(filePath);
var uploadsZip = Path.Combine(importDir, "Uploads.bak");
ZipFile.ExtractToDirectory(uploadsZip, UploadsDirectory, true);
var thumbnailsZip = Path.Combine(importDir, "Thumbnails.bak");
ZipFile.ExtractToDirectory(thumbnailsZip, ThumbnailsDirectory, true);
var dbImport = Path.Combine(importDir, "WeddingShare.bak");
var imported = await _database.Import($"Data Source={dbImport}");
return Json(new { success = imported });
}
}
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Import_Failed"].Value} - {ex?.Message}");
}
finally
{
_fileHelper.DeleteDirectoryIfExists(importDir);
}
}
return Json(new { success = false });
}
[HttpPost]
public async Task<IActionResult> RegisterMultifactorAuth(string secret, string code)
{
if (!string.IsNullOrWhiteSpace(secret) && !string.IsNullOrWhiteSpace(code))
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
try
{
var tfa = new TwoFactorAuth(_config.GetOrDefault("Settings:Title", "WeddingShare"));
if (tfa.VerifyCode(secret, code))
{
var userId = int.Parse(((ClaimsIdentity)User.Identity).Claims.FirstOrDefault(x => string.Equals(ClaimTypes.Sid, x.Type, StringComparison.OrdinalIgnoreCase))?.Value ?? "-1");
if (userId > 0)
{
var set = await _database.SetMultiFactorToken(userId, secret);
if (set)
{
HttpContext.Session.SetString(SessionKey.MultiFactorTokenSet, "true");
return Json(new { success = true });
}
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["MultiFactor_Token_Set_Failed"].Value} - {ex?.Message}");
}
}
}
return Json(new { success = false });
}
[HttpDelete]
public async Task<IActionResult> ResetMultifactorAuth()
{
if (User?.Identity != null && User.Identity.IsAuthenticated)
{
try
{
var userId = int.Parse(((ClaimsIdentity)User.Identity).Claims.FirstOrDefault(x => string.Equals(ClaimTypes.Sid, x.Type, StringComparison.OrdinalIgnoreCase))?.Value ?? "-1");
if (userId > 0)
{
var cleared = await _database.SetMultiFactorToken(userId, string.Empty);
if (cleared)
{
HttpContext.Session.SetString(SessionKey.MultiFactorTokenSet, "false");
return Json(new { success = true });
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["MultiFactor_Token_Set_Failed"].Value} - {ex?.Message}");
}
}
return Json(new { success = false });
}
private async Task<bool> SetUserClaims(HttpContext ctx, UserModel user)
{
try
{
var claims = new List<Claim>
{
new Claim(ClaimTypes.Sid, user.Id.ToString()),
new Claim(ClaimTypes.Name, user.Username.ToLower())
};
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
await ctx.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(claimsIdentity));
return true;
}
catch
{
return false;
}
}
private async Task<bool> FailedLoginDetected(LoginModel model, UserModel user)
{
try
{
if (_config.GetOrDefault("Notifications:Alerts:Failed_Login", true))
{
await _notificationHelper.Send("Invalid Login Detected", $"An invalid login attempt was made for account '{model?.Username}'.", _url.GenerateBaseUrl(HttpContext?.Request, "/Admin"));
}
var failedAttempts = await _database.IncrementLockoutCount(user.Id);
if (failedAttempts >= _config.GetOrDefault("Settings:Account:Lockout_Attempts", 5))
{
var timeout = _config.GetOrDefault("Settings:Account:Lockout_Mins", 60);
await _database.SetLockout(user.Id, DateTime.UtcNow.AddMinutes(timeout));
if (_config.GetOrDefault("Notifications:Alerts:Account_Lockout", true))
{
await _notificationHelper.Send("Account Lockout", $"Account '{model?.Username}' has been locked out for {timeout} minutes due to too many failed login attempts.", _url.GenerateBaseUrl(HttpContext?.Request, "/Admin"));
}
}
return true;
}
catch
{
return false;
}
}
}
}

View File

@@ -1,30 +1,19 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WeddingShare.Models;
namespace WeddingShare.Controllers
{
[AllowAnonymous]
public class ErrorController : Controller
{
private readonly ILogger _logger;
public ErrorController(ILogger<ErrorController> logger)
public ErrorController()
{
_logger = logger;
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Index()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult AccessDenied()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
return View();
}
}
}

View File

@@ -1,10 +1,17 @@
using System.Diagnostics;
using System.IO.Compression;
using System.Net;
using System.Web;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using WeddingShare.Attributes;
using WeddingShare.Enums;
using WeddingShare.Extensions;
using WeddingShare.Helpers;
using WeddingShare.Helpers.Database;
using WeddingShare.Helpers.Notifications;
using WeddingShare.Models;
using WeddingShare.Models.Database;
namespace WeddingShare.Controllers
{
@@ -13,152 +20,316 @@ namespace WeddingShare.Controllers
{
private readonly IWebHostEnvironment _hostingEnvironment;
private readonly IConfigHelper _config;
private readonly IDatabaseHelper _database;
private readonly IFileHelper _fileHelper;
private readonly IGalleryHelper _gallery;
private readonly IDeviceDetector _deviceDetector;
private readonly IImageHelper _imageHelper;
private readonly INotificationHelper _notificationHelper;
private readonly IEncryptionHelper _encryptionHelper;
private readonly Helpers.IUrlHelper _urlHelper;
private readonly ILogger _logger;
private readonly IStringLocalizer<GalleryController> _localizer;
private readonly IStringLocalizer<Lang.Translations> _localizer;
private readonly string TempDirectory;
private readonly string UploadsDirectory;
private readonly string ThumbnailsDirectory;
public GalleryController(IWebHostEnvironment hostingEnvironment, IConfigHelper config, ILogger<GalleryController> logger, IStringLocalizer<GalleryController> localizer)
public GalleryController(IWebHostEnvironment hostingEnvironment, IConfigHelper config, IDatabaseHelper database, IFileHelper fileHelper, IGalleryHelper galleryHelper, IDeviceDetector deviceDetector, IImageHelper imageHelper, INotificationHelper notificationHelper, IEncryptionHelper encryptionHelper, Helpers.IUrlHelper urlHelper, ILogger<GalleryController> logger, IStringLocalizer<Lang.Translations> localizer)
{
_hostingEnvironment = hostingEnvironment;
_config = config;
_database = database;
_fileHelper = fileHelper;
_gallery = galleryHelper;
_deviceDetector = deviceDetector;
_imageHelper = imageHelper;
_notificationHelper = notificationHelper;
_encryptionHelper = encryptionHelper;
_urlHelper = urlHelper;
_logger = logger;
_localizer = localizer;
TempDirectory = Path.Combine(_hostingEnvironment.WebRootPath, "temp");
UploadsDirectory = Path.Combine(_hostingEnvironment.WebRootPath, "uploads");
ThumbnailsDirectory = Path.Combine(_hostingEnvironment.WebRootPath, "thumbnails");
}
[HttpPost]
public IActionResult Login(string id = "default", string? key = null)
{
var append = new List<KeyValuePair<string, string>>()
{
new KeyValuePair<string, string>("id", id)
};
if (!string.IsNullOrWhiteSpace(key))
{
var enc = _encryptionHelper.IsEncryptionEnabled();
append.Add(new KeyValuePair<string, string>("key", enc ? _encryptionHelper.Encrypt(key) : key));
append.Add(new KeyValuePair<string, string>("enc", enc.ToString().ToLower()));
}
var redirectUrl = _urlHelper.GenerateFullUrl(HttpContext.Request, "/Gallery", append);
return new JsonResult(new { success = true, redirectUrl });
}
[HttpGet]
public IActionResult Index(string id, string? key)
[RequiresSecretKey]
[AllowGuestCreate]
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public async Task<IActionResult> Index(string id = "default", string? key = null, ViewMode? mode = null, GalleryOrder order = GalleryOrder.UploadedDesc, bool partial = false)
{
if (_config.GetOrDefault("Settings", "Single_Gallery_Mode", false))
id = (!string.IsNullOrWhiteSpace(id) && !_config.GetOrDefault("Settings:Single_Gallery_Mode", false)) ? id.ToLower() : "default";
try
{
id = "default";
ViewBag.ViewMode = mode ?? (ViewMode)_gallery.GetConfig(id, "Gallery:Default_View", (int)ViewMode.Default);
}
catch
{
ViewBag.ViewMode = ViewMode.Default;
}
id = id.ToLower();
var secretKey = _config.Get("Settings", $"Secret_Key_{id}");
if (string.IsNullOrEmpty(secretKey))
var deviceType = HttpContext.Session.GetString(SessionKey.DeviceType);
if (string.IsNullOrWhiteSpace(deviceType))
{
secretKey = _config.Get("Settings", "Secret_Key");
deviceType = (await _deviceDetector.ParseDeviceType(Request.Headers["User-Agent"].ToString())).ToString();
HttpContext.Session.SetString(SessionKey.DeviceType, deviceType ?? "Desktop");
}
if (!string.IsNullOrEmpty(secretKey) && !string.Equals(secretKey, key))
{
_logger.LogWarning(_localizer["Invalid_Security_Key_Warning"].Value);
ViewBag.ErrorMessage = _localizer["Invalid_Gallery_Key"].Value;
return View("~/Views/Home/Index.cshtml");
}
else if (string.IsNullOrEmpty(id))
{
ViewBag.ErrorMessage = _localizer["Invalid_Gallery_Id"].Value;
return View("~/Views/Home/Index.cshtml");
}
ViewBag.SecretKey = key;
var dd = new DeviceDetectorNET.DeviceDetector(Request.Headers["User-Agent"].ToString());
dd.Parse();
ViewBag.IsMobile = dd.IsParsed() && dd.IsMobile();
ViewBag.IsMobile = !string.Equals("Desktop", deviceType, StringComparison.OrdinalIgnoreCase);
var galleryPath = Path.Combine(UploadsDirectory, id);
var allowedFileTypes = _config.GetOrDefault("Settings", "Allowed_File_Types", ".jpg,.jpeg,.png").Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
var files = Directory.Exists(galleryPath) ? Directory.GetFiles(galleryPath, "*.*", SearchOption.TopDirectoryOnly)?.Where(x => allowedFileTypes.Any(y => string.Equals(Path.GetExtension(x).Trim('.'), y.Trim('.'), StringComparison.OrdinalIgnoreCase))) : null;
var pendingPath = Path.Combine(galleryPath, "Pending");
var images = new PhotoGallery(_config.GetOrDefault("Settings", "Gallery_Columns", 4))
{
GalleryId = id,
GalleryPath = $"/{galleryPath.Remove(_hostingEnvironment.WebRootPath).Replace('\\', '/').TrimStart('/')}",
Images = files?.OrderByDescending(x => new FileInfo(x).CreationTimeUtc)?.Select(x => Path.GetFileName(x))?.ToList(),
PendingCount = Directory.Exists(pendingPath) ? Directory.GetFiles(pendingPath, "*.*", SearchOption.TopDirectoryOnly).Length : 0,
FileUploader = !_config.GetOrDefault("Settings", "Disable_Upload", false) || (User?.Identity != null && User.Identity.IsAuthenticated) ? new FileUploader(id, "/Gallery/UploadImage") : null
};
_fileHelper.CreateDirectoryIfNotExists(galleryPath);
_fileHelper.CreateDirectoryIfNotExists(Path.Combine(galleryPath, "Pending"));
return View(images);
GalleryModel? gallery = await _database.GetGallery(id);
if (gallery == null)
{
gallery = await _database.AddGallery(new GalleryModel()
{
Name = id.ToLower(),
SecretKey = key
});
}
if (gallery != null)
{
ViewBag.GalleryId = gallery.Name;
var secretKey = await _gallery.GetSecretKey(gallery.Name);
ViewBag.SecretKey = secretKey;
var currentPage = 1;
try
{
currentPage = int.Parse((Request.Query.ContainsKey("page") && !string.IsNullOrWhiteSpace(Request.Query["page"])) ? Request.Query["page"].ToString().ToLower() : "1");
}
catch { }
var mediaType = mode == ViewMode.Slideshow ? MediaType.Image : MediaType.All;
var itemsPerPage = _gallery.GetConfig(gallery?.Name, "Gallery:Items_Per_Page", 50);
var allowedFileTypes = _gallery.GetConfig(gallery?.Name, "Gallery:Allowed_File_Types", ".jpg,.jpeg,.png,.mp4,.mov").Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
var items = (await _database.GetAllGalleryItems(gallery?.Id, GalleryItemState.Approved, mediaType, order, itemsPerPage, currentPage))?.Where(x => allowedFileTypes.Any(y => string.Equals(Path.GetExtension(x.Title).Trim('.'), y.Trim('.'), StringComparison.OrdinalIgnoreCase)));
var isAdmin = User?.Identity != null && User.Identity.IsAuthenticated;
FileUploader? fileUploader = null;
if (!string.Equals("All", gallery?.Name, StringComparison.OrdinalIgnoreCase) && (_gallery.GetConfig(gallery?.Name, "Gallery:Upload", true) || isAdmin))
{
var uploadActvated = isAdmin;
try
{
if (!uploadActvated)
{
var periods = _gallery.GetConfig(gallery?.Name, "Gallery:Upload_Period", "1970-01-01 00:00")?.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
if (periods != null)
{
var now = DateTime.UtcNow;
foreach (var period in periods)
{
var timeRanges = period?.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
if (timeRanges != null && timeRanges.Length > 0)
{
var startDate = DateTime.Parse(timeRanges[0]).ToUniversalTime();
if (timeRanges.Length == 2)
{
var endDate = DateTime.Parse(timeRanges[1]).ToUniversalTime();
if (now >= startDate && now < endDate)
{
uploadActvated = true;
break;
}
}
else if (timeRanges.Length == 1 && now >= startDate)
{
uploadActvated = true;
break;
}
}
}
}
}
}
catch
{
uploadActvated = true;
}
if (uploadActvated)
{
fileUploader = new FileUploader(gallery?.Name ?? "default", secretKey, "/Gallery/UploadImage", _config.GetOrDefault("Settings:Identity_Check:Require_Identity_For_Upload", false));
}
}
var model = new PhotoGallery()
{
GalleryId = gallery?.Id,
GalleryName = gallery?.Name,
Images = items?.Select(x => new PhotoGalleryImage()
{
Id = x.Id,
GalleryId = x.GalleryId,
GalleryName = x.GalleryName,
Name = Path.GetFileName(x.Title),
UploadedBy = x.UploadedBy,
ImagePath = $"/{Path.Combine(UploadsDirectory, x.GalleryName).Remove(_hostingEnvironment.WebRootPath).Replace('\\', '/').TrimStart('/')}/{x.Title}",
ThumbnailPath = $"/{ThumbnailsDirectory.Remove(_hostingEnvironment.WebRootPath).Replace('\\', '/').TrimStart('/')}/{Path.GetFileNameWithoutExtension(x.Title)}.webp",
MediaType = x.MediaType
})?.ToList(),
CurrentPage = currentPage,
ApprovedCount = gallery?.ApprovedItems ?? 0,
PendingCount = gallery?.PendingItems ?? 0,
ItemsPerPage = itemsPerPage,
FileUploader = fileUploader,
ViewMode = (ViewMode)ViewBag.ViewMode,
Pagination = order != GalleryOrder.Random,
LoadScripts = !partial
};
return partial ? PartialView("~/Views/Gallery/GalleryWrapper.cshtml", model) : View(model);
}
return View(new PhotoGallery());
}
[HttpPost]
public async Task<IActionResult> UploadImage()
{
Response.StatusCode = (int)HttpStatusCode.BadRequest;
try
{
var secretKey = _config.Get("Settings", "Secret_Key");
var key = Request?.Form?.FirstOrDefault(x => string.Equals("SecretKey", x.Key, StringComparison.OrdinalIgnoreCase)).Value;
if (!string.IsNullOrEmpty(secretKey) && !string.Equals(secretKey, key))
string galleryId = (Request?.Form?.FirstOrDefault(x => string.Equals("Id", x.Key, StringComparison.OrdinalIgnoreCase)).Value)?.ToString()?.ToLower() ?? string.Empty;
if (string.IsNullOrWhiteSpace(galleryId))
{
_logger.LogWarning(_localizer["Invalid_Security_Key_Warning"].Value);
throw new UnauthorizedAccessException(_localizer["Invalid_Access_Token"].Value);
return Json(new { success = false, uploaded = 0, errors = new List<string>() { _localizer["Invalid_Gallery_Id"].Value } });
}
string galleryId = Request?.Form?.FirstOrDefault(x => string.Equals("GalleryId", x.Key, StringComparison.OrdinalIgnoreCase)).Value ?? string.Empty;
if (string.IsNullOrEmpty(galleryId))
var gallery = await _database.GetGallery(galleryId);
if (gallery != null)
{
return Json(new { success = true, uploaded = 0, errors = new List<string>() { _localizer["Invalid_Gallery_Id"].Value } });
}
galleryId = galleryId.ToLower();
var galleryPath = Path.Combine(UploadsDirectory, galleryId);
var files = Request?.Form?.Files;
if (files != null && files.Count > 0)
{
if (!Directory.Exists(galleryPath))
var secretKey = await _gallery.GetSecretKey(galleryId);
string key = (Request?.Form?.FirstOrDefault(x => string.Equals("SecretKey", x.Key, StringComparison.OrdinalIgnoreCase)).Value)?.ToString() ?? string.Empty;
if (!string.IsNullOrWhiteSpace(secretKey) && !string.Equals(secretKey, key))
{
Directory.CreateDirectory(galleryPath);
return Json(new { success = false, uploaded = 0, errors = new List<string>() { _localizer["Invalid_Secret_Key_Warning"].Value } });
}
var requiresReview = _config.GetOrDefault("Settings", "Require_Review", true);
if (requiresReview)
{
galleryPath = Path.Combine(galleryPath, "Pending");
if (!Directory.Exists(galleryPath))
{
Directory.CreateDirectory(galleryPath);
}
}
var uploaded = 0;
var errors = new List<string>();
foreach (IFormFile file in files)
string uploadedBy = HttpContext.Session.GetString(SessionKey.ViewerIdentity) ?? "Anonymous";
var files = Request?.Form?.Files;
if (files != null && files.Count > 0)
{
try
{
var extension = Path.GetExtension(file.FileName);
var maxFilesSize = _config.GetOrDefault("Settings", "Max_File_Size_Mb", 10) * 1000000;
var requiresReview = _gallery.GetConfig(galleryId, "Gallery:Require_Review", true);
var allowedFileTypes = _config.GetOrDefault("Settings", "Allowed_File_Types", ".jpg,.jpeg,.png").Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
if (!allowedFileTypes.Any(x => string.Equals(x.Trim('.'), extension.Trim('.'), StringComparison.OrdinalIgnoreCase)))
var uploaded = 0;
var errors = new List<string>();
foreach (IFormFile file in files)
{
try
{
errors.Add($"{_localizer["File_Upload_Failed"].Value} '{Path.GetFileName(file.FileName)}'. {_localizer["Invalid_File_Type"].Value}");
}
else if (file.Length > maxFilesSize)
{
errors.Add($"{_localizer["File_Upload_Failed"].Value} '{Path.GetFileName(file.FileName)}'. {_localizer["Max_File_Size"].Value} {maxFilesSize} bytes");
}
else
{
var filePath = Path.Combine(galleryPath, $"{Guid.NewGuid()}{Path.GetExtension(file.FileName)}");
if (!string.IsNullOrEmpty(filePath))
var extension = Path.GetExtension(file.FileName);
var maxGallerySize = _gallery.GetConfig(galleryId, "Gallery:Max_Size_Mb", 1024L) * 1000000;
var maxFilesSize = _gallery.GetConfig(galleryId, "Gallery:Max_File_Size_Mb", 10L) * 1000000;
var galleryPath = Path.Combine(UploadsDirectory, gallery.Name);
var allowedFileTypes = _gallery.GetConfig(galleryId, "Gallery:Allowed_File_Types", ".jpg,.jpeg,.png,.mp4,.mov").Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
if (!allowedFileTypes.Any(x => string.Equals(x.Trim('.'), extension.Trim('.'), StringComparison.OrdinalIgnoreCase)))
{
using (var fs = new FileStream(filePath, FileMode.Create))
errors.Add($"{_localizer["File_Upload_Failed"].Value}. {_localizer["Invalid_File_Type"].Value}");
}
else if (file.Length > maxFilesSize)
{
errors.Add($"{_localizer["File_Upload_Failed"].Value}. {_localizer["Max_File_Size"].Value} {maxFilesSize} bytes");
}
else if ((_fileHelper.GetDirectorySize(galleryPath) + file.Length) > maxGallerySize)
{
errors.Add($"{_localizer["File_Upload_Failed"].Value}. {_localizer["Gallery_Full"].Value} {maxGallerySize} bytes");
}
else
{
var fileName = $"{Guid.NewGuid()}{Path.GetExtension(file.FileName)}";
galleryPath = requiresReview ? Path.Combine(galleryPath, "Pending") : galleryPath;
_fileHelper.CreateDirectoryIfNotExists(galleryPath);
var filePath = Path.Combine(galleryPath, fileName);
if (!string.IsNullOrWhiteSpace(filePath))
{
await file.CopyToAsync(fs);
uploaded++;
await _fileHelper.SaveFile(file, filePath, FileMode.Create);
var checksum = await _fileHelper.GetChecksum(filePath);
if (_gallery.GetConfig(galleryId, "Gallery:Prevent_Duplicates", true) && (string.IsNullOrWhiteSpace(checksum) || await _database.GetGalleryItemByChecksum(gallery.Id, checksum) != null))
{
errors.Add($"{_localizer["File_Upload_Failed"].Value}. {_localizer["Duplicate_Item_Detected"].Value}");
_fileHelper.DeleteFileIfExists(filePath);
}
else
{
_fileHelper.CreateDirectoryIfNotExists(ThumbnailsDirectory);
await _imageHelper.GenerateThumbnail(filePath, Path.Combine(ThumbnailsDirectory, $"{Path.GetFileNameWithoutExtension(filePath)}.webp"), _config.GetOrDefault("Settings:Thumbnail_Size", 720));
var item = await _database.AddGalleryItem(new GalleryItemModel()
{
GalleryId = gallery.Id,
Title = fileName,
UploadedBy = uploadedBy,
Checksum = checksum,
MediaType = _imageHelper.GetMediaType(filePath),
State = requiresReview ? GalleryItemState.Pending : GalleryItemState.Approved
});
if (item?.Id > 0)
{
uploaded++;
}
}
}
}
}
catch (Exception ex)
{
_logger.LogWarning(ex, $"{_localizer["Save_To_Gallery_Failed"].Value} - {ex?.Message}");
}
}
catch (Exception ex)
{
_logger.LogWarning(ex, $"{_localizer["Save_To_Gallery_Failed"].Value} - {ex?.Message}");
}
}
return Json(new { success = true, uploaded, requiresReview, errors });
Response.StatusCode = (int)HttpStatusCode.OK;
return Json(new { success = uploaded > 0, uploaded, uploadedBy, requiresReview, errors });
}
else
{
return Json(new { success = false, uploaded = 0, errors = new List<string>() { _localizer["No_Files_For_Upload"].Value } });
}
}
else
{
return Json(new { success = false, uploaded = 0, errors = new List<string>() { _localizer["Gallery_Does_Not_Exist"].Value } });
}
}
catch (Exception ex)
@@ -168,5 +339,105 @@ namespace WeddingShare.Controllers
return Json(new { success = false, uploaded = 0 });
}
[HttpPost]
public async Task<IActionResult> UploadCompleted()
{
Response.StatusCode = (int)HttpStatusCode.BadRequest;
try
{
string galleryId = (Request?.Form?.FirstOrDefault(x => string.Equals("Id", x.Key, StringComparison.OrdinalIgnoreCase)).Value)?.ToString()?.ToLower() ?? string.Empty;
if (string.IsNullOrWhiteSpace(galleryId))
{
return Json(new { success = false, uploaded = 0, errors = new List<string>() { _localizer["Invalid_Gallery_Id"].Value } });
}
var gallery = await _database.GetGallery(galleryId);
if (gallery != null)
{
var secretKey = await _gallery.GetSecretKey(galleryId);
string key = (Request?.Form?.FirstOrDefault(x => string.Equals("SecretKey", x.Key, StringComparison.OrdinalIgnoreCase)).Value)?.ToString() ?? string.Empty;
if (!string.IsNullOrWhiteSpace(secretKey) && !string.Equals(secretKey, key))
{
return Json(new { success = false, uploaded = 0, errors = new List<string>() { _localizer["Invalid_Secret_Key_Warning"].Value } });
}
var uploadedBy = HttpContext.Session.GetString(SessionKey.ViewerIdentity) ?? "Anonymous";
var requiresReview = _gallery.GetConfig(galleryId, "Gallery:Require_Review", true);
int uploaded = int.Parse((Request?.Form?.FirstOrDefault(x => string.Equals("Count", x.Key, StringComparison.OrdinalIgnoreCase)).Value)?.ToString() ?? "0");
if (uploaded > 0 && requiresReview && _config.GetOrDefault("Notifications:Alerts:Pending_Review", true))
{
await _notificationHelper.Send(_localizer["New_Items_Pending_Review"].Value, $"{uploaded} new item(s) have been uploaded to gallery '{gallery.Name}' by '{(!string.IsNullOrWhiteSpace(uploadedBy) ? uploadedBy : "Anonymous")}' and are awaiting your review.", _urlHelper.GenerateBaseUrl(HttpContext?.Request, "/Admin"));
}
Response.StatusCode = (int)HttpStatusCode.OK;
return Json(new { success = true, counters = new { total = gallery?.TotalItems ?? 0, approved = gallery?.ApprovedItems ?? 0, pending = gallery?.PendingItems ?? 0 }, uploaded, uploadedBy, requiresReview });
}
else
{
return Json(new { success = false, uploaded = 0, errors = new List<string>() { _localizer["Gallery_Does_Not_Exist"].Value } });
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Image_Upload_Failed"].Value} - {ex?.Message}");
}
return Json(new { success = false });
}
[HttpPost]
public async Task<IActionResult> DownloadGallery(int id)
{
try
{
var gallery = await _database.GetGallery(id);
if (gallery != null)
{
if (_gallery.GetConfig(gallery.Name, "Gallery:Download", true) || (User?.Identity != null && User.Identity.IsAuthenticated))
{
var galleryDir = id > 0 ? Path.Combine(UploadsDirectory, gallery.Name) : UploadsDirectory;
if (_fileHelper.DirectoryExists(galleryDir))
{
_fileHelper.CreateDirectoryIfNotExists(TempDirectory);
var tempZipFile = Path.Combine(TempDirectory, $"{gallery.Name}-{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.zip");
ZipFile.CreateFromDirectory(galleryDir, tempZipFile, CompressionLevel.Optimal, false);
if (User?.Identity == null || !User.Identity.IsAuthenticated)
{
using (var fs = new FileStream(tempZipFile, FileMode.Open, FileAccess.ReadWrite))
using (var archive = new ZipArchive(fs, ZipArchiveMode.Update, false))
{
foreach (var entry in archive.Entries.Where(x => x.FullName.StartsWith("Pending/", StringComparison.OrdinalIgnoreCase) || x.FullName.StartsWith("Rejected/", StringComparison.OrdinalIgnoreCase)).ToList())
{
entry.Delete();
}
}
}
return Json(new { success = true, filename = $"/temp/{Path.GetFileName(tempZipFile)}" });
}
}
else
{
return Json(new { success = false, message = _localizer["Download_Gallery_Not_Allowed"].Value });
}
}
else
{
return Json(new { success = false, message = _localizer["Failed_Download_Gallery"].Value });
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Failed_Download_Gallery"].Value} - {ex?.Message}");
}
return Json(new { success = false });
}
}
}

View File

@@ -1,22 +1,77 @@
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using WeddingShare.Helpers;
using WeddingShare.Models;
namespace WeddingShare.Controllers
{
[AllowAnonymous]
public class HomeController : Controller
{
private readonly IConfigHelper _config;
private readonly IGalleryHelper _gallery;
private readonly IDeviceDetector _deviceDetector;
private readonly ILogger _logger;
public HomeController(IConfigHelper config, ILogger<HomeController> logger)
private readonly IStringLocalizer<Lang.Translations> _localizer;
public HomeController(IConfigHelper config, IGalleryHelper gallery, IDeviceDetector deviceDetector, ILogger<HomeController> logger, IStringLocalizer<Lang.Translations> localizer)
{
_config = config;
_gallery = gallery;
_deviceDetector = deviceDetector;
_logger = logger;
_localizer = localizer;
}
[HttpGet]
public IActionResult Index()
public async Task<IActionResult> Index()
{
try
{
var deviceType = HttpContext.Session.GetString(SessionKey.DeviceType);
if (string.IsNullOrWhiteSpace(deviceType))
{
deviceType = (await _deviceDetector.ParseDeviceType(Request.Headers["User-Agent"].ToString())).ToString();
HttpContext.Session.SetString(SessionKey.DeviceType, deviceType ?? "Desktop");
}
if (_config.GetOrDefault("Settings:Single_Gallery_Mode", false))
{
var key = await _gallery.GetSecretKey("default");
if (string.IsNullOrWhiteSpace(key))
{
return RedirectToAction("Index", "Gallery");
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Homepage_Load_Error"].Value} - {ex?.Message}");
}
return View();
}
[HttpPost]
public IActionResult SetIdentity(string name)
{
try
{
if (Regex.IsMatch(name, @"^[a-zA-Z-\s\-\']+$", RegexOptions.Compiled))
{
HttpContext.Session.SetString(SessionKey.ViewerIdentity, name);
return Json(new { success = true });
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"{_localizer["Identity_Session_Error"].Value}: '{name}'");
}
return Json(new { success = false });
}
}
}

View File

@@ -4,18 +4,19 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 5000
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG TARGETARCH
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["WeddingShare/WeddingShare.csproj", "WeddingShare/"]
RUN dotnet restore "./WeddingShare/./WeddingShare.csproj"
RUN dotnet restore -a $TARGETARCH "./WeddingShare/./WeddingShare.csproj"
COPY . .
WORKDIR "/src/WeddingShare"
RUN dotnet build "./WeddingShare.csproj" -c $BUILD_CONFIGURATION -o /app/build
RUN dotnet build "./WeddingShare.csproj" -a $TARGETARCH -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./WeddingShare.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
RUN dotnet publish "./WeddingShare.csproj" -a $TARGETARCH -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app

View File

@@ -0,0 +1,9 @@
namespace WeddingShare.Enums
{
public enum DatabaseType
{
Unknown,
SQLite,
MySQL
}
}

View File

@@ -0,0 +1,10 @@
namespace WeddingShare.Enums
{
public enum DeviceType
{
Unknown,
Desktop,
Tablet,
Mobile
}
}

View File

@@ -0,0 +1,9 @@
namespace WeddingShare.Enums
{
public enum GalleryItemState
{
Pending = 0,
Approved = 1,
All = 99
}
}

View File

@@ -0,0 +1,12 @@
namespace WeddingShare.Enums
{
public enum GalleryOrder
{
None,
UploadedAsc,
UploadedDesc,
NameAsc,
NameDesc,
Random
}
}

View File

@@ -0,0 +1,10 @@
namespace WeddingShare.Enums
{
public enum ImageOrientation
{
None,
Square,
Portrait,
Landscape
}
}

View File

@@ -0,0 +1,10 @@
namespace WeddingShare.Enums
{
public enum MediaType
{
Unknown,
Image,
Video,
All
}
}

View File

@@ -0,0 +1,9 @@
namespace WeddingShare.Enums
{
public enum ViewMode
{
Default,
Presentation,
Slideshow
}
}

View File

@@ -1,38 +1,51 @@
namespace WeddingShare.Helpers
using WeddingShare.Helpers.Migrators;
using WeddingShare.Models.Migrator;
namespace WeddingShare.Helpers
{
public interface IConfigHelper
{
string? GetEnvironmentVariable(string key);
string? GetConfigValue(string section, string key);
string? Get(string section, string key);
string GetOrDefault(string section, string key, string defaultValue);
int GetOrDefault(string section, string key, int defaultValue);
long GetOrDefault(string section, string key, long defaultValue);
decimal GetOrDefault(string section, string key, decimal defaultValue);
double GetOrDefault(string section, string key, double defaultValue);
bool GetOrDefault(string section, string key, bool defaultValue);
DateTime? GetOrDefault(string section, string key, DateTime? defaultValue);
string? GetEnvironmentVariable(string key, string? galleryId = null);
string? GetConfigValue(string key);
string? Get(string key, string? galleryId = null);
string GetOrDefault(string key, string defaultValue);
int GetOrDefault(string key, int defaultValue);
long GetOrDefault(string key, long defaultValue);
decimal GetOrDefault(string key, decimal defaultValue);
double GetOrDefault(string key, double defaultValue);
bool GetOrDefault(string key, bool defaultValue);
DateTime? GetOrDefault(string key, DateTime? defaultValue);
}
public class ConfigHelper : IConfigHelper
{
private readonly IEnvironmentWrapper _environment;
private readonly IConfiguration _configuration;
private readonly ILogger<ConfigHelper> _logger;
private readonly ILogger _logger;
public ConfigHelper(IConfiguration config, ILogger<ConfigHelper> logger)
{
public ConfigHelper(IEnvironmentWrapper environment, IConfiguration config, ILogger<ConfigHelper> logger)
{
_environment = environment;
_configuration = config;
_logger = logger;
}
public string? GetEnvironmentVariable(string key)
public string? GetEnvironmentVariable(string key, string? galleryId = null)
{
try
{
var value = Environment.GetEnvironmentVariable(key.Replace(":", "_").ToUpper());
if (!string.IsNullOrEmpty(value))
foreach (var envKey in KeyHelper.GetAlternateVersions(key, galleryId))
{
return value;
if (!this.IsProtectedVariable(envKey.Key))
{
var keyName = string.Join('_', envKey.Key.Split(':', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).Skip(1)).Trim('_').ToUpper();
var value = _environment.GetEnvironmentVariable(keyName);
if (!string.IsNullOrWhiteSpace(value))
{
return envKey.MigrationAction != null ? envKey.MigrationAction(value) : value;
}
}
}
}
catch (Exception ex)
@@ -43,12 +56,12 @@
return null;
}
public string? GetConfigValue(string section, string key)
public string? GetConfigValue(string key)
{
try
{
var value = _configuration.GetValue<string>(!string.IsNullOrEmpty(section) ? $"{section}:{key}" : key);
if (!string.IsNullOrEmpty(value))
var value = _configuration.GetValue<string>(key);
if (!string.IsNullOrWhiteSpace(value))
{
return value;
}
@@ -61,18 +74,18 @@
return null;
}
public string? Get(string section, string key)
public string? Get(string key, string? galleryId = null)
{
try
{
var value = !IsProtectedVariable($"{section}_{key}") ? this.GetEnvironmentVariable(key) : string.Empty;
if (!string.IsNullOrEmpty(value))
var value = this.GetEnvironmentVariable(key, galleryId);
if (!string.IsNullOrWhiteSpace(value))
{
return value;
}
value = this.GetConfigValue(section, key);
if (!string.IsNullOrEmpty(value))
value = this.GetConfigValue(key);
if (!string.IsNullOrWhiteSpace(value))
{
return value;
}
@@ -85,12 +98,12 @@
return null;
}
public string GetOrDefault(string section, string key, string defaultValue)
public string GetOrDefault(string key, string defaultValue)
{
try
{
var value = this.Get(section, key);
if (!string.IsNullOrEmpty(value))
var value = this.Get(key);
if (!string.IsNullOrWhiteSpace(value))
{
return value;
}
@@ -100,12 +113,12 @@
return defaultValue;
}
public int GetOrDefault(string section, string key, int defaultValue)
public int GetOrDefault(string key, int defaultValue)
{
try
{
var value = this.GetOrDefault(section, key, string.Empty);
if (!string.IsNullOrEmpty(value))
var value = this.GetOrDefault(key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToInt32(value);
}
@@ -115,12 +128,12 @@
return defaultValue;
}
public long GetOrDefault(string section, string key, long defaultValue)
public long GetOrDefault(string key, long defaultValue)
{
try
{
var value = this.GetOrDefault(section, key, string.Empty);
if (!string.IsNullOrEmpty(value))
var value = this.GetOrDefault(key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToInt64(value);
}
@@ -130,12 +143,12 @@
return defaultValue;
}
public decimal GetOrDefault(string section, string key, decimal defaultValue)
public decimal GetOrDefault(string key, decimal defaultValue)
{
try
{
var value = this.GetOrDefault(section, key, string.Empty);
if (!string.IsNullOrEmpty(value))
var value = this.GetOrDefault(key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToDecimal(value);
}
@@ -145,12 +158,12 @@
return defaultValue;
}
public double GetOrDefault(string section, string key, double defaultValue)
public double GetOrDefault(string key, double defaultValue)
{
try
{
var value = this.GetOrDefault(section, key, string.Empty);
if (!string.IsNullOrEmpty(value))
var value = this.GetOrDefault(key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToDouble(value);
}
@@ -160,12 +173,12 @@
return defaultValue;
}
public bool GetOrDefault(string section, string key, bool defaultValue)
public bool GetOrDefault(string key, bool defaultValue)
{
try
{
var value = this.GetOrDefault(section, key, string.Empty);
if (!string.IsNullOrEmpty(value))
var value = this.GetOrDefault(key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToBoolean(value);
}
@@ -175,12 +188,12 @@
return defaultValue;
}
public DateTime? GetOrDefault(string section, string key, DateTime? defaultValue)
public DateTime? GetOrDefault(string key, DateTime? defaultValue)
{
try
{
var value = this.GetOrDefault(section, key, string.Empty);
if (!string.IsNullOrEmpty(value))
var value = this.GetOrDefault(key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToDateTime(value);
}

View File

@@ -0,0 +1,42 @@
using WeddingShare.Enums;
using WeddingShare.Models.Database;
namespace WeddingShare.Helpers.Database
{
public interface IDatabaseHelper
{
Task<List<GalleryModel>> GetAllGalleries();
Task<GalleryModel?> GetGallery(int id);
Task<GalleryModel?> GetGallery(string name);
Task<GalleryModel?> AddGallery(GalleryModel model);
Task<GalleryModel?> EditGallery(GalleryModel model);
Task<bool> WipeGallery(GalleryModel model);
Task<bool> WipeAllGalleries();
Task<bool> DeleteGallery(GalleryModel model);
Task<List<GalleryItemModel>> GetAllGalleryItems(int? galleryId, GalleryItemState state = GalleryItemState.All, MediaType type = MediaType.All, GalleryOrder order = GalleryOrder.UploadedDesc, int limit = int.MaxValue, int page = 1);
Task<int> GetPendingGalleryItemCount(int? galleryId = null);
Task<List<GalleryItemModel>> GetPendingGalleryItems(int? galleryId = null);
Task<GalleryItemModel?> GetPendingGalleryItem(int id);
Task<GalleryItemModel?> GetGalleryItem(int id);
Task<GalleryItemModel?> GetGalleryItemByChecksum(int galleryId, string checksum);
Task<GalleryItemModel?> AddGalleryItem(GalleryItemModel model);
Task<GalleryItemModel?> EditGalleryItem(GalleryItemModel model);
Task<bool> DeleteGalleryItem(GalleryItemModel model);
Task<bool> InitAdminAccount(UserModel model);
Task<bool> ValidateCredentials(string username, string password);
Task<List<UserModel>?> GetAllUsers();
Task<UserModel?> GetUser(int id);
Task<UserModel?> GetUser(string name);
Task<UserModel?> AddUser(UserModel model);
Task<UserModel?> EditUser(UserModel model);
Task<bool> DeleteUser(UserModel model);
Task<bool> ChangePassword(UserModel model);
Task<int> IncrementLockoutCount(int id);
Task<bool> SetLockout(int id, DateTime? datetime);
Task<bool> ResetLockoutCount(int id);
Task<bool> SetMultiFactorToken(int id, string token);
Task<bool> ResetMultiFactorToDefault();
Task<bool> Import(string path);
Task<bool> Export(string path);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,110 @@
using System.Reflection;
using DbUp;
using DbUp.Engine;
using WeddingShare.Enums;
using WeddingShare.Helpers.Database;
using WeddingShare.Models.Database;
namespace WeddingShare.Helpers.Dbup
{
public sealed class DbupMigrator(IEnvironmentWrapper environment, IConfiguration configuration, IDatabaseHelper database, IFileHelper fileHelper, ILoggerFactory loggerFactory) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
var logger = loggerFactory.CreateLogger<DbupMigrator>();
fileHelper.CreateDirectoryIfNotExists("config");
var config = new ConfigHelper(environment, configuration, loggerFactory.CreateLogger<ConfigHelper>());
var connString = config.GetOrDefault("Settings:Database:Connection_String", "Data Source=./config/wedding-share.db");
if (!string.IsNullOrWhiteSpace(connString))
{
DatabaseUpgradeResult? dbupResult;
var dbType = config.GetOrDefault("Settings:Database:Type", "sqlite")?.ToLower();
switch (dbType)
{
case "sqlite":
dbupResult = new DbupSqliteHelper().Migrate(connString);
break;
case "mysql":
dbupResult = new DbupMySqlHelper().Migrate(connString);
break;
default:
var error = $"Database type '{dbType}' is not yet supported by this application";
logger.LogWarning(error);
throw new NotImplementedException(error);
}
if (dbupResult != null && !dbupResult.Successful)
{
logger.LogWarning($"DBUP failed with error: '{dbupResult?.Error?.Message}' - '{dbupResult?.Error?.ToString()}'");
}
var adminAccount = new UserModel() { Username = config.GetOrDefault("Settings:Account:Admin:Username", "admin"), Password = config.GetOrDefault("Settings:Account:Admin:Password", "admin") };
await database.InitAdminAccount(adminAccount);
if (config.GetOrDefault("Settings:Account:Admin:Log_Password", true))
{
logger.LogInformation($"Password: {adminAccount.Password}");
}
if (config.GetOrDefault("Security:2FA:Reset_To_Default", false))
{
await database.ResetMultiFactorToDefault();
}
}
else
{
logger.LogError($"DBUP failed with error: 'Connection string was null or empty'");
throw new ArgumentNullException("Please specify a valid database connection string");
}
}
}
public class DbupSqliteHelper
{
public DatabaseUpgradeResult Migrate(string connectionString)
{
try
{
var dbupBuilder = DeployChanges.To
.SQLiteDatabase(connectionString)
.WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
.WithScriptNameComparer(new DbupScriptComparer())
.WithFilter(new DbupScriptFilter(DatabaseType.SQLite))
.LogToConsole();
dbupBuilder.Configure(c => c.Journal = new DbupSQLiteTableJournal(() => c.ConnectionManager, () => c.Log, "schemaversions"));
return dbupBuilder.Build().PerformUpgrade();
}
catch (Exception ex)
{
return new DatabaseUpgradeResult(null, false, ex, null);
}
}
}
public class DbupMySqlHelper
{
public DatabaseUpgradeResult Migrate(string connectionString)
{
try
{
var dbupBuilder = DeployChanges.To
.MySqlDatabase(connectionString)
.WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
.WithScriptNameComparer(new DbupScriptComparer())
.WithFilter(new DbupScriptFilter(DatabaseType.MySQL))
.LogToConsole();
dbupBuilder.Configure(c => c.Journal = new DbupMySqlTableJournal(() => c.ConnectionManager, () => c.Log, "weddingshare", "schemaversions"));
return dbupBuilder.Build().PerformUpgrade();
}
catch (Exception ex)
{
return new DatabaseUpgradeResult(null, false, ex, null);
}
}
}
}

View File

@@ -0,0 +1,33 @@
using System.Data;
using DbUp.Engine;
using DbUp.Engine.Output;
using DbUp.Engine.Transactions;
using DbUp.MySql;
namespace WeddingShare.Helpers.Dbup
{
public class DbupMySqlTableJournal : MySqlTableJournal
{
public DbupMySqlTableJournal(Func<IConnectionManager> connectionManager, Func<IUpgradeLog> logger, string scheme, string table)
: base(connectionManager, logger, scheme, table)
{
}
public override void StoreExecutedScript(SqlScript script, Func<IDbCommand> dbCommandFactory)
{
var scriptName = script.Name;
try
{
var parts = script.Name.Split('.', StringSplitOptions.RemoveEmptyEntries);
if (parts != null && parts.Length >= 2)
{
scriptName = string.Join(".", parts.Skip(parts.Length - 2).Take(2));
}
}
catch { }
base.StoreExecutedScript(new SqlScript(scriptName, script.Contents), dbCommandFactory);
}
}
}

View File

@@ -0,0 +1,33 @@
using System.Data;
using DbUp.Engine;
using DbUp.Engine.Output;
using DbUp.Engine.Transactions;
using DbUp.SQLite;
namespace WeddingShare.Helpers.Dbup
{
public class DbupSQLiteTableJournal : SQLiteTableJournal
{
public DbupSQLiteTableJournal(Func<IConnectionManager> connectionManager, Func<IUpgradeLog> logger, string table)
: base(connectionManager, logger, table)
{
}
public override void StoreExecutedScript(SqlScript script, Func<IDbCommand> dbCommandFactory)
{
var scriptName = script.Name;
try
{
var parts = script.Name.Split('.', StringSplitOptions.RemoveEmptyEntries);
if (parts != null && parts.Length >= 2)
{
scriptName = string.Join(".", parts.Skip(parts.Length - 2).Take(2));
}
}
catch { }
base.StoreExecutedScript(new SqlScript(scriptName, script.Contents), dbCommandFactory);
}
}
}

View File

@@ -0,0 +1,31 @@
using System.Diagnostics.CodeAnalysis;
namespace WeddingShare.Helpers.Dbup
{
public class DbupScriptComparer : IComparer<string>
{
public DbupScriptComparer()
{
}
public int Compare([AllowNull] string x, [AllowNull] string y)
{
return GetFileName(x).ToLower().CompareTo(GetFileName(y).ToLower());
}
private string GetFileName(string name)
{
try
{
var parts = name.Split('.', StringSplitOptions.RemoveEmptyEntries);
if (parts != null && parts.Length >= 2)
{
return string.Join(".", parts.Skip(parts.Length - 2).Take(2));
}
}
catch { }
return name;
}
}
}

View File

@@ -0,0 +1,30 @@
using DbUp.Engine;
using DbUp.Support;
using WeddingShare.Enums;
namespace WeddingShare.Helpers.Dbup
{
public class DbupScriptFilter : IScriptFilter
{
private readonly DatabaseType _dbType;
public DbupScriptFilter(DatabaseType dbType)
{
_dbType = dbType;
}
public IEnumerable<SqlScript> Filter(IEnumerable<SqlScript> sorted, HashSet<string> executedScriptNames, ScriptNameComparer comparer)
{
var scripts = sorted.Where(s => s.SqlScriptOptions.ScriptType == ScriptType.RunAlways || !executedScriptNames.Contains(s.Name, comparer));
switch (_dbType)
{
case DatabaseType.SQLite:
return scripts.Where(s => s.Name.ToLower().Contains(".sqlscripts.sqlite."));
case DatabaseType.MySQL:
return scripts.Where(s => s.Name.ToLower().Contains(".sqlscripts.mysql."));
default:
return new List<SqlScript>();
}
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Text.RegularExpressions;
using WeddingShare.Enums;
namespace WeddingShare.Helpers
{
public interface IDeviceDetector
{
Task<DeviceType> ParseDeviceType(string userAgent);
}
public class DeviceDetector : IDeviceDetector
{
public async Task<DeviceType> ParseDeviceType(string userAgent)
{
return await Task.Run(() =>
{
if (string.IsNullOrWhiteSpace(userAgent))
{
return DeviceType.Unknown;
}
if (Regex.IsMatch(userAgent, "(tablet|ipad|playbook|silk)|(android(?!.*mobile))", RegexOptions.IgnoreCase))
{
return DeviceType.Tablet;
}
if (Regex.IsMatch(userAgent, "blackberry|iphone|mobile|windows ce|opera mini|htc|sony|palm|symbianos|ipad|ipod|blackberry|bada|kindle|symbian|sonyericsson|android|samsung|nokia|wap|motor", RegexOptions.IgnoreCase))
{
return DeviceType.Mobile;
}
return DeviceType.Desktop;
});
}
}
}

View File

@@ -0,0 +1,89 @@
using System.Security.Cryptography;
using System.Text;
namespace WeddingShare.Helpers
{
public interface IEncryptionHelper
{
bool IsEncryptionEnabled();
string Encrypt(string value);
}
public class EncryptionHelper : IEncryptionHelper
{
private readonly HashAlgorithmName _hashType;
private readonly int _iterations;
private readonly string _key;
private readonly string _salt;
public EncryptionHelper(IConfigHelper config)
{
_hashType = ParseHashType(config.GetOrDefault("Security:Encryption:HashType", "SHA256"));
_iterations = config.GetOrDefault("Security:Encryption:Iterations", 1000);
_key = config.GetOrDefault("Security:Encryption:Key", string.Empty);
_salt = config.GetOrDefault("Security:Encryption:Salt", "WUtlVOvC2a6ol9M6ZidO5sJkQxYMolyasFid2Fyqvjd0uucAjYy5EsHPxdeplFRj");
}
public bool IsEncryptionEnabled()
{
return !string.IsNullOrWhiteSpace(_key) && !string.IsNullOrWhiteSpace(_salt);
}
public string Encrypt(string value)
{
var enabled = this.IsEncryptionEnabled();
if (enabled)
{
var clearBytes = Encoding.Unicode.GetBytes(value);
var saltBytes = Encoding.Unicode.GetBytes(_salt);
using (var encryptor = Aes.Create())
{
var pdb = new Rfc2898DeriveBytes(_key, saltBytes, _iterations, _hashType);
encryptor.Key = pdb.GetBytes(32);
encryptor.IV = pdb.GetBytes(16);
using (var ms = new MemoryStream())
{
using (var cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write))
{
cs.Write(clearBytes, 0, clearBytes.Length);
cs.Close();
}
value = Convert.ToBase64String(ms.ToArray());
}
}
}
return value;
}
private HashAlgorithmName ParseHashType(string name)
{
switch (name?.Trim()?.ToUpper())
{
case "MD5":
return HashAlgorithmName.MD5;
case "SHA1":
return HashAlgorithmName.SHA1;
case "SHA256":
return HashAlgorithmName.SHA256;
case "SHA384":
return HashAlgorithmName.SHA384;
case "SHA512":
return HashAlgorithmName.SHA512;
case "SHA3_256":
return HashAlgorithmName.SHA3_256;
case "SHA3_384":
return HashAlgorithmName.SHA3_384;
case "SHA3_512":
return HashAlgorithmName.SHA3_512;
default:
return HashAlgorithmName.SHA256;
}
}
}
}

View File

@@ -0,0 +1,15 @@
namespace WeddingShare.Helpers
{
public interface IEnvironmentWrapper
{
string? GetEnvironmentVariable(string variable);
}
public class EnvironmentWrapper : IEnvironmentWrapper
{
public string? GetEnvironmentVariable(string variable)
{
return Environment.GetEnvironmentVariable(variable);
}
}
}

View File

@@ -0,0 +1,10 @@
namespace WeddingShare.Helpers
{
public static class ErrorCode
{
public const int UnexpectedError = 400;
public const int Unauthorized = 401;
public const int InvalidSecretKey = 402;
public const int GalleryCreationNotAllowed = 403;
}
}

View File

@@ -0,0 +1,157 @@
using System.Security.Cryptography;
using System.Text;
namespace WeddingShare.Helpers
{
public interface IFileHelper
{
bool DirectoryExists(string path);
bool CreateDirectoryIfNotExists(string path);
bool DeleteDirectoryIfExists(string path, bool recursive = true);
string[] GetDirectories(string path, string pattern = "*", SearchOption searchOption = SearchOption.AllDirectories);
string[] GetFiles(string path, string pattern = "*.*", SearchOption searchOption = SearchOption.AllDirectories);
bool FileExists(string path);
bool DeleteFileIfExists(string path);
bool MoveFileIfExists(string source, string destination);
long GetDirectorySize(string path);
Task<byte[]> ReadAllBytes(string path);
Task SaveFile(IFormFile file, string path, FileMode mode);
Task<string> GetChecksum(string path);
}
public class FileHelper : IFileHelper
{
private readonly ILogger<FileHelper> _logger;
public FileHelper(ILogger<FileHelper> logger)
{
_logger = logger;
}
public bool DirectoryExists(string path)
{
return Directory.Exists(path);
}
public bool CreateDirectoryIfNotExists(string path)
{
if (!DirectoryExists(path))
{
Directory.CreateDirectory(path);
return true;
}
return false;
}
public bool DeleteDirectoryIfExists(string path, bool recursive = true)
{
if (DirectoryExists(path))
{
Directory.Delete(path, recursive);
return true;
}
return false;
}
public string[] GetDirectories(string path, string pattern = "*", SearchOption searchOption = SearchOption.AllDirectories)
{
return Directory.GetDirectories(path, pattern, searchOption);
}
public string[] GetFiles(string path, string pattern = "*", SearchOption searchOption = SearchOption.AllDirectories)
{
return Directory.GetFiles(path, pattern, searchOption);
}
public bool FileExists(string path)
{
return File.Exists(path);
}
public bool DeleteFileIfExists(string path)
{
if (FileExists(path))
{
File.Delete(path);
return true;
}
return false;
}
public bool MoveFileIfExists(string source, string destination)
{
if (FileExists(source))
{
File.Move(source, destination);
return true;
}
return false;
}
public long GetDirectorySize(string path)
{
long size = 0;
if (DirectoryExists(path))
{
var info = new DirectoryInfo(path);
foreach (var file in info.GetFiles())
{
size += file.Length;
}
foreach (var dir in info.GetDirectories())
{
size += GetDirectorySize(dir.FullName);
}
}
return size;
}
public async Task<byte[]> ReadAllBytes(string path)
{
return await File.ReadAllBytesAsync(path);
}
public async Task SaveFile(IFormFile file, string path, FileMode mode)
{
using (var fs = new FileStream(path, mode))
{
await file.CopyToAsync(fs);
}
}
public async Task<string> GetChecksum(string path)
{
return await Task.Run(() =>
{
var checksum = string.Empty;
try
{
using (var md5 = MD5.Create())
using (var stream = File.OpenRead(path))
{
checksum = Encoding.UTF8.GetString(md5.ComputeHash(stream));
}
}
catch (Exception ex)
{
_logger.LogWarning(ex, $"Failed to compute MD5 checksum for file '{path}'");
}
return checksum;
});
}
}
}

View File

@@ -0,0 +1,163 @@
using WeddingShare.Helpers.Database;
namespace WeddingShare.Helpers
{
public interface IGalleryHelper
{
string GetConfig(string? galleryId, string key, string defaultValue);
int GetConfig(string? galleryId, string key, int defaultValue);
long GetConfig(string? galleryId, string key, long defaultValue);
decimal GetConfig(string? galleryId, string key, decimal defaultValue);
double GetConfig(string? galleryId, string key, double defaultValue);
bool GetConfig(string? galleryId, string key, bool defaultValue);
DateTime? GetConfig(string section, string key, DateTime? defaultValue);
Task<string?> GetSecretKey(string galleryId);
}
public class GalleryHelper : IGalleryHelper
{
private readonly IConfigHelper _config;
private readonly IDatabaseHelper _database;
public GalleryHelper(IConfigHelper config, IDatabaseHelper database)
{
_config = config;
_database = database;
}
public string GetConfig(string? galleryId, string key, string defaultValue = "")
{
string? value = null;
try
{
value = _config.Get($"Settings:{key}", galleryId ?? "default");
if (string.IsNullOrWhiteSpace(value))
{
value = _config.Get($"Settings:{key}");
if (string.IsNullOrWhiteSpace(value))
{
value = defaultValue;
}
}
}
catch
{
}
return !string.IsNullOrWhiteSpace(value) ? value : defaultValue;
}
public int GetConfig(string? galleryId, string key, int defaultValue)
{
try
{
var value = this.GetConfig(galleryId, key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToInt32(value);
}
}
catch { }
return defaultValue;
}
public long GetConfig(string? galleryId, string key, long defaultValue)
{
try
{
var value = this.GetConfig(galleryId, key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToInt64(value);
}
}
catch { }
return defaultValue;
}
public decimal GetConfig(string? galleryId, string key, decimal defaultValue)
{
try
{
var value = this.GetConfig(galleryId, key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToDecimal(value);
}
}
catch { }
return defaultValue;
}
public double GetConfig(string? galleryId, string key, double defaultValue)
{
try
{
var value = this.GetConfig(galleryId, key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToDouble(value);
}
}
catch { }
return defaultValue;
}
public bool GetConfig(string? galleryId, string key, bool defaultValue)
{
try
{
var value = this.GetConfig(galleryId, key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToBoolean(value);
}
}
catch { }
return defaultValue;
}
public DateTime? GetConfig(string? galleryId, string key, DateTime? defaultValue)
{
try
{
var value = this.GetConfig(galleryId, key, string.Empty);
if (!string.IsNullOrWhiteSpace(value))
{
return Convert.ToDateTime(value);
}
}
catch { }
return defaultValue;
}
public async Task<string?> GetSecretKey(string galleryId)
{
try
{
var secretKey = _config.Get($"Settings:Gallery:Secret_Key", galleryId ?? "default");
if (string.IsNullOrWhiteSpace(secretKey))
{
secretKey = (await _database.GetGallery(galleryId ?? "default"))?.SecretKey;
if (string.IsNullOrWhiteSpace(secretKey))
{
secretKey = _config.Get("Settings:Gallery:Secret_Key");
}
}
return secretKey;
}
catch
{
return null;
}
}
}
}

View File

@@ -0,0 +1,168 @@
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using WeddingShare.Enums;
using Xabe.FFmpeg;
using Xabe.FFmpeg.Downloader;
namespace WeddingShare.Helpers
{
public interface IImageHelper
{
Task<bool> GenerateThumbnail(string filePath, string savePath, int size = 720);
ImageOrientation GetOrientation(Image img);
MediaType GetMediaType(string filePath);
Task<bool> DownloadFFMPEG(string path);
}
public class ImageHelper : IImageHelper
{
private readonly IFileHelper _fileHelper;
private readonly ILogger _logger;
private readonly IStringLocalizer<Lang.Translations> _localizer;
private static bool FfmpegInstalled = false;
public ImageHelper(IFileHelper fileHelper, ILogger<ImageHelper> logger, IStringLocalizer<Lang.Translations> localizer)
{
_fileHelper = fileHelper;
_logger = logger;
_localizer = localizer;
}
public async Task<bool> GenerateThumbnail(string filePath, string savePath, int size = 720)
{
if (_fileHelper.FileExists(filePath))
{
try
{
var mediaType = GetMediaType(filePath);
if (mediaType == MediaType.Image || mediaType == MediaType.Video)
{
var filename = Path.GetFileName(filePath);
if (mediaType == MediaType.Video)
{
if (FfmpegInstalled == false)
{
_logger.LogWarning(_localizer["FFMPEG_Downloading"].Value);
return false;
}
var conversion = await FFmpeg.Conversions.FromSnippet.Snapshot(filePath, savePath, TimeSpan.FromSeconds(0));
await conversion.Start();
filePath = savePath;
}
using (var img = await Image.LoadAsync(filePath))
{
var width = 0;
var height = 0;
var orientation = this.GetOrientation(img);
if (orientation == ImageOrientation.Square)
{
width = size;
height = size;
}
else if (orientation == ImageOrientation.Landscape)
{
var scale = (decimal)size / (decimal)img.Width;
width = (int)((decimal)img.Width * scale);
height = (int)((decimal)img.Height * scale);
}
else if (orientation == ImageOrientation.Portrait)
{
var scale = (decimal)size / (decimal)img.Height;
width = (int)((decimal)img.Width * scale);
height = (int)((decimal)img.Height * scale);
}
img.Mutate(x =>
{
x.Resize(width, height);
x.AutoOrient();
});
await img.SaveAsWebpAsync(savePath);
}
}
return true;
}
catch (Exception ex)
{
_logger.LogWarning(ex, $"Failed to generate thumbnail - '{filePath}'");
}
}
return false;
}
public MediaType GetMediaType(string path)
{
try
{
var provider = new FileExtensionContentTypeProvider();
if (provider.TryGetContentType(path, out string? contentType))
{
if (contentType.StartsWith("image/", StringComparison.OrdinalIgnoreCase))
{
return MediaType.Image;
}
else if (contentType.StartsWith("video/", StringComparison.OrdinalIgnoreCase))
{
return MediaType.Video;
}
}
}
catch { }
return MediaType.Unknown;
}
public ImageOrientation GetOrientation(Image img)
{
if (img != null)
{
if (img.Width > img.Height)
{
return ImageOrientation.Landscape;
}
else if (img.Width < img.Height)
{
return ImageOrientation.Portrait;
}
else if (img.Width == img.Height)
{
return ImageOrientation.Square;
}
}
return ImageOrientation.None;
}
public async Task<bool> DownloadFFMPEG(string path)
{
try
{
if (!_fileHelper.DirectoryExists(path))
{
_fileHelper.CreateDirectoryIfNotExists(path);
await FFmpegDownloader.GetLatestVersion(FFmpegVersion.Official, path);
}
FFmpeg.SetExecutablesPath(path);
FfmpegInstalled = true;
return true;
}
catch
{
return false;
}
}
}
}

View File

@@ -0,0 +1,178 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using WeddingShare.Models.Migrator;
namespace WeddingShare.Helpers.Migrators
{
public class KeyHelper
{
public static List<KeyMigrator> GetAlternateVersions(string key, string? galleryId = null)
{
var keys = new List<KeyMigrator>();
try
{
key = key.Trim();
keys.Add(new KeyMigrator(1, key));
if (string.Equals(key, "Settings:Home_Link", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Disable_Home_Link", (v) => { return (bool.Parse(v) == false).ToString(); }));
}
else if (string.Equals(key, "Settings:Disable_Guest_Gallery_Creation", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Guest_Gallery_Creation", (v) => { return (bool.Parse(v) == false).ToString(); }));
}
else if (string.Equals(key, "Settings:Themes:Enabled", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Disable_Dark_Mode", (v) => { return (bool.Parse(v) == false).ToString(); }));
}
else if (string.Equals(key, "Settings:Themes:Enabled", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Disable_Themes", (v) => { return (bool.Parse(v) == false).ToString(); }));
}
else if (string.Equals(key, "Settings:Themes:Default", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Default_Theme"));
}
else if (string.Equals(key, "Settings:Identity_Check:Enabled", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Show_Identity_Request"));
}
else if (string.Equals(key, "Settings:Show_Identity_Request", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Identity_Check:Enabled", (v) => { return (bool.Parse(v) == false).ToString(); }));
}
else if (string.Equals(key, "Settings:Account:Admins:Username", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Admin:Username"));
}
else if (string.Equals(key, "Settings:Account:Admins:Password", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Admin:Password"));
}
else if (string.Equals(key, "Settings:Account:Admins:Log_Password", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Admin:Log_Password"));
}
else if (string.Equals(key, "Settings:Gallery:QR_Code", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Disable_QR_Code", (v) => { return (bool.Parse(v) == false).ToString(); }));
}
else if (string.Equals(key, "Settings:Gallery:Secret_Key", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Secret_Key"));
}
else if (string.Equals(key, "Settings:Gallery:Columns", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Gallery_Columns"));
}
else if (string.Equals(key, "Settings:Gallery:Items_Per_Page", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Gallery_Items_Per_Page"));
}
else if (string.Equals(key, "Settings:Gallery:Quote", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Gallery_Quote"));
}
else if (string.Equals(key, "Settings:Gallery:Retain_Rejected_Items", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Retain_Rejected_Items"));
}
else if (string.Equals(key, "Settings:Gallery:Full_Width", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Full_Width_Gallery"));
}
else if (string.Equals(key, "Settings:Gallery:Upload", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Disable_Upload", (v) => { return (bool.Parse(v) == false).ToString(); }));
}
else if (string.Equals(key, "Settings:Gallery:Download", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Disable_Download", (v) => { return (bool.Parse(v) == false).ToString(); }));
}
else if (string.Equals(key, "Settings:Gallery:Require_Review", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Require_Review"));
}
else if (string.Equals(key, "Settings:Gallery:Review_Counter", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Disable_Review_Counter"));
}
else if (string.Equals(key, "Settings:Gallery:Prevent_Duplicates", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Prevent_Duplicates"));
}
else if (string.Equals(key, "Settings:Gallery:Idle_Refresh_Mins", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Idle_Gallery_Refresh_Mins"));
}
else if (string.Equals(key, "Settings:Gallery:Max_Size_Mb", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Max_Size_Mb"));
}
else if (string.Equals(key, "Settings:Gallery:Max_File_Size_Mb", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Max_File_Size_Mb"));
}
else if (string.Equals(key, "Settings:Gallery:Allowed_File_Types", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Allowed_File_Types"));
}
else if (string.Equals(key, "Settings:Gallery:Default_View", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Settings:Default_Gallery_View"));
}
else if (string.Equals(key, "BackgroundServices:Schedules:Directory_Scanner", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "BackgroundServices:Directory_Scanner_Interval"));
}
else if (string.Equals(key, "BackgroundServices:Schedules:Email_Report", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "BackgroundServices:Email_Report_Interval"));
}
else if (string.Equals(key, "BackgroundServices:Schedules:Cleanup", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "BackgroundServices:Cleanup_Interval"));
}
else if (string.Equals(key, "Security:Headers:Enabled", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Security:Set_Headers"));
}
else if (string.Equals(key, "Security:Headers:X_Frame_Options", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Security:X_Frame_Options"));
}
else if (string.Equals(key, "Security:Headers:X_Content_Type_Options", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Security:X_Content_Type_Options"));
}
else if (string.Equals(key, "Security:Headers:CSP", StringComparison.OrdinalIgnoreCase))
{
keys.Add(new KeyMigrator(2, "Security:CSP_Header"));
}
if (!string.IsNullOrWhiteSpace(galleryId) && keys.Any())
{
var priority = keys.Max(k => k.Priority) * -1;
var count = keys.Count;
for (var i = 0; i < count; i++)
{
var k = keys[i];
keys.Add(new KeyMigrator(priority + k.Priority, $"{k.Key}_{galleryId}", k.MigrationAction));
}
}
}
catch { }
keys = keys.Distinct().OrderBy(x => x.Priority).ToList();
return keys;
}
}
}

View File

@@ -0,0 +1,103 @@
using System.Net;
using System.Net.Mail;
using System.Text;
namespace WeddingShare.Helpers.Notifications
{
public class EmailHelper : INotificationHelper
{
private readonly IConfigHelper _config;
private readonly ISmtpClientWrapper _client;
private readonly ILogger _logger;
public EmailHelper(IConfigHelper config, ISmtpClientWrapper client, ILogger<EmailHelper> logger)
{
_config = config;
_client = client;
_logger = logger;
}
public async Task<bool> Send(string title, string message, string? actionLink = null)
{
if (_config.GetOrDefault("Notifications:Smtp:Enabled", false))
{
try
{
var recipients = _config.GetOrDefault("Notifications:Smtp:Recipient", string.Empty)?.Split(new char[] { ';', ',' }, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries)?.Select(x => new MailAddress(x));
if (recipients != null && recipients.Any())
{
var host = _config.GetOrDefault("Notifications:Smtp:Host", string.Empty);
if (!string.IsNullOrWhiteSpace(host))
{
var port = _config.GetOrDefault("Notifications:Smtp:Port", 587);
if (port > 0)
{
var from = _config.GetOrDefault("Notifications:Smtp:From", string.Empty);
if (!string.IsNullOrWhiteSpace(from))
{
var sentToAll = true;
using (var smtp = new SmtpClient(host, port))
{
var username = _config.GetOrDefault("Notifications:Smtp:Username", string.Empty);
var password = _config.GetOrDefault("Notifications:Smtp:Password", string.Empty);
if (!string.IsNullOrWhiteSpace(username) && !string.IsNullOrWhiteSpace(password))
{
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential(username, password);
}
smtp.EnableSsl = _config.GetOrDefault("Notifications:Smtp:Use_SSL", false);
var sender = new MailAddress(from, _config.GetOrDefault("Notifications:Smtp:DisplayName", "WeddingShare"));
foreach (var to in recipients)
{
try
{
await _client.SendMailAsync(smtp, new MailMessage(new MailAddress(from, _config.GetOrDefault("Notifications:Smtp:DisplayName", "WeddingShare")), to)
{
Sender = sender,
Subject = title,
Body = !string.IsNullOrWhiteSpace(actionLink) ? $"{message}<br/><br/>Visit - {actionLink}" : message,
IsBodyHtml = true,
});
}
catch (Exception ex)
{
_logger.LogWarning(ex, $"Failed to send email to '{to}' - {ex.Message}");
sentToAll = false;
}
}
}
return sentToAll;
}
else
{
_logger.LogWarning($"Invalid SMTP sender specified");
}
}
else
{
_logger.LogWarning($"Invalid SMTP port specified");
}
}
else
{
_logger.LogWarning($"Invalid SMTP host specified");
}
}
else
{
_logger.LogWarning($"Invalid SMTP recipient specified");
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"Failed to send email with title '{title}' - {ex?.Message}");
}
}
return false;
}
}
}

View File

@@ -0,0 +1,75 @@
namespace WeddingShare.Helpers.Notifications
{
public class GotifyHelper : INotificationHelper
{
private readonly IConfigHelper _config;
private readonly IHttpClientFactory _clientFactory;
private readonly ILogger _logger;
public GotifyHelper(IConfigHelper config, IHttpClientFactory clientFactory, ILogger<GotifyHelper> logger)
{
_config = config;
_clientFactory = clientFactory;
_logger = logger;
}
public async Task<bool> Send(string title, string message, string? actionLink = null)
{
if (string.IsNullOrWhiteSpace(_config.GetOrDefault("Notifications:Gotify:Endpoint", string.Empty)))
{
_logger.LogWarning($"Invalid Gotify endpoint specified");
return false;
}
if (string.IsNullOrWhiteSpace(_config.GetOrDefault("Notifications:Gotify:Token", string.Empty)))
{
_logger.LogWarning($"Invalid Gotify token specified");
return false;
}
if (_config.GetOrDefault("Notifications:Gotify:Enabled", false))
{
try
{
var token = _config.GetOrDefault("Notifications:Gotify:Token", string.Empty);
if (!string.IsNullOrWhiteSpace(token))
{
var priority = _config.GetOrDefault("Notifications:Gotify:Priority", 4);
if (priority > 0)
{
message = !string.IsNullOrWhiteSpace(actionLink) ? $"{message} - Visit - {actionLink}" : message;
var client = _clientFactory.CreateClient("GotifyClient");
using (var response = await client.PostAsJsonAsync($"/message?token={token}", new { title, message, priority }))
{
if (response.IsSuccessStatusCode)
{
return true;
}
else
{
var error = await response.Content.ReadAsStringAsync();
_logger.LogError($"Failed to send Gotify message with title '{title}' - {error}");
}
}
}
else
{
_logger.LogWarning($"Invalid Gotify priority specified");
}
}
else
{
_logger.LogWarning($"Invalid Gotify token specified");
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"Failed to send Gotify message with title '{title}' - {ex?.Message}");
}
}
return false;
}
}
}

View File

@@ -0,0 +1,7 @@
namespace WeddingShare.Helpers.Notifications
{
public interface INotificationHelper
{
Task<bool> Send(string title, string message, string? actionLink = null);
}
}

View File

@@ -0,0 +1,42 @@
namespace WeddingShare.Helpers.Notifications
{
public class NotificationBroker : INotificationHelper
{
private readonly IConfigHelper _config;
private readonly ISmtpClientWrapper _smtp;
private readonly IHttpClientFactory _clientFactory;
private readonly ILoggerFactory _logger;
public NotificationBroker(IConfigHelper config, ISmtpClientWrapper smtp, IHttpClientFactory clientFactory, ILoggerFactory logger)
{
_config = config;
_smtp = smtp;
_clientFactory = clientFactory;
_logger = logger;
}
public async Task<bool> Send(string title, string message, string? actionLink = null)
{
var emailSent = true;
var ntfySent = true;
var gotifySent = true;
if (_config.GetOrDefault("Notifications:Smtp:Enabled", false))
{
emailSent = await new EmailHelper(_config, _smtp, _logger.CreateLogger<EmailHelper>()).Send(title, message, actionLink);
}
if (_config.GetOrDefault("Notifications:Ntfy:Enabled", false))
{
ntfySent = await new NtfyHelper(_config, _clientFactory, _logger.CreateLogger<NtfyHelper>()).Send(title, message, actionLink);
}
if (_config.GetOrDefault("Notifications:Gotify:Enabled", false))
{
gotifySent = await new GotifyHelper(_config, _clientFactory, _logger.CreateLogger<GotifyHelper>()).Send(title, message, actionLink);
}
return emailSent && ntfySent && gotifySent;
}
}
}

View File

@@ -0,0 +1,77 @@
namespace WeddingShare.Helpers.Notifications
{
public class NtfyHelper : INotificationHelper
{
private readonly IConfigHelper _config;
private readonly IHttpClientFactory _clientFactory;
private readonly ILogger _logger;
public NtfyHelper(IConfigHelper config, IHttpClientFactory clientFactory, ILogger<NtfyHelper> logger)
{
_config = config;
_clientFactory = clientFactory;
_logger = logger;
}
public async Task<bool> Send(string title, string message, string? actionLink = null)
{
if (string.IsNullOrWhiteSpace(_config.GetOrDefault("Notifications:Ntfy:Endpoint", string.Empty)))
{
_logger.LogWarning($"Invalid Ntfy endpoint specified");
return false;
}
if (string.IsNullOrWhiteSpace(_config.GetOrDefault("Notifications:Ntfy:Token", string.Empty)))
{
_logger.LogWarning($"Invalid Ntfy token specified");
return false;
}
if (_config.GetOrDefault("Notifications:Ntfy:Enabled", false))
{
try
{
var topic = _config.GetOrDefault("Notifications:Ntfy:Topic", "WeddingShare");
if (!string.IsNullOrWhiteSpace(topic))
{
var priority = _config.GetOrDefault("Notifications:Ntfy:Priority", 4);
if (priority > 0)
{
var defaultIcon = "https://github.com/Cirx08/WeddingShare/blob/main/WeddingShare/wwwroot/images/logo.png?raw=true";
var icon = _config.GetOrDefault("Settings:Logo", defaultIcon);
icon = !icon.StartsWith('.') && !icon.StartsWith('/') ? icon : defaultIcon;
var client = _clientFactory.CreateClient("NtfyClient");
using (var response = await client.PostAsJsonAsync("/", new { icon, topic, title, message, priority, click = actionLink }))
{
if (response.IsSuccessStatusCode)
{
return true;
}
else
{
var error = await response.Content.ReadAsStringAsync();
_logger.LogError($"Failed to send Ntfy message with title '{title}' - {error}");
}
}
}
else
{
_logger.LogWarning($"Invalid Ntfy priority specified");
}
}
else
{
_logger.LogWarning($"Invalid Ntfy topic specified");
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"Failed to send Ntfy message with title '{title}' - {ex?.Message}");
}
}
return false;
}
}
}

View File

@@ -0,0 +1,17 @@
using System.Net.Mail;
namespace WeddingShare.Helpers
{
public interface ISmtpClientWrapper
{
Task SendMailAsync(SmtpClient client, MailMessage message);
}
public class SmtpClientWrapper : ISmtpClientWrapper
{
public async Task SendMailAsync(SmtpClient client, MailMessage message)
{
await client.SendMailAsync(message);
}
}
}

View File

@@ -0,0 +1,96 @@
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
namespace WeddingShare.Helpers
{
public interface IUrlHelper
{
public string GenerateFullUrl(HttpRequest? ctx, string? path, List<KeyValuePair<string, string>>? append = null, List<string>? exclude = null);
public string GenerateBaseUrl(HttpRequest? ctx, string? path);
public string GenerateQueryString(HttpRequest? ctx, List<KeyValuePair<string, string>>? append = null, List<string>? exclude = null);
public string ExtractHost(string value);
public string ExtractQueryValue(HttpRequest? ctx, string key);
}
public class UrlHelper : IUrlHelper
{
private readonly IConfigHelper _config;
public UrlHelper(IConfigHelper config)
{
_config = config;
}
public string GenerateFullUrl(HttpRequest? ctx, string? path, List<KeyValuePair<string, string>>? append = null, List<string>? exclude = null)
{
return $"{GenerateBaseUrl(ctx, path)}{GenerateQueryString(ctx, append, exclude)}";
}
public string GenerateBaseUrl(HttpRequest? ctx, string? path)
{
if (ctx != null)
{
var scheme = _config.GetOrDefault("Settings:Force_Https", false) ? "https" : ctx.Scheme;
var host = ExtractHost(_config.GetOrDefault("Settings:Base_Url", ctx.Host.Value));
return $"{scheme}://{host}/{path?.TrimStart('/')}";
}
return string.Empty;
}
public string GenerateQueryString(HttpRequest? ctx, List<KeyValuePair<string, string>>? append = null, List<string>? exclude = null)
{
if (ctx != null)
{
append = append ?? new List<KeyValuePair<string, string>>();
exclude = exclude ?? new List<string>();
foreach (var a in append)
{
exclude.Add(a.Key);
}
var queryString = new StringBuilder();
foreach (var q in ctx.Query.Where(x => !exclude.Any(f => f.Equals(x.Key, StringComparison.OrdinalIgnoreCase))))
{
queryString.Append($"&{HttpUtility.UrlEncode(q.Key)}={HttpUtility.UrlEncode(q.Value)}");
}
foreach (var a in append)
{
queryString.Append($"&{HttpUtility.UrlEncode(a.Key)}={HttpUtility.UrlEncode(a.Value)}");
}
return $"?{queryString.ToString().Trim('&')}".TrimEnd('?');
}
return string.Empty;
}
public string ExtractHost(string value)
{
if (!string.IsNullOrWhiteSpace(value))
{
return Regex.Replace(value, "http[s]*\\:\\/\\/", string.Empty).Trim('/');
}
return string.Empty;
}
public string ExtractQueryValue(HttpRequest? ctx, string key)
{
if (ctx?.Query != null)
{
try
{
return ctx.Query.FirstOrDefault(x => string.Equals(key, x.Key, StringComparison.OrdinalIgnoreCase)).Value.ToString();
}
catch { }
}
return string.Empty;
}
}
}

View File

@@ -0,0 +1,6 @@
namespace WeddingShare.Lang
{
public class Translations
{
}
}

View File

@@ -0,0 +1,33 @@
using WeddingShare.Enums;
namespace WeddingShare.Models.Database
{
public class GalleryItemModel
{
public GalleryItemModel()
: this(0, 0, string.Empty, string.Empty, null, null, MediaType.Unknown, GalleryItemState.Pending)
{
}
public GalleryItemModel(int id, int galleryId, string galleryName, string title, string? uploadedBy, string? checksum, MediaType mediaType, GalleryItemState state)
{
Id = id;
GalleryId = galleryId;
GalleryName = galleryName;
Title = title;
UploadedBy = uploadedBy;
Checksum = checksum;
MediaType = mediaType;
State = state;
}
public int Id { get; set; }
public int GalleryId { get; set; }
public string GalleryName { get; set; }
public string Title { get; set; }
public string? UploadedBy { get; set; }
public string? Checksum { get; set; }
public MediaType MediaType { get; set; }
public GalleryItemState State { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
namespace WeddingShare.Models.Database
{
public class GalleryModel
{
public int Id { get; set; }
public string Name { get; set; }
public string? SecretKey { get; set; }
public int TotalItems { get; set; }
public int ApprovedItems { get; set; }
public int PendingItems { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
namespace WeddingShare.Models.Database
{
public class UserModel
{
public int Id { get; set; }
public string Username { get; set; }
public string? Email { get; set; }
public string? Password { get; set; }
public int FailedLogins { get; set; }
public DateTime? LockoutUntil { get; set; }
public string? MultiFactorToken { get; set; }
public bool IsLockedOut
{
get
{
return this.LockoutUntil != null && this.LockoutUntil >= DateTime.UtcNow;
}
}
}
}

View File

@@ -4,6 +4,6 @@ namespace WeddingShare.Models
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
public bool ShowRequestId => !string.IsNullOrWhiteSpace(RequestId);
}
}

View File

@@ -2,13 +2,17 @@
{
public class FileUploader
{
public FileUploader(string id, string url)
public FileUploader(string id, string? key, string url, bool identityRequired = false)
{
this.GalleryId = id;
this.SecretKey = key;
this.UploadUrl = url;
this.IdentityRequired = identityRequired;
}
public string? GalleryId { get; set; }
public string? SecretKey { get; set; }
public string? UploadUrl { get; set; }
public bool IdentityRequired { get; set; }
}
}

View File

@@ -4,8 +4,13 @@
{
public LoginModel()
{
this.Username = string.Empty;
this.Password = string.Empty;
this.Code = string.Empty;
}
public string? Password { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Code { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
namespace WeddingShare.Models.Migrator
{
public class KeyMigrator
{
public KeyMigrator(int priority, string key, Func<string, string>? action = null)
{
Priority = priority;
Key = key;
MigrationAction = action;
}
public string Key { get; set; }
public Func<string, string>? MigrationAction { get; set; }
public int Priority { get; set; }
}
}

View File

@@ -1,38 +1,38 @@
namespace WeddingShare.Models
using WeddingShare.Enums;
namespace WeddingShare.Models
{
public class PhotoGallery
{
public PhotoGallery()
: this(3)
: this(ViewMode.Default)
{
}
public PhotoGallery(int columnCount)
: this("default", columnCount, string.Empty, new List<string>())
public PhotoGallery(ViewMode viewMode)
: this(1, "default", string.Empty, viewMode, new List<PhotoGalleryImage>(), false)
{
}
public PhotoGallery(string id, int columnCount, string path, List<string> images)
public PhotoGallery(int id, string name, string secretKey, ViewMode viewMode, List<PhotoGalleryImage> images, bool requireIdentity)
{
this.GalleryId = id;
this.GalleryPath = path;
this.ColumnCount = columnCount;
this.GalleryName = name;
this.ViewMode = viewMode;
this.PendingCount = 0;
this.Images = images;
this.FileUploader = new FileUploader(id, "/Gallery/UploadImage");
this.FileUploader = new FileUploader(name, secretKey, "/Gallery/UploadImage", requireIdentity);
}
public string? GalleryId { get; set; }
public string? GalleryPath { get; set; }
public int ColumnCount { get; set; }
public int? GalleryId { get; set; }
public string? GalleryName { get; set; }
public ViewMode ViewMode { get; set; }
public int ApprovedCount { get; set; }
public int PendingCount { get; set; }
public int ApprovedCount
{
get
{
return this.Images?.Count ?? 0;
}
}
public int ItemsPerPage { get; set; } = 50;
public int CurrentPage { get; set; } = 1;
public bool Pagination { get; set; } = true;
public bool LoadScripts { get; set; } = true;
public int TotalCount
{
get
@@ -40,7 +40,23 @@
return this.ApprovedCount + this.PendingCount;
}
}
public List<string>? Images { get; set; }
public List<PhotoGalleryImage>? Images { get; set; }
public FileUploader? FileUploader { get; set; }
}
public class PhotoGalleryImage
{
public PhotoGalleryImage()
{
}
public int Id { get; set; }
public int? GalleryId { get; set; }
public string? GalleryName { get; set; }
public string? Name { get; set; }
public string? UploadedBy { get; set; }
public string? ImagePath { get; set; }
public string? ThumbnailPath { get; set; }
public MediaType MediaType { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
namespace WeddingShare.Models
{
public static class SessionKey
{
public const string DeviceType = "DeviceType";
public const string ViewerIdentity = "ViewerIdentity";
public const string MultiFactorTokenSet = "2FA_SET";
public const string MultiFactorSecret = "2FA_SECRET";
public const string MultiFactorQR = "2FA_QR_CODE";
}
}

View File

@@ -16,6 +16,6 @@ namespace WeddingShare
.UseIIS()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.UseUrls("http://*:5000/");
.UseUrls("http://*:5000");
}
}

View File

@@ -7,15 +7,15 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5051"
"applicationUrl": "http://localhost:5000"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"environmentVariables": {
"ASPNETCORE_HTTPS_PORTS": "8081",
"ASPNETCORE_HTTP_PORTS": "8080"
"ASPNETCORE_HTTPS_PORTS": "5001",
"ASPNETCORE_HTTP_PORTS": "5000"
},
"publishAllPorts": true,
"useSSL": true

View File

@@ -1,135 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Failed_Finding_File" xml:space="preserve">
<value>Failed to find file</value>
</data>
<data name="Failed_Reviewing_Photo" xml:space="preserve">
<value>Failed to review photo</value>
</data>
<data name="Login_Failed" xml:space="preserve">
<value>Faied to log user in</value>
</data>
<data name="Pending_Uploads_Failed" xml:space="preserve">
<value>Failed to get pending uploads</value>
</data>
<data name="Unknown_Review_Action" xml:space="preserve">
<value>Unknown review action</value>
</data>
</root>

View File

@@ -1,135 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Failed_Finding_File" xml:space="preserve">
<value>Impossible de trouver le fichier</value>
</data>
<data name="Failed_Reviewing_Photo" xml:space="preserve">
<value>Impossible de vérifier la photo</value>
</data>
<data name="Login_Failed" xml:space="preserve">
<value>Impossible de connecter l'utilisateur</value>
</data>
<data name="Pending_Uploads_Failed" xml:space="preserve">
<value>Impossible d'obtenir les téléchargements en attente</value>
</data>
<data name="Unknown_Review_Action" xml:space="preserve">
<value>Action de révision inconnue</value>
</data>
</root>

View File

@@ -1,147 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="File_Upload_Failed" xml:space="preserve">
<value>Failed to upload file</value>
</data>
<data name="Image_Upload_Failed" xml:space="preserve">
<value>Failed to upload images</value>
</data>
<data name="Invalid_Access_Token" xml:space="preserve">
<value>The provided access token was invalid</value>
</data>
<data name="Invalid_File_Type" xml:space="preserve">
<value>File type is invalid</value>
</data>
<data name="Invalid_Gallery_Id" xml:space="preserve">
<value>Invalid gallery Id</value>
</data>
<data name="Invalid_Gallery_Key" xml:space="preserve">
<value>Invalid gallery key</value>
</data>
<data name="Invalid_Security_Key_Warning" xml:space="preserve">
<value>A request was made using an invalid security key</value>
</data>
<data name="Max_File_Size" xml:space="preserve">
<value>Max file size is</value>
</data>
<data name="Save_To_Gallery_Failed" xml:space="preserve">
<value>Failed to save image to gallery</value>
</data>
</root>

View File

@@ -1,147 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="File_Upload_Failed" xml:space="preserve">
<value>Impossible de télécharger le fichier</value>
</data>
<data name="Image_Upload_Failed" xml:space="preserve">
<value>Impossible de télécharger les images</value>
</data>
<data name="Invalid_Access_Token" xml:space="preserve">
<value>Le jeton d'accès fourni n'était pas valide</value>
</data>
<data name="Invalid_File_Type" xml:space="preserve">
<value>Le type de fichier n'est pas valide</value>
</data>
<data name="Invalid_Gallery_Id" xml:space="preserve">
<value>ID de galerie invalide</value>
</data>
<data name="Invalid_Gallery_Key" xml:space="preserve">
<value>Clé de galerie non valide</value>
</data>
<data name="Invalid_Security_Key_Warning" xml:space="preserve">
<value>Une demande a été effectuée à l'aide d'une clé de sécurité non valide</value>
</data>
<data name="Max_File_Size" xml:space="preserve">
<value>La taille maximale du fichier est</value>
</data>
<data name="Save_To_Gallery_Failed" xml:space="preserve">
<value>Impossible d'enregistrer l'image dans la galerie</value>
</data>
</root>

View File

@@ -0,0 +1,435 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="File_Upload_Failed" xml:space="preserve">
<value>Datei-Upload fehlgeschlagen</value>
</data>
<data name="Duplicate_Item_Detected" xml:space="preserve">
<value>Doppelte Datei erkannt</value>
</data>
<data name="Gallery_Does_Not_Exist" xml:space="preserve">
<value>Die angeforderte Galerie wurde nicht gefunden oder existiert nicht</value>
</data>
<data name="Image_Upload_Failed" xml:space="preserve">
<value>Bilder-Upload fehlgeschlagen</value>
</data>
<data name="Invalid_Access_Token" xml:space="preserve">
<value>Das bereitgestellte Zugriffstoken war ungültig</value>
</data>
<data name="Invalid_File_Type" xml:space="preserve">
<value>Dateityp ist ungültig</value>
</data>
<data name="Invalid_Gallery_Id" xml:space="preserve">
<value>Ungültige Galerie-ID</value>
</data>
<data name="Invalid_Gallery_Key" xml:space="preserve">
<value>Ungültiger Galerie-Schlüssel</value>
</data>
<data name="Invalid_Secret_Key_Warning" xml:space="preserve">
<value>Eine Anfrage wurde mit einem ungültigen geheimen Schlüssel gestellt</value>
</data>
<data name="Max_File_Size" xml:space="preserve">
<value>Maximale Dateigröße ist</value>
</data>
<data name="Gallery_Full" xml:space="preserve">
<value>Die Galerie ist voll und überschritt die maximale Größe von</value>
</data>
<data name="New_Items_Pending_Review" xml:space="preserve">
<value>Neue Elemente warten auf Überprüfung</value>
</data>
<data name="No_Files_For_Upload" xml:space="preserve">
<value>Keine Dateien zum Hochladen erkannt</value>
</data>
<data name="Save_To_Gallery_Failed" xml:space="preserve">
<value>Speichern des Bildes in der Galerie fehlgeschlagen</value>
</data>
<data name="Failed_Download_Gallery" xml:space="preserve">
<value>Galerie-Download fehlgeschlagen</value>
</data>
<data name="Download_Gallery_Not_Allowed" xml:space="preserve">
<value>Sie sind nicht berechtigt, diese Galerie herunterzuladen</value>
</data>
<data name="Failed_Add_Gallery" xml:space="preserve">
<value>Erstellen der Galerie fehlgeschlagen</value>
</data>
<data name="Failed_Delete_Gallery" xml:space="preserve">
<value>Löschen der Galerie fehlgeschlagen</value>
</data>
<data name="Failed_Edit_Gallery" xml:space="preserve">
<value>Aktualisieren der Galerie fehlgeschlagen</value>
</data>
<data name="Failed_Export" xml:space="preserve">
<value>Export der Daten fehlgeschlagen</value>
</data>
<data name="Failed_Finding_File" xml:space="preserve">
<value>Datei nicht gefunden</value>
</data>
<data name="Failed_Import" xml:space="preserve">
<value>Import der Daten fehlgeschlagen</value>
</data>
<data name="Failed_Reviewing_Media" xml:space="preserve">
<value>Überprüfung des Elements fehlgeschlagen</value>
</data>
<data name="Failed_Wipe_Galleries" xml:space="preserve">
<value>Löschen der Galerien fehlgeschlagen</value>
</data>
<data name="Failed_Wipe_Gallery" xml:space="preserve">
<value>Löschen der Galerie fehlgeschlagen</value>
</data>
<data name="Gallery_Name_Already_Exists" xml:space="preserve">
<value>Galeriename existiert bereits</value>
</data>
<data name="Login_Failed" xml:space="preserve">
<value>Benutzeranmeldung fehlgeschlagen</value>
</data>
<data name="Name_Cannot_Be_Blank" xml:space="preserve">
<value>Galeriename darf nicht leer sein</value>
</data>
<data name="Gallery_List_Failed" xml:space="preserve">
<value>Galerieliste konnte nicht abgerufen werden.</value>
</data>
<data name="Users_List_Failed" xml:space="preserve">
<value>Benutzerliste konnte nicht abgerufen werden.</value>
</data>
<data name="Pending_Uploads_Failed" xml:space="preserve">
<value>Fehler beim Abrufen ausstehender Uploads</value>
</data>
<data name="Unknown_Review_Action" xml:space="preserve">
<value>Unbekannte Überprüfungsaktion</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Aktionen</value>
</data>
<data name="Username" xml:space="preserve">
<value>Benutzername</value>
</data>
<data name="Login" xml:space="preserve">
<value>Anmelden</value>
</data>
<data name="Login_Username_Help" xml:space="preserve">
<value>Bitte geben Sie den Benutzernamen ein.</value>
</data>
<data name="Login_Username_Placeholder" xml:space="preserve">
<value>Admin</value>
</data>
<data name="Login_Password_Help" xml:space="preserve">
<value>Bitte geben Sie das Passwort ein.</value>
</data>
<data name="Login_Password_Placeholder" xml:space="preserve">
<value>Passwort</value>
</data>
<data name="Approve" xml:space="preserve">
<value>Genehmigen</value>
</data>
<data name="Approved" xml:space="preserve">
<value>Genehmigt</value>
</data>
<data name="Available_Galleries" xml:space="preserve">
<value>Verfügbare Galerien</value>
</data>
<data name="Create" xml:space="preserve">
<value>Erstellen</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Löschen</value>
</data>
<data name="Key" xml:space="preserve">
<value>Schlüssel</value>
</data>
<data name="Link" xml:space="preserve">
<value>Link</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="No_Galleries" xml:space="preserve">
<value>Noch keine Galerien erstellt</value>
</data>
<data name="No_Pending_Uploads" xml:space="preserve">
<value>Keine ausstehenden Uploads</value>
</data>
<data name="Pending" xml:space="preserve">
<value>Ausstehend</value>
</data>
<data name="Pending_Uploads" xml:space="preserve">
<value>Ausstehende Uploads</value>
</data>
<data name="Reject" xml:space="preserve">
<value>Ablehnen</value>
</data>
<data name="Rename" xml:space="preserve">
<value>Umbenennen</value>
</data>
<data name="Total" xml:space="preserve">
<value>Gesamt</value>
</data>
<data name="Uploaded_By" xml:space="preserve">
<value>Hochgeladen von</value>
</data>
<data name="Review" xml:space="preserve">
<value>Überprüfen</value>
</data>
<data name="Import" xml:space="preserve">
<value>Importieren</value>
</data>
<data name="Export" xml:space="preserve">
<value>Exportieren</value>
</data>
<data name="Wipe" xml:space="preserve">
<value>Löschen</value>
</data>
<data name="Gallery" xml:space="preserve">
<value>Galerie</value>
</data>
<data name="Uploader" xml:space="preserve">
<value>Uploader</value>
</data>
<data name="400_Error_Message" xml:space="preserve">
<value>Wenn dieses Problem weiterhin besteht, wenden Sie sich bitte an den Webadministrator</value>
</data>
<data name="400_Error_Title" xml:space="preserve">
<value>Ups, es sieht so aus, als wäre ein unerwarteter Fehler aufgetreten...</value>
</data>
<data name="401_Error_Message" xml:space="preserve">
<value>Es sieht so aus, als wären Sie nicht berechtigt, diese Seite anzusehen...</value>
</data>
<data name="401_Error_Title" xml:space="preserve">
<value>Zugriff verweigert</value>
</data>
<data name="402_Error_Message" xml:space="preserve">
<value>Der angegebene geheime Schlüssel war falsch</value>
</data>
<data name="402_Error_Title" xml:space="preserve">
<value>Ungültiger geheimer Schlüssel</value>
</data>
<data name="403_Error_Message" xml:space="preserve">
<value>Die angegebene Galerie existiert nicht und Sie haben keine Berechtigung, sie zu erstellen</value>
</data>
<data name="403_Error_Title" xml:space="preserve">
<value>Zugriff verweigert</value>
</data>
<data name="Share_Code" xml:space="preserve">
<value>Teilen Code</value>
</data>
<data name="View" xml:space="preserve">
<value>Ansicht</value>
</data>
<data name="Sort" xml:space="preserve">
<value>Sortieren</value>
</data>
<data name="Gallery_Empty_Upload" xml:space="preserve">
<value>Es wurden bisher keine Erinnerungen geteilt, warum laden Sie Ihre nicht oben hoch!</value>
</data>
<data name="Gallery_Empty" xml:space="preserve">
<value>Es wurden bisher keine Erinnerungen geteilt</value>
</data>
<data name="Scan_To_Share" xml:space="preserve">
<value>Scannen Sie den QR-Code mit Ihrem Telefon, um Ihre Bilder zu teilen</value>
</data>
<data name="Gallery_Key" xml:space="preserve">
<value>Galerie Schlüssel</value>
</data>
<data name="Gallery_Key_Help" xml:space="preserve">
<value>Bitte geben Sie den geheimen Schlüssel ein.</value>
</data>
<data name="Gallery_Key_Placeholder" xml:space="preserve">
<value>hochzeitstag</value>
</data>
<data name="Gallery_Name" xml:space="preserve">
<value>Galerie Name</value>
</data>
<data name="Gallery_Name_Help" xml:space="preserve">
<value>Bitte geben Sie den Namen der Galerie ein, die Sie besuchen möchten.</value>
</data>
<data name="Gallery_Name_Placeholder" xml:space="preserve">
<value>meine-hochzeitsgalerie</value>
</data>
<data name="Gallery_Selector_Title" xml:space="preserve">
<value>Galerieauswahl</value>
</data>
<data name="Generate" xml:space="preserve">
<value>Erstellen</value>
</data>
<data name="Logout" xml:space="preserve">
<value>Abmelden</value>
</data>
<data name="Visit" xml:space="preserve">
<value>Zur Galerie</value>
</data>
<data name="Click_To_Upload" xml:space="preserve">
<value>Klicken Sie hier, um Dateien zum Hochladen auszuwählen</value>
</data>
<data name="Drag_And_Drop" xml:space="preserve">
<value>Ziehen Sie Dateien hierher und legen Sie sie dort ab, um sie in die Galerie hochzuladen</value>
</data>
<data name="Upload_Media" xml:space="preserve">
<value>Medien hochladen</value>
</data>
<data name="Clean" xml:space="preserve">
<value>Aufräumem</value>
</data>
<data name="Clean_Confirmation" xml:space="preserve">
<value>Sind Sie sicher, dass Sie diese Galerie aufräumen möchten?</value>
</data>
<data name="Wipe_Confirmation" xml:space="preserve">
<value>Sind Sie sicher, dass Sie diese Galerie löschen möchten?</value>
</data>
<data name="Close" xml:space="preserve">
<value>Schließen</value>
</data>
<data name="Default" xml:space="preserve">
<value>Standard</value>
</data>
<data name="Delete_Confirmation" xml:space="preserve">
<value>Sind Sie sicher, dass Sie diese Galerie löschen möchten?</value>
</data>
<data name="Update" xml:space="preserve">
<value>Aktualisieren</value>
</data>
<data name="Wipe_All_Confirmation" xml:space="preserve">
<value>Aktualisieren</value>
</data>
<data name="Homepage_Load_Error" xml:space="preserve">
<value>Beim Laden der Homepage ist ein Fehler aufgetreten</value>
</data>
<data name="Identity_Session_Error" xml:space="preserve">
<value>Fehler beim Festlegen der Benutzeridentitätssitzung Name</value>
</data>
<data name="Save_QR" xml:space="preserve">
<value>QR speichern</value>
</data>
<data name="FFMPEG_Downloading" xml:space="preserve">
<value>Es wurde versucht, ein Video-Thumbnail zu erstellen, aber der Download von FFMPEG ist noch nicht abgeschlossen. Wenn es sich um eine Neuinstallation handelt, warten Sie bitte, bis der Download abgeschlossen ist. Fehlende Thumbnails werden vom Hintergrundscanner erstellt.</value>
</data>
<data name="FFMPEG_Download_Failed" xml:space="preserve">
<value>FFMPEG konnte nicht in den Pfad heruntergeladen werden</value>
</data>
<data name="MultiFactor_Token_Set_Failed" xml:space="preserve">
<value>2FA konnte nicht eingerichtet werden</value>
</data>
<data name="Users" xml:space="preserve">
<value>Benutzer</value>
</data>
<data name="Galleries" xml:space="preserve">
<value>Galerien</value>
</data>
<data name="Failed_Delete_User" xml:space="preserve">
<value>Benutzer konnte nicht gelöscht werden</value>
</data>
</root>

View File

@@ -0,0 +1,435 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="File_Upload_Failed" xml:space="preserve">
<value>Failed to upload file</value>
</data>
<data name="Duplicate_Item_Detected" xml:space="preserve">
<value>Duplicate file detected</value>
</data>
<data name="Gallery_Does_Not_Exist" xml:space="preserve">
<value>The requested gallery was not found or does not exist</value>
</data>
<data name="Image_Upload_Failed" xml:space="preserve">
<value>Failed to upload images</value>
</data>
<data name="Invalid_Access_Token" xml:space="preserve">
<value>The provided access token was invalid</value>
</data>
<data name="Invalid_File_Type" xml:space="preserve">
<value>File type is invalid</value>
</data>
<data name="Invalid_Gallery_Id" xml:space="preserve">
<value>Invalid gallery Id</value>
</data>
<data name="Invalid_Gallery_Key" xml:space="preserve">
<value>Invalid gallery key</value>
</data>
<data name="Invalid_Secret_Key_Warning" xml:space="preserve">
<value>A request was made using an invalid secret key</value>
</data>
<data name="Max_File_Size" xml:space="preserve">
<value>Max file size is</value>
</data>
<data name="Gallery_Full" xml:space="preserve">
<value>Gallery is full and has exceeded the max size of</value>
</data>
<data name="New_Items_Pending_Review" xml:space="preserve">
<value>New Items Pending Review</value>
</data>
<data name="No_Files_For_Upload" xml:space="preserve">
<value>No files were detected for upload</value>
</data>
<data name="Save_To_Gallery_Failed" xml:space="preserve">
<value>Failed to save image to gallery</value>
</data>
<data name="Failed_Download_Gallery" xml:space="preserve">
<value>Failed to download gallery</value>
</data>
<data name="Download_Gallery_Not_Allowed" xml:space="preserve">
<value>You are not authorised to download this gallery</value>
</data>
<data name="Failed_Add_Gallery" xml:space="preserve">
<value>Failed to create gallery</value>
</data>
<data name="Failed_Delete_Gallery" xml:space="preserve">
<value>Failed to delete gallery</value>
</data>
<data name="Failed_Edit_Gallery" xml:space="preserve">
<value>Failed to update gallery</value>
</data>
<data name="Failed_Export" xml:space="preserve">
<value>Failed to export data</value>
</data>
<data name="Failed_Finding_File" xml:space="preserve">
<value>Failed to find file</value>
</data>
<data name="Failed_Import" xml:space="preserve">
<value>Failed to import data</value>
</data>
<data name="Failed_Reviewing_Media" xml:space="preserve">
<value>Failed to review item</value>
</data>
<data name="Failed_Wipe_Galleries" xml:space="preserve">
<value>Failed to wipe galleries</value>
</data>
<data name="Failed_Wipe_Gallery" xml:space="preserve">
<value>Failed to wipe gallery</value>
</data>
<data name="Gallery_Name_Already_Exists" xml:space="preserve">
<value>Gallery name already exists</value>
</data>
<data name="Login_Failed" xml:space="preserve">
<value>Failed to log user in</value>
</data>
<data name="Name_Cannot_Be_Blank" xml:space="preserve">
<value>Gallery name cannot be empty</value>
</data>
<data name="Gallery_List_Failed" xml:space="preserve">
<value>Failed to get gallery list</value>
</data>
<data name="Users_List_Failed" xml:space="preserve">
<value>Failed to get users list</value>
</data>
<data name="Pending_Uploads_Failed" xml:space="preserve">
<value>Failed to get pending uploads</value>
</data>
<data name="Unknown_Review_Action" xml:space="preserve">
<value>Unknown review action</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</data>
<data name="Username" xml:space="preserve">
<value>Username</value>
</data>
<data name="Login" xml:space="preserve">
<value>Login</value>
</data>
<data name="Login_Username_Help" xml:space="preserve">
<value>Please enter account username.</value>
</data>
<data name="Login_Username_Placeholder" xml:space="preserve">
<value>Admin</value>
</data>
<data name="Login_Password_Help" xml:space="preserve">
<value>Please enter account password.</value>
</data>
<data name="Login_Password_Placeholder" xml:space="preserve">
<value>Password</value>
</data>
<data name="Approve" xml:space="preserve">
<value>Approve</value>
</data>
<data name="Approved" xml:space="preserve">
<value>Approved</value>
</data>
<data name="Available_Galleries" xml:space="preserve">
<value>Available Galleries</value>
</data>
<data name="Create" xml:space="preserve">
<value>Create</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Delete</value>
</data>
<data name="Key" xml:space="preserve">
<value>Key</value>
</data>
<data name="Link" xml:space="preserve">
<value>Link</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="No_Galleries" xml:space="preserve">
<value>No galleries created yet</value>
</data>
<data name="No_Pending_Uploads" xml:space="preserve">
<value>No uploads pending review</value>
</data>
<data name="Pending" xml:space="preserve">
<value>Pending</value>
</data>
<data name="Pending_Uploads" xml:space="preserve">
<value>Pending Uploads</value>
</data>
<data name="Reject" xml:space="preserve">
<value>Reject</value>
</data>
<data name="Rename" xml:space="preserve">
<value>Rename</value>
</data>
<data name="Total" xml:space="preserve">
<value>Total</value>
</data>
<data name="Uploaded_By" xml:space="preserve">
<value>Uploaded By</value>
</data>
<data name="Review" xml:space="preserve">
<value>Review</value>
</data>
<data name="Import" xml:space="preserve">
<value>Import</value>
</data>
<data name="Export" xml:space="preserve">
<value>Export</value>
</data>
<data name="Wipe" xml:space="preserve">
<value>Wipe</value>
</data>
<data name="Gallery" xml:space="preserve">
<value>Gallery</value>
</data>
<data name="Uploader" xml:space="preserve">
<value>Uploader</value>
</data>
<data name="400_Error_Message" xml:space="preserve">
<value>If this issue persists please contact the web administrator</value>
</data>
<data name="400_Error_Title" xml:space="preserve">
<value>Opps, it looks like an unexpected error occurred...</value>
</data>
<data name="401_Error_Message" xml:space="preserve">
<value>It looks like you are not authorized to view that page...</value>
</data>
<data name="401_Error_Title" xml:space="preserve">
<value>Access Denied</value>
</data>
<data name="402_Error_Message" xml:space="preserve">
<value>The provided secret key was incorrect</value>
</data>
<data name="402_Error_Title" xml:space="preserve">
<value>Invalid Secret Key</value>
</data>
<data name="403_Error_Message" xml:space="preserve">
<value>The specified gellery does not exist and you do not have permissions to create it</value>
</data>
<data name="403_Error_Title" xml:space="preserve">
<value>Access Denied</value>
</data>
<data name="Share_Code" xml:space="preserve">
<value>Share Code</value>
</data>
<data name="View" xml:space="preserve">
<value>View</value>
</data>
<data name="Sort" xml:space="preserve">
<value>Sort</value>
</data>
<data name="Gallery_Empty_Upload" xml:space="preserve">
<value>There are currently no memories shared, why don't you upload yours above!</value>
</data>
<data name="Gallery_Empty" xml:space="preserve">
<value>There are currently no memories shared</value>
</data>
<data name="Scan_To_Share" xml:space="preserve">
<value>Scan the QR code with your phone to share your images</value>
</data>
<data name="Gallery_Key" xml:space="preserve">
<value>Gallery Key</value>
</data>
<data name="Gallery_Key_Help" xml:space="preserve">
<value>Please enter the secret key.</value>
</data>
<data name="Gallery_Key_Placeholder" xml:space="preserve">
<value>wedding-day</value>
</data>
<data name="Gallery_Name" xml:space="preserve">
<value>Gallery Name</value>
</data>
<data name="Gallery_Name_Help" xml:space="preserve">
<value>Please enter the name of the gallery you want to visit.</value>
</data>
<data name="Gallery_Name_Placeholder" xml:space="preserve">
<value>my-wedding-gallery</value>
</data>
<data name="Gallery_Selector_Title" xml:space="preserve">
<value>Gallery Selector</value>
</data>
<data name="Generate" xml:space="preserve">
<value>Generate</value>
</data>
<data name="Logout" xml:space="preserve">
<value>Logout</value>
</data>
<data name="Visit" xml:space="preserve">
<value>Visit</value>
</data>
<data name="Click_To_Upload" xml:space="preserve">
<value>Click here to select files to upload</value>
</data>
<data name="Drag_And_Drop" xml:space="preserve">
<value>Drag &amp; Drop files(s) here to upload them to the gallery</value>
</data>
<data name="Upload_Media" xml:space="preserve">
<value>Upload Media</value>
</data>
<data name="Clean" xml:space="preserve">
<value>Clean</value>
</data>
<data name="Clean_Confirmation" xml:space="preserve">
<value>Are you sure you want to clean this gallery?</value>
</data>
<data name="Wipe_Confirmation" xml:space="preserve">
<value>Are you sure you want to wipe this gallery?</value>
</data>
<data name="Close" xml:space="preserve">
<value>Close</value>
</data>
<data name="Default" xml:space="preserve">
<value>Default</value>
</data>
<data name="Delete_Confirmation" xml:space="preserve">
<value>Are you sure you want to delete this gallery?</value>
</data>
<data name="Update" xml:space="preserve">
<value>Update</value>
</data>
<data name="Wipe_All_Confirmation" xml:space="preserve">
<value>Are you sure you want to wipe all galleries?</value>
</data>
<data name="Homepage_Load_Error" xml:space="preserve">
<value>An error occurred loading the homepage</value>
</data>
<data name="Identity_Session_Error" xml:space="preserve">
<value>Failed to set user identity session - Name</value>
</data>
<data name="Save_QR" xml:space="preserve">
<value>Save QR</value>
</data>
<data name="FFMPEG_Downloading" xml:space="preserve">
<value>Attempted to generate video thumbnail but FFMPEG has not completed downloading yet. If this is a fresh install please wait for the download to complete and missed thumbnails will be generated by the background scanner</value>
</data>
<data name="FFMPEG_Download_Failed" xml:space="preserve">
<value>Failed to download FFMPEG to path</value>
</data>
<data name="MultiFactor_Token_Set_Failed" xml:space="preserve">
<value>Failed to set up 2FA</value>
</data>
<data name="Users" xml:space="preserve">
<value>Users</value>
</data>
<data name="Galleries" xml:space="preserve">
<value>Galleries</value>
</data>
<data name="Failed_Delete_User" xml:space="preserve">
<value>Failed to delete user</value>
</data>
</root>

View File

@@ -0,0 +1,435 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="File_Upload_Failed" xml:space="preserve">
<value>Error al subir el archivo</value>
</data>
<data name="Duplicate_Item_Detected" xml:space="preserve">
<value>Archivo duplicado detectado</value>
</data>
<data name="Gallery_Does_Not_Exist" xml:space="preserve">
<value>La galería solicitada no fue encontrada o no existe</value>
</data>
<data name="Image_Upload_Failed" xml:space="preserve">
<value>Error al subir imágenes</value>
</data>
<data name="Invalid_Access_Token" xml:space="preserve">
<value>El token de acceso proporcionado no es válido</value>
</data>
<data name="Invalid_File_Type" xml:space="preserve">
<value>El tipo de archivo no es válido</value>
</data>
<data name="Invalid_Gallery_Id" xml:space="preserve">
<value>ID de galería no válido</value>
</data>
<data name="Invalid_Gallery_Key" xml:space="preserve">
<value>Clave de galería no válida</value>
</data>
<data name="Invalid_Secret_Key_Warning" xml:space="preserve">
<value>Se realizó una solicitud con una clave secreta no válida</value>
</data>
<data name="Max_File_Size" xml:space="preserve">
<value>El tamaño máximo de archivo es</value>
</data>
<data name="Gallery_Full" xml:space="preserve">
<value>La galería está llena y ha excedido el tamaño máximo de</value>
</data>
<data name="New_Items_Pending_Review" xml:space="preserve">
<value>Nuevos elementos pendientes de revisión</value>
</data>
<data name="No_Files_For_Upload" xml:space="preserve">
<value>No se detectaron archivos para subir</value>
</data>
<data name="Save_To_Gallery_Failed" xml:space="preserve">
<value>Error al guardar la imagen en la galería</value>
</data>
<data name="Failed_Download_Gallery" xml:space="preserve">
<value>Error al descargar la galería</value>
</data>
<data name="Download_Gallery_Not_Allowed" xml:space="preserve">
<value>No tienes autorización para descargar esta galería</value>
</data>
<data name="Failed_Add_Gallery" xml:space="preserve">
<value>Error al crear la galería</value>
</data>
<data name="Failed_Delete_Gallery" xml:space="preserve">
<value>Error al eliminar la galería</value>
</data>
<data name="Failed_Edit_Gallery" xml:space="preserve">
<value>Error al actualizar la galería</value>
</data>
<data name="Failed_Export" xml:space="preserve">
<value>Error al exportar datos</value>
</data>
<data name="Failed_Finding_File" xml:space="preserve">
<value>Error al encontrar el archivo</value>
</data>
<data name="Failed_Import" xml:space="preserve">
<value>Error al importar datos</value>
</data>
<data name="Failed_Reviewing_Media" xml:space="preserve">
<value>Error al revisar el elemento</value>
</data>
<data name="Failed_Wipe_Galleries" xml:space="preserve">
<value>Error al borrar las galerías</value>
</data>
<data name="Failed_Wipe_Gallery" xml:space="preserve">
<value>Error al borrar la galería</value>
</data>
<data name="Gallery_Name_Already_Exists" xml:space="preserve">
<value>El nombre de la galería ya existe</value>
</data>
<data name="Login_Failed" xml:space="preserve">
<value>Error al iniciar sesión</value>
</data>
<data name="Name_Cannot_Be_Blank" xml:space="preserve">
<value>El nombre de la galería no puede estar vacío</value>
</data>
<data name="Gallery_List_Failed" xml:space="preserve">
<value>No se pudo obtener la lista de la galería</value>
</data>
<data name="Users_List_Failed" xml:space="preserve">
<value>Failed to get users list</value>
</data>
<data name="Pending_Uploads_Failed" xml:space="preserve">
<value>No se pudo obtener la lista de usuarios</value>
</data>
<data name="Unknown_Review_Action" xml:space="preserve">
<value>Acción de revisión desconocida</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Acciones</value>
</data>
<data name="Username" xml:space="preserve">
<value>Usuario</value>
</data>
<data name="Login" xml:space="preserve">
<value>Iniciar sesión</value>
</data>
<data name="Login_Username_Help" xml:space="preserve">
<value>Por favor, introduce el nombre de usuario de la cuenta.</value>
</data>
<data name="Login_Username_Placeholder" xml:space="preserve">
<value>Admin</value>
</data>
<data name="Login_Password_Help" xml:space="preserve">
<value>Por favor, introduce la contraseña de la cuenta.</value>
</data>
<data name="Login_Password_Placeholder" xml:space="preserve">
<value>Contraseña</value>
</data>
<data name="Approve" xml:space="preserve">
<value>Aprobar</value>
</data>
<data name="Approved" xml:space="preserve">
<value>Aprobado</value>
</data>
<data name="Available_Galleries" xml:space="preserve">
<value>Galerías disponibles</value>
</data>
<data name="Create" xml:space="preserve">
<value>Crear</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Eliminar</value>
</data>
<data name="Key" xml:space="preserve">
<value>Clave</value>
</data>
<data name="Link" xml:space="preserve">
<value>Enlace</value>
</data>
<data name="Name" xml:space="preserve">
<value>Nombre</value>
</data>
<data name="No_Galleries" xml:space="preserve">
<value>Aún no hay galerías creadas</value>
</data>
<data name="No_Pending_Uploads" xml:space="preserve">
<value>No hay subidas pendientes de revisión</value>
</data>
<data name="Pending" xml:space="preserve">
<value>Pendiente</value>
</data>
<data name="Pending_Uploads" xml:space="preserve">
<value>Subidas pendientes</value>
</data>
<data name="Reject" xml:space="preserve">
<value>Rechazar</value>
</data>
<data name="Rename" xml:space="preserve">
<value>Renombrar</value>
</data>
<data name="Total" xml:space="preserve">
<value>Total</value>
</data>
<data name="Uploaded_By" xml:space="preserve">
<value>Subido por</value>
</data>
<data name="Review" xml:space="preserve">
<value>Revisar</value>
</data>
<data name="Import" xml:space="preserve">
<value>Importar</value>
</data>
<data name="Export" xml:space="preserve">
<value>Exportar</value>
</data>
<data name="Wipe" xml:space="preserve">
<value>Borrar</value>
</data>
<data name="Gallery" xml:space="preserve">
<value>Galería</value>
</data>
<data name="Uploader" xml:space="preserve">
<value>Subido por</value>
</data>
<data name="400_Error_Message" xml:space="preserve">
<value>Si este problema persiste, contacta al administrador web</value>
</data>
<data name="400_Error_Title" xml:space="preserve">
<value>Oops, parece que ocurrió un error inesperado...</value>
</data>
<data name="401_Error_Message" xml:space="preserve">
<value>Parece que no estás autorizado para ver esta página...</value>
</data>
<data name="401_Error_Title" xml:space="preserve">
<value>Acceso Denegado</value>
</data>
<data name="402_Error_Message" xml:space="preserve">
<value>La clave secreta proporcionada es incorrecta</value>
</data>
<data name="402_Error_Title" xml:space="preserve">
<value>Clave secreta inválida</value>
</data>
<data name="403_Error_Message" xml:space="preserve">
<value>La galería especificada no existe y no tienes permisos para crearla</value>
</data>
<data name="403_Error_Title" xml:space="preserve">
<value>Acceso Denegado</value>
</data>
<data name="Share_Code" xml:space="preserve">
<value>Código para compartir</value>
</data>
<data name="View" xml:space="preserve">
<value>Ver</value>
</data>
<data name="Sort" xml:space="preserve">
<value>Ordenar</value>
</data>
<data name="Gallery_Empty_Upload" xml:space="preserve">
<value>Aún no hay recuerdos compartidos, ¡sube los tuyos arriba!</value>
</data>
<data name="Gallery_Empty" xml:space="preserve">
<value>Aún no hay recuerdos compartidos</value>
</data>
<data name="Scan_To_Share" xml:space="preserve">
<value>Escanea el código QR con tu teléfono para compartir tus imágenes</value>
</data>
<data name="Gallery_Key" xml:space="preserve">
<value>Clave de la galería</value>
</data>
<data name="Gallery_Key_Help" xml:space="preserve">
<value>Por favor, introduce la clave secreta.</value>
</data>
<data name="Gallery_Key_Placeholder" xml:space="preserve">
<value>wedding-day</value>
</data>
<data name="Gallery_Name" xml:space="preserve">
<value>Nombre de la galería</value>
</data>
<data name="Gallery_Name_Help" xml:space="preserve">
<value>Please enter the name of the gallery you want to visit.</value>
</data>
<data name="Gallery_Name_Placeholder" xml:space="preserve">
<value>my-wedding-gallery</value>
</data>
<data name="Gallery_Selector_Title" xml:space="preserve">
<value>Selector de galería</value>
</data>
<data name="Generate" xml:space="preserve">
<value>Generar</value>
</data>
<data name="Logout" xml:space="preserve">
<value>Cerrar sesión</value>
</data>
<data name="Visit" xml:space="preserve">
<value>Visitar</value>
</data>
<data name="Click_To_Upload" xml:space="preserve">
<value>Haz clic aquí para seleccionar archivos para subir</value>
</data>
<data name="Drag_And_Drop" xml:space="preserve">
<value>Arrastra y suelta archivos aquí para subirlos a la galería</value>
</data>
<data name="Upload_Media" xml:space="preserve">
<value>Subir ficheros</value>
</data>
<data name="Clean" xml:space="preserve">
<value>Limpiar</value>
</data>
<data name="Clean_Confirmation" xml:space="preserve">
<value>¿Estás seguro de que quieres limpiar esta galería?</value>
</data>
<data name="Wipe_Confirmation" xml:space="preserve">
<value>¿Estás seguro de que quieres borrar esta galería?</value>
</data>
<data name="Close" xml:space="preserve">
<value>Cerrar</value>
</data>
<data name="Default" xml:space="preserve">
<value>Por defecro</value>
</data>
<data name="Delete_Confirmation" xml:space="preserve">
<value>¿Estás seguro de que quieres eliminar esta galería?</value>
</data>
<data name="Update" xml:space="preserve">
<value>Actualizar</value>
</data>
<data name="Wipe_All_Confirmation" xml:space="preserve">
<value>¿Estás seguro de que quieres borrar todas las galerías?</value>
</data>
<data name="Homepage_Load_Error" xml:space="preserve">
<value>Ocurrió un error al cargar la página de inicio</value>
</data>
<data name="Identity_Session_Error" xml:space="preserve">
<value>Error al establecer la sesión de identidad del usuario - Nombre</value>
</data>
<data name="Save_QR" xml:space="preserve">
<value>Guardar QR</value>
</data>
<data name="FFMPEG_Downloading" xml:space="preserve">
<value>Intentando generar miniaturas de video, pero FFMPEG aún no ha terminado de descargarse. Si es una instalación nueva, espera a que termine la descarga.</value>
</data>
<data name="FFMPEG_Download_Failed" xml:space="preserve">
<value>Error al descargar FFMPEG en la ruta especificada</value>
</data>
<data name="MultiFactor_Token_Set_Failed" xml:space="preserve">
<value>Error al configurar 2FA</value>
</data>
<data name="Users" xml:space="preserve">
<value>Usuarias</value>
</data>
<data name="Galleries" xml:space="preserve">
<value>Galerías</value>
</data>
<data name="Failed_Delete_User" xml:space="preserve">
<value>No se pudo eliminar la usuario</value>
</data>
</root>

View File

@@ -0,0 +1,435 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="File_Upload_Failed" xml:space="preserve">
<value>Impossible de télécharger le fichier</value>
</data>
<data name="Duplicate_Item_Detected" xml:space="preserve">
<value>Fichier en double détecté</value>
</data>
<data name="Gallery_Does_Not_Exist" xml:space="preserve">
<value>La galerie demandée n'a pas été trouvée ou n'existe pas</value>
</data>
<data name="Image_Upload_Failed" xml:space="preserve">
<value>Impossible de télécharger les images</value>
</data>
<data name="Invalid_Access_Token" xml:space="preserve">
<value>Le jeton d'accès fourni n'était pas valide</value>
</data>
<data name="Invalid_File_Type" xml:space="preserve">
<value>Le type de fichier n'est pas valide</value>
</data>
<data name="Invalid_Gallery_Id" xml:space="preserve">
<value>ID de galerie invalide</value>
</data>
<data name="Invalid_Gallery_Key" xml:space="preserve">
<value>Clé de galerie non valide</value>
</data>
<data name="Invalid_Secret_Key_Warning" xml:space="preserve">
<value>Une demande a été effectuée à l'aide d'une clé de sécurité non valide</value>
</data>
<data name="Max_File_Size" xml:space="preserve">
<value>La taille maximale du fichier est</value>
</data>
<data name="Gallery_Full" xml:space="preserve">
<value>La galerie est pleine et a dépassé la taille maximale de</value>
</data>
<data name="New_Items_Pending_Review" xml:space="preserve">
<value>Nouveaux articles en attente d'examen</value>
</data>
<data name="No_Files_For_Upload" xml:space="preserve">
<value>Aucun fichier n'a été détecté pour le téléchargement</value>
</data>
<data name="Save_To_Gallery_Failed" xml:space="preserve">
<value>Impossible d'enregistrer l'image dans la galerie</value>
</data>
<data name="Failed_Download_Gallery" xml:space="preserve">
<value>Impossible de télécharger la galerie</value>
</data>
<data name="Download_Gallery_Not_Allowed" xml:space="preserve">
<value>Vous n'êtes pas autorisé à télécharger cette galerie</value>
</data>
<data name="Failed_Add_Gallery" xml:space="preserve">
<value>Impossible de créer la galerie</value>
</data>
<data name="Failed_Delete_Gallery" xml:space="preserve">
<value>Impossible de supprimer la galerie</value>
</data>
<data name="Failed_Edit_Gallery" xml:space="preserve">
<value>Échec de la mise à jour de la galerie</value>
</data>
<data name="Failed_Export" xml:space="preserve">
<value>Échec de l'exportation des données</value>
</data>
<data name="Failed_Finding_File" xml:space="preserve">
<value>Impossible de trouver le fichier</value>
</data>
<data name="Failed_Import" xml:space="preserve">
<value>Échec de l'importation des données</value>
</data>
<data name="Failed_Reviewing_Media" xml:space="preserve">
<value>Impossible de réviser l'article</value>
</data>
<data name="Failed_Wipe_Galleries" xml:space="preserve">
<value>Impossible d'effacer la galerie</value>
</data>
<data name="Failed_Wipe_Gallery" xml:space="preserve">
<value>Impossible d'effacer la galerie</value>
</data>
<data name="Gallery_Name_Already_Exists" xml:space="preserve">
<value>Le nom de la galerie existe déjà</value>
</data>
<data name="Login_Failed" xml:space="preserve">
<value>Impossible de connecter l'utilisateur</value>
</data>
<data name="Name_Cannot_Be_Blank" xml:space="preserve">
<value>Le nom de la galerie ne peut pas être vide</value>
</data>
<data name="Gallery_List_Failed" xml:space="preserve">
<value>Impossible d'obtenir la liste des galeries</value>
</data>
<data name="Users_List_Failed" xml:space="preserve">
<value>Impossible d'obtenir la liste des utilisateurs</value>
</data>
<data name="Pending_Uploads_Failed" xml:space="preserve">
<value>Impossible d'obtenir les téléchargements en attente</value>
</data>
<data name="Unknown_Review_Action" xml:space="preserve">
<value>Action de révision inconnue</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Actes</value>
</data>
<data name="Username" xml:space="preserve">
<value>Benutzername</value>
</data>
<data name="Login" xml:space="preserve">
<value>Se connecter</value>
</data>
<data name="Login_Username_Help" xml:space="preserve">
<value>Veuillez entrer le nom d'utilisateur du compte.</value>
</data>
<data name="Login_Username_Placeholder" xml:space="preserve">
<value>Admin</value>
</data>
<data name="Login_Password_Help" xml:space="preserve">
<value>Veuillez entrer le mot de passe du compte.</value>
</data>
<data name="Login_Password_Placeholder" xml:space="preserve">
<value>Mot de passe</value>
</data>
<data name="Approve" xml:space="preserve">
<value>Approuver</value>
</data>
<data name="Approved" xml:space="preserve">
<value>Approuvée</value>
</data>
<data name="Available_Galleries" xml:space="preserve">
<value>Galeries disponibles</value>
</data>
<data name="Create" xml:space="preserve">
<value>Créer</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Supprimer</value>
</data>
<data name="Key" xml:space="preserve">
<value>Clé</value>
</data>
<data name="Link" xml:space="preserve">
<value>Lien</value>
</data>
<data name="Name" xml:space="preserve">
<value>Nom</value>
</data>
<data name="No_Galleries" xml:space="preserve">
<value>Aucune galerie n'a encore été créée</value>
</data>
<data name="No_Pending_Uploads" xml:space="preserve">
<value>Aucun téléchargement en attente de révision</value>
</data>
<data name="Pending" xml:space="preserve">
<value>En attente</value>
</data>
<data name="Pending_Uploads" xml:space="preserve">
<value>Téléchargements en attente</value>
</data>
<data name="Reject" xml:space="preserve">
<value>Rejeter</value>
</data>
<data name="Rename" xml:space="preserve">
<value>Rebaptiser</value>
</data>
<data name="Total" xml:space="preserve">
<value>Totale</value>
</data>
<data name="Uploaded_By" xml:space="preserve">
<value>Téléchargé par</value>
</data>
<data name="Review" xml:space="preserve">
<value>Révision</value>
</data>
<data name="Import" xml:space="preserve">
<value>Importer</value>
</data>
<data name="Export" xml:space="preserve">
<value>Exporter</value>
</data>
<data name="Wipe" xml:space="preserve">
<value>Effacer</value>
</data>
<data name="Gallery" xml:space="preserve">
<value>Galerie</value>
</data>
<data name="Uploader" xml:space="preserve">
<value>Téléchargeur</value>
</data>
<data name="400_Error_Message" xml:space="preserve">
<value>Si ce problème persiste, veuillez contacter l'administrateur Web</value>
</data>
<data name="400_Error_Title" xml:space="preserve">
<value>Oups, il semble qu'une erreur inattendue se soit produite...</value>
</data>
<data name="401_Error_Message" xml:space="preserve">
<value>Il semble que vous n'êtes pas autorisé à voir cette page...</value>
</data>
<data name="401_Error_Title" xml:space="preserve">
<value>Accès refusé</value>
</data>
<data name="402_Error_Message" xml:space="preserve">
<value>La clé secrète fournie était incorrecte</value>
</data>
<data name="402_Error_Title" xml:space="preserve">
<value>Clé secrète invalide</value>
</data>
<data name="403_Error_Message" xml:space="preserve">
<value>La galerie spécifiée n'existe pas et vous n'avez pas les autorisations pour la créer</value>
</data>
<data name="403_Error_Title" xml:space="preserve">
<value>Accès refusé</value>
</data>
<data name="Share_Code" xml:space="preserve">
<value>Partager le code</value>
</data>
<data name="View" xml:space="preserve">
<value>Voir</value>
</data>
<data name="Sort" xml:space="preserve">
<value>Trier</value>
</data>
<data name="Gallery_Empty_Upload" xml:space="preserve">
<value>Il n'y a actuellement aucun souvenir partagé</value>
</data>
<data name="Gallery_Empty" xml:space="preserve">
<value>Il n'y a actuellement aucun souvenir partagé, pourquoi ne pas télécharger le vôtre ci-dessus!</value>
</data>
<data name="Scan_To_Share" xml:space="preserve">
<value>Scannez le code QR avec votre téléphone pour partager vos images</value>
</data>
<data name="Gallery_Key" xml:space="preserve">
<value>Clé de la galerie</value>
</data>
<data name="Gallery_Key_Help" xml:space="preserve">
<value>Veuillez entrer la clé secrète.</value>
</data>
<data name="Gallery_Key_Placeholder" xml:space="preserve">
<value>jour-du-mariage</value>
</data>
<data name="Gallery_Name" xml:space="preserve">
<value>Nom de la galerie</value>
</data>
<data name="Gallery_Name_Help" xml:space="preserve">
<value>Veuillez entrer le nom de la galerie que vous souhaitez visiter.</value>
</data>
<data name="Gallery_Name_Placeholder" xml:space="preserve">
<value>ma-galerie-de-mariage</value>
</data>
<data name="Gallery_Selector_Title" xml:space="preserve">
<value>Sélecteur de galerie</value>
</data>
<data name="Generate" xml:space="preserve">
<value>Générer</value>
</data>
<data name="Logout" xml:space="preserve">
<value>Déconnexion</value>
</data>
<data name="Visit" xml:space="preserve">
<value>Visite</value>
</data>
<data name="Click_To_Upload" xml:space="preserve">
<value>Cliquez ici pour sélectionner les fichiers à télécharger</value>
</data>
<data name="Drag_And_Drop" xml:space="preserve">
<value>Faites glisser et déposez les images ici pour les télécharger dans la galerie</value>
</data>
<data name="Upload_Media" xml:space="preserve">
<value>Télécharger des médias</value>
</data>
<data name="Clean" xml:space="preserve">
<value>Faire le ménage</value>
</data>
<data name="Clean_Confirmation" xml:space="preserve">
<value>Etes-vous sûr de vouloir nettoyer cette galerie?</value>
</data>
<data name="Wipe_Confirmation" xml:space="preserve">
<value>Etes-vous sûr de vouloir effacer cette galerie?</value>
</data>
<data name="Close" xml:space="preserve">
<value>Fermer</value>
</data>
<data name="Default" xml:space="preserve">
<value>Défaut</value>
</data>
<data name="Delete_Confirmation" xml:space="preserve">
<value>Etes-vous sûr de vouloir supprimer cette galerie?</value>
</data>
<data name="Update" xml:space="preserve">
<value>Mise à jour</value>
</data>
<data name="Wipe_All_Confirmation" xml:space="preserve">
<value>Êtes-vous sûr de vouloir effacer toutes les galeries?</value>
</data>
<data name="Homepage_Load_Error" xml:space="preserve">
<value>Une erreur s'est produite lors du chargement de la page d'accueil</value>
</data>
<data name="Identity_Session_Error" xml:space="preserve">
<value>Impossible de définir l'identité de l'utilisateur lors de la session - Nom</value>
</data>
<data name="Save_QR" xml:space="preserve">
<value>Enregistrer le QR</value>
</data>
<data name="FFMPEG_Downloading" xml:space="preserve">
<value>J'ai tenté de générer une miniature de vidéo, mais FFMPEG n'a pas encore terminé le téléchargement. S'il s'agit d'une nouvelle installation, veuillez attendre la fin du téléchargement et les miniatures manquantes seront générées par le scanner d'arrière-plan</value>
</data>
<data name="FFMPEG_Download_Failed" xml:space="preserve">
<value>Échec du téléchargement de FFMPEG sur le chemin</value>
</data>
<data name="MultiFactor_Token_Set_Failed" xml:space="preserve">
<value>Échec de la configuration de la 2FA</value>
</data>
<data name="Users" xml:space="preserve">
<value>Utilisatrices</value>
</data>
<data name="Galleries" xml:space="preserve">
<value>Galeries</value>
</data>
<data name="Failed_Delete_User" xml:space="preserve">
<value>Impossible de supprimer l'utilisateur</value>
</data>
</root>

View File

@@ -0,0 +1,376 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value></value>
</resheader>
<resheader name="version">
<value></value>
</resheader>
<resheader name="reader">
<value></value>
</resheader>
<resheader name="writer">
<value></value>
</resheader>
<data name="File_Upload_Failed" xml:space="preserve">
<value>Bestand uploaden mislukt</value>
</data>
<data name="Duplicate_Item_Detected" xml:space="preserve">
<value>Dubbel bestand gedetecteerd</value>
</data>
<data name="Gallery_Does_Not_Exist" xml:space="preserve">
<value>De gevraagde galerij is niet gevonden of bestaat niet</value>
</data>
<data name="Image_Upload_Failed" xml:space="preserve">
<value>Afbeeldingen uploaden mislukt</value>
</data>
<data name="Invalid_Access_Token" xml:space="preserve">
<value>Het opgegeven toegangstoken was ongeldig</value>
</data>
<data name="Invalid_File_Type" xml:space="preserve">
<value>Ongeldig bestandstype</value>
</data>
<data name="Invalid_Gallery_Id" xml:space="preserve">
<value>Ongeldige galerij-ID</value>
</data>
<data name="Invalid_Gallery_Key" xml:space="preserve">
<value>Ongeldige galerij-sleutel</value>
</data>
<data name="Invalid_Secret_Key_Warning" xml:space="preserve">
<value>Er is een verzoek gedaan met een ongeldige beveiligingssleutel</value>
</data>
<data name="Max_File_Size" xml:space="preserve">
<value>De maximale bestandsgrootte is</value>
</data>
<data name="Gallery_Full" xml:space="preserve">
<value>Galerij is vol en heeft de maximale grootte overschreden</value>
</data>
<data name="New_Items_Pending_Review" xml:space="preserve">
<value>Nieuwe items in afwachting van beoordeling</value>
</data>
<data name="No_Files_For_Upload" xml:space="preserve">
<value>Er zijn geen bestanden gedetecteerd om te uploaden</value>
</data>
<data name="Save_To_Gallery_Failed" xml:space="preserve">
<value>Afbeelding opslaan in de galerij is mislukt</value>
</data>
<data name="Failed_Download_Gallery" xml:space="preserve">
<value>Het downloaden van de galerij is mislukt</value>
</data>
<data name="Download_Gallery_Not_Allowed" xml:space="preserve">
<value>U bent niet bevoegd om deze galerij te downloaden</value>
</data>
<data name="Failed_Add_Gallery" xml:space="preserve">
<value>Galerij aanmaken mislukt</value>
</data>
<data name="Failed_Delete_Gallery" xml:space="preserve">
<value>Galerij verwijderen mislukt</value>
</data>
<data name="Failed_Edit_Gallery" xml:space="preserve">
<value>Galerij kan niet worden bijgewerkt</value>
</data>
<data name="Failed_Export" xml:space="preserve">
<value>Gegevens exporteren is mislukt</value>
</data>
<data name="Failed_Finding_File" xml:space="preserve">
<value>Bestand kon niet worden gevonden</value>
</data>
<data name="Failed_Import" xml:space="preserve">
<value>Gegevens importeren is mislukt</value>
</data>
<data name="Failed_Reviewing_Media" xml:space="preserve">
<value>Item kon niet worden beoordeeld</value>
</data>
<data name="Failed_Wipe_Galleries" xml:space="preserve">
<value>Het wissen van galerijen is mislukt</value>
</data>
<data name="Failed_Wipe_Gallery" xml:space="preserve">
<value>Het wissen van de galerij is mislukt</value>
</data>
<data name="Gallery_Name_Already_Exists" xml:space="preserve">
<value>Galerijnaam bestaat al</value>
</data>
<data name="Login_Failed" xml:space="preserve">
<value>Het is niet gelukt om de gebruiker aan te melden</value>
</data>
<data name="Name_Cannot_Be_Blank" xml:space="preserve">
<value>Galerijnaam mag niet leeg zijn</value>
</data>
<data name="Gallery_List_Failed" xml:space="preserve">
<value>Het is niet gelukt om de galerijlijst op te halen</value>
</data>
<data name="Users_List_Failed" xml:space="preserve">
<value>Het is niet gelukt om de gebruikerslijst op te halen</value>
</data>
<data name="Pending_Uploads_Failed" xml:space="preserve">
<value>Het is niet gelukt om in behandeling zijnde uploads te verkrijgen</value>
</data>
<data name="Unknown_Review_Action" xml:space="preserve">
<value>Onbekende beoordelingsactie</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Acties</value>
</data>
<data name="Username" xml:space="preserve">
<value>Gebruikersnaam</value>
</data>
<data name="Login" xml:space="preserve">
<value>Login</value>
</data>
<data name="Login_Username_Help" xml:space="preserve">
<value>Voer de gebruikersnaam van uw account in.</value>
</data>
<data name="Login_Username_Placeholder" xml:space="preserve">
<value>Admin</value>
</data>
<data name="Login_Password_Help" xml:space="preserve">
<value>Voer het wachtwoord van uw account in.</value>
</data>
<data name="Login_Password_Placeholder" xml:space="preserve">
<value>Wachtwoord</value>
</data>
<data name="Approve" xml:space="preserve">
<value>Goedkeuren</value>
</data>
<data name="Approved" xml:space="preserve">
<value>Goedgekeurd</value>
</data>
<data name="Available_Galleries" xml:space="preserve">
<value>Beschikbare galerijen</value>
</data>
<data name="Create" xml:space="preserve">
<value>Aanmaken</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Verwijderen</value>
</data>
<data name="Key" xml:space="preserve">
<value>Sleutel</value>
</data>
<data name="Link" xml:space="preserve">
<value>Link</value>
</data>
<data name="Name" xml:space="preserve">
<value>Naam</value>
</data>
<data name="No_Galleries" xml:space="preserve">
<value>Er zijn nog geen galerijen aangemaakt</value>
</data>
<data name="No_Pending_Uploads" xml:space="preserve">
<value>Er zijn nog geen uploads om te beoordeling</value>
</data>
<data name="Pending" xml:space="preserve">
<value>In behandeling</value>
</data>
<data name="Pending_Uploads" xml:space="preserve">
<value>Uploads in behandeling</value>
</data>
<data name="Reject" xml:space="preserve">
<value>Afwijzen</value>
</data>
<data name="Rename" xml:space="preserve">
<value>Hernoemen</value>
</data>
<data name="Total" xml:space="preserve">
<value>Totaal</value>
</data>
<data name="Uploaded_By" xml:space="preserve">
<value>Geüpload door</value>
</data>
<data name="Review" xml:space="preserve">
<value>Beoordeling</value>
</data>
<data name="Import" xml:space="preserve">
<value>Importeren</value>
</data>
<data name="Export" xml:space="preserve">
<value>Exporteren</value>
</data>
<data name="Wipe" xml:space="preserve">
<value>Wissen</value>
</data>
<data name="Gallery" xml:space="preserve">
<value>Galerij</value>
</data>
<data name="Uploader" xml:space="preserve">
<value>Uploaden</value>
</data>
<data name="400_Error_Message" xml:space="preserve">
<value>Als dit probleem aanhoudt, neem dan contact op met de website beheerder</value>
</data>
<data name="400_Error_Title" xml:space="preserve">
<value>Oeps, het lijkt erop dat er een onverwachte fout is opgetreden...</value>
</data>
<data name="401_Error_Message" xml:space="preserve">
<value>Het lijkt erop dat u niet bevoegd bent om de pagina te bekijken...</value>
</data>
<data name="401_Error_Title" xml:space="preserve">
<value>Toegang geweigerd</value>
</data>
<data name="402_Error_Message" xml:space="preserve">
<value>De opgegeven geheime sleutel was onjuist</value>
</data>
<data name="402_Error_Title" xml:space="preserve">
<value>Ongeldige geheime sleutel</value>
</data>
<data name="403_Error_Message" xml:space="preserve">
<value>De opgegeven galerij bestaat niet en u heeft geen rechten om deze aan te maken</value>
</data>
<data name="403_Error_Title" xml:space="preserve">
<value>Toegang geweigerd</value>
</data>
<data name="Share_Code" xml:space="preserve">
<value>Code delen</value>
</data>
<data name="View" xml:space="preserve">
<value>Weergave</value>
</data>
<data name="Sort" xml:space="preserve">
<value>Sorteren</value>
</data>
<data name="Gallery_Empty_Upload" xml:space="preserve">
<value>Er zijn momenteel geen herinneringen gedeeld. Upload hierboven uw eigen herinnering!</value>
</data>
<data name="Gallery_Empty" xml:space="preserve">
<value>Er zijn momenteel geen herinneringen gedeeld. Upload je herinneringen hierboven.</value>
</data>
<data name="Scan_To_Share" xml:space="preserve">
<value>Scan de QR-code met uw telefoon om uw afbeeldingen te delen</value>
</data>
<data name="Gallery_Key" xml:space="preserve">
<value>Galerij sleutel</value>
</data>
<data name="Gallery_Key_Help" xml:space="preserve">
<value>Voer de geheime sleutel in.</value>
</data>
<data name="Gallery_Key_Placeholder" xml:space="preserve">
<value>trouwdag</value>
</data>
<data name="Gallery_Name" xml:space="preserve">
<value>Galerij naam</value>
</data>
<data name="Gallery_Name_Help" xml:space="preserve">
<value>Voer de naam in van de galerij die u wenst te bezoeken.</value>
</data>
<data name="Gallery_Name_Placeholder" xml:space="preserve">
<value>mijn-bruiloft-galerij</value>
</data>
<data name="Gallery_Selector_Title" xml:space="preserve">
<value>Selecteer een galerij</value>
</data>
<data name="Generate" xml:space="preserve">
<value>Genereren</value>
</data>
<data name="Logout" xml:space="preserve">
<value>Uitloggen</value>
</data>
<data name="Visit" xml:space="preserve">
<value>Bezoeken</value>
</data>
<data name="Click_To_Upload" xml:space="preserve">
<value>Klik hier om bestanden te selecteren om te uploaden</value>
</data>
<data name="Drag_And_Drop" xml:space="preserve">
<value>Sleep afbeelding(en) hierheen om ze naar de galerij te uploaden</value>
</data>
<data name="Upload_Media" xml:space="preserve">
<value>Media uploaden</value>
</data>
<data name="Clean" xml:space="preserve">
<value>Opruimen</value>
</data>
<data name="Clean_Confirmation" xml:space="preserve">
<value>Weet u zeker dat u deze galerij wenst op te ruimen?</value>
</data>
<data name="Wipe_Confirmation" xml:space="preserve">
<value>Weet u zeker dat u deze galerij wenst te wissen?</value>
</data>
<data name="Close" xml:space="preserve">
<value>Sluiten</value>
</data>
<data name="Default" xml:space="preserve">
<value>Standaard</value>
</data>
<data name="Delete_Confirmation" xml:space="preserve">
<value>Weet u zeker dat u deze galerij wenst te verwijderen?</value>
</data>
<data name="Update" xml:space="preserve">
<value>Bijwerken</value>
</data>
<data name="Wipe_All_Confirmation" xml:space="preserve">
<value>Weet u zeker dat u alle galerijen wenst te wissen?</value>
</data>
<data name="Homepage_Load_Error" xml:space="preserve">
<value>Er is een fout opgetreden bij het laden van de homepage</value>
</data>
<data name="Identity_Session_Error" xml:space="preserve">
<value>Het is niet gelukt om de gebruikersidentiteitssessie in te stellen - Naam</value>
</data>
<data name="Save_QR" xml:space="preserve">
<value>QR opslaan</value>
</data>
<data name="FFMPEG_Downloading" xml:space="preserve">
<value>Probeerde videominiatuur te genereren, maar FFMPEG is nog niet klaar met downloaden. Als dit een nieuwe installatie is, wacht dan tot het downloaden is voltooid en de gemiste miniaturen worden gegenereerd door de achtergrondscanner</value>
</data>
<data name="FFMPEG_Download_Failed" xml:space="preserve">
<value>Het is niet gelukt om FFMPEG naar het pad te downloaden</value>
</data>
<data name="MultiFactor_Token_Set_Failed" xml:space="preserve">
<value>Het is niet gelukt om 2FA in te stellen</value>
</data>
<data name="Users" xml:space="preserve">
<value>Gebruikers</value>
</data>
<data name="Galleries" xml:space="preserve">
<value>Galerijen</value>
</data>
<data name="Failed_Delete_User" xml:space="preserve">
<value>Het is niet gelukt om de gebruiker te verwijderen</value>
</data>
</root>

View File

@@ -0,0 +1,434 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="File_Upload_Failed" xml:space="preserve">
<value>Misslyckades att ladda upp filen</value>
</data>
<data name="Duplicate_Item_Detected" xml:space="preserve">
<value>Dubblettfil upptäcktes</value>
</data>
<data name="Gallery_Does_Not_Exist" xml:space="preserve">
<value>Det begärda galleriet hittades inte eller finns inte</value>
</data>
<data name="Image_Upload_Failed" xml:space="preserve">
<value>Det gick inte att ladda upp bilder</value>
</data>
<data name="Invalid_Access_Token" xml:space="preserve">
<value>Den angivna åtkomstnyckeln var ogiltig</value>
</data>
<data name="Invalid_File_Type" xml:space="preserve">
<value>Filtypen är ogiltig</value>
</data>
<data name="Invalid_Gallery_Id" xml:space="preserve">
<value>Ogiltigt galleri-id</value>
</data>
<data name="Invalid_Gallery_Key" xml:space="preserve">
<value>Ogiltig gallerinyckel</value>
</data>
<data name="Invalid_Secret_Key_Warning" xml:space="preserve">
<value>En begäran gjordes med en ogiltig hemlig nyckel</value>
</data>
<data name="Max_File_Size" xml:space="preserve">
<value>Max filstorlek är</value>
</data>
<data name="Gallery_Full" xml:space="preserve">
<value>Galleriet är fullt och har överskridit maxstorleken på</value>
</data>
<data name="New_Items_Pending_Review" xml:space="preserve">
<value>Nya bilder väntar på granskning</value>
</data>
<data name="No_Files_For_Upload" xml:space="preserve">
<value>Inga filer upptäcktes för uppladdning</value>
</data>
<data name="Save_To_Gallery_Failed" xml:space="preserve">
<value>Det gick inte att spara bilden i galleriet</value>
</data>
<data name="Failed_Download_Gallery" xml:space="preserve">
<value>Det gick inte att ladda ned galleriet</value>
</data>
<data name="Download_Gallery_Not_Allowed" xml:space="preserve">
<value>Du är inte behörig att ladda ner det här galleriet</value>
</data>
<data name="Failed_Add_Gallery" xml:space="preserve">
<value>Det gick inte att skapa galleriet</value>
</data>
<data name="Failed_Delete_Gallery" xml:space="preserve">
<value>Det gick inte att ta bort galleriet</value>
</data>
<data name="Failed_Edit_Gallery" xml:space="preserve">
<value>Det gick inte att uppdatera galleriet</value>
</data>
<data name="Failed_Export" xml:space="preserve">
<value>Det gick inte att exportera data</value>
</data>
<data name="Failed_Finding_File" xml:space="preserve">
<value>Det gick inte att hitta filen</value>
</data>
<data name="Failed_Import" xml:space="preserve">
<value>Det gick inte att importera data</value>
</data>
<data name="Failed_Reviewing_Media" xml:space="preserve">
<value>Det gick inte att granska objektet</value>
</data>
<data name="Failed_Wipe_Galleries" xml:space="preserve">
<value>Det gick inte att rensa gallerier</value>
</data>
<data name="Failed_Wipe_Gallery" xml:space="preserve">
<value>Det gick inte att rensa galleriet</value>
</data>
<data name="Gallery_Name_Already_Exists" xml:space="preserve">
<value>Gallerinamnet finns redan</value>
</data>
<data name="Login_Failed" xml:space="preserve">
<value>Det gick inte att logga in användaren</value>
</data>
<data name="Name_Cannot_Be_Blank" xml:space="preserve">
<value>Gallerinamnet får inte vara tomt</value>
</data>
<data name="Gallery_List_Failed" xml:space="preserve">
<value>Det gick inte att hämta gallerilistan</value>
</data>
<data name="Users_List_Failed" xml:space="preserve">
<value>Det gick inte att hämta användarlistan</value>
</data>
<data name="Pending_Uploads_Failed" xml:space="preserve">
<value>Det gick inte att hämta väntande uppladdningar</value>
</data>
<data name="Unknown_Review_Action" xml:space="preserve">
<value>Okänd granskningsåtgärd</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Åtgärder</value>
</data>
<data name="Username" xml:space="preserve">
<value>Användarnamn</value>
</data>
<data name="Login" xml:space="preserve">
<value>Logga in</value>
</data>
<data name="Login_Username_Help" xml:space="preserve">
<value>Ange användarnamn för kontot.</value>
</data>
<data name="Login_Username_Placeholder" xml:space="preserve">
<value>Admininstratör</value>
</data>
<data name="Login_Password_Help" xml:space="preserve">
<value>Vänligen ange kontolösenord.</value>
</data>
<data name="Login_Password_Placeholder" xml:space="preserve">
<value>Lösenord</value>
</data>
<data name="Approve" xml:space="preserve">
<value>Godkänna</value>
</data>
<data name="Approved" xml:space="preserve">
<value>Godkänna</value>
</data>
<data name="Available_Galleries" xml:space="preserve">
<value>Tillgängliga Gallerier</value>
</data>
<data name="Create" xml:space="preserve">
<value>Skapa</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Radera</value>
</data>
<data name="Key" xml:space="preserve">
<value>Nyckel</value>
</data>
<data name="Link" xml:space="preserve">
<value>Länk</value>
</data>
<data name="Name" xml:space="preserve">
<value>Namn</value>
</data>
<data name="No_Galleries" xml:space="preserve">
<value>Inga gallerier har skapats ännu</value>
</data>
<data name="No_Pending_Uploads" xml:space="preserve">
<value>Inga uppladdningar väntar på granskning</value>
</data>
<data name="Pending" xml:space="preserve">
<value>I avvaktan på</value>
</data>
<data name="Pending_Uploads" xml:space="preserve">
<value>Väntande uppladdningar</value>
</data>
<data name="Reject" xml:space="preserve">
<value>Avvisa</value>
</data>
<data name="Rename" xml:space="preserve">
<value>Döpa om</value>
</data>
<data name="Total" xml:space="preserve">
<value>Totalt</value>
</data>
<data name="Uploaded_By" xml:space="preserve">
<value>Uppladdad av</value>
</data>
<data name="Review" xml:space="preserve">
<value>Recension</value>
</data>
<data name="Import" xml:space="preserve">
<value>Importera</value>
</data>
<data name="Export" xml:space="preserve">
<value>Exportera</value>
</data>
<data name="Wipe" xml:space="preserve">
<value>Radera</value>
</data>
<data name="Gallery" xml:space="preserve">
<value>Galleri</value>
</data>
<data name="Uploader" xml:space="preserve">
<value>Uppladdare</value>
</data>
<data name="400_Error_Message" xml:space="preserve">
<value>Kontakta webbadministratören om problemet kvarstår</value>
</data>
<data name="400_Error_Title" xml:space="preserve">
<value>Hoppsan, det verkar som om ett oväntat fel inträffade...</value>
</data>
<data name="401_Error_Message" xml:space="preserve">
<value>Det verkar som att du inte har behörighet att visa den sidan...</value>
</data>
<data name="401_Error_Title" xml:space="preserve">
<value>Access Denied</value>
</data>
<data name="402_Error_Message" xml:space="preserve">
<value>Den angivna hemliga nyckeln var felaktig</value>
</data>
<data name="402_Error_Title" xml:space="preserve">
<value>Ogiltig hemlig nyckel</value>
</data>
<data name="403_Error_Message" xml:space="preserve">
<value>Det angivna galleriet finns inte och du har inte behörighet att skapa det</value>
</data>
<data name="403_Error_Title" xml:space="preserve">
<value>Åtkomst nekad</value>
</data>
<data name="Share_Code" xml:space="preserve">
<value>Dela kod</value>
</data>
<data name="View" xml:space="preserve">
<value>Visa</value>
</data>
<data name="Sort" xml:space="preserve">
<value>Sortera</value>
</data>
<data name="Gallery_Empty_Upload" xml:space="preserve">
<value>Det finns för närvarande inga delade minnen, varför laddar du inte upp dina ovan!</value>
</data>
<data name="Gallery_Empty" xml:space="preserve">
<value>Det finns för närvarande inga delade minnen</value>
</data>
<data name="Scan_To_Share" xml:space="preserve">
<value>Skanna QR-koden med din telefon för att dela dina bilder</value>
</data>
<data name="Gallery_Key" xml:space="preserve">
<value>Gallerinyckel</value>
</data>
<data name="Gallery_Key_Help" xml:space="preserve">
<value>Vänligen ange den hemliga nyckeln.</value>
</data>
<data name="Gallery_Key_Placeholder" xml:space="preserve">
<value>bröllopsdag</value>
</data>
<data name="Gallery_Name" xml:space="preserve">
<value>Gallerinamn</value>
</data>
<data name="Gallery_Name_Help" xml:space="preserve">
<value>Ange namnet på det galleri du vill besöka.</value>
</data>
<data name="Gallery_Name_Placeholder" xml:space="preserve">
<value>mitt-brollopsgalleri</value>
</data>
<data name="Gallery_Selector_Title" xml:space="preserve">
<value>Galleriväljare</value>
</data>
<data name="Generate" xml:space="preserve">
<value>Generera</value>
</data>
<data name="Logout" xml:space="preserve">
<value>Utloggning</value>
</data>
<data name="Visit" xml:space="preserve">
<value>Besök</value>
</data>
<data name="Click_To_Upload" xml:space="preserve">
<value>Klicka här för att välja filer att ladda upp</value>
</data>
<data name="Drag_And_Drop" xml:space="preserve">
<value>Dra &amp; Släpp filer här för att ladda upp dem till galleriet</value>
</data>
<data name="Upload_Media" xml:space="preserve">
<value>Ladda upp media</value>
</data>
<data name="Clean" xml:space="preserve">
<value>Rensa</value>
</data>
<data name="Clean_Confirmation" xml:space="preserve">
<value>Är du säker på att du vill rengöra det här galleriet?</value>
</data>
<data name="Wipe_Confirmation" xml:space="preserve">
<value>Är du säker på att du vill rensa det här galleriet?</value>
</data>
<data name="Close" xml:space="preserve">
<value>Stäng</value>
</data>
<data name="Default" xml:space="preserve">
<value>Standard</value>
</data>
<data name="Delete_Confirmation" xml:space="preserve">
<value>Är du säker på att du vill ta bort det här galleriet?</value>
</data>
<data name="Update" xml:space="preserve">
<value>Uppdatera</value>
</data>
<data name="Wipe_All_Confirmation" xml:space="preserve">
<value>Är du säker på att du vill radera alla gallerier?</value>
</data>
<data name="Homepage_Load_Error" xml:space="preserve">
<value>Ett fel uppstod när startsidan laddades</value>
</data>
<data name="Identity_Session_Error" xml:space="preserve">
<value>Det gick inte att ställa in användar identitets session - Namn</value>
</data>
<data name="Save_QR" xml:space="preserve">
<value>Spara QR</value>
</data>
<data name="FFMPEG_Downloading" xml:space="preserve">
<value>Försökte skapa videominiatyrer men FFMPEG har inte slutfört nedladdningen ännu. Om detta är en nyinstallation, vänta tills nedladdningen är klar och missade miniatyrer kommer att genereras av bakgrundsskannern</value>
</data>
<data name="FFMPEG_Download_Failed" xml:space="preserve">
<value>Det gick inte att ladda ner FFMPEG till sökvägen</value>
</data>
<data name="MultiFactor_Token_Set_Failed" xml:space="preserve">
<value>Det gick inte att konfigurera 2FA</value>
</data>
<data name="Users" xml:space="preserve">
<value>Användare</value>
</data>
<data name="Galleries" xml:space="preserve">
<value>Gallerier</value>
</data>
<data name="Failed_Delete_User" xml:space="preserve">
<value>Det gick inte att ta bort användaren</value>
</data>
</root>

View File

@@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Approve" xml:space="preserve">
<value>Approve</value>
</data>
<data name="Available_Galleries" xml:space="preserve">
<value>Available Galleries</value>
</data>
<data name="Link" xml:space="preserve">
<value>Link</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="No_Galleries" xml:space="preserve">
<value>No galleries created yet</value>
</data>
<data name="No_Pending_Uploads" xml:space="preserve">
<value>No uploads pending review</value>
</data>
<data name="Pending_Uploads" xml:space="preserve">
<value>Pending Uploads</value>
</data>
<data name="Reject" xml:space="preserve">
<value>Reject</value>
</data>
</root>

View File

@@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Approve" xml:space="preserve">
<value>Approuver</value>
</data>
<data name="Available_Galleries" xml:space="preserve">
<value>Galeries disponibles</value>
</data>
<data name="Link" xml:space="preserve">
<value>Lien</value>
</data>
<data name="Name" xml:space="preserve">
<value>Nom</value>
</data>
<data name="No_Galleries" xml:space="preserve">
<value>Aucune galerie n'a encore été créée</value>
</data>
<data name="No_Pending_Uploads" xml:space="preserve">
<value>Aucun téléchargement en attente de révision</value>
</data>
<data name="Pending_Uploads" xml:space="preserve">
<value>Téléchargements en attente</value>
</data>
<data name="Reject" xml:space="preserve">
<value>Rejeter</value>
</data>
</root>

View File

@@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Access_Denied" xml:space="preserve">
<value>Access Denied</value>
</data>
<data name="Access_Denied_Message" xml:space="preserve">
<value>It looks like you are not authorized to view that page...</value>
</data>
</root>

View File

@@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Access_Denied" xml:space="preserve">
<value>Accès refusé</value>
</data>
<data name="Access_Denied_Message" xml:space="preserve">
<value>Il semble que vous n'êtes pas autorisé à voir cette page...</value>
</data>
</root>

View File

@@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Unexpected_Error" xml:space="preserve">
<value>Opps, it looks like an unexpected error occurred...</value>
</data>
<data name="Unexpected_Error_Message" xml:space="preserve">
<value>If this issue persists please contact the web administrator</value>
</data>
</root>

View File

@@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Unexpected_Error" xml:space="preserve">
<value>Oups, il semble qu'une erreur inattendue se soit produite...</value>
</data>
<data name="Unexpected_Error_Message" xml:space="preserve">
<value>Si ce problème persiste, veuillez contacter l'administrateur Web</value>
</data>
</root>

View File

@@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Share_Code" xml:space="preserve">
<value>Share Code</value>
</data>
</root>

Some files were not shown because too many files have changed in this diff Show More