val socks = Sec.socketPerms uname;
val tpe = Sec.isTpe uname;
val cron = Sec.cronAllowed uname;
+val ftp = Sec.ftpAllowed uname;
ref showNormal = true;
end
%><h3><b>Request added</b></h3><%
+elseif $"cmd" = "ftp" then
+ showNormal := false;
+ val ftp = iff $"ftp" = "yes" then "enabled" else "disabled";
+ %>Are you sure you want to request that FTP permissions for <b><% Web.html uname %></b> be <b><% ftp %></b>?<br>
+ <a href="sec?cmd=ftp2&uname=<% Web.urlEncode uname %>&ftp=<% ftp %>&msg=<% Web.urlEncode ($"msg") %>">Yes, place the request!</a><%
+elseif $"cmd" = "ftp2" then
+ val ftp = iff $"ftp" = "enabled" then "enable" else "disable";
+ val id = Sec.Req.add (you, String.concat [uname, ": ", ftp, " FTP access"], $"msg");
+ if not (Sec.Req.notifyNew id) then
+ %><h3><b>Error sending e-mail notification</b></h3><%
+ end
+ %><h3><b>Request added</b></h3><%
+
elseif $"cmd" = "rule" then
showNormal := false;
val rule = $"rule";
</table>
</form>
+<h3><b>Request change to your FTP permissions</b></h3>
+
+<form action="sec" method="post">
+<input type="hidden" name="uname" value="<% uname %>">
+<input type="hidden" name="cmd" value="ftp">
+<table>
+<tr> <td align="right"><b>Allowed to use FTP?</b></td> <td><select name="ftp">
+ <option value="no"<% if not ftp then %> selected<% end %>>No</option>
+ <option value="yes"<% if ftp then %> selected<% end %>>Yes</option>
+</select></td> </tr>
+<tr> <td align="right" valign="top"><b>Reason:</b></td> <td><textarea name="msg" wrap="soft" rows="3" cols="80"></textarea></td> </tr>
+<tr> <td><input type="submit" value="Request"></td> </tr>
+</table>
+</form>
+
<% val rules = Sec.findFirewallRules uname;
switch rules of
_::_ => %>
val socketPerms : string -> socket_perms
val isTpe : string -> bool
val cronAllowed : string -> bool
+ val ftpAllowed : string -> bool
val findFirewallRules : string -> string list
end
before TextIO.closeIn inf
end
-fun cronAllowed uname =
+fun somethingAllowed fname uname =
let
- val inf = TextIO.openIn "/etc/cron.allow"
+ val inf = TextIO.openIn fname
val uname' = uname ^ "\n"
fun loop () =
before TextIO.closeIn inf
end
+val cronAllowed = somethingAllowed "/etc/cron.allow"
+val ftpAllowed = somethingAllowed "/etc/ftpusers"
+
end