mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-16 10:11:28 +00:00
Improve Eula
This commit is contained in:
parent
4208513978
commit
0a43cdbbe1
3 changed files with 29 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
|||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Method/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"><ExtraRule Prefix="" Suffix="" Style="aaBb" /></Policy></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Affero/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Braaains/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=brun/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ezoiar/@EntryIndexedValue">True</s:Boolean>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Kettu;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Logging;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
@ -18,9 +19,11 @@ namespace LBPUnion.ProjectLighthouse.Controllers {
|
|||
[HttpGet("eula")]
|
||||
public async Task<IActionResult> Eula() {
|
||||
User user = await this.database.UserFromRequest(this.Request);
|
||||
return user == null ? this.StatusCode(403, "") :
|
||||
this.Ok($"You are now logged in as user {user.Username} (id {user.UserId}).\n" +
|
||||
"This is a private testing instance. Please do not make anything public for now, and keep in mind security isn't as tight as a full release would.");
|
||||
return user == null
|
||||
? this.StatusCode(403, "")
|
||||
: this.Ok($"You are now logged in as user {user.Username} (id {user.UserId}).\n" +
|
||||
(EulaHelper.ShowPrivateInstanceNotice ? "\n" + EulaHelper.PrivateInstanceNotice : "") + "\n" +
|
||||
$"{EulaHelper.License}\n");
|
||||
}
|
||||
|
||||
[HttpGet("announce")]
|
||||
|
|
22
ProjectLighthouse/Helpers/EulaHelper.cs
Normal file
22
ProjectLighthouse/Helpers/EulaHelper.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
namespace LBPUnion.ProjectLighthouse.Helpers {
|
||||
public static class EulaHelper {
|
||||
public const string License = @"
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.";
|
||||
|
||||
public const string PrivateInstanceNotice = @"This server is a private testing instance.
|
||||
Please do not make anything public for now, and keep in mind security isn't as tight as a full release would.";
|
||||
|
||||
public const bool ShowPrivateInstanceNotice = false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue