浏览代码

add Brand option

Marino Faggiana 7 年之前
父节点
当前提交
ac98844331
共有 3 个文件被更改,包括 13 次插入7 次删除
  1. 3 1
      iOSClient/Brand/NCBrand.swift
  2. 7 6
      iOSClient/Login/CCLogin.m
  3. 3 0
      iOSClient/Main/CCMain.m

+ 3 - 1
iOSClient/Brand/NCBrand.swift

@@ -70,7 +70,8 @@ class NCBrandOptions: NSObject {
     public let loginBaseUrl:                    String = "https://cloud.twsweb.it"
     public let loginBaseUrlMultiDomains:        [String] = ["domain.com", "domain.it"]
     public let pushNotificationServer:          String = "https://push-notifications.nextcloud.com"
-    public let loginButtonLabelLink:            String = "https://nextcloud.com/providers"
+    public let linkLoginProvider:               String = "https://nextcloud.com/providers"
+    public let textLoginProvider:               String = "_login_bottom_label_"
     public let middlewarePingUrl:               String = ""
     public let webLoginAutenticationProtocol:   String = ""
     public let webCloseViewProtocol:            String = ""
@@ -93,6 +94,7 @@ class NCBrandOptions: NSObject {
     public let use_storeLocalAutoUploadAll:     Bool = false
     
     public let disable_intro:                   Bool = false
+    public let disable_linkLoginProvider:       Bool = false
     public let disable_request_login_url:       Bool = false
     public let disable_multiaccount:            Bool = false
     public let disable_cryptocloudsystem:       Bool = false

+ 7 - 6
iOSClient/Login/CCLogin.m

@@ -43,8 +43,13 @@
     self.login.backgroundColor = [NCBrandColor sharedInstance].customer;
     
     // Bottom label
-    self.bottomLabel.text = NSLocalizedString(@"_login_bottom_label_", nil);
+    self.bottomLabel.text = NSLocalizedString([NCBrandOptions sharedInstance].textLoginProvider, nil);
     self.bottomLabel.userInteractionEnabled = YES;
+    
+    if ([NCBrandOptions sharedInstance].disable_linkLoginProvider) {
+        self.bottomLabel.hidden = YES;
+    }
+
     UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tabBottomLabel)];
     [self.bottomLabel addGestureRecognizer:tapGesture];
     
@@ -59,10 +64,6 @@
         self.bottomLabel.hidden = YES;
     }
     
-#ifdef CUSTOM_BUILD
-    self.bottomLabel.hidden = YES;
-#endif
-    
     self.annulla.tintColor = [NCBrandColor sharedInstance].customer;
     
     [self.baseUrl setDelegate:self];
@@ -354,7 +355,7 @@
 
 - (void)tabBottomLabel
 {
-    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NCBrandOptions sharedInstance].loginButtonLabelLink]];
+    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NCBrandOptions sharedInstance].linkLoginProvider]];
 }
 
 - (IBAction)handlebaseUrlchange:(id)sender

+ 3 - 0
iOSClient/Main/CCMain.m

@@ -1879,6 +1879,9 @@
 
 - (void)readFileReloadFolder
 {
+    if (!_serverUrl || !app.activeAccount || app.maintenanceMode)
+        return;
+    
     CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
 
     metadataNet.action = actionReadFile;