mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-14 21:04:53 +00:00
fix(mail(js)): hide sign and encrypt options if not usable
When composing a message, don't offer to sign nor encrypt the message if user has not uploaded a certificate or if S/MIME is disabled.
This commit is contained in:
@@ -392,6 +392,16 @@
|
||||
return identity.textSignature;
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $hasCertificate
|
||||
* @memberof Account.prototype
|
||||
* @desc Return true if the user has a S/MIME certificate for this account
|
||||
* @returns a boolean value
|
||||
*/
|
||||
Account.prototype.$hasCertificate = function() {
|
||||
return this.security && this.security.hasCertificate;
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $certificate
|
||||
* @memberof Account.prototype
|
||||
@@ -401,7 +411,7 @@
|
||||
Account.prototype.$certificate = function() {
|
||||
var _this = this;
|
||||
|
||||
if (this.security && this.security.hasCertificate) {
|
||||
if (this.$hasCertificate()) {
|
||||
if (this.$$certificate)
|
||||
return Account.$q.when(this.$$certificate);
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user