From eba4ba19183d420426538c400f1c4c85cf0cdb9a Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 18 Jun 2010 23:41:55 +0000 Subject: Use cgicc, add checks, tasks, dynamic loader, atom feed, login page --- gentoobrowse/atomebuilds.xslt | 31 ++++++++++++++++++++++++++++ gentoobrowse/datasources/postgres.xml | 4 ++-- gentoobrowse/login.xslt | 19 +++++++++++++++++- gentoobrowse/present/accountHome.xml | 4 ++++ gentoobrowse/present/atom.xml | 4 ++++ gentoobrowse/present/login.xml | 4 ++++ gentoobrowse/request/dologin.xml | 38 +++++++++++++++++++++++++++++++++++ gentoobrowse/views/categories.xml | 7 ++++--- gentoobrowse/views/category.xml | 7 ++++--- gentoobrowse/views/newebuilds.xml | 6 +++--- gentoobrowse/views/package.xml | 27 +++++++++++++------------ gentoobrowse/views/search.xml | 7 ++++--- 12 files changed, 130 insertions(+), 28 deletions(-) create mode 100644 gentoobrowse/atomebuilds.xslt create mode 100644 gentoobrowse/present/accountHome.xml create mode 100644 gentoobrowse/present/atom.xml create mode 100644 gentoobrowse/present/login.xml create mode 100644 gentoobrowse/request/dologin.xml diff --git a/gentoobrowse/atomebuilds.xslt b/gentoobrowse/atomebuilds.xslt new file mode 100644 index 0000000..67a9fae --- /dev/null +++ b/gentoobrowse/atomebuilds.xslt @@ -0,0 +1,31 @@ + + + + + + + + + + + Gentoo Browse | New ebuilds + http://gentoobrowse.randomdan.homeip.net/ + Unofficial Gentoo package browser + en-gb + Wed, 16 Jun 2010 14:52:43 GMT + Copyright: (C) Gentoo Foundation, Inc. + 15 + + + + + + <xsl:value-of select="filename" /> + + http://gentoobrowse.randomdan.homeip.net/package// + http://gentoobrowse.randomdan.homeip.net/package/ + + ebuild + + + diff --git a/gentoobrowse/datasources/postgres.xml b/gentoobrowse/datasources/postgres.xml index 0bb95f2..4e739f2 100644 --- a/gentoobrowse/datasources/postgres.xml +++ b/gentoobrowse/datasources/postgres.xml @@ -1,8 +1,8 @@ - + Driver=postgresql;Readonly=yes;ServerName=firebrand.random.lan;Username=gentoo;Database=gentoo;Password=gentoo; Driver=postgresql;Readonly=yes;ServerName=defiant.random.lan;Username=gentoo;Database=gentoo;Password=gentoo; Driver=postgresql;Readonly=no;ServerName=postgresql.random.lan;Username=gentoo;Database=gentoo;Password=gentoo;CPTimeOut=60 - + diff --git a/gentoobrowse/login.xslt b/gentoobrowse/login.xslt index 4ea8536..ac1b651 100644 --- a/gentoobrowse/login.xslt +++ b/gentoobrowse/login.xslt @@ -1,7 +1,24 @@ - + + +

Login

+
+ + + + + + + + + + + +
+
diff --git a/gentoobrowse/present/accountHome.xml b/gentoobrowse/present/accountHome.xml new file mode 100644 index 0000000..00c239f --- /dev/null +++ b/gentoobrowse/present/accountHome.xml @@ -0,0 +1,4 @@ + + + + diff --git a/gentoobrowse/present/atom.xml b/gentoobrowse/present/atom.xml new file mode 100644 index 0000000..1bd5d24 --- /dev/null +++ b/gentoobrowse/present/atom.xml @@ -0,0 +1,4 @@ + + + + diff --git a/gentoobrowse/present/login.xml b/gentoobrowse/present/login.xml new file mode 100644 index 0000000..88da572 --- /dev/null +++ b/gentoobrowse/present/login.xml @@ -0,0 +1,4 @@ + + + + diff --git a/gentoobrowse/request/dologin.xml b/gentoobrowse/request/dologin.xml new file mode 100644 index 0000000..315e65d --- /dev/null +++ b/gentoobrowse/request/dologin.xml @@ -0,0 +1,38 @@ + + + + + .+ + User name required + + + .{6,} + Password too short + + + Invalid username or password + + SELECT COUNT(*) + FROM users + WHERE username = ? + AND userpassword = ? + + + + + + + + + INSERT INTO user_logins(userid, logintime) + SELECT userid, NOW() + FROM users + WHERE username = ? + + + + + + + diff --git a/gentoobrowse/views/categories.xml b/gentoobrowse/views/categories.xml index ed53caa..aeceb43 100644 --- a/gentoobrowse/views/categories.xml +++ b/gentoobrowse/views/categories.xml @@ -1,7 +1,8 @@ - + - + SELECT c.categoryid, MIN(c.name) AS catname, COUNT(*) AS packages FROM categories c, packages p @@ -9,5 +10,5 @@ GROUP BY c.categoryid ORDER BY MIN(c.name) - + diff --git a/gentoobrowse/views/category.xml b/gentoobrowse/views/category.xml index 5e4644e..2e1adb9 100644 --- a/gentoobrowse/views/category.xml +++ b/gentoobrowse/views/category.xml @@ -1,7 +1,8 @@ - + - + SELECT c.name AS catname, p.name AS pkgname, p.description FROM categories c, packages p @@ -12,5 +13,5 @@ - + diff --git a/gentoobrowse/views/newebuilds.xml b/gentoobrowse/views/newebuilds.xml index 46a64f9..1f0c5f4 100644 --- a/gentoobrowse/views/newebuilds.xml +++ b/gentoobrowse/views/newebuilds.xml @@ -1,7 +1,7 @@ - + - + SELECT filename, description, moddate, p.name AS pkgname, c.name AS catname, EXTRACT('day' FROM (SELECT MAX(fm.firstseen) FROM files fm)) - EXTRACT('day' FROM f.firstseen) AS age @@ -12,5 +12,5 @@ AND f.firstseen > (SELECT MAX(fm.firstseen) - INTERVAL '2.1 days' FROM files fm) ORDER BY c.name, p.name, e.versioninst - + diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml index 8544123..3cc24a2 100644 --- a/gentoobrowse/views/package.xml +++ b/gentoobrowse/views/package.xml @@ -1,7 +1,8 @@ - + - + SELECT p.packageid, p.name AS pkgname, p.description, p.firstseen, c.name AS catname FROM packages p, categories c @@ -13,7 +14,7 @@ - + SELECT e.ebuildid, e.version FROM ebuilds e @@ -23,8 +24,8 @@ - - + + SELECT pu.url FROM package_urls pu @@ -34,8 +35,8 @@ - - + + SELECT u.* FROM ebuilds e, ebuild_uses u @@ -46,8 +47,8 @@ - - + + SELECT a.* FROM ebuilds e, ebuild_archs a @@ -58,8 +59,8 @@ - - + + SELECT distinct cd.name AS catname, pd.name AS pkgname, pd.description FROM ebuilds e, ebuild_deps d, packages pd, categories cd @@ -72,6 +73,6 @@ - - + + diff --git a/gentoobrowse/views/search.xml b/gentoobrowse/views/search.xml index 538e852..06b90a6 100644 --- a/gentoobrowse/views/search.xml +++ b/gentoobrowse/views/search.xml @@ -1,7 +1,8 @@ - + - + select c.name as catname, p.name as pkgname, description, ts_rank((setweight(to_tsvector('english', p.name), 'A') || setweight(to_tsvector('english', p.description), 'B')), @@ -15,5 +16,5 @@ - + -- cgit v1.2.3