else
raise Access ("You aren't a member of group \"" ^ grp ^ "\"")
+fun requireAnyGroupName groups =
+ if List.exists (fn grp => inGroupName grp) groups then
+ ()
+ else
+ raise Access ("You aren't a member of any groups \"" ^ String.concatWith ", " groups ^ "\"")
+
fun validGroupName name =
size name <= 10
andalso CharVector.all Char.isAlphaNum name
%><h3>Incorrect code!</h3><%
end
elseif $"cmd" = "add" then
- Group.requireGroupNum 0;
+ Group.requireAnyGroupName ["root", "board"];
val title = $"title";
val msg = $"msg";
if title = "" then
end
elseif $"mod" <> "" then
- Group.requireGroupNum 0;
+ Group.requireAnyGroupName ["root", "board"];
showNormal := false;
val rc = Roll.lookupRollCall (Web.stoi ($"mod")) %>
<h3>Modify roll call</h3>
</form>
<% elseif $"cmd" = "Save" then
- Group.requireGroupNum 0;
+ Group.requireAnyGroupName ["root", "board"];
val rc = Roll.lookupRollCall (Web.stoi ($"id"));
val title = $"title";
end
elseif $"del" <> "" then
- Group.requireGroupNum 0;
+ Group.requireAnyGroupName ["root", "board"];
showNormal := false;
val rc = Roll.lookupRollCall (Web.stoi ($"del")) %>
<h3>Are you sure you want to delete roll call "<a href="roll?view=<% #id rc %>"><% Web.html (#title rc) %></a>"?</h3>
<a href="roll?del2=<% $"del" %>">Yes, delete <% Web.html (#title rc) %>!</a>
<% elseif $"del2" <> "" then
- Group.requireGroupNum 0;
+ Group.requireAnyGroupName ["root", "board"];
val rc = Roll.lookupRollCall (Web.stoi ($"del2"));
Roll.deleteRollCall (Web.stoi ($"del2")) %>
<h3><% Web.html (#title rc) %> deleted!</h3>
<% elseif $"cmd" = "mailall" then
- Group.requireGroupNum 0;
+ Group.requireAnyGroupName ["root", "board"];
showNormal := false;
ref first = true %>
end %>">Mail everyone!</a>
<% elseif $"view" <> "" then
- Group.requireGroupNum 0;
+ Group.requireAnyGroupName ["root", "board"];
val id = Web.stoi ($"view");
viewingCall := SOME id
end;
if showNormal then
- Group.requireGroupNum 0;
+ Group.requireAnyGroupName ["root", "board"];
switch viewingCall of
NONE => %>