Ticket #635: httpauth.patch
| File httpauth.patch, 3.7 KB (added by technimad, 2 years ago) |
|---|
-
Classes/BlogDataManager.m
5137 5137 //call the keychain util's getPassword function, passing in the userName and blogURL we got from the method that called this one 5138 5138 // and set our blank string equal to the result of this call 5139 5139 NSError *anError = nil; 5140 blogURL = [blogURL stringByReplacingOccurrencesOfString:@"https://" withString:@""]; 5140 5141 keychainPWD = [SFHFKeychainUtils getPasswordForUsername : userName andServiceName : blogURL error:&anError]; 5141 5142 //return the resulting string to the calling function as a string 5142 5143 //NSLog(@"Inside getBlogPasswordFromKeychainWithUsername... keychainPWD is %@", keychainPWD); -
Classes/AddSiteViewController.m
522 522 // Grab our XML-RPC url 523 523 ASIHTTPRequest *htmlRequest = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:url]]; 524 524 [htmlRequest setShouldPresentCredentialsBeforeChallenge:NO]; 525 [htmlRequest setValidatesSecureCertificate:NO]; 525 526 [htmlRequest setShouldPresentAuthenticationDialog:YES]; 526 527 [htmlRequest setUseKeychainPersistence:YES]; 527 528 [htmlRequest setDelegate:self]; … … 742 743 andBlogURL:[self.url stringByReplacingOccurrencesOfRegex:@"http(s?)://" withString:@""]]; 743 744 744 745 if([authEnabled isEqualToNumber:[NSNumber numberWithInt:1]]) { 745 [[BlogDataManager sharedDataManager] updatePasswordInKeychain:authPassword746 [[BlogDataManager sharedDataManager] saveBlogPasswordToKeychain:authPassword 746 747 andUserName:authUsername 747 748 andBlogURL:authBlogURL]; 748 749 } -
Classes/WPMediaUploader.h
20 20 UILabel *messageLabel; 21 21 UIProgressView *progressView; 22 22 UIButton *stopButton; 23 BlogDataManager *dm; 23 24 24 25 MediaType mediaType; 25 26 MediaOrientation orientation; -
Classes/WPMediaUploader.m
148 148 else if(self.mediaType == kVideo) 149 149 [self updateStatus:@"Uploading video..."]; 150 150 151 152 dm = [BlogDataManager sharedDataManager]; 153 BOOL httpAuthEnabled = [[dm.currentBlog objectForKey:@"authEnabled"] boolValue]; 154 NSString *httpAuthUsername = [dm.currentBlog valueForKey:@"authUsername"]; 155 NSString *httpAuthPassword = [dm getHTTPPasswordFromKeychainInContextOfCurrentBlog:dm.currentBlog]; 156 151 157 ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:self.xmlrpcURL]]; 152 158 [request setDelegate:self]; 153 159 [request setShouldStreamPostDataFromDisk:YES]; 154 160 [request appendPostDataFromFile:self.localEncodedURL]; 155 161 [request setUploadProgressDelegate:self.progressView]; 156 162 [request setTimeOutSeconds:600]; 163 [request setValidatesSecureCertificate:NO]; 164 if (httpAuthEnabled) { 165 [request setUsername:httpAuthUsername]; 166 [request setPassword:httpAuthPassword]; 167 } 157 168 [request startAsynchronous]; 158 169 } 159 170 … … 473 484 474 485 - (void)connection:(NSURLConnection *)conn didFailWithError:(NSError *)error { 475 486 [self updateStatus:@"Upload failed. Please try again."]; 476 NSLog(@"connection failed: %@", [error localizedDescription]); 487 NSLog(@"connection failed: %@", [error localizedDescription]); 477 488 478 489 if(self.mediaType == kImage) 479 490 [self stopWithNotificationName:@"ImageUploadFailed"];
