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; } }