summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-07-07 19:12:01 +0000
committerrandomdan <randomdan@localhost>2010-07-07 19:12:01 +0000
commite7fac952c8e467aaa90e8696077a00930d82c8c4 (patch)
tree4e8ab1c52df86efe9c063eafb2788b0cbdfaea72
parentGroup by sync times instead of guessing at days (diff)
downloadgentoobrowse-e7fac952c8e467aaa90e8696077a00930d82c8c4.tar.bz2
gentoobrowse-e7fac952c8e467aaa90e8696077a00930d82c8c4.tar.xz
gentoobrowse-e7fac952c8e467aaa90e8696077a00930d82c8c4.zip
Implement variables (prefixed strings to find values elsewhere)
-rw-r--r--gentoobrowse/request/dologin.xml18
-rw-r--r--gentoobrowse/views/category.xml2
-rw-r--r--gentoobrowse/views/package.xml14
-rw-r--r--gentoobrowse/views/search.xml4
4 files changed, 17 insertions, 21 deletions
diff --git a/gentoobrowse/request/dologin.xml b/gentoobrowse/request/dologin.xml
index 5b3999a..0eda6bc 100644
--- a/gentoobrowse/request/dologin.xml
+++ b/gentoobrowse/request/dologin.xml
@@ -2,11 +2,11 @@
<view name="dologin" present="accountHome" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:project2="http://project2.randomdan.homeip.net">
<xi:include href="../datasources/postgres.xml" />
- <project2:regexcheck apply-to="username" present="login" name="usernameEntered">
+ <project2:regexcheck apply-to="$username" present="login" name="usernameEntered">
<regex>.+</regex>
<message>User name required</message>
</project2:regexcheck>
- <project2:regexcheck apply-to="password" present="login" name="passwordLength">
+ <project2:regexcheck apply-to="$password" present="login" name="passwordLength">
<regex>.{6,}</regex>
<message>Password too short</message>
</project2:regexcheck>
@@ -19,25 +19,21 @@
AND userpassword = ?
</sql>
<parameters>
- <param bind="0" id="username" source="query" />
- <param bind="1" id="password" source="query" />
+ <param bind="0" value="$username" />
+ <param bind="1" value="$password" />
</parameters>
</project2:sqlcheck>
- <project2:sqliterate datasource="postgres">
+ <project2:sqliterate datasource="postgres" name="getUidFromDatabase">
<sql>
SELECT userid
FROM users
WHERE username = ?
</sql>
<parameters>
- <param bind="0" id="username" source="query" />
+ <param bind="0" value="$username" />
</parameters>
<tasks>
- <project2:sessionset key="loggedInUserID">
- <parameters>
- <param bind="0" id="userid" source="parent" />
- </parameters>
- </project2:sessionset>
+ <project2:sessionset key="loggedInUserID" value="^userid" name="setUidInSession" />
</tasks>
</project2:sqliterate>
</view>
diff --git a/gentoobrowse/views/category.xml b/gentoobrowse/views/category.xml
index 2e1adb9..1ba0fb5 100644
--- a/gentoobrowse/views/category.xml
+++ b/gentoobrowse/views/category.xml
@@ -11,7 +11,7 @@
ORDER BY p.name
</sql>
<parameters>
- <param bind="0" id="1" source="uri" />
+ <param bind="0" value="/1" />
</parameters>
</project2:sqlview>
</block>
diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml
index 3cc24a2..28aff03 100644
--- a/gentoobrowse/views/package.xml
+++ b/gentoobrowse/views/package.xml
@@ -11,8 +11,8 @@
AND p.categoryid = c.categoryid
</sql>
<parameters>
- <param bind="0" id="1" source="uri" />
- <param bind="1" id="2" source="uri" />
+ <param bind="0" value="/1" />
+ <param bind="1" value="/2" />
</parameters>
<project2:sqlview name="versions" recordname="version" datasource="postgres">
<sql>
@@ -22,7 +22,7 @@
ORDER BY versioninst desc
</sql>
<parameters>
- <param bind="0" id="packageid" source="parent" />
+ <param bind="0" value="^packageid" />
</parameters>
</project2:sqlview>
<project2:sqlview name="packageUrls" recordname="url" datasource="postgres">
@@ -33,7 +33,7 @@
ORDER BY pu.url
</sql>
<parameters>
- <param bind="0" id="packageid" source="parent" />
+ <param bind="0" value="^packageid" />
</parameters>
</project2:sqlview>
<project2:sqlview name="versionUses" recordname="use" datasource="postgres">
@@ -45,7 +45,7 @@
ORDER BY version
</sql>
<parameters>
- <param bind="0" id="packageid" source="parent" />
+ <param bind="0" value="^packageid" />
</parameters>
</project2:sqlview>
<project2:sqlview name="versionArchs" recordname="arch" datasource="postgres">
@@ -57,7 +57,7 @@
ORDER BY version
</sql>
<parameters>
- <param bind="0" id="packageid" source="parent" />
+ <param bind="0" value="^packageid" />
</parameters>
</project2:sqlview>
<project2:sqlview name="deps" recordname="package" datasource="postgres">
@@ -71,7 +71,7 @@
ORDER BY cd.name, pd.name
</sql>
<parameters>
- <param bind="0" id="packageid" source="parent" />
+ <param bind="0" value="^packageid" />
</parameters>
</project2:sqlview>
</project2:sqlview>
diff --git a/gentoobrowse/views/search.xml b/gentoobrowse/views/search.xml
index 06b90a6..65db6b8 100644
--- a/gentoobrowse/views/search.xml
+++ b/gentoobrowse/views/search.xml
@@ -13,8 +13,8 @@
order by rank desc, p.name
</sql>
<parameters>
- <param bind="0" id="criteria" source="query" />
- <param bind="1" id="criteria" source="query" />
+ <param bind="0" value="$criteria" />
+ <param bind="1" value="$criteria" />
</parameters>
</project2:sqlview>
</block>