+ C = cursor(q([E || E <- qlc:keysort(9, mnesia:table(user), [{order, descending}])])),
+ Users = qlc:next_answers(C, N),
+ lists:foreach(
+ fun(U) ->
+ #user{id = Id, pseudo = Pseudo, login = Login, ek_master = Ek_master, date_derniere_connexion = Date} = U,
+ {{Annee, Mois, Jour}, {Heure, Min, _}} = calendar:now_to_local_time(Date),
+ io:format(
+ "~4w : ~10.10..s~10.10..s ~2w.~2.2.0w.~w - ~2wh~2.2.0w~n",
+ [
+ Id,
+ if Ek_master -> "*"; true -> "" end ++ Pseudo,
+ "(" ++ Login ++ ")",
+ Jour, Mois, Annee, Heure, Min
+ ]
+ )
+ end,
+ Users
+ ),
+ qlc:delete_cursor(C)
+ end)).
+
+
+% Affiche tous les users.
+print_users() ->
+ print_users(all_remaining).