Question
I am testing for a user's membership in a group. Here is what I have tried:
%USERINFO{"DewayneVanHoozer" format="$groups"}%
Am I a member of AnyUndefinedGroup
%CALC{$IF($FIND(AnyUndefinedGroup, %USERINFO{"DewayneVanHoozer" format="$groups"}%), Member, Not Member)}%
Am I a member of SimulationGroup
%CALC{$IF($FIND(SimulationGroup, %USERINFO{"DewayneVanHoozer" format="$groups"}%), Member, Not Member)}%
Am I a member of Group
%CALC{$IF($FIND(Group, %USERINFO{"DewayneVanHoozer" format="$groups"}%), Member, Not Member)}%
Am I a member of TWikiAdminGroup
%CALC{$IF($FIND(TWikiAdminGroup, %USERINFO{"DewayneVanHoozer" format="$groups"}%), Member, Not Member)}%
Am I a member of ModeratorGroup
%CALC{$IF($FIND(ModeratorGroup, %USERINFO{"DewayneVanHoozer" format="$groups"}%), Member, Not Member)}%
which produces these results:
TWikiAdminGroup, ModeratorGroup, SimulationGroup isAdmin()
Am I a member of AnyUndefinedGroup?
Not Member
Am I a member of SimulationGroup
Not Member
Am I a member of Group
Member
Am I a member of TWikiAdminGroup
Member
Am I a member of ModeratorGroup
Not Member
Any ideas? Should I be escaping something?
I was planning on using this kind of conditional inside a
FormattedSearch. My overall goal is to create an address book from the Main web for only those people in a specific group. Once the problem I'm having with the Calc If Find Userinfo is resolved, I will put it into the format of my search.
This successfully produces my table:
| *Last Name* | *First Name* | *Country* | *Telephone* | *Email* | *Groups* |
%SEARCH{"%META:FORM.*[U]serForm" web="%MAINWEB%" scope="text" nosearch="on" nototal="on" order="modified" reverse="on" format="| $formfield(LastName) | $formfield(FirstName) | $formfield(Country) | $formfield(Telephone) | $formfield(Email) | $percntUSERINFO{\"$topic\" format=\"$groups\"}$percnt |" }%
Environment
--
DewayneVanHoozer - 21 Jun 2007
Answer
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.
Sorry, closing this after more than 30 days of inactivity...
--
PeterThoeny - 10 Aug 2007