Item11219: %IF confused by not ingroup
on trunk
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: minor
Applies To: Engine
Component: SEARCH
Branches:
The following %IF works fine on 1.1.4, fails on trunk.
%IF{"$ WIKINAME!='WikiGuest' and $USERNAME not ingroup 'AdminGroup' and '%REGISTRATIONGROUPTYPE%' = 'automatic' and not defined 'REGISTRATIONGROUPS'" then="<blockquote><span class=\"foswikiAlert\"> *Caution!* Registering a user while logged in will add the new user to all groups you have permission to change.</span> REGISTRATIONGROUPTYPE is set to =automatic=, and no groups are set in REGISTRATIONGROUPS. </blockquote>"}%
Fixing it by moving the not outside of the ingroup comparison - thanks pharvey
%IF{"($WIKINAME!='WikiGuest') and (not ($USERNAME ingroup 'AdminGroup')) and ('%REGISTRATIONGROUPTYPE%' = 'automatic') and (not defined 'REGISTRATIONGROUPS')" then="<blockquote><span class=\"foswikiAlert\"> *Caution!* Registering a user while logged in will add the new user to all groups you have permission to change.</span> REGISTRATIONGROUPTYPE is set to =automatic=, and no groups are set in REGISTRATIONGROUPS. </blockquote>"}%
Test:
No parenthesis
IF{ "$ WIKINAME!='WikiGuest' and $USERNAME not ingroup 'AdminGroup' and 'none' = 'automatic' and not defined 'REGISTRATIONGROUPS'" else="else clause" then=" Caution! Registering a user while logged in will add the new user to all groups you have permission to change. REGISTRATIONGROUPTYPE is set to automatic
, and no groups are set in REGISTRATIONGROUPS.
" }: Missing operator in '$ WIKINAME!='WikiGuest' and $USERNAME not ingroup 'AdminGroup' and 'none' = 'automatic' and not defined 'REGISTRATIONGROUPS''
With parenthesis
else clause
--
GeorgeClark - 30 Oct 2011