I ask me a question about the macro 'to member of'. When a user's name is given in parameter, the macro return a result not empty if it is up to one of the groups that we wish to test.
It seems in the sources that if the account does not exist, then the name of the on-line user is taken and can give a bad result.
s:=par(1, 'user');
if s > '' then
a:=getAccount(s);
if (a = NIL) and assigned(md.cd) then
a:=md.cd.account;
I make a mistake certainly, but in my opinion if a name is then supplied the current user should not interfere. To convince itself, it is enough to associate its own account to an existing group 'group1' and to use the macro following one with the unexisting account 'taratata':
<body>
{.if|{.member of|group1|taratata.}|<hr>yep<hr>.}
The obtained result is a magnificent 'YEP', what is not in accordance with the reality of the made test.
The code adequate would rather be the one this
procedure memberOf();
var
a: Paccount;
s: string;
begin
a:=NIL;
s:=par(1, 'user');
if s > '' then a:=getAccount(s)
else if (pars.count<2) and assigned(md.cd) then a:=md.cd.account; result:='';
if a = NIL then exit;
trueIf(findEnabledLinkedAccount(a, split(';',par(0,'group'))) <> NIL);
end; // memberOf
current user by using
{.member of|group1.} and not by {.member of|group1
|.}