Join script should rule out retired usernames
[bpt/portal.git] / ip.mlt
diff --git a/ip.mlt b/ip.mlt
index b34929f..c849e1f 100644 (file)
--- a/ip.mlt
+++ b/ip.mlt
@@ -14,7 +14,7 @@ if $"new" <> "" then
        <a href="ip?node=<% nodeNum %>&req=<% port %>&msg=<% Web.urlEncode msg %>">Yes, I want to request that.</a>
 
 <% elseif $"req" <> "" then
-       val id = Ip.add {usr = Init.getUserId(), node = nodeNum, data = $"req", msg = $"msg"};
+       val id = Ip.add {usr = Init.getUserId (), node = nodeNum, data = $"req", msg = $"msg"};
        if not (Ip.notifyNew id) then
                %><h3>Error sending e-mail notification</h3><%
        end
@@ -28,7 +28,7 @@ elseif $"cmd" = "open" then
 <br><hr><br>
 <table class="blanks">
 <tr> <td>By:</td> <td><a href="user?id=<% #usr req %>"><% name %></a></td> </tr>
-<tr> <td>Time:</td> <td><% #stamp req %></td> </tr>
+<tr> <td>Time:</td> <td><% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)</td> </tr>
 <tr> <td>Node:</td> <td><% Web.html (Init.nodeName (#node req)) %></td> </tr>
 <tr> <td>Port:</td> <td><% #data req %></td> </tr>
 <tr> <td>Reason:</td> <td><% Web.html (#msg req) %></td> </tr>
@@ -38,7 +38,22 @@ elseif $"cmd" = "open" then
        <br>
        <a href="ip?mod=<% #id req %>">[Modify]</a>
        <a href="ip?del=<% #id req %>">[Delete]</a><br>
-       To install, run: <i>tell adamc what text to put here</i>.
+       To install: <ol>
+          <li> Choose a new IP address <tt>69.90.123.<i>NNN</i></tt> from those available.</li>
+          <li> Add new entry to <tt>/etc/network/interfaces</tt> on mire, where <tt><i>N</i></tt> is some incremented number.
+<blockquote><pre>auto eth0:N
+iface eth0:N inet static
+        address 69.90.123.NNN
+        netmask 255.255.255.224
+        network 69.90.123.64
+</pre></blockquote></li>
+          <li> Edit <tt>/etc/apache2/ports.conf</tt> and add the following lines:
+<blockquote><pre>Listen 69.90.123.NNN:80
+Listen 69.90.123.NNN:443</pre></blockquote></li>
+           <li> Run <tt>ifup eth0:<i>N</i></tt>.
+          <li> Restart Apache with <tt>/etc/init.d/apache2 restart</tt>.</li>
+          <li> Run <tt>domtool-admin grant <i><% name %></i> ip 69.90.123.<i>NNN</i></tt>
+       </ol>
 <% end %>
 
 <%     end
@@ -50,7 +65,7 @@ elseif $"cmd" = "list" then
 <br><hr><br>
 <table class="blanks">
 <tr> <td>By:</td> <td><a href="user?id=<% #usr req %>"><% name %></a></td> </tr>
-<tr> <td>Time:</td> <td><% #stamp req %></td> </tr>
+<tr> <td>Time:</td> <td><% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)</td> </tr>
 <tr> <td>Node:</td> <td><% Web.html (Init.nodeName (#node req)) %></td> </tr>
 <tr> <td>Port:</td> <td><% #data req %></td> </tr>
 <tr> <td>Reason:</td> <td><% Web.html (#msg req) %></td> </tr>
@@ -75,7 +90,7 @@ elseif $"mod" <> "" then
 <input type="hidden" name="save" value="<% id %>">
 <table class="blanks">
 <tr> <td>Requestor:</td> <td><a href="user?id=<% #usr req %>"><% #name user %></a></td> </tr>
-<tr> <td>Time:</td> <td><% #stamp req %></td> </tr>
+<tr> <td>Time:</td> <td><% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)</td> </tr>
 <tr> <td>Node:</td> <td><select name="node">
 <% foreach node in Init.listNodes () do %>
        <option value="<% #id node %>"<% if #id node = #node req then %> selected<% end %>><% Web.html (#name node) %> (<% Web.html (#descr node) %>; Debian <% Web.html (#debian node) %>)</option>
@@ -100,10 +115,8 @@ elseif $"mod" <> "" then
        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
-                       %><h3>Error sending e-mail notification</h3><%
-               end
+       if not (Ip.notifyMod {old = oldStatus, new = newStatus, changer = Init.getUserName(), req = id}) then
+               %><h3>Error sending e-mail notification</h3><%
        end
        %><h3>Request modified</h3>
        Back to: <a href="ip?cmd=open">open requests</a>, <a href="ip?cmd=list">all requests</a>