ftp apps can be set a per-app password
this is useful for use in ftp clients
This commit is contained in:
+11
-12
@@ -399,15 +399,16 @@ angular.module('Application').controller('ProfileController', ['$scope', '$locat
|
||||
$scope.appPassword.identifiers = [];
|
||||
var appsById = {};
|
||||
$scope.apps.forEach(function (app) {
|
||||
// ignore apps without ldap or with email
|
||||
if (!app.manifest.addons || !app.manifest.addons.ldap || app.manifest.addons.email || !app.sso) return;
|
||||
if (!app.manifest.addons) return;
|
||||
var ftp = app.manifest.addons.localstorage && app.manifest.addons.localstorage.ftp;
|
||||
|
||||
// ignore apps without ftp and ldap or email
|
||||
if (!ftp && (!app.manifest.addons.ldap || app.manifest.addons.email || !app.sso)) return;
|
||||
|
||||
appsById[app.id] = app;
|
||||
if (app.label) {
|
||||
$scope.appPassword.identifiers.push({ id: app.id, label: app.label + ' (' + app.fqdn + ')' });
|
||||
} else {
|
||||
$scope.appPassword.identifiers.push({ id: app.id, label: app.fqdn });
|
||||
}
|
||||
var labelSuffix = ftp ? ' - SFTP' : '';
|
||||
var label = app.label ? app.label + ' (' + app.fqdn + ')' + labelSuffix : app.fqdn + labelSuffix;
|
||||
$scope.appPassword.identifiers.push({ id: app.id, label: label });
|
||||
});
|
||||
$scope.appPassword.identifiers.push({ id: 'mail', label: 'Mail client' });
|
||||
|
||||
@@ -417,11 +418,9 @@ angular.module('Application').controller('ProfileController', ['$scope', '$locat
|
||||
var app = appsById[password.identifier];
|
||||
if (!app) return password.label = password.identifier + ' (App not found)';
|
||||
|
||||
if (app.label) {
|
||||
password.label = app.label + ' (' + app.fqdn + ')';
|
||||
} else {
|
||||
password.label = app.fqdn;
|
||||
}
|
||||
var ftp = app.manifest.addons && app.manifest.addons.localstorage && app.manifest.addons.localstorage.ftp;
|
||||
var labelSuffix = ftp ? ' - SFTP' : '';
|
||||
password.label = app.label ? app.label + ' (' + app.fqdn + ')' + labelSuffix : app.fqdn + labelSuffix;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user