diff --git a/lib/pki_base.cpp b/lib/pki_base.cpp index f48da5b0..f69898b3 100644 --- a/lib/pki_base.cpp +++ b/lib/pki_base.cpp @@ -415,13 +415,13 @@ QStringList pki_base::icsVEVENT(const a1time &expires, "BEGIN:VEVENT" << QString("DTSTAMP:%1").arg(a1time().toString("yyyyMMdd'T'HHmmss'Z'")) << QString("UID:EXP-%1@xca.ovh").arg(uniqueid) << - "STATUS:NEEDS-ACTION" << + "STATUS:CONFIRMED" << QString("DTSTART:%1").arg(expires.toString("yyyyMMdd")) << "DURATION:P1D" << QString("SUMMARY:%1").arg(icsValue(summary)) << QString("DESCRIPTION:%1").arg(desc) << "BEGIN:VALARM" << - "ACTION:EMAIL" << + "ACTION:DISPLAY" << QString("SUMMARY:%1").arg(icsValue(summary)) << QString("DESCRIPTION:%1").arg(desc) << QString("TRIGGER:-P%1").arg(alarm) << diff --git a/lib/pki_crl.cpp b/lib/pki_crl.cpp index 959791d2..ec7e3974 100644 --- a/lib/pki_crl.cpp +++ b/lib/pki_crl.cpp @@ -432,12 +432,22 @@ QVariant pki_crl::getIcon(const dbheader *hd) const QStringList pki_crl::icsVEVENT() const { + pki_x509 *ca = getIssuer(); + if (ca) { + return pki_base::icsVEVENT(getNextUpdate(), + tr("CRL Renewal of CA '%1' due").arg(ca->getIntName()), + tr("The latest CRL issued by the CA '%1' will expire on %2.\n" + "It is stored in the XCA database '%3'") + .arg(ca->getIntName()) + .arg(getNextUpdate().toPretty()) + .arg(currentDB) + ); + } return pki_base::icsVEVENT(getNextUpdate(), tr("Renew CRL: %1").arg(getIntName()), - tr("The XCA CRL '%1', issued by the CA '%2' on %3 will expire on %4.\n" + tr("The XCA CRL '%1', issued on %3 will expire on %4.\n" "It is stored in the XCA database '%5'") .arg(getIntName()) - .arg(getIssuerName()) .arg(getLastUpdate().toPretty()) .arg(getNextUpdate().toPretty()) .arg(currentDB) diff --git a/lib/pki_x509.cpp b/lib/pki_x509.cpp index ef2e4d10..f202529b 100644 --- a/lib/pki_x509.cpp +++ b/lib/pki_x509.cpp @@ -954,6 +954,8 @@ QStringList pki_x509::icsVEVENT() const QStringList pki_x509::icsVEVENT_ca() const { QStringList ics; + pki_crl *crl = NULL; + ics << icsVEVENT(); foreach(pki_base *p, childItems) { pki_x509 *pki = static_cast(p); @@ -961,14 +963,18 @@ QStringList pki_x509::icsVEVENT_ca() const ics << pki->icsVEVENT(); } - ics << pki_base::icsVEVENT(crlExpire, - tr("CRL Renewal of CA '%1' due").arg(getIntName()), - tr("The latest CRL issued by the CA '%1' will expire on %2.\n" - "It is stored in the XCA database '%3'") - .arg(getIntName()) - .arg(crlExpire.toPretty()) - .arg(currentDB) - ); + QList list = db_base::sqlSELECTpki( + "SELECT item FROM crls WHERE issuer = ?", + QList() << QVariant(sqlItemId)); + + /* Get latest CRL */ + foreach(pki_crl *pki, list) { + if (!crl || crl->getNextUpdate() < pki->getNextUpdate()) + crl = pki; + } + if (crl) + ics << crl->icsVEVENT(); + return ics; }