This commit is contained in:
marinofaggiana 2019-09-17 20:30:34 +02:00
Родитель fa60926a37
Коммит a363aa558a
3 изменённых файлов: 56 добавлений и 8 удалений

Просмотреть файл

@ -0,0 +1,47 @@
<managedAppConfiguration>
<version>1.0.0</version>
<bundleId>it.twsweb.Nextcloud</bundleId>
<dict>
<string keyName="serverUrl">
<defaultValue>
<value>https:&#x2F;&#x2F;cloud.nextcloud.com</value>
</defaultValue>
</string>
<string keyName="username">
<defaultValue>
<value>marino.faggiana</value>
</defaultValue>
</string>
<string keyName="password">
<defaultValue>
<value>password</value>
</defaultValue>
</string>
</dict>
<presentation defaultLocale="en-US">
<field keyName="serverUrl" type="input">
<label>
<language value="en-US">serverUrl</language>
</label>
<description>
<language value="en-US">Nextcloud server url</language>
</description>
</field>
<field keyName="username" type="input">
<label>
<language value="en-US">username</language>
</label>
<description>
<language value="en-US">User Name</language>
</description>
</field>
<field keyName="password" type="input">
<label>
<language value="en-US">password</language>
</label>
<description>
<language value="en-US">Password</language>
</description>
</field>
</presentation>
</managedAppConfiguration>

Просмотреть файл

@ -287,10 +287,11 @@ PKPushRegistry *pushRegistry;
// use appConfig [MDM]
if ([NCBrandOptions sharedInstance].use_configuration) {
NSDictionary *serverConfig = [[NSUserDefaults standardUserDefaults] dictionaryForKey:NCBrandConfiguration.sharedInstance.key];
NSString *serverUrl = serverConfig[NCBrandConfiguration.sharedInstance.serverUrl];
NSString *username = serverConfig[NCBrandConfiguration.sharedInstance.username];
NSString *password = serverConfig[NCBrandConfiguration.sharedInstance.password];
NSDictionary *serverConfig = [[NSUserDefaults standardUserDefaults] dictionaryForKey:NCBrandConfiguration.sharedInstance.configuration_key];
NSString *serverUrl = serverConfig[NCBrandConfiguration.sharedInstance.configuration_serverUrl];
NSString *username = serverConfig[NCBrandConfiguration.sharedInstance.configuration_username];
NSString *password = serverConfig[NCBrandConfiguration.sharedInstance.configuration_password];
if (serverUrl && [serverUrl isKindOfClass:[NSString class]] && username && [username isKindOfClass:[NSString class]] && password && [password isKindOfClass:[NSString class]]) {

Просмотреть файл

@ -144,9 +144,9 @@ class NCBrandColor: NSObject {
return instance
}()
@objc public let key: String = "com.apple.configuration.managed"
@objc public let serverUrl: String = "serverUrl"
@objc public let username: String = "username"
@objc public let password: String = "password"
@objc public let configuration_key: String = "it.twsweb.Nextcloud"
@objc public let configuration_serverUrl: String = "serverUrl"
@objc public let configuration_username: String = "username"
@objc public let configuration_password: String = "password"
}