|
@@ -565,6 +565,15 @@ angular.module('syncthing.core')
|
|
}).error($scope.emitHTTPError);
|
|
}).error($scope.emitHTTPError);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $scope.isAuthEnabled = function () {
|
|
|
|
+ // This function should match IsAuthEnabled() in guiconfiguration.go
|
|
|
|
+ var guiCfg = $scope.config && $scope.config.gui;
|
|
|
|
+ if (guiCfg) {
|
|
|
|
+ return guiCfg.authMode === 'ldap' || (guiCfg.user && guiCfg.password);
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ };
|
|
|
|
+
|
|
function refreshNoAuthWarning() {
|
|
function refreshNoAuthWarning() {
|
|
if (!$scope.system || !$scope.config || !$scope.config.gui) {
|
|
if (!$scope.system || !$scope.config || !$scope.config.gui) {
|
|
// We need all to be able to determine the state.
|
|
// We need all to be able to determine the state.
|
|
@@ -579,8 +588,7 @@ angular.module('syncthing.core')
|
|
$scope.openNoAuth = addr.substr(0, 4) !== "127."
|
|
$scope.openNoAuth = addr.substr(0, 4) !== "127."
|
|
&& addr.substr(0, 6) !== "[::1]:"
|
|
&& addr.substr(0, 6) !== "[::1]:"
|
|
&& addr.substr(0, 1) !== "/"
|
|
&& addr.substr(0, 1) !== "/"
|
|
- && (!guiCfg.user || !guiCfg.password)
|
|
|
|
- && guiCfg.authMode !== 'ldap'
|
|
|
|
|
|
+ && !$scope.isAuthEnabled()
|
|
&& !guiCfg.insecureAdminAccess;
|
|
&& !guiCfg.insecureAdminAccess;
|
|
|
|
|
|
if ((guiCfg.user && guiCfg.password) || guiCfg.authMode === 'ldap') {
|
|
if ((guiCfg.user && guiCfg.password) || guiCfg.authMode === 'ldap') {
|