From 13eb9bdc245273918bc2b96b475d7d74f01aae2b Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 03 Oct 2015 12:56:33 -0400
Subject: [PATCH] Enigma: Display complete key information (subkeys, user IDs)

---
 plugins/enigma/lib/enigma_key.php |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/enigma/lib/enigma_key.php b/plugins/enigma/lib/enigma_key.php
index 734cbb8..b687e62 100644
--- a/plugins/enigma/lib/enigma_key.php
+++ b/plugins/enigma/lib/enigma_key.php
@@ -28,6 +28,9 @@
 
     const CAN_SIGN    = 1;
     const CAN_ENCRYPT = 2;
+    const CAN_CERTIFY = 4;
+    const CAN_AUTH    = 8;
+
 
     /**
      * Keys list sorting callback for usort()
@@ -99,9 +102,7 @@
             if ($user->email === $email && $user->valid && !$user->revoked) {
                 foreach ($this->subkeys as $subkey) {
                     if (!$subkey->revoked && (!$subkey->expires || $subkey->expires > $now)) {
-                        if (($mode == self::CAN_ENCRYPT && $subkey->can_encrypt)
-                            || ($mode == self::CAN_SIGN && $subkey->has_private)
-                        ) {
+                        if ($subkey->usage & $mode) {
                             return $subkey;
                         }
                     }
@@ -147,5 +148,4 @@
 
         return $result;
     }
-
 }

--
Gitblit v1.9.1