roundcubemail/plugins/enigma/lib/enigma_key.php
function find_subkey($email, $mode)
    {
        $now = time();

        foreach ($this->users as $user) {
            if (strcasecmp($user->email, $email) === 0 && $user->valid && !$user->revoked) {
                foreach ($this->subkeys as $subkey) {
                    if (!$subkey->revoked && (!$subkey->expires || $subkey->expires > $now)) {
                        if ($subkey->usage & $mode) {
                            return $subkey;
                        }
                    }
                }
            }
        }
    }
function find_subkey($email, $mode)
    {
        $now = time();

        foreach ($this->users as $user) {
            if (strcasecmp($user->email, $email) === 0 && $user->valid && !$user->revoked) {
                foreach ($this->subkeys as $subkey) {
                    if (!$subkey->revoked && (!$subkey->expires || $subkey->expires > $now)) {
                        if ($subkey->usage & $mode) {
                            return $subkey;
                        }
                    }
                }
            }
        }
    }
function find_subkey ( $ email , $ mode ) { $ now = time ( ) ; foreach ( $ this -> users as $ user ) { if ( strcasecmp ( $ user -> email , $ email ) === 0 && $ user -> valid && ! $ user -> revoked ) { foreach ( $ this -> subkeys as $ subkey ) { if ( ! $ subkey -> revoked && ( ! $ subkey -> expires || $ subkey -> expires > $ now ) ) { if ( $ subkey -> usage & $ mode ) { return $ subkey ; } } } } } }
Get key ID by user email
Get key ID by user email