allowed users to configure their own file extensions.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-03-03 19:32:20 -07:00
parent 940f48b816
commit 604c98a031
10 changed files with 27 additions and 18 deletions

View File

@@ -15,6 +15,7 @@ namespace CarCareTracker.Helper
string GetServerLanguage();
bool GetServerEnableShopSupplies();
string GetServerPostgresConnection();
string GetAllowedFileUploadExtensions();
public bool DeleteUserConfig(int userId);
}
public class ConfigHelper : IConfigHelper
@@ -44,6 +45,14 @@ namespace CarCareTracker.Helper
}
return logoUrl;
}
public string GetAllowedFileUploadExtensions()
{
var allowedFileExtensions = _config["LUBELOGGER_ALLOWED_FILE_EXTENSIONS"];
if (string.IsNullOrWhiteSpace(allowedFileExtensions)){
return ".png,.jpg,.jpeg,.pdf,.xls,.xlsx,.docx";
}
return allowedFileExtensions;
}
public bool AuthenticateRootUser(string username, string password)
{
var rootUsername = _config[nameof(UserConfig.UserNameHash)] ?? string.Empty;