Browse Source

dev schema nextcloud

marinofaggiana 5 years ago
parent
commit
abfe4be9cd
2 changed files with 13 additions and 1 deletions
  1. 12 1
      iOSClient/AppDelegate.m
  2. 1 0
      iOSClient/Supporting Files/en.lproj/Localizable.strings

+ 12 - 1
iOSClient/AppDelegate.m

@@ -1515,6 +1515,18 @@ PKPushRegistry *pushRegistry;
             NSString *link = [CCUtility valueForKey:@"link" fromQueryItems:queryItems];
             tableAccount *matchedAccount = nil;
 
+            // verify parameter
+            if (user.length == 0 || path.length == 0 || [[NSURL URLWithString:link] host].length == 0) {
+                
+                UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_", nil) message:NSLocalizedString(@"_error_parameter_schema_", nil) preferredStyle:UIAlertControllerStyleAlert];
+                UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {}];
+                
+                [alertController addAction:okAction];
+                [self.window.rootViewController presentViewController:alertController animated:YES completion:nil];
+                
+                return YES;
+            }
+            
             tableAccount *account = [[NCManageDatabase sharedInstance] getAccountActive];
             if (account) {
                 NSURL *activeAccountURL = [NSURL URLWithString:account.url];
@@ -1579,7 +1591,6 @@ PKPushRegistry *pushRegistry;
                             self.activeMain.scrollToFileNamePath = fileNamePath;
                             [self.activeMain readFolder:serverUrl];
                         }
-                        
                     }];
                     
                     [self.activeMain.navigationController popToRootViewControllerAnimated:NO];

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

@@ -102,6 +102,7 @@
 "_start_"                   = "Start";
 "_purchase_"                = "Purchase";
 "_account_not_available_"   = "The user %@ on server %@ do not exists, please add it to be able to read the file %@";
+"_error_parameter_schema_"  = "Wrong parameters, impossible to continue";
 
 // App