Page 1 of 1 1
Topic Options
#31120 - 2002-10-21 02:07 PM Compare an @USERID and an array
Flo Offline
Lurker

Registered: 2002-10-21
Posts: 2
Loc: Germany
Hi,

Iīm just programming a logon-script which maps the network-drives. My problem: I want to map different drives for each compartment and their user.
I made an array like "technic" where every user of the compartment "technical support" is listed. Now I want to check if the user is in this array!!

something like:
if @USERID [Confused] $technic
map drives....
ENDIF

I donīt know which operator ( [Confused] ) should be used to check this....

Thanx for your help
Flo

Top
#31121 - 2002-10-21 02:13 PM Re: Compare an @USERID and an array
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I don't understand why don't you use normal groups for this and use them with ingroup()...

anyway, if you have array of userIDs, you can do:
for each $username in $array
if $username=@userid
...
endif
next

you may also do:
if instr(join($array,chr(10)),@userid)
...
endif

or similar.
but, I still must wonder, don't you have groups for this?

cheers.
_________________________
!

download KiXnet

Top
#31122 - 2002-10-21 02:30 PM Re: Compare an @USERID and an array
Flo Offline
Lurker

Registered: 2002-10-21
Posts: 2
Loc: Germany
Thanx Lonkero,

quiet easy solution to my problem... [Wink]
...I should have known it myself...

Iīve read about this "INGROUP"-command, but I thought it checks just the normal Windows-user/-rights (like Admin, Domain Admins or user)... and that wouldnīt bring me any further...
Thus I tried the way using an array for each compartment...

How ever, now it works... thank you
Flo

Top
#31123 - 2002-10-21 02:47 PM Re: Compare an @USERID and an array
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
nah,
ingroup("technicians")

works just fine for me. [Wink]
_________________________
!

download KiXnet

Top
#31124 - 2002-10-21 02:53 PM Re: Compare an @USERID and an array
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Flo:

INGROUP checks group membership for any local or global group that you create int he User Manager. I would highly recommend to create groups for your users based on function/task or any other grouping, like 'Accounting','Secretaries','Coffee Makers', and so on. This will also assist you in setting correct file permissions since you will only have to assign permissions based on groups. You then add users to their respective groups and don't have to worry about adjusting permissions.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1386 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.057 seconds in which 0.026 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