mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Added registry check to allow system admins to disable uploads
This commit is contained in:
parent
53b5855d1d
commit
feedbe6ce4
4 changed files with 35 additions and 0 deletions
11
ShareX/Properties/Resources.Designer.cs
generated
11
ShareX/Properties/Resources.Designer.cs
generated
|
@ -3117,5 +3117,16 @@ public static string YourAntiVirusSoftwareOrTheControlledFolderAccessFeatureInWi
|
||||||
"ShareX", resourceCulture);
|
"ShareX", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Your system admin disabled the upload feature..
|
||||||
|
/// </summary>
|
||||||
|
public static string YourSystemAdminDisabledTheUploadFeature
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ResourceManager.GetString("YourSystemAdminDisabledTheUploadFeature", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -568,4 +568,10 @@ Soll ShareX neu gestartet werden?</value>
|
||||||
<data name="AboutForm_AboutForm_Language_fa_IR" xml:space="preserve">
|
<data name="AboutForm_AboutForm_Language_fa_IR" xml:space="preserve">
|
||||||
<value>Persisch</value>
|
<value>Persisch</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ThisFeatureWillNotWorkWhenDisableUploadOptionIsEnabled" xml:space="preserve">
|
||||||
|
<value>Diese Funktion funktioniert nicht, wenn die "DisableUpload"-Option eingeschaltet wurde!</value>
|
||||||
|
</data>
|
||||||
|
<data name="YourSystemAdminDisabledTheUploadFeature" xml:space="preserve">
|
||||||
|
<value>Ihr Systemadministrator hat diese Funktion ausgeschaltet.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1097,4 +1097,7 @@ Please run ShareX as administrator to change personal folder path.</value>
|
||||||
<data name="Discord" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="Discord" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\discord.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\resources\discord.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="YourSystemAdminDisabledTheUploadFeature" xml:space="preserve">
|
||||||
|
<value>Your system admin disabled the upload feature.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1797,6 +1797,21 @@ public static void ShowNotificationTip(string text, string title = "ShareX", int
|
||||||
|
|
||||||
public static bool IsUploadAllowed()
|
public static bool IsUploadAllowed()
|
||||||
{
|
{
|
||||||
|
bool isDisabled = false;
|
||||||
|
try {
|
||||||
|
isDisabled = RegistryHelpers.CheckRegistry("SOFTWARE\\ShareX", "DisableUpload", "true", Microsoft.Win32.RegistryHive.LocalMachine);
|
||||||
|
}
|
||||||
|
catch(Exception e) {
|
||||||
|
DebugHelper.WriteException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDisabled)
|
||||||
|
{
|
||||||
|
MessageBox.Show(Resources.YourSystemAdminDisabledTheUploadFeature, "ShareX",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (Program.Settings.DisableUpload)
|
if (Program.Settings.DisableUpload)
|
||||||
{
|
{
|
||||||
MessageBox.Show(Resources.ThisFeatureWillNotWorkWhenDisableUploadOptionIsEnabled, "ShareX",
|
MessageBox.Show(Resources.ThisFeatureWillNotWorkWhenDisableUploadOptionIsEnabled, "ShareX",
|
||||||
|
|
Loading…
Reference in a new issue