Page 1 of 1 1
Topic Options
#70932 - 2002-10-17 03:43 PM IF INGROUP OR INGROUP
ElGuapo Offline
Starting to like KiXtart

Registered: 2002-06-19
Posts: 100
Should the following code work in KIX 3.61 ? I want to do if someone is a member of group A or B. I haven't tested it yet, just curious at this point.

IF ingroup("A") or ingroup ("B")

ELSE

ENDIF

Top
#70933 - 2002-10-17 03:45 PM Re: IF INGROUP OR INGROUP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yes, that is correct.

Please take a look at the KiXtart Manual under IF, it contains a couple of examples.

[ 17. October 2002, 15:46: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#70934 - 2002-10-17 03:54 PM Re: IF INGROUP OR INGROUP
ElGuapo Offline
Starting to like KiXtart

Registered: 2002-06-19
Posts: 100
Thank you for your reply. The 3.61 manual p. 59 has the INGROUP statement, but no examples of testing for multiple group membership.
Top
#70935 - 2002-10-17 05:26 PM Re: IF INGROUP OR INGROUP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You might want to check the KiXtart Manual under IF and not under INGROUP since the multiple checks for logical TRUE are part fo the IF clause.
_________________________
There are two types of vessels, submarines and targets.

Top
#70936 - 2002-10-17 05:49 PM Re: IF INGROUP OR INGROUP
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You don't say what IF =

That is, you don't specify what you anticipate InGroup() to return. This has changed with KiX versions.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#70937 - 2002-10-17 06:40 PM Re: IF INGROUP OR INGROUP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
INGROUP returns 1 if the user is a member of one or more of the specified groups. It returns 0 if the user is not a member of any of the groups. Straight from the manual. Thus, checking for just a TRUE statement is okay as in
code:
IF 1
ENDIF

_________________________
There are two types of vessels, submarines and targets.

Top
#70938 - 2002-10-17 07:01 PM Re: IF INGROUP OR INGROUP
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Again, what InGroup() returns depends on KiX version.

From the 3.62 manual:
0 The user is not a member of a group with this name.
1 The user is a member of a global group with this name.
2 The user is a member of a local group with this name.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#70939 - 2002-10-17 07:47 PM Re: IF INGROUP OR INGROUP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Damn, missed the 3.6x reference. I'm so used to 4.12 by now.

[ 17. October 2002, 19:47: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#70940 - 2002-10-18 06:38 AM Re: IF INGROUP OR INGROUP
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
still, the result is the same.
checking on group membership in domain (there can't be local and global with same name) does not need to specify 1 or 2.
simple if ingroup() will do.
_________________________
!

download KiXnet

Top
#70941 - 2002-10-18 07:14 AM Re: IF INGROUP OR INGROUP
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
However,

We are doing a domain migration ..

For example we are using:

code:
IF ingroup("DomainA\Accounting") or ingroup ("DomainB\Accounting")
; - true condition
ELSE
; - false condition
ENDIF

Hmmm... Maybe you could try:
code:
IF 1 = ingroup("DomainA\Accounting") or 1 = ingroup ("DomainB\Accounting")
; - true condition
ELSE
; - false condition
ENDIF

Or...
code:
IF (1 = ingroup("DomainA\Accounting")) or (1 = ingroup ("DomainB\Accounting"))
; - true condition
ELSE
; - false condition
ENDIF

Thanks,

Kent

[ 18. October 2002, 07:35: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#70942 - 2002-10-18 07:23 AM Re: IF INGROUP OR INGROUP
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
why "1"?
and not just 1?
_________________________
!

download KiXnet

Top
#70943 - 2002-10-18 07:36 AM Re: IF INGROUP OR INGROUP
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Jooel,

You are right, we are checking for an error condition and not a string value.

My bad..

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.06 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org