<% @header [("title", ["Disk quota change requests"])]; val admin = Group.inGroupName "server"; if $"new" <> "" then ref url = "?cmd=request&msg=" ^ Web.urlEncode ($"msg"); ref changed = false; val uname = Init.getUserName (); %>Are you sure you want to request these quota changes? <% if changed then %> Yes, I'm sure! <% else %> Hm, no changes! <% end elseif $"cmd" = "request" then ref cmds = ""; val uname = Init.getUserName (); foreach vol in Quotas.getQuotas uname do val requested = Web.stoi ($(#vol vol)); if requested <> #quota vol then cmds := cmds ^ "fs sq " ^ Quotas.path (#vol vol) ^ " " ^ Int.toString requested ^ "\n# Current quota: " ^ Int.toString (#quota vol) ^ "\n" end end; val id = Quota.add (Init.getUserId (), cmds, $"msg"); if not (Quota.notifyNew id) then %>

Error sending e-mail notification

<% end %>

Request added

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

Open requests

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


By: <% name %>
Time: <% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)
Request: <% Web.htmlNl (#data req) %>
Reason: <% Web.html (#msg req) %>
<% if admin then %>
[Modify] [Delete]
<% end %> <% end elseif $"cmd" = "list" then %>

All requests

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


By: <% name %>
Time: <% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)
Request: <% Web.htmlNl (#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 = Quota.lookup id; val user = Init.lookupUser (#usr req) %>

Handle request

Requestor: <% #name user %>
Time: <% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)
Status:
Request:
Message:
<% elseif $"save" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"save"); val req = Quota.lookup id; val oldStatus = #status req; val newStatus = Quota.statusFromInt (Web.stoi ($"status")); Quota.modify {req with data = $"req", msg = $"msg", status = newStatus}; if not (Quota.notifyMod (oldStatus, newStatus, Init.getUserName(), id)) then %>

Error sending e-mail notification

<% end %>

Request modified

Back to: open requests, all requests <% elseif $"del" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"del"); val req = Quota.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"); Quota.delete id %>

Request deleted

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

Request a disk quota change

Remember that a high quota does not by itself use up any resources. Quotas are solely a check on unintentional overusage. We don't yet have any concrete policies to charge members based on disk usage, and, if we do implement such policies, you'll be charged only on actual disk usage, not quota.

<% foreach vol in Quotas.getQuotas (Init.getUserName ()) do %> <% end %>
Volume Used Current Quota Requested Quota (kB)
<% #vol vol %> <% #used vol %> kB (<% (#used vol) / 1024 %> MiB) <% #quota vol %> kB (<% (# quota vol) / 1024 %> MiB)
Additional comments:
<% end %> <% @footer[] %>