You are here: Foswiki>Tasks Web>Item11219 (17 Aug 2015, GeorgeClark)Edit Attach

Item11219: %IF confused by not ingroup on trunk

pencil
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: minor
Applies To: Engine
Component: SEARCH
Branches:
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
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

 

ItemTemplate edit

Summary %IF confused by not ingroup on trunk
ReportedBy GeorgeClark
Codebase trunk
SVN Range
AppliesTo Engine
Component SEARCH
Priority Normal
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease minor
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r2 - 17 Aug 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy