premium required for attachment download

This commit is contained in:
Kyle Spearrin 2017-07-21 17:21:04 -04:00
parent 1124c48c8d
commit b32603b472
3 changed files with 22 additions and 4 deletions

View file

@ -277,8 +277,14 @@ namespace Bit.App.Pages
private async Task OpenAttachmentAsync(Login login, VaultViewLoginPageModel.Attachment attachment) private async Task OpenAttachmentAsync(Login login, VaultViewLoginPageModel.Attachment attachment)
{ {
// 20 MB warning if(!_tokenService.TokenPremium && !login.OrganizationUseTotp)
if(attachment.Size >= 20971520 && !(await _userDialogs.ConfirmAsync( {
_userDialogs.Alert(AppResources.PremiumRequired);
return;
}
// 10 MB warning
if(attachment.Size >= 10485760 && !(await _userDialogs.ConfirmAsync(
string.Format(AppResources.AttachmentLargeWarning, attachment.SizeName), null, string.Format(AppResources.AttachmentLargeWarning, attachment.SizeName), null,
AppResources.Yes, AppResources.No))) AppResources.Yes, AppResources.No)))
{ {

View file

@ -1771,6 +1771,15 @@ namespace Bit.App.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to A premium membership is required to use this feature..
/// </summary>
public static string PremiumRequired {
get {
return ResourceManager.GetString("PremiumRequired", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to bitwarden keeps your vault automatically synced by using push notifications. For the best possible experience, please select &quot;Ok&quot; on the following prompt when asked to enable push notifications.. /// Looks up a localized string similar to bitwarden keeps your vault automatically synced by using push notifications. For the best possible experience, please select &quot;Ok&quot; on the following prompt when asked to enable push notifications..
/// </summary> /// </summary>

View file

@ -962,4 +962,7 @@
<data name="DisableAutoTotpCopy" xml:space="preserve"> <data name="DisableAutoTotpCopy" xml:space="preserve">
<value>Disable Automatic TOTP Copy</value> <value>Disable Automatic TOTP Copy</value>
</data> </data>
<data name="PremiumRequired" xml:space="preserve">
<value>A premium membership is required to use this feature.</value>
</data>
</root> </root>