X-Git-Url: https://git.hcoop.net/hcoop/portal.git/blobdiff_plain/5da9f4a91ea8e648812be0ca1afaeace2ba0423c..b6392a52a07ca163e5a1ee1b46d62a48ef395829:/apt.mlt
diff --git a/apt.mlt b/apt.mlt
index 519040b..ab3e2e4 100644
--- a/apt.mlt
+++ b/apt.mlt
@@ -2,6 +2,10 @@
val admin = Group.inGroupName "server";
+val nodeNum = case $"node" of
+ "" => 4
+ | node => Web.stoi node;
+
if $"new" <> "" then
val pkgs = String.tokens Char.isSpace ($"new");
@@ -9,7 +13,7 @@ if $"new" <> "" then
ref infos = [];
foreach pkg in pkgs do
- switch AptQuery.query pkg of
+ switch AptQuery.query {node = nodeNum, pkg = pkg} of
NONE =>
ok := false;
%>Error: Unknown package "<% Web.html pkg %>." <%
@@ -23,17 +27,18 @@ if $"new" <> "" then
end
end;
- if ok then %>
+ if ok then
+ val debian = Init.nodeDebian nodeNum %>
Are you sure these are the packages you wanted?
- ">Yes, I want to request these packages.
+ ">Yes, I want to request these packages.
<% end
@@ -43,7 +48,7 @@ elseif $"req" <> "" then
ref ok = true;
foreach pkg in pkgs do
- switch AptQuery.query pkg of
+ switch AptQuery.query {node = nodeNum, pkg = pkg} of
NONE =>
ok := false;
%>Error: Unknown package "<% Web.html pkg %>." <%
@@ -56,26 +61,28 @@ elseif $"req" <> "" then
end;
if ok then
- val id = Apt.add (Init.getUserId(), $"req", $"msg");
+ val id = Apt.add {usr = Init.getUserId(), node = nodeNum, data = $"req", msg = $"msg"};
if not (Apt.notifyNew id) then
- %>
<%
ref first = true;
val pkgs = String.tokens Char.isSpace (#data req);
+ val debian = Init.nodeDebian (#node req);
foreach pkg in pkgs do
if first then
@@ -83,16 +90,16 @@ elseif $"cmd" = "open" then
else
%>
<%
ref first = true;
val pkgs = String.tokens Char.isSpace (#data req);
+ val debian = Init.nodeDebian (#node req);
foreach pkg in pkgs do
if first then
@@ -123,16 +132,16 @@ elseif $"cmd" = "list" then
else
%>
<% if admin then %>
@@ -148,20 +157,25 @@ elseif $"mod" <> "" then
val id = Web.stoi ($"mod");
val req = Apt.lookup id;
val user = Init.lookupUser (#usr req) %>
-