Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #958 from owncloud/release_3.7.0
Browse files Browse the repository at this point in the history
Release 3.7.0
  • Loading branch information
nasli authored Dec 26, 2017
2 parents 6d33d54 + 88c1333 commit 3f9580d
Show file tree
Hide file tree
Showing 48 changed files with 610 additions and 541 deletions.
17 changes: 17 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 3.7.0 (December 2017)
- OAuth2 support with automatically refresh of new tokens
- New login view redesign
- Improve the automatic parse of valid URL in login view
- Automatic detection of authentication method available from the URL
- Improve network error messages inside the login view and all the app
- Improve UX for network warnings shown on the top of file list view
- Improve accounts handling
- Improve cookie sessions handling
- Improve switching between accounts
- Improve credentials handling in all requests and keychain
- Upgrade new db version
- New option in public share link that allows you to share a folder with only the option of uploading files to it
- Reflect forbidden reshare server capability in app
- Changes in Open-with feature to support whitelisted apps
- Bugs fixing

## 3.6.2 (June 2017)
- Support for private links
- Fix crash in public share links on iPads with iOS10
Expand Down
2 changes: 1 addition & 1 deletion OC Share Sheet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.5</string>
<string>1.0.6</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSAppTransportSecurity</key>
Expand Down
14 changes: 3 additions & 11 deletions Owncloud iOs Client/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,6 @@ extern NSString * NotReachableNetworkForDownloadsNotification;
*/
- (void) cancelTheCurrentUploadsOfTheUser:(NSInteger)userId;

/*
* This method is called after that this class receive the notification that the user
* has resolved the credentials error.
* In this method we changed the kind of error of uploads failed "errorCredentials" to "notAndError"
* for a specific user
* @userId -> userId for a scpecific user.
*/
- (void)changeTheStatusOfCredentialsFilesErrorOfAnUserId:(NSInteger)userId;


///-----------------------------------
/// @name Generate App Interface
Expand All @@ -295,7 +286,7 @@ extern NSString * NotReachableNetworkForDownloadsNotification;
* For iPad:
* - The same TabBarController with three items.
* - Detail View.
*
*
*/
- (void) generateAppInterfaceFromLoginScreen:(BOOL)isFromLogin;

Expand Down Expand Up @@ -330,7 +321,8 @@ extern NSString * NotReachableNetworkForDownloadsNotification;
* Method that switches the active user to that passed as a parameter
*
* @param user -> UserDto to set as active user
* @param isNewAccount -> BOOL if this user is a new account added
*/
- (void) switchActiveUserTo:(UserDto *) user inHardMode:(BOOL)hardMode withCompletionHandler:(void (^)(void)) completionHandler;
- (void) switchActiveUserTo:(UserDto *) user isNewAccount:(BOOL)isNewAccount;

@end
147 changes: 56 additions & 91 deletions Owncloud iOs Client/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

[self showSplashScreenFake];

//Check if the server support shared api
[CheckFeaturesSupported updateServerFeaturesAndCapabilitiesOfActiveUser];


//Needed to use on background tasks
if (!k_is_sso_active) {
[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
Expand Down Expand Up @@ -180,6 +178,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

if (user) {
self.activeUser = user;
[UtilsCookies deleteCurrentSystemCookieStorageAndRestoreTheCookiesOfActiveUser];

((CheckAccessToServer*)[CheckAccessToServer sharedManager]).delegate = self;
[[CheckAccessToServer sharedManager] isConnectionToTheServerByUrl:user.url withTimeout:k_timeout_fast];
Expand Down Expand Up @@ -589,14 +588,16 @@ + (OCCommunication*)sharedOCCommunication
//Cookies is allways available in current supported Servers
[sharedOCCommunication setIsCookiesAvailable:YES];

[sharedOCCommunication setOauth2Configuration: [[OCOAuth2Configuration alloc]
initWithClientId:k_oauth2_client_id
clientSecret:k_oauth2_client_secret
redirectUri:k_oauth2_redirect_uri
authorizationEndpoint:k_oauth2_authorization_endpoint
tokenEndpoint:k_oauth2_token_endpoint]];
OCOAuth2Configuration *ocOAuth2conf = [[OCOAuth2Configuration alloc]
initWithClientId:k_oauth2_client_id
clientSecret:k_oauth2_client_secret
redirectUri:k_oauth2_redirect_uri
authorizationEndpoint:k_oauth2_authorization_endpoint
tokenEndpoint:k_oauth2_token_endpoint];

[sharedOCCommunication setValueOauth2Configuration: ocOAuth2conf];

[sharedOCCommunication setUserAgent:[UtilsUrls getUserAgent]];
[sharedOCCommunication setValueOfUserAgent:[UtilsUrls getUserAgent]];

OCKeychain *oKeychain = [[OCKeychain alloc] init];
[sharedOCCommunication setValueCredentialsStorage:oKeychain];
Expand Down Expand Up @@ -631,14 +632,16 @@ + (OCCommunication*)sharedOCCommunicationDownloadFolder {
//Cookies is allways available in current supported Servers
[sharedOCCommunicationDownloadFolder setIsCookiesAvailable:YES];

[sharedOCCommunicationDownloadFolder setOauth2Configuration: [[OCOAuth2Configuration alloc]
initWithClientId:k_oauth2_client_id
clientSecret:k_oauth2_client_secret
redirectUri:k_oauth2_redirect_uri
authorizationEndpoint:k_oauth2_authorization_endpoint
tokenEndpoint:k_oauth2_token_endpoint]];
OCOAuth2Configuration *ocOAuth2conf = [[OCOAuth2Configuration alloc]
initWithClientId:k_oauth2_client_id
clientSecret:k_oauth2_client_secret
redirectUri:k_oauth2_redirect_uri
authorizationEndpoint:k_oauth2_authorization_endpoint
tokenEndpoint:k_oauth2_token_endpoint];

[sharedOCCommunicationDownloadFolder setUserAgent:[UtilsUrls getUserAgent]];
[sharedOCCommunicationDownloadFolder setValueOauth2Configuration:ocOAuth2conf];

[sharedOCCommunicationDownloadFolder setValueOfUserAgent:[UtilsUrls getUserAgent]];

OCKeychain *oKeychain = [[OCKeychain alloc] init];
[sharedOCCommunicationDownloadFolder setValueCredentialsStorage:oKeychain];
Expand Down Expand Up @@ -974,6 +977,10 @@ - (void)applicationWillTerminate:(UIApplication *)application
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.

//Set on the user defaults that the app has been killed by user

//Store active user cookies on the Database
[UtilsCookies saveCurrentOfActiveUserAndClean];

NSUserDefaults * standardUserDefaults = [NSUserDefaults standardUserDefaults];
[standardUserDefaults setBool:YES forKey:k_app_killed_by_user];
[standardUserDefaults synchronize];
Expand Down Expand Up @@ -1714,8 +1721,13 @@ - (void) closeAlertViewAndViewControllers {
if (self.presentFilesViewController){
//Close the openWith option in FileViewController
if (self.presentFilesViewController.openWith) {
[self.presentFilesViewController.openWith.documentInteractionController dismissMenuAnimated:NO];
self.presentFilesViewController.openWith.documentInteractionController = nil;
if (k_use_open_with_UIDocumentInteractionController) {
[self.presentFilesViewController.openWith.documentInteractionController dismissMenuAnimated:NO];
self.presentFilesViewController.openWith.documentInteractionController = nil;
} else {
[self.presentFilesViewController.openWith.activityView dismissViewControllerAnimated:NO completion:nil];
self.presentFilesViewController.openWith.activityView = nil;
}
}
//Close the delete option in FilesViewController
if (self.presentFilesViewController.mDeleteFile.popupQuery) {
Expand Down Expand Up @@ -2586,39 +2598,6 @@ - (void) cancelTheCurrentUploadsOfTheUser:(NSInteger)userId{
}
}


///-----------------------------------
/// @name Change the Status in uploads with Credential Error
///-----------------------------------

/**
* This method is called after that this class receive the notification that the user
* has resolved the credentials error.
* In this method we changed the kind of error of uploads failed "errorCredentials" to "notAndError"
* for a specific user
*
* @param userId -> userId for a scpecific user.
*
* @discussion Maybe could be better move this kind of method to a singleton class inicializate in appDelegate.
*
*/
- (void)changeTheStatusOfCredentialsFilesErrorOfAnUserId:(NSInteger)userId{

__block ManageUploadRequest *currentManageUploadRequest;

NSArray *failedUploadsTemp = [NSArray arrayWithArray:_uploadArray];

[failedUploadsTemp enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
currentManageUploadRequest = obj;

if (currentManageUploadRequest.currentUpload.kindOfError == errorCredentials && currentManageUploadRequest.currentUpload.userId == userId) {
DLog(@"ub with name %@ not an error", currentManageUploadRequest.currentUpload.uploadFileName);
currentManageUploadRequest.currentUpload.kindOfError=notAnError;
[ManageUploadsDB setStatus:currentManageUploadRequest.currentUpload.status andKindOfError:notAnError byUploadOffline:currentManageUploadRequest.currentUpload];
}
}];
}

- (void) changeUploadsToWaitingForServerConnection{

if (self.uploadArray.count > 0) {
Expand Down Expand Up @@ -2780,72 +2759,58 @@ -(void)badCertificateNotAcceptedByUser {
}


#pragma mark - Active User
#pragma mark - Switch Active User

- (void) switchActiveUserTo:(UserDto *)user inHardMode:(BOOL)hardMode withCompletionHandler:(void (^)(void)) completionHandler {

// all the switch is performed in background, without blocking the caller thread, that should be main
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- (void) switchActiveUserTo:(UserDto *)user isNewAccount:(BOOL)isNewAccount {


self.userSessionCurrentToken = nil;
// should be here or right after checking the user really changed? for the moment, here

if (self.activeUser.userId != user.userId || hardMode) {

//We delete the cookies on SAML
if (k_is_sso_active) {
[UtilsCookies eraseCredentialsAndUrlCacheOfActiveUser];
}
if (!self.activeUser) {
self.activeUser = user;
}

if (self.activeUser.userId != user.userId || isNewAccount) {

// Cancel downloads of the previous user, in the same background thread
// Cancel downloads of the previous user
[self portedCancelAllDownloads];

[UtilsCookies saveActiveUserCookiesAndRestoreCookiesOfUser:user];

// update active state of users in DB
[ManageUsersDB setAllUsersNoActive];
[ManageUsersDB setActiveAccountByUserId:user.userId];
user.activeaccount = YES;

//Restore the cookies of the future activeUser
//1- Store the new cookies on the Database
[UtilsCookies setOnDBStorageCookiesByUser:self.activeUser];
//2- Clean the cookies storage
[UtilsFramework deleteAllCookies];
//3- We restore the previous cookies of the active user on the System cookies storage
[UtilsCookies setOnSystemStorageCookiesByUser:user];
//4- We delete the cookies of the active user on the database because it could change and it is not necessary keep them there
[ManageCookiesStorageDB deleteCookiesByUser:user];


//Change the active user in appDelegate global variable
self.activeUser = user;


//We check the connection here because we need to accept the certificate on the self signed server before go to the files tab
[[CheckAccessToServer sharedManager] isConnectionToTheServerByUrl:[UtilsUrls getFullRemoteServerPath:user]];

[CheckFeaturesSupported updateServerFeaturesAndCapabilitiesOfActiveUser];

[UtilsCookies eraseURLCache];

//we create the user folder to haver multiuser
[UtilsFileSystem createFolderForUser:APP_DELEGATE.activeUser];

//we create the user folder to have multiuser
[UtilsFileSystem createFolderForUser:user];

self.isNewUser = YES;

ManageAccounts *manageAccounts = [ManageAccounts new];
[manageAccounts updateDisplayNameOfUserWithUser:self.activeUser];
[manageAccounts updateDisplayNameOfUserWithUser:user];

}

// completion handler is called in main thread
dispatch_async(dispatch_get_main_queue(), ^{
if (completionHandler) {
completionHandler();
}
});
});
}


- (void) portedCancelAllDownloads {
//Cancel downloads in ipad
[self.downloadManager cancelDownloads];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

[self.downloadManager cancelDownloads];

[[AppDelegate sharedSyncFolderManager] cancelAllDownloads];
[[AppDelegate sharedSyncFolderManager] cancelAllDownloads];
});
}


Expand Down
26 changes: 5 additions & 21 deletions Owncloud iOs Client/Branding/Customization.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

//URLs Setting
#define k_help_url @"http://owncloud.com/mobile/help"
#define k_recomended_url @"http://owncloud.com/mobile/recommend"
#define k_send_feedback @"http://owncloud.com/mobile/feedback"

//Hide url server
#define k_hide_url_server NO
Expand All @@ -33,9 +31,6 @@

//Show multiaccount or disconnect
#define k_multiaccount_available YES

//Have icon on backbutton
#define k_have_icon_on_popover YES

//Have image background on navigation bar
#define k_have_image_background_navigation_bar NO
Expand Down Expand Up @@ -69,18 +64,12 @@
//Show impressum
#define k_show_imprint_option_on_settings NO

//Buy more storage company name
#define k_company_name_buy_more_storage @""

//Customize UITabBar
#define k_is_customize_uitabbar YES

//Customize Unselected UITabBarItems (The images of tabBar should be the unseleted tabs)
#define k_is_customize_unselectedUITabBarItems NO

//Set Image on Preview Bottom toolBar on iPhone
#define k_set_image_on_preview_bottom_toolBar_on_iPhone NO

//Impressum is a File
#define k_impressum_is_file YES

Expand All @@ -90,26 +79,17 @@
//Customize recomend mail
#define k_is_custom_recommend_mail NO
#define k_is_username_recommend_mail NO
//#define k_subject_recommend_mail @"Sehen Sie sich die mobilcom-debitel Cloud an!"
#define k_subject_recommend_mail @""
// /r/n needed for CR and LF
#define k_text_recommend_mail @""
#define k_is_sign_custom_usign_username NO

//Customize background of bar bottom preview with image or color
#define k_is_image_background_preview_bottom_bar NO

//Social customize
#define k_is_custom_twitter NO
#define k_custom_twitter_message @""
#define k_is_custom_facebook NO
#define k_custom_facebook_message @""

//Autocomplete Login
#define k_is_autocomplete_username_necessary NO
#define k_letter_to_begin_autocomplete @"@"
#define k_text_to_autocomplete @""

//Number of uploads shown in recents tab from the database
#define k_number_uploads_shown 30

Expand Down Expand Up @@ -155,7 +135,6 @@
#define k_oauth2_client_secret @"KFeFWWEZO9TkisIQzR3fo7hfiMXlOpaqP8CFuTbSHzV1TUuGECglPxpiVKJfOXIx"



//Following not in use in 3.7.0
/****************************************************************/
//Have oauth active
Expand All @@ -166,6 +145,11 @@
#define k_oauth_token @""
#define k_oauth_webservice @""
#define k_oauth_client_id @"" //the same in k_oauth_login

//Autocomplete Login
#define k_is_autocomplete_username_necessary NO
#define k_letter_to_begin_autocomplete @"@"
#define k_text_to_autocomplete @""
/***************************************************************/


Expand Down
2 changes: 1 addition & 1 deletion Owncloud iOs Client/Branding/UIColor+Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

/*
Copyright (C) 2016, ownCloud GmbH.
Copyright (C) 2017, ownCloud GmbH.
This code is covered by the GNU Public License Version 3.
For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/
You should have received a copy of this license
Expand Down
Loading

0 comments on commit 3f9580d

Please sign in to comment.