From 70c1cdfd8f34472761fe5ec97f0713990c1b4f5b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 5 Sep 2018 21:23:41 +0300 Subject: Add multi-tenancy support --- mod/mod-repository-details.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mod/mod-repository-details.cxx') diff --git a/mod/mod-repository-details.cxx b/mod/mod-repository-details.cxx index 36d5508..6d3b8c1 100644 --- a/mod/mod-repository-details.cxx +++ b/mod/mod-repository-details.cxx @@ -82,7 +82,7 @@ handle (request& rq, response& rs) << CSS_LINKS (path ("repository-details.css"), root) << ~HEAD << BODY - << DIV_HEADER (root, options_->logo (), options_->menu ()) + << DIV_HEADER (options_->logo (), options_->menu (), root, tenant) << DIV(ID="content"); transaction t (package_db_->begin ()); @@ -91,13 +91,14 @@ handle (request& rq, response& rs) for (const auto& r: package_db_->query ( - query::internal + "ORDER BY" + query::priority)) + (query::internal && query::id.tenant == tenant) + + "ORDER BY" + query::priority)) { //@@ Feels like a lot of trouble (e.g., id_attribute()) for very // dubious value. A link to the package search page just for // this repository would probably be more useful. // - string id (html_id (r.name)); + string id (html_id (r.canonical_name)); s << H1(ID=id) << A(HREF="#" + web::mime_url_encode (id, false)) << r.display_name @@ -144,9 +145,9 @@ handle (request& rq, response& rs) // s << P << "REPOSITORY CERTIFICATE" << ~P << P - << "CN=" << cert.name.c_str () + np + 1 << *BR - << "O=" << cert.organization << *BR - << email (cert.email) + << "CN=" << cert.name.c_str () + np + 1 << *BR + << "O=" << cert.organization << *BR + << email (cert.email) << ~P << P(CLASS="certfp") << cert.fingerprint << ~P << PRE(CLASS="certpem") << cert.pem << ~PRE; -- cgit v1.1