Browse Source

add new option : disable_manage_account

Marino Faggiana 8 years ago
parent
commit
f89184c8ac
2 changed files with 33 additions and 31 deletions
  1. 1 0
      iOSClient/Brand/NCBrand.swift
  2. 32 31
      iOSClient/Settings/CCManageAccount.m

+ 1 - 0
iOSClient/Brand/NCBrand.swift

@@ -84,5 +84,6 @@ class NCBrandOptions: NSObject {
     public let disable_request_login_url:       Bool = false
     public let disable_multiaccount:            Bool = false
     public let disable_cryptocloudsystem:       Bool = false
+    public let disable_manage_account:          Bool = false
 }
 

+ 32 - 31
iOSClient/Settings/CCManageAccount.m

@@ -49,7 +49,7 @@
     
     NSArray *listAccount = [CCCoreData getAllAccount];
 
-    // Section : PICKER ACCOUNT -------------------------------------------
+    // Section : CLOUD ACCOUNT -------------------------------------------
     
     section = [XLFormSectionDescriptor formSectionWithTitle:@"cloud account"];
     [form addFormSection:section];
@@ -101,46 +101,47 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"detailTextLabel.font"];
     [section addFormRow:row];
-
     
     // Section : MANAGE ACCOUNT -------------------------------------------
     
-    section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_manage_account_", nil)];
-    [form addFormSection:section];
+    if ([NCBrandOptions sharedInstance].disable_manage_account == NO) {
     
-    // Modify Account
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"changePassword" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_change_password_", nil)];
-    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
-    [row.cellConfig setObject:[UIImage imageNamed:@"settingsAccountModify"] forKey:@"imageView.image"];
-    [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
-    [row.cellConfig setObject:[UIColor blackColor] forKey:@"textLabel.textColor"];
-    row.action.formSelector = @selector(changePassword:);
-    if (listAccount.count == 0) row.disabled = @YES;
-    [section addFormRow:row];
-
-    // Brand
-    if ([NCBrandOptions sharedInstance].disable_multiaccount == NO) {
+        section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_manage_account_", nil)];
+        [form addFormSection:section];
     
-        // New Account nextcloud
-        row = [XLFormRowDescriptor formRowDescriptorWithTag:@"addAccount" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_add_account_", nil)];
+        // Modify Account
+        row = [XLFormRowDescriptor formRowDescriptorWithTag:@"changePassword" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_change_password_", nil)];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
-        [row.cellConfig setObject:[UIImage imageNamed:@"settingsAccountNextcloud"] forKey:@"imageView.image"];
+        [row.cellConfig setObject:[UIImage imageNamed:@"settingsAccountModify"] forKey:@"imageView.image"];
         [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
         [row.cellConfig setObject:[UIColor blackColor] forKey:@"textLabel.textColor"];
-        row.action.formSelector = @selector(addAccount:);
+        row.action.formSelector = @selector(changePassword:);
+        if (listAccount.count == 0) row.disabled = @YES;
         [section addFormRow:row];
-    }
-    
-    // delete Account
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"delAccount" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_delete_account_", nil)];
-    if (listAccount.count > 0) [row.cellConfig setObject:[UIColor redColor] forKey:@"textLabel.textColor"];
-    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
-    [row.cellConfig setObject:[UIImage imageNamed:@"settingsAccountDelete"] forKey:@"imageView.image"];
-    [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
-    row.action.formSelector = @selector(answerDelAccount:);
-    if (listAccount.count == 0) row.disabled = @YES;
-    [section addFormRow:row];
+
+        // Brand
+        if ([NCBrandOptions sharedInstance].disable_multiaccount == NO) {
+    
+            // New Account nextcloud
+            row = [XLFormRowDescriptor formRowDescriptorWithTag:@"addAccount" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_add_account_", nil)];
+            [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+            [row.cellConfig setObject:[UIImage imageNamed:@"settingsAccountNextcloud"] forKey:@"imageView.image"];
+            [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
+            [row.cellConfig setObject:[UIColor blackColor] forKey:@"textLabel.textColor"];
+            row.action.formSelector = @selector(addAccount:);
+            [section addFormRow:row];
+        }
     
+        // delete Account
+        row = [XLFormRowDescriptor formRowDescriptorWithTag:@"delAccount" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_delete_account_", nil)];
+        if (listAccount.count > 0) [row.cellConfig setObject:[UIColor redColor] forKey:@"textLabel.textColor"];
+        [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+        [row.cellConfig setObject:[UIImage imageNamed:@"settingsAccountDelete"] forKey:@"imageView.image"];
+        [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
+        row.action.formSelector = @selector(answerDelAccount:);
+        if (listAccount.count == 0) row.disabled = @YES;
+        [section addFormRow:row];
+    }
     
     return [super initWithForm:form];
 }