|
|
@ -100,14 +100,18 @@ func KeysPost(ctx *context.Context) { |
|
|
|
loadKeysData(ctx) |
|
|
|
loadKeysData(ctx) |
|
|
|
ctx.Data["Err_Content"] = true |
|
|
|
ctx.Data["Err_Content"] = true |
|
|
|
ctx.Data["Err_Signature"] = true |
|
|
|
ctx.Data["Err_Signature"] = true |
|
|
|
ctx.Data["KeyID"] = err.(asymkey_model.ErrGPGInvalidTokenSignature).ID |
|
|
|
keyID := err.(asymkey_model.ErrGPGInvalidTokenSignature).ID |
|
|
|
|
|
|
|
ctx.Data["KeyID"] = keyID |
|
|
|
|
|
|
|
ctx.Data["PaddedKeyID"] = asymkey_model.PaddedKeyID(keyID) |
|
|
|
ctx.RenderWithErr(ctx.Tr("settings.gpg_invalid_token_signature"), tplSettingsKeys, &form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("settings.gpg_invalid_token_signature"), tplSettingsKeys, &form) |
|
|
|
case asymkey_model.IsErrGPGNoEmailFound(err): |
|
|
|
case asymkey_model.IsErrGPGNoEmailFound(err): |
|
|
|
loadKeysData(ctx) |
|
|
|
loadKeysData(ctx) |
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["Err_Content"] = true |
|
|
|
ctx.Data["Err_Content"] = true |
|
|
|
ctx.Data["Err_Signature"] = true |
|
|
|
ctx.Data["Err_Signature"] = true |
|
|
|
ctx.Data["KeyID"] = err.(asymkey_model.ErrGPGNoEmailFound).ID |
|
|
|
keyID := err.(asymkey_model.ErrGPGNoEmailFound).ID |
|
|
|
|
|
|
|
ctx.Data["KeyID"] = keyID |
|
|
|
|
|
|
|
ctx.Data["PaddedKeyID"] = asymkey_model.PaddedKeyID(keyID) |
|
|
|
ctx.RenderWithErr(ctx.Tr("settings.gpg_no_key_email_found"), tplSettingsKeys, &form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("settings.gpg_no_key_email_found"), tplSettingsKeys, &form) |
|
|
|
default: |
|
|
|
default: |
|
|
|
ctx.ServerError("AddPublicKey", err) |
|
|
|
ctx.ServerError("AddPublicKey", err) |
|
|
@ -139,7 +143,9 @@ func KeysPost(ctx *context.Context) { |
|
|
|
loadKeysData(ctx) |
|
|
|
loadKeysData(ctx) |
|
|
|
ctx.Data["VerifyingID"] = form.KeyID |
|
|
|
ctx.Data["VerifyingID"] = form.KeyID |
|
|
|
ctx.Data["Err_Signature"] = true |
|
|
|
ctx.Data["Err_Signature"] = true |
|
|
|
ctx.Data["KeyID"] = err.(asymkey_model.ErrGPGInvalidTokenSignature).ID |
|
|
|
keyID := err.(asymkey_model.ErrGPGInvalidTokenSignature).ID |
|
|
|
|
|
|
|
ctx.Data["KeyID"] = keyID |
|
|
|
|
|
|
|
ctx.Data["PaddedKeyID"] = asymkey_model.PaddedKeyID(keyID) |
|
|
|
ctx.RenderWithErr(ctx.Tr("settings.gpg_invalid_token_signature"), tplSettingsKeys, &form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("settings.gpg_invalid_token_signature"), tplSettingsKeys, &form) |
|
|
|
default: |
|
|
|
default: |
|
|
|
ctx.ServerError("VerifyGPG", err) |
|
|
|
ctx.ServerError("VerifyGPG", err) |
|
|
|