X-Git-Url: https://git.hcoop.net/hcoop/portal.git/blobdiff_plain/b6dd1aafb4c9cddf89b06c2eeac1b5277046ad9f..daaa0de7fc21561fd324cbc93fc99d69646b537f:/users.mlt diff --git a/users.mlt b/users.mlt index cd7582b..2135308 100644 --- a/users.mlt +++ b/users.mlt @@ -17,7 +17,7 @@ if $"cmd" = "Create" then "" => Balance.addBalance ($"name") | s => Web.stoi s); - val id = Init.addUser ($"name", $"rname", bal, ap); + val id = Init.addUser ($"name", $"rname", bal, ap, 1); Group.addToGroups (id, map Web.stoi (Web.getMultiParam "grp")); if $"amount" <> "" then @@ -27,12 +27,19 @@ if $"cmd" = "Create" then Money.applyCharges trn end; + App.add ap; + if $"subscribe" = "on" then if not (Pref.subscribe ("hcoop-announce", $"name" ^ Init.emailSuffix)) then %>

Error subscribing to hcoop-announce

<% end - end %> -

Member added

+ end; + + if $"nomail" = "" then + App.welcome ap + end + + %>

Member added

<% end end elseif $"mod" <> "" then @@ -70,13 +77,29 @@ elseif $"mod" <> "" then Init.deleteUser (Web.stoi ($"del2")) %>

<% #name user %> deleted!

-<% elseif $"cmd" = "grandfather" then +<% elseif $"retire" <> "" then + showNormal := false; + val user = Init.lookupUser (Web.stoi ($"retire")) %> +

Are you sure you want to retire member <% #name user %>?

+ ">Yes, retire <% #name user %>! + +<% elseif $"retire2" <> "" then + val usr = Web.stoi ($"retire2"); + val user = Init.lookupUser usr; + switch (Group.groupNameToId "paying", Group.groupNameToId "retired") of + (SOME paying, SOME retired) => + Group.removeFromGroup {usr = usr, grp = paying}; + Group.addToGroup {usr = usr, grp = retired} %> +

<% #name user %> retired!

<% + | _ => %>

Couldn't find "paying" or "retired" group by name!

<% + end + +elseif $"cmd" = "grandfather" then Init.grandfatherUsers() %>

Grandfathered

-<% end %> - -<% if showNormal then %> +<% elseif $"cmd" = "addform" then + showNormal := false %>

New member

@@ -101,6 +124,61 @@ elseif $"mod" <> "" then
+<% elseif $"cmd" = "unmigrated" then + showNormal := false; + ref negative = 0; + val users = Init.unmigratedUsers () %> + +

Unmigrated members (<% length users %>)

+ + +<% foreach user in users do %> + +<% val bal = Balance.lookupBalance (#bal user); +if Balance.isNegative bal then + negative := negative + 1 +end %> + +<% end %> +
<% Web.html (#name user) %><% #amount bal %> +<%if #name bal <> #name user then %> + <% Web.html (#name bal) %> +<% end %> +
+ +

<% negative %> have negative balances.

+ +<% elseif $"cmd" = "diff" then + showNormal := false; + + val against = (case $"against" of + "" => Init.usersInAfs () + | x => String.tokens Char.isSpace x); + + val diff = Init.usersDiff (Init.listUsernames (), against) %> + +

User diff

+ +

Only on the portal:

+ + +

Only in AFS:

+ + +<% end %> + +<% if showNormal then %> + +Add a user manually
+

Manage current members

@@ -110,11 +188,14 @@ elseif $"mod" <> "" then if #name bal <> #name user then %> <% Web.html (#name bal) %> <% end %> - + <% end %>
[Modify] [Delete]
[Modify] [Delete] + [Retire]

Grandfather old users to have applications
+Who hasn't migrated yet?
+How does the set of users in AFS compare with the set of active portal users?
<% end %>