X-Git-Url: https://git.hcoop.net/hcoop/portal.git/blobdiff_plain/9bda1e7f56f54ad5f5fa2782a8b746c4b77ae70b..811dc1e5e566b76e8448fd1dcf156c8f2d56427a:/users.mlt diff --git a/users.mlt b/users.mlt index c55ffcc..2135308 100644 --- a/users.mlt +++ b/users.mlt @@ -6,17 +6,18 @@ ref showNormal = true; if $"cmd" = "Create" then if not (Init.validUsername ($"name")) then %> -

Invalid username

+

Invalid username

<% else switch Init.userNameToId ($"name") of SOME _ => %> -

Username already in use

+

Username already in use

<% | NONE => + val ap = Web.stoi ($"app"); val bal = (case $"bal" of "" => Balance.addBalance ($"name") | s => Web.stoi s); - val id = Init.addUser ($"name", $"rname", bal); + val id = Init.addUser ($"name", $"rname", bal, ap, 1); Group.addToGroups (id, map Web.stoi (Web.getMultiParam "grp")); if $"amount" <> "" then @@ -26,25 +27,32 @@ if $"cmd" = "Create" then Money.applyCharges trn end; + App.add ap; + if $"subscribe" = "on" then - if not (Pref.subscribe ("hcoop-announce", $"name" ^ "@hcoop.net")) then - %>

Error subscribing to hcoop-announce

<% + 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 showNormal := false; val user = Init.lookupUser (Web.stoi ($"mod")) %> -

Modify member record

+

Modify member record

-
+ "> - - - -
Name:
Real name:
Funded by: + + +
Name:
Real name:
Funded by: - - -
Name:
Real name:
Funded by: + + + - - - - + + +
Name:
Real name:
Funded by:
Initial transaction amount:
Initial transaction description:
Subscribe to hcoop-announce
Groups:
Initial transaction amount:
Initial transaction description:
Subscribe to hcoop-announce
Groups:
-

Manage current members

+<% 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:

+
    +<% foreach user in #onlyInSecond diff do %> +
  • <% Web.html user %>
  • +<% end %> +
+ +<% end %> + +<% if showNormal then %> + +Add a user manually
+ +

Manage current members

<% foreach user in Init.listUsers () do %> @@ -105,10 +188,15 @@ 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 %> <% @footer [] %> \ No newline at end of file