Roxen.git / server / etc / modules / CertDB.pmod

version» Context lines:

Roxen.git/server/etc/modules/CertDB.pmod:643:    " WHERE id = %d",    tmp[0]->pem_id);    if (sizeof(tmp)) {    res->certs[-1]->pem_path = tmp[0]->path;    }    }    }       return res;   } +  + array(int) get_keypairs_by_name(string name) + { +  Sql.Sql db = DBManager.cached_get("roxen"); +  +  array(int) res = +  db->typed_query("SELECT cert_keypairs.id AS id " +  " FROM cert_keypairs, certs " +  " WHERE name = %s " +  " AND cert_id = certs.id " +  " AND pem_id IS NOT NULL " +  " ORDER BY expires ASC", name)->id; +  if (!sizeof(res)) { +  res = +  db->typed_query("SELECT cert_keypairs.id AS id " +  " FROM cert_keypairs, certs " +  " WHERE name = %s " +  " AND cert_id = certs.id " +  " ORDER BY expires DESC " +  " LIMIT 1", name)->id; +  } +  return res; + }