diff --git a/ShareX/Program.cs b/ShareX/Program.cs index 41de80820..5af8d1854 100644 --- a/ShareX/Program.cs +++ b/ShareX/Program.cs @@ -118,6 +118,7 @@ public static string TitleShort public static bool SteamFirstTimeConfig { get; private set; } public static bool IgnoreHotkeyWarning { get; private set; } public static bool PuushMode { get; private set; } + public static bool UploadForbidden { get; private set; } internal static ApplicationConfig Settings { get; set; } internal static TaskSettings DefaultTaskSettings { get; set; } @@ -361,6 +362,7 @@ private static void Run() CheckPuushMode(); DebugWriteFlags(); + SetForbiddenUpload(); SettingManager.LoadInitialSettings(); Uploader.UpdateServicePointManager(); @@ -619,6 +621,25 @@ public static bool WritePersonalPathConfig(string path) return false; } + private static void SetForbiddenUpload() + { + try + { + if (RegistryHelpers.CheckRegistry(@"SOFTWARE\ShareX", "UploadForbidden")) + { + UploadForbidden = RegistryHelpers.CheckRegistry("SOFTWARE\\ShareX", "UploadForbidden", "true"); + } + else + { + UploadForbidden = RegistryHelpers.CheckRegistry(@"SOFTWARE\ShareX", "UploadForbidden", "true", Microsoft.Win32.RegistryHive.LocalMachine); + } + } + catch (Exception e) + { + DebugHelper.WriteException(e); + } + } + private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { OnError(e.Exception); diff --git a/ShareX/Properties/Resources.Designer.cs b/ShareX/Properties/Resources.Designer.cs index 16987446f..72318b2a5 100644 --- a/ShareX/Properties/Resources.Designer.cs +++ b/ShareX/Properties/Resources.Designer.cs @@ -3117,5 +3117,16 @@ public static string YourAntiVirusSoftwareOrTheControlledFolderAccessFeatureInWi "ShareX", resourceCulture); } } + + /// + /// Looks up a localized string similar to Your system admin disabled the upload feature.. + /// + public static string YourSystemAdminDisabledTheUploadFeature + { + get + { + return ResourceManager.GetString("YourSystemAdminDisabledTheUploadFeature", resourceCulture); + } + } } } diff --git a/ShareX/Properties/Resources.de.resx b/ShareX/Properties/Resources.de.resx index af364f074..4cef1d4cb 100644 --- a/ShareX/Properties/Resources.de.resx +++ b/ShareX/Properties/Resources.de.resx @@ -568,4 +568,10 @@ Soll ShareX neu gestartet werden? Persisch + + Diese Funktion funktioniert nicht, wenn die "DisableUpload"-Option eingeschaltet wurde! + + + Ihr Systemadministrator hat diese Funktion ausgeschaltet. + \ No newline at end of file diff --git a/ShareX/Properties/Resources.resx b/ShareX/Properties/Resources.resx index ca9b9fbd2..7abe0b9a9 100644 --- a/ShareX/Properties/Resources.resx +++ b/ShareX/Properties/Resources.resx @@ -1097,4 +1097,7 @@ Please run ShareX as administrator to change personal folder path. ..\resources\discord.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Your system admin disabled the upload feature. + \ No newline at end of file diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs index 74518fb2f..19d3eed46 100644 --- a/ShareX/TaskHelpers.cs +++ b/ShareX/TaskHelpers.cs @@ -1797,6 +1797,13 @@ public static void ShowNotificationTip(string text, string title = "ShareX", int public static bool IsUploadAllowed() { + if (Program.UploadForbidden) + { + MessageBox.Show(Resources.YourSystemAdminDisabledTheUploadFeature, "ShareX", + MessageBoxButtons.OK, MessageBoxIcon.Information); + + return false; + } if (Program.Settings.DisableUpload) { MessageBox.Show(Resources.ThisFeatureWillNotWorkWhenDisableUploadOptionIsEnabled, "ShareX",