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

Release 3.7.0 #958

Merged
merged 43 commits into from
Dec 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6fcdcbd
Update library commit with master branch
nasli Nov 10, 2017
a956b1f
Update bundle version. Update library commit
nasli Nov 10, 2017
07dc410
Remove constants not in use
nasli Nov 13, 2017
30f8958
Update library commit that fix duplicate sessions
nasli Nov 16, 2017
0aaee80
Improved error messages in file list view, show warnings on the top
nasli Oct 31, 2017
09cb875
Show error messages over navigation bar
nasli Nov 16, 2017
9968990
Fix server share capabilities supported
nasli Nov 20, 2017
ba92359
Update user with changes in server features supported
nasli Nov 20, 2017
ad76b34
Fix update credentials active user to avoid crash
nasli Nov 20, 2017
440a597
Fix update properly the active user
nasli Nov 21, 2017
7248c2f
Improve readability
nasli Nov 21, 2017
99dbcae
Fix active user for new account added
nasli Nov 21, 2017
c41d7e8
Remove duplicated code
nasli Nov 21, 2017
0885380
Refactor handling of cookies. Store cookies before app will terminate
nasli Nov 21, 2017
4ed5045
Fix bug use wrong cookies after enter an user that already exist
nasli Nov 22, 2017
6e2edca
Recover active user cookies if the login view is cancelled. Update co…
nasli Nov 23, 2017
15c68a7
Check features server supported before on init
nasli Nov 23, 2017
df6c9f2
Update library commit with the fix to update sharee permissions
nasli Nov 27, 2017
78fbbcd
disabled predict keyboards in the login view
Nov 28, 2017
51d9b7d
remove private link button in the share view
Nov 29, 2017
f0bce77
fix for the public link when the server version is 8
Nov 29, 2017
a2a43b0
changed the log type for only debug logs
Nov 29, 2017
7f41daa
fix for the code review
Nov 29, 2017
1a692a0
Fix show login view again after input credentials
nasli Nov 29, 2017
e888ba7
Refactor cookies to fix issue after update account
nasli Dec 11, 2017
cea6ba7
Comment methods not in use
nasli Dec 11, 2017
1e06bc1
Fix crash after switch between account
nasli Nov 14, 2017
ccb24df
Added a control to prevent the user change
ggdiez Nov 30, 2017
63a9df3
Remove commented code
nasli Dec 12, 2017
01e3628
Fix login view in SAML remain even after renew credentials. Moved syn…
nasli Dec 12, 2017
96afe15
Clean imlementation class, remove duplicated comments
nasli Dec 12, 2017
8761389
Fix duplicate accounts
nasli Dec 14, 2017
4b55b93
Update library commit
nasli Dec 14, 2017
b3d9124
Fix use correct cookies after a renew of credentials in SAML
nasli Dec 15, 2017
0fd4868
Fix relaunch credential error uploads when the user preview the uploa…
nasli Dec 19, 2017
bc42492
Update library commit with a fix for a crash in the library trying to…
nasli Dec 20, 2017
966a31e
Update library commit
nasli Dec 20, 2017
f142de1
Update library commit
nasli Dec 21, 2017
ae49091
Update changelog and versions
nasli Dec 21, 2017
1133ae5
Fix crash after switch between account
nasli Nov 14, 2017
f826a47
Fix open-with in iOS11, revert open-with UIDocumentInteractionControl…
nasli Dec 20, 2017
d67cf89
Move constant to system constants file instead customization
nasli Dec 21, 2017
88c1333
Update library to last release_2.2.0 commit
nasli Dec 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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