marinofaggiana 3 роки тому
батько
коміт
9aab062b20

+ 8 - 8
File Provider Extension/FileProviderData.swift

@@ -84,18 +84,18 @@ class fileProviderData: NSObject {
         // NO DOMAIN -> Set default account
         if domain == nil {
             
-            guard let accountActive = NCManageDatabase.shared.getAccountActive() else { return nil }
-            let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: accountActive.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
-            let webDav = NCUtilityFileSystem.shared.getWebDAV(account: accountActive.account)
+            guard let activeAccount = NCManageDatabase.shared.getActiveAccount() else { return nil }
+            let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: activeAccount.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
+            let webDav = NCUtilityFileSystem.shared.getWebDAV(account: activeAccount.account)
             
-            account = accountActive.account
-            accountUrlBase = accountActive.urlBase
-            homeServerUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: accountActive.urlBase, account: accountActive.account)
+            account = activeAccount.account
+            accountUrlBase = activeAccount.urlBase
+            homeServerUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: activeAccount.urlBase, account: activeAccount.account)
                         
-            NCCommunicationCommon.shared.setup(account: accountActive.account, user: accountActive.user, userId: accountActive.userId, password: CCUtility.getPassword(accountActive.account), urlBase: accountActive.urlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
+            NCCommunicationCommon.shared.setup(account: activeAccount.account, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account), urlBase: activeAccount.urlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
             NCNetworking.shared.delegate = providerExtension as? NCNetworkingDelegate
             
-            return tableAccount.init(value: accountActive)
+            return tableAccount.init(value: activeAccount)
         }
         
         // DOMAIN

+ 9 - 7
Share/NCShareExtension.swift

@@ -208,14 +208,14 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
 
     func setAccount() {
         
-        guard let account = NCManageDatabase.shared.getAccountActive() else {
+        guard let activeAccount = NCManageDatabase.shared.getActiveAccount() else {
             extensionContext?.completeRequest(returningItems: extensionContext?.inputItems, completionHandler: nil)
             return
         }
-        self.activeAccount = account
+        self.activeAccount = activeAccount
         
         // NETWORKING
-        NCCommunicationCommon.shared.setup(account: account.account, user: account.user, userId: account.userId, password: CCUtility.getPassword(account.account), urlBase: account.urlBase, userAgent: CCUtility.getUserAgent(), webDav: NCUtilityFileSystem.shared.getWebDAV(account: account.account), dav: NCUtilityFileSystem.shared.getDAV(), nextcloudVersion: 0, delegate: NCNetworking.shared)
+        NCCommunicationCommon.shared.setup(account: activeAccount.account, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account), urlBase: activeAccount.urlBase, userAgent: CCUtility.getUserAgent(), webDav: NCUtilityFileSystem.shared.getWebDAV(account: activeAccount.account), dav: NCUtilityFileSystem.shared.getDAV(), nextcloudVersion: 0, delegate: NCNetworking.shared)
                 
         // get auto upload folder
         autoUploadFileName = NCManageDatabase.shared.getAccountAutoUploadFileName()
@@ -259,12 +259,12 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
             
         if serverUrl == NCUtilityFileSystem.shared.getHomeServer(urlBase: activeAccount.urlBase, account: activeAccount.account) {
              
-            let account = NCManageDatabase.shared.getAccountActive()
+            let activeAccount = NCManageDatabase.shared.getActiveAccount()
             var title = "  "
-            if account?.alias == "" {
-                title = title + (account?.user ?? "")
+            if activeAccount?.alias == "" {
+                title = title + (activeAccount?.user ?? "")
             } else {
-                title = title + (account?.alias ?? "")
+                title = title + (activeAccount?.alias ?? "")
             }
                 
             profileButton.setTitle(title, for: .normal)
@@ -632,6 +632,8 @@ extension NCShareExtension: UICollectionViewDataSource {
     }
 }
 
+// MARK: - Table View
+
 extension NCShareExtension: UITableViewDelegate {
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {

+ 1 - 1
iOSClient/Account Request/NCAccountRequest.swift

@@ -164,7 +164,7 @@ extension NCAccountRequest: UITableViewDelegate {
         } else {
         
             let account = accounts[indexPath.row]
-            let activeAccount = NCManageDatabase.shared.getAccountActive()
+            let activeAccount = NCManageDatabase.shared.getActiveAccount()
             if account.account != activeAccount?.account {
                 NCManageDatabase.shared.setAccountActive(account.account)
                 dismiss(animated: true) {

+ 21 - 13
iOSClient/AppDelegate.swift

@@ -110,17 +110,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         }
         
         // Activate user account
-        if let resultActiveAccount = NCManageDatabase.shared.getAccountActive() {
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
             
             // FIX 3.0.5 lost urlbase
-            if resultActiveAccount.urlBase.count == 0 {
-                let user = resultActiveAccount.user + " "
-                let urlBase = resultActiveAccount.account.replacingOccurrences(of: user, with: "")
-                resultActiveAccount.urlBase = urlBase
-                NCManageDatabase.shared.updateAccount(resultActiveAccount)
+            if activeAccount.urlBase.count == 0 {
+                let user = activeAccount.user + " "
+                let urlBase = activeAccount.account.replacingOccurrences(of: user, with: "")
+                activeAccount.urlBase = urlBase
+                NCManageDatabase.shared.updateAccount(activeAccount)
             }
             
-            settingAccount(resultActiveAccount.account, urlBase: resultActiveAccount.urlBase, user: resultActiveAccount.user, userId: resultActiveAccount.userId, password: CCUtility.getPassword(resultActiveAccount.account))
+            settingAccount(activeAccount.account, urlBase: activeAccount.urlBase, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account))
             
         } else {
             
@@ -212,6 +212,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     func applicationWillEnterForeground(_ application: UIApplication) {
         
         if account == "" { return }
+        guard let activeAccount = NCManageDatabase.shared.getActiveAccount() else { return }
+        
+        // Account changed ??
+        if activeAccount.account != account {
+            settingAccount(activeAccount.account, urlBase: activeAccount.urlBase, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account))
+            
+            NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitializeMain)
+        }
 
         NCCommunicationCommon.shared.writeLog("Application will enter in foreground")
         
@@ -605,7 +613,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     // MARK: - Account Request
     
     func changeAccountRequestAddAccount() {
-        if let activeAccount = NCManageDatabase.shared.getAccountActive() {
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
             
             NCOperationQueue.shared.cancelAllQueue()
             NCNetworking.shared.cancelAllTask()
@@ -754,12 +762,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
                 guard let pathScheme = CCUtility.value(forKey: "path", fromQueryItems: queryItems) else { return false }
                 guard let linkScheme = CCUtility.value(forKey: "link", fromQueryItems: queryItems) else { return false }
                 
-                if let account = NCManageDatabase.shared.getAccountActive() {
+                if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
                     
-                    let urlBase = URL(string: account.urlBase)
-                    let user = account.user
+                    let urlBase = URL(string: activeAccount.urlBase)
+                    let user = activeAccount.user
                     if linkScheme.contains(urlBase?.host ?? "") && userScheme == user {
-                        matchedAccount = account
+                        matchedAccount = activeAccount
                     } else {
                         let accounts = NCManageDatabase.shared.getAllAccount()
                         for account in accounts {
@@ -776,7 +784,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
                     
                     if matchedAccount != nil {
                         
-                        let webDAV = NCUtilityFileSystem.shared.getWebDAV(account: account.account)
+                        let webDAV = NCUtilityFileSystem.shared.getWebDAV(account: activeAccount.account)
                         if pathScheme.contains("/") {
                             fileName = (pathScheme as NSString).lastPathComponent
                             serverUrl = matchedAccount!.urlBase + "/" + webDAV + "/" + (pathScheme as NSString).deletingLastPathComponent

+ 8 - 8
iOSClient/Data/NCManageDatabase.swift

@@ -338,7 +338,7 @@ class NCManageDatabase: NSObject {
         }
     }
 
-    @objc func getAccountActive() -> tableAccount? {
+    @objc func getActiveAccount() -> tableAccount? {
         
         let realm = try! Realm()
         
@@ -538,13 +538,13 @@ class NCManageDatabase: NSObject {
         var returnAccount = tableAccount()
 
         do {
-            guard let account = self.getAccountActive() else {
+            guard let activeAccount = self.getActiveAccount() else {
                 return nil
             }
             
             try realm.safeWrite {
                 
-                guard let result = realm.objects(tableAccount.self).filter("account == %@", account.account).first else {
+                guard let result = realm.objects(tableAccount.self).filter("account == %@", activeAccount.account).first else {
                     return
                 }
                 
@@ -587,13 +587,13 @@ class NCManageDatabase: NSObject {
         var returnAccount = tableAccount()
 
         do {
-            guard let account = self.getAccountActive() else {
+            guard let activeAccount = self.getActiveAccount() else {
                 return nil
             }
             
             try realm.safeWrite {
                 
-                guard let result = realm.objects(tableAccount.self).filter("account == %@", account.account).first else {
+                guard let result = realm.objects(tableAccount.self).filter("account == %@", activeAccount.account).first else {
                     return
                 }
                 
@@ -1467,7 +1467,7 @@ class NCManageDatabase: NSObject {
     
     @objc func getE2eEncryptions(predicate: NSPredicate) -> [tableE2eEncryption]? {
         
-        guard self.getAccountActive() != nil else {
+        guard self.getActiveAccount() != nil else {
             return nil
         }
         
@@ -1486,7 +1486,7 @@ class NCManageDatabase: NSObject {
     
     @objc func renameFileE2eEncryption(serverUrl: String, fileNameIdentifier: String, newFileName: String, newFileNamePath: String) {
         
-        guard let tableAccount = self.getAccountActive() else {
+        guard let activeAccount = self.getActiveAccount() else {
             return
         }
         
@@ -1494,7 +1494,7 @@ class NCManageDatabase: NSObject {
 
         realm.beginWrite()
 
-        guard let result = realm.objects(tableE2eEncryption.self).filter("account == %@ AND serverUrl == %@ AND fileNameIdentifier == %@", tableAccount.account, serverUrl, fileNameIdentifier).first else {
+        guard let result = realm.objects(tableE2eEncryption.self).filter("account == %@ AND serverUrl == %@ AND fileNameIdentifier == %@", activeAccount.account, serverUrl, fileNameIdentifier).first else {
             realm.cancelWrite()
             return 
         }

+ 3 - 3
iOSClient/Diagnostics/NCCapabilitiesViewController.swift

@@ -152,10 +152,10 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
         imageUserStatus.image = UIImage.init(named: "userStatusAway")!.image(color: .gray, size: 50)
         imageComments.image = UIImage.init(named: "comments")!.image(color: .gray, size: 50)
 
-        guard let account = NCManageDatabase.shared.getAccountActive() else { return }
-        self.account = account.account
+        guard let activeAccount = NCManageDatabase.shared.getActiveAccount() else { return }
+        self.account = activeAccount.account
         
-        if let text = NCManageDatabase.shared.getCapabilities(account: account.account) {
+        if let text = NCManageDatabase.shared.getCapabilities(account: activeAccount.account) {
             capabilitiesText = text
             updateCapabilities()
         } else {

+ 5 - 5
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -251,12 +251,12 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 
                 if serverUrl == NCUtilityFileSystem.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account) {
                  
-                    let account = NCManageDatabase.shared.getAccountActive()
+                    let activeAccount = NCManageDatabase.shared.getActiveAccount()
                     var title = "  "
-                    if account?.alias == "" {
-                        title = title + (account?.user ?? "")
+                    if activeAccount?.alias == "" {
+                        title = title + (activeAccount?.user ?? "")
                     } else {
-                        title = title + (account?.alias ?? "")
+                        title = title + (activeAccount?.alias ?? "")
                     }
                     
                     button.setTitle(title, for: .normal)
@@ -664,7 +664,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     
     func changeAccountRequestAddAccount() {
-        if let activeAccount = NCManageDatabase.shared.getAccountActive() {
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
             
             NCOperationQueue.shared.cancelAllQueue()
             NCNetworking.shared.cancelAllTask()

+ 2 - 2
iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift

@@ -143,8 +143,8 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate {
         
         // Use Sub folder
         row = XLFormRowDescriptor(tag: "useSubFolder", rowType: XLFormRowDescriptorTypeBooleanSwitch, title: NSLocalizedString("_autoupload_create_subfolder_", comment: ""))
-        let tableAccount = NCManageDatabase.shared.getAccountActive()
-        if tableAccount?.autoUploadCreateSubfolder == true {
+        let activeAccount = NCManageDatabase.shared.getActiveAccount()
+        if activeAccount?.autoUploadCreateSubfolder == true {
             row.value = 1
         } else {
             row.value = 0

+ 2 - 2
iOSClient/Media/NCMedia.swift

@@ -478,8 +478,8 @@ extension NCMedia {
         
         livePhoto = CCUtility.getLivePhoto()
         
-        if let tableAccount = NCManageDatabase.shared.getAccountActive() {
-            self.mediaPath = tableAccount.mediaPath
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
+            self.mediaPath = activeAccount.mediaPath
         }
         let startServerUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account) + mediaPath
         

+ 7 - 7
iOSClient/More/NCMore.swift

@@ -180,17 +180,17 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         
         // Display Name user & Quota
 
-        if let tabAccount = NCManageDatabase.shared.getAccountActive() {
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
       
-            self.tabAccount = tabAccount
+            self.tabAccount = activeAccount
 
-            if (tabAccount.quotaRelative > 0) {
-                progressQuota.progress = Float(tabAccount.quotaRelative) / 100
+            if (activeAccount.quotaRelative > 0) {
+                progressQuota.progress = Float(activeAccount.quotaRelative) / 100
             } else {
                 progressQuota.progress = 0
             }
 
-            switch tabAccount.quotaTotal {
+            switch activeAccount.quotaTotal {
             case -1:
                 quota = "0"
             case -2:
@@ -198,10 +198,10 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             case -3:
                 quota = NSLocalizedString("_quota_space_unlimited_", comment: "")
             default:
-                quota = CCUtility.transformedSize(tabAccount.quotaTotal)
+                quota = CCUtility.transformedSize(activeAccount.quotaTotal)
             }
 
-            let quotaUsed: String = CCUtility.transformedSize(tabAccount.quotaUsed)
+            let quotaUsed: String = CCUtility.transformedSize(activeAccount.quotaUsed)
 
             labelQuota.text = String.localizedStringWithFormat(NSLocalizedString("_quota_using_", comment: ""), quotaUsed, quota)
         }

+ 9 - 9
iOSClient/Networking/NCAutoUpload.swift

@@ -63,8 +63,8 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
         
         NCCommunicationCommon.shared.writeLog("Location manager: latitude \(latitude) longitude \(longitude)")
         
-        if let account = NCManageDatabase.shared.getAccountActive() {
-            if account.autoUpload && account.autoUploadBackground && UIApplication.shared.applicationState == UIApplication.State.background {
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
+            if activeAccount.autoUpload && activeAccount.autoUploadBackground && UIApplication.shared.applicationState == UIApplication.State.background {
                 NCAskAuthorization.shared.askAuthorizationPhotoLibrary(viewController: nil) { (hasPermission) in
                     if hasPermission {
                         self.uploadAssetsNewAndFull(viewController: nil, selector: NCGlobal.shared.selectorUploadAutoUpload, log: "Change location") { (items) in
@@ -98,8 +98,8 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
     // MARK: -
     
     @objc func initAutoUpload(viewController: UIViewController?, completion: @escaping (_ items: Int)->()) {
-        if let account = NCManageDatabase.shared.getAccountActive() {
-            if account.autoUpload {
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
+            if activeAccount.autoUpload {
                 NCAskAuthorization.shared.askAuthorizationPhotoLibrary(viewController: viewController) { (hasPermission) in
                     if hasPermission {
                         self.uploadAssetsNewAndFull(viewController:viewController, selector: NCGlobal.shared.selectorUploadAutoUpload, log: "Init Auto Upload") { (items) in
@@ -108,7 +108,7 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
                             }
                             completion(items)
                         }
-                        if account.autoUploadBackground {
+                        if activeAccount.autoUploadBackground {
                             NCAskAuthorization.shared.askAuthorizationLocationManager() { (hasFullPermissions) in
                                 if hasFullPermissions {
                                     self.startSignificantChangeUpdates()
@@ -312,11 +312,11 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
     // MARK: -
 
     @objc func alignPhotoLibrary(viewController: UIViewController?) {
-        if let account = NCManageDatabase.shared.getAccountActive() {
-            getCameraRollAssets(viewController: viewController, account: account, selector: NCGlobal.shared.selectorUploadAutoUploadAll, alignPhotoLibrary: true) { (assets) in
-                NCManageDatabase.shared.clearTable(tablePhotoLibrary.self, account: account.account)
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
+            getCameraRollAssets(viewController: viewController, account: activeAccount, selector: NCGlobal.shared.selectorUploadAutoUploadAll, alignPhotoLibrary: true) { (assets) in
+                NCManageDatabase.shared.clearTable(tablePhotoLibrary.self, account: activeAccount.account)
                 if let assets = assets {
-                    NCManageDatabase.shared.addPhotoLibrary(assets, account: account.account)
+                    NCManageDatabase.shared.addPhotoLibrary(assets, account: activeAccount.account)
                     NCCommunicationCommon.shared.writeLog("Align Photo Library \(assets.count)")
                 }
             }

+ 1 - 1
iOSClient/Select/NCSelect.swift

@@ -100,7 +100,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
         self.navigationController?.navigationBar.prefersLargeTitles = true
         self.navigationController?.presentationController?.delegate = self
         
-        activeAccount = NCManageDatabase.shared.getAccountActive()
+        activeAccount = NCManageDatabase.shared.getActiveAccount()
         
         // Cell
         collectionView.register(UINib.init(nibName: "NCListCell", bundle: nil), forCellWithReuseIdentifier: "listCell")

+ 34 - 34
iOSClient/Settings/CCManageAccount.m

@@ -43,7 +43,7 @@
     XLFormRowDescriptor *row;
         
     NSArray *accounts = [[NCManageDatabase shared] getAllAccount];
-    tableAccount *accountActive = [[NCManageDatabase shared] getAccountActive];
+    tableAccount *activeAccount = [[NCManageDatabase shared] getActiveAccount];
 
     // Section : ACCOUNTS -------------------------------------------
     
@@ -84,7 +84,7 @@
     [row.cellConfig setObject:[[UIImage imageNamed:@"form-textbox"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textField.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textField.textColor"];
-    row.value = accountActive.alias;
+    row.value = activeAccount.alias;
     [section addFormRow:row];
     
     // Section : REQUEST ACCOUNT -------------------------------------------
@@ -139,7 +139,7 @@
 #if TARGET_OS_SIMULATOR
         // Set user status
         if (@available(iOS 13.0, *)) {
-            BOOL userStatus = [[NCManageDatabase shared] getCapabilitiesServerBoolWithAccount:accountActive.account elements:NCElementsJSON.shared.capabilitiesUserStatusEnabled exists:false];
+            BOOL userStatus = [[NCManageDatabase shared] getCapabilitiesServerBoolWithAccount:activeAccount.account elements:NCElementsJSON.shared.capabilitiesUserStatusEnabled exists:false];
             if (userStatus) {
                 row = [XLFormRowDescriptor formRowDescriptorWithTag:@"setUserStatus" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_set_user_status_", nil)];
                 row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
@@ -161,107 +161,107 @@
     [form addFormSection:section];
     
     // Full Name
-    if ([accountActive.displayName length] > 0) {
+    if ([activeAccount.displayName length] > 0) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"userfullname" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_user_full_name_", nil)];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"user"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.displayName;
+        row.value = activeAccount.displayName;
         [section addFormRow:row];
     }
     
     // Address
-    if ([accountActive.address length] > 0) {
+    if ([activeAccount.address length] > 0) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"useraddress" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_user_address_", nil)];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"address"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.address;
+        row.value = activeAccount.address;
         [section addFormRow:row];
     }
     
     // City + zip
-    if ([accountActive.city length] > 0) {
+    if ([activeAccount.city length] > 0) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"usercity" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_user_city_", nil)];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"city"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.city;
-        if ([accountActive.zip length] > 0) {
-            row.value = [NSString stringWithFormat:@"%@ %@", row.value, accountActive.zip];
+        row.value = activeAccount.city;
+        if ([activeAccount.zip length] > 0) {
+            row.value = [NSString stringWithFormat:@"%@ %@", row.value, activeAccount.zip];
         }
         [section addFormRow:row];
     }
     
     // Country
-    if ([accountActive.country length] > 0) {
+    if ([activeAccount.country length] > 0) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"usercountry" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_user_country_", nil)];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"country"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = [[NSLocale systemLocale] displayNameForKey:NSLocaleCountryCode value:accountActive.country];
+        row.value = [[NSLocale systemLocale] displayNameForKey:NSLocaleCountryCode value:activeAccount.country];
         //NSArray *countryCodes = [NSLocale ISOCountryCodes];
         [section addFormRow:row];
     }
     
     // Phone
-    if ([accountActive.phone length] > 0) {
+    if ([activeAccount.phone length] > 0) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"userphone" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_user_phone_", nil)];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"phone"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.phone;
+        row.value = activeAccount.phone;
         [section addFormRow:row];
     }
     
     // Email
-    if ([accountActive.email length] > 0) {
+    if ([activeAccount.email length] > 0) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"useremail" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_user_email_", nil)];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"email"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.email;
+        row.value = activeAccount.email;
         [section addFormRow:row];
     }
     
     // Web
-    if ([accountActive.webpage length] > 0) {
+    if ([activeAccount.webpage length] > 0) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"userweb" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_user_web_", nil)];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"network"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.webpage;
+        row.value = activeAccount.webpage;
         [section addFormRow:row];
     }
     
     // Twitter
-    if ([accountActive.twitter length] > 0) {
+    if ([activeAccount.twitter length] > 0) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"usertwitter" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_user_twitter_", nil)];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"twitter"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.twitter;
+        row.value = activeAccount.twitter;
         [section addFormRow:row];
     }
     
     // Section : THIRT PART -------------------------------------------
-    BOOL isHandwerkcloudEnabled = [[NCManageDatabase shared] getCapabilitiesServerBoolWithAccount:accountActive.account elements:NCElementsJSON.shared.capabilitiesHWCEnabled exists:false];
+    BOOL isHandwerkcloudEnabled = [[NCManageDatabase shared] getCapabilitiesServerBoolWithAccount:activeAccount.account elements:NCElementsJSON.shared.capabilitiesHWCEnabled exists:false];
     if (isHandwerkcloudEnabled) {
 
         section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_user_job_", nil)];
@@ -274,7 +274,7 @@
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"businesstype"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.businessType;
+        row.value = activeAccount.businessType;
         [section addFormRow:row];
         
         // Business Size
@@ -284,7 +284,7 @@
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"users"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.businessSize;
+        row.value = activeAccount.businessSize;
         [section addFormRow:row];
         
         // Role
@@ -294,9 +294,9 @@
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"role"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        if ([accountActive.role isEqualToString:@"owner"]) row.value = NSLocalizedString(@"_user_owner_", nil);
-        else if ([accountActive.role isEqualToString:@"employee"]) row.value = NSLocalizedString(@"_user_employee_", nil);
-        else if ([accountActive.role isEqualToString:@"contractor"]) row.value = NSLocalizedString(@"_user_contractor_", nil);
+        if ([activeAccount.role isEqualToString:@"owner"]) row.value = NSLocalizedString(@"_user_owner_", nil);
+        else if ([activeAccount.role isEqualToString:@"employee"]) row.value = NSLocalizedString(@"_user_employee_", nil);
+        else if ([activeAccount.role isEqualToString:@"contractor"]) row.value = NSLocalizedString(@"_user_contractor_", nil);
         else row.value = @"";
         [section addFormRow:row];
         
@@ -307,10 +307,10 @@
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"company"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-        row.value = accountActive.company;
+        row.value = activeAccount.company;
         [section addFormRow:row];
     
-        if (accountActive.hcIsTrial) {
+        if (activeAccount.hcIsTrial) {
         
             section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_trial_", nil)];
             [form addFormSection:section];
@@ -322,7 +322,7 @@
             [row.cellConfig setObject:[UIColor redColor] forKey:@"textLabel.textColor"];
             [row.cellConfig setObject:[UIColor redColor] forKey:@"detailTextLabel.textColor"];
             [row.cellConfig setObject:[[UIImage imageNamed:@"timer"] imageWithColor:NCBrandColor.shared.icon size:25] forKey:@"imageView.image"];
-            NSInteger numberOfDays = accountActive.hcTrialRemainingSec / (24*3600);
+            NSInteger numberOfDays = activeAccount.hcTrialRemainingSec / (24*3600);
             row.value = [@(numberOfDays) stringValue];
             [section addFormRow:row];
         }
@@ -400,11 +400,11 @@
     [super formRowDescriptorValueHasChanged:rowDescriptor oldValue:oldValue newValue:newValue];
     
     NSArray *accounts = [[NCManageDatabase shared] getAllAccount];
-    tableAccount *accountActive = [[NCManageDatabase shared] getAccountActive];
+    tableAccount *activeAccount = [[NCManageDatabase shared] getActiveAccount];
 
     for (tableAccount *account in accounts) {
         if ([rowDescriptor.tag isEqualToString:account.account]) {
-            if (![account.account isEqualToString:accountActive.account]) {
+            if (![account.account isEqualToString:activeAccount.account]) {
                 [self ChangeDefaultAccount:account.account];
                 [self initializeForm];
             }
@@ -448,8 +448,8 @@
     
     [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_delete_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
         
-        tableAccount *accountActive = [[NCManageDatabase shared] getAccountActive];
-        NSString *account = accountActive.account;
+        tableAccount *activeAccount = [[NCManageDatabase shared] getActiveAccount];
+        NSString *account = activeAccount.account;
         
         if (account) {
             [appDelegate deleteAccount:account wipe:false];

+ 29 - 29
iOSClient/Settings/CCManageAutoUpload.m

@@ -40,7 +40,7 @@
     XLFormSectionDescriptor *section;
     XLFormRowDescriptor *row;
  
-    tableAccount *tableAccount = [[NCManageDatabase shared] getAccountActive];
+    tableAccount *activeAccount = [[NCManageDatabase shared] getActiveAccount];
     
     // Auto Upload
     
@@ -50,7 +50,7 @@
 
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUpload" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_autoupload_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
-    if (tableAccount.autoUpload) row.value = @1;
+    if (activeAccount.autoUpload) row.value = @1;
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
@@ -80,7 +80,7 @@
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUploadImage" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_autoupload_photos_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
-    if (tableAccount.autoUploadImage) row.value = @1;
+    if (activeAccount.autoUploadImage) row.value = @1;
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
@@ -89,7 +89,7 @@
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUploadWWAnPhoto" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_wifi_only_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
-    if (tableAccount.autoUploadWWAnPhoto) row.value = @1;
+    if (activeAccount.autoUploadWWAnPhoto) row.value = @1;
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
@@ -103,7 +103,7 @@
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUploadVideo" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_autoupload_videos_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
-    if (tableAccount.autoUploadVideo) row.value = @1;
+    if (activeAccount.autoUploadVideo) row.value = @1;
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
@@ -112,7 +112,7 @@
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUploadWWAnVideo" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_wifi_only_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
-    if (tableAccount.autoUploadWWAnVideo) row.value = @1;
+    if (activeAccount.autoUploadWWAnVideo) row.value = @1;
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
@@ -126,7 +126,7 @@
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"removePhotoCameraRoll" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_remove_photo_CameraRoll_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
-    if (tableAccount.autoUploadDeleteAssetLocalIdentifier) row.value = @1;
+    if (activeAccount.autoUploadDeleteAssetLocalIdentifier) row.value = @1;
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
@@ -140,7 +140,7 @@
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUploadBackground" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_autoupload_background_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
-    if (tableAccount.autoUploadBackground) row.value = @1;
+    if (activeAccount.autoUploadBackground) row.value = @1;
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
@@ -155,7 +155,7 @@
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
     row.value = 0;
-    if (tableAccount.autoUploadFull) row.value = @1;
+    if (activeAccount.autoUploadFull) row.value = @1;
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
@@ -169,7 +169,7 @@
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUploadCreateSubfolder" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_autoupload_create_subfolder_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.cellSettings;
     row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
-    if (tableAccount.autoUploadCreateSubfolder) row.value = @1;
+    if (activeAccount.autoUploadCreateSubfolder) row.value = @1;
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
@@ -256,7 +256,7 @@
 {
     [super formRowDescriptorValueHasChanged:rowDescriptor oldValue:oldValue newValue:newValue];
     
-    tableAccount *account = [[NCManageDatabase shared] getAccountActive];
+    tableAccount *activeAccount = [[NCManageDatabase shared] getActiveAccount];
     
     if ([rowDescriptor.tag isEqualToString:@"autoUpload"]) {
         
@@ -269,7 +269,7 @@
             [[NCManageDatabase shared] setAccountAutoUploadDirectory:nil urlBase:appDelegate.urlBase account:appDelegate.account];
             
             // verifichiamo che almeno uno dei servizi (foto video) siano attivi, in caso contrario attiviamo le foto
-            if (account.autoUploadImage == NO && account.autoUploadVideo == NO) {
+            if (activeAccount.autoUploadImage == NO && activeAccount.autoUploadVideo == NO) {
                 [[NCManageDatabase shared] setAccountAutoUploadProperty:@"autoUploadImage" state:YES];
                 [[NCManageDatabase shared] setAccountAutoUploadProperty:@"autoUploadVideo" state:YES];
             }
@@ -399,33 +399,33 @@
     XLFormRowDescriptor *rowAutoUploadFileName = [self.form formRowWithTag:@"autoUploadFileName"];
         
     // - STATUS ---------------------
-    tableAccount *tableAccount = [[NCManageDatabase shared] getAccountActive];
+    tableAccount *activeAccount = [[NCManageDatabase shared] getActiveAccount];
     
-    if (tableAccount.autoUpload)
+    if (activeAccount.autoUpload)
         [rowAutoUpload setValue:@1]; else [rowAutoUpload setValue:@0];
     
-    if (tableAccount.autoUploadImage)
+    if (activeAccount.autoUploadImage)
         [rowAutoUploadImage setValue:@1]; else [rowAutoUploadImage setValue:@0];
     
-    if (tableAccount.autoUploadWWAnPhoto)
+    if (activeAccount.autoUploadWWAnPhoto)
         [rowAutoUploadWWAnPhoto setValue:@1]; else [rowAutoUploadWWAnPhoto setValue:@0];
     
-    if (tableAccount.autoUploadVideo)
+    if (activeAccount.autoUploadVideo)
         [rowAutoUploadVideo setValue:@1]; else [rowAutoUploadVideo setValue:@0];
     
-    if (tableAccount.autoUploadWWAnVideo)
+    if (activeAccount.autoUploadWWAnVideo)
         [rowAutoUploadWWAnVideo setValue:@1]; else [rowAutoUploadWWAnVideo setValue:@0];
     
-    if (tableAccount.autoUploadDeleteAssetLocalIdentifier)
+    if (activeAccount.autoUploadDeleteAssetLocalIdentifier)
            [rowRemovePhotoCameraRoll setValue:@1]; else [rowRemovePhotoCameraRoll setValue:@0];
     
-    if (tableAccount.autoUploadBackground)
+    if (activeAccount.autoUploadBackground)
         [rowAutoUploadBackground setValue:@1]; else [rowAutoUploadBackground setValue:@0];
     
-    if (tableAccount.autoUploadFull)
+    if (activeAccount.autoUploadFull)
         [rowAutoUploadFull setValue:@1]; else [rowAutoUploadFull setValue:@0];
     
-    if (tableAccount.autoUploadCreateSubfolder)
+    if (activeAccount.autoUploadCreateSubfolder)
         [rowAutoUploadCreateSubfolder setValue:@1]; else [rowAutoUploadCreateSubfolder setValue:@0];
 
     // - HIDDEN --------------------------------------------------------------------------
@@ -455,7 +455,7 @@
 
 - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
 {
-    tableAccount *tableAccount = [[NCManageDatabase shared] getAccountActive];
+    tableAccount *activeAccount = [[NCManageDatabase shared] getActiveAccount];
     NSString *sectionName;
     NSString *autoUploadPath = [NSString stringWithFormat:@"%@/%@", [[NCManageDatabase shared] getAccountAutoUploadDirectoryWithUrlBase:appDelegate.urlBase account:appDelegate.account], [[NCManageDatabase shared] getAccountAutoUploadFileName]];
 
@@ -465,27 +465,27 @@
             sectionName = NSLocalizedString(@"_autoupload_description_", nil);
             break;
         case 1:
-            if (tableAccount.autoUpload) sectionName = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"_autoupload_current_folder_", nil), [CCUtility returnPathfromServerUrl:autoUploadPath urlBase:appDelegate.urlBase account:appDelegate.account]];
+            if (activeAccount.autoUpload) sectionName = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"_autoupload_current_folder_", nil), [CCUtility returnPathfromServerUrl:autoUploadPath urlBase:appDelegate.urlBase account:appDelegate.account]];
             else sectionName = @"";
             break;
         case 4:
-            if (tableAccount.autoUpload) sectionName = NSLocalizedString(@"_remove_photo_CameraRoll_desc_", nil);
+            if (activeAccount.autoUpload) sectionName = NSLocalizedString(@"_remove_photo_CameraRoll_desc_", nil);
             else sectionName = @"";
             break;
         case 5:
-            if (tableAccount.autoUpload) sectionName = NSLocalizedString(@"_autoupload_description_background_", nil);
+            if (activeAccount.autoUpload) sectionName = NSLocalizedString(@"_autoupload_description_background_", nil);
             else sectionName = @"";
             break;
         case 6:
-            if (tableAccount.autoUpload) sectionName =  NSLocalizedString(@"_autoupload_fullphotos_footer_", nil);
+            if (activeAccount.autoUpload) sectionName =  NSLocalizedString(@"_autoupload_fullphotos_footer_", nil);
             else sectionName = @"";
             break;
         case 7:
-            if (tableAccount.autoUpload) sectionName =  NSLocalizedString(@"_autoupload_create_subfolder_footer_", nil);
+            if (activeAccount.autoUpload) sectionName =  NSLocalizedString(@"_autoupload_create_subfolder_footer_", nil);
             else sectionName = @"";
             break;
         case 8:
-            if (tableAccount.autoUpload) sectionName =  NSLocalizedString(@"_autoupload_filenamemask_footer_", nil);
+            if (activeAccount.autoUpload) sectionName =  NSLocalizedString(@"_autoupload_filenamemask_footer_", nil);
             else sectionName = @"";
             break;
     }

+ 4 - 4
iOSClient/Share/NCShareComments.swift

@@ -56,15 +56,15 @@ class NCShareComments: UIViewController, NCShareCommentsCellDelegate {
         newCommentField.placeholder = NSLocalizedString("_new_comment_", comment: "")
         
         // Display Name user & Quota
-        guard let tabAccount = NCManageDatabase.shared.getAccountActive() else {
+        guard let activeAccount = NCManageDatabase.shared.getActiveAccount() else {
             return
         }
         
-        if tabAccount.displayName.isEmpty {
-            labelUser.text = tabAccount.user
+        if activeAccount.displayName.isEmpty {
+            labelUser.text = activeAccount.user
         }
         else{
-            labelUser.text = tabAccount.displayName
+            labelUser.text = activeAccount.displayName
         }
         
         imageItem.image = UIImage(named: "avatar")