Browse Source

Verifiy exists user

Marino Faggiana 8 years ago
parent
commit
0aa216f3fa

+ 3 - 2
Libraries external/OCCommunicationLib/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -140,7 +140,6 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
         [UtilsFramework deleteAllCookies];
     }
     
-    
     OCHTTPRequestOperation *operation = (OCHTTPRequestOperation*) [sharedOCCommunication.networkSessionManager dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
          if (!error) {
             success((NSHTTPURLResponse*)response,responseObject);
@@ -772,9 +771,11 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     serverPath = [serverPath stringByAppendingString:deviceIdentifier];
     serverPath = [serverPath stringByAppendingString:deviceIdentifierSignature];
     serverPath = [serverPath stringByAppendingString:userPublicKey];
-
+    
     NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
     
+    [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
+    
     OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
     [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
     [operation resume];

+ 4 - 0
iOSClient/AppDelegate.m

@@ -417,6 +417,10 @@
 {
 #if defined(OPTION_NOTIFICATION_PUSH_ENABLE)
     
+    // test
+    if (self.activeAccount.length == 0)
+        return;
+    
     NSString *pushToken = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""];
     NSString *pushTokenHash = [[CCCrypto sharedManager] createSHA512:pushToken];