<% @header [("title", ["IP address requests"])]; val admin = Group.inGroupName "server"; val nodeNum = case $"node" of "" => 2 | node => Web.stoi node; if $"new" <> "" then val port = Web.stoi ($"port"); val msg = $"msg"; %>Are you sure you want to ask for an IP address with port <% port %> free on machine <% Init.nodeName nodeNum %>?

Yes, I want to request that. <% elseif $"req" <> "" then val id = Ip.add {usr = Init.getUserId (), node = nodeNum, data = $"req", msg = $"msg"}; if not (Ip.notifyNew id) then %>

Error sending e-mail notification

<% end %>

Request added

<% elseif $"cmd" = "open" then %>

Open requests

List all requests<% foreach (name, req) in Ip.listOpen () do %>


By: <% name %>
Time: <% #stamp req %>
Node: <% Web.html (Init.nodeName (#node req)) %>
Port: <% #data req %>
Reason: <% Web.html (#msg req) %>
<% if admin then %>
[Modify] [Delete]
To install, run: tell adamc what text to put here. <% end %> <% end elseif $"cmd" = "list" then %>

All requests

<% foreach (name, req) in Ip.list () do %>


By: <% name %>
Time: <% #stamp req %>
Node: <% Web.html (Init.nodeName (#node req)) %>
Port: <% #data req %>
Reason: <% Web.html (#msg req) %>
<% if admin then %>
[Modify] [Delete] <% end %> <% end elseif $"mod" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"mod"); val req = Ip.lookup id; val user = Init.lookupUser (#usr req) %>

Handle request

Requestor: <% #name user %>
Time: <% #stamp req %>
Node:
Status:
Port:
Message:
<% elseif $"save" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"save"); val node = Web.stoi ($"node"); val req = Ip.lookup id; val oldStatus = #status req; val newStatus = Ip.statusFromInt (Web.stoi ($"status")); Ip.modify {req with node = node, data = $"port", msg = $"msg", status = newStatus}; if oldStatus <> newStatus then if not (Ip.notifyMod {old = oldStatus, new = newStatus, changer = Init.getUserName(), req = id}) then %>

Error sending e-mail notification

<% end end %>

Request modified

Back to: open requests, all requests <% elseif $"del" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"del"); val req = Ip.lookup id; val user = Init.lookupUser (#usr req) %>

Are you sure you want to delete request by <% #name user %> for <% #data req %>?

Yes, I'm sure! <% elseif $"del2" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"del2"); Ip.delete id %>

Request deleted

Back to: open requests, all requests <% else %>

Request an IP address

Use this form to request use of a particular port. If your request is granted, you will be assigned rights to your port on a particular IP address. The most common use of this form is to ask for an IP address to use with an SSL virtual web host. We will grant requests in very few other cases. Try to use free ports on the base IP address of one of the machines on which we grant member log-in.

Machine:
Port#:
Reason:
<% end %> <% @footer[] %>