浏览代码

check delete directory e2e

Marino Faggiana 7 年之前
父节点
当前提交
0f7d94ef42
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 10 0
      iOSClient/Networking/OCNetworking.m
  2. 1 0
      iOSClient/Supporting Files/en.lproj/Localizable.strings

+ 10 - 0
iOSClient/Networking/OCNetworking.m

@@ -757,6 +757,16 @@
     [communication setCredentialsWithUser:_activeUser andUserID:_activeUserID andPassword:_activePassword];
     [communication setCredentialsWithUser:_activeUser andUserID:_activeUserID andPassword:_activePassword];
     [communication setUserAgent:[CCUtility getUserAgent]];
     [communication setUserAgent:[CCUtility getUserAgent]];
     
     
+    // Delete only directory NOT encrypted
+    if (_metadataNet.directory && _metadataNet.e2eEncrypted) {
+        
+        [self.delegate deleteFileOrFolderFailure:_metadataNet message:NSLocalizedString(@"_e2e_delete_folder_not_permitted_", nil) errorCode:0];
+        
+        [self complete];
+        
+        return;
+    }
+    
     [communication deleteFileOrFolder:serverFileUrl onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
     [communication deleteFileOrFolder:serverFileUrl onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
         
         
         if ([_metadataNet.selector rangeOfString:selectorDelete].location != NSNotFound && [self.delegate respondsToSelector:@selector(deleteFileOrFolderSuccess:)])
         if ([_metadataNet.selector rangeOfString:selectorDelete].location != NSNotFound && [self.delegate respondsToSelector:@selector(deleteFileOrFolderSuccess:)])

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -507,4 +507,5 @@
 "_e2e_set_folder_encrypted_"        = "Set as encrypted";
 "_e2e_set_folder_encrypted_"        = "Set as encrypted";
 "_e2e_remove_folder_encrypted_"     = "Remove as encrypted";
 "_e2e_remove_folder_encrypted_"     = "Remove as encrypted";
 "_e2e_goto_settings_for_enable_"    = "You are in a encrypted directory, go to on \"Settings\" and enable the End-To-End Encryption";
 "_e2e_goto_settings_for_enable_"    = "You are in a encrypted directory, go to on \"Settings\" and enable the End-To-End Encryption";
+"_e2e_delete_folder_not_permitted_" = "Delete the directory marked as encrypted is not allowed";