|
|
|||||||
I can't seem to get the syntax right for this. I'm trying to test if someone is in the group Engr or Truss or Receptionist, and if they are in one of those, to do some condition. Here is what I have but it doesn't work: IF INGROUP("Engr") OR INGROUP("Truss") OR INGROUP("Receptionist") |
||||||||
|
|
|||||||
Syntactically and logically correct, but you miss the conditional code plus the endif Only half kidding here, can you show us a bit more ? Additionally, have you added your user to one of these groups just to test and haven't refreshed the token cache of KiX (hint: run kix32 with /f) ? If you did refresh the cache, does anything change if you add the domain name to your ingroup statements ? |
||||||||
|
|
|||||||
IF trys every statement so the or is not needed. Code: IF INGROUP("Engr") Select finds the first true statement and then stops looking. Code: SELECT |
||||||||
|
|
|||||||
Quote: Eh? So you promote writing the conditional code 'thrice' |
||||||||
|
|
|||||||
No I was trying to explain that IF keeps steping through and and case can be used if you have only one possible statement that could be true. I wa s not recommending the use of the code as written. |
||||||||
|
|
|||||||
Allrighty then |
||||||||
|
|
|||||||
IF INGROUP("Engr") or INGROUP("Truss") or INGROUP("Receptionist") ; Make sure the user can run MATLIST -- they need a .get file and it gets ; created automatically if they don't have one (copied from one that works) IF NOT EXIST("\\corpsrv\data\batch\paths\@USERID.get") ;cp \\corpsrv\data\batch\paths\jenny.get \\corpsrv\data\batch\paths@USERID.get ENDIF ; The program was written to use a variable that exists in Novell but not NT, so we set it here SETM "LINAME=@USERID" ? "LINAME set to @USERID" ; for MATLIST program -- look in %L\DATA\BATCH\PATHS\username.get ; Set up drive mappings here (X will go away eventually) USE L: \\corpsrv\engr USE G: \\corpsrv\apps USE Q: \\corpsrv\data USE U: \\corpsrv\utils use X: \\corpsrv\X ENDIF I get an error in the kixtart script if I have the IF line setup that way. If I take out everything but INGROUP("Engr") it works fine. |
||||||||
|
|
|||||||
What's the error then ? Is there a line number specified ? |
||||||||
|
|
|||||||
No need to OR it unless you have a very old version of KiX. InGroup supports the passing of multiple group names. Quote: |
||||||||
|
|
|||||||
As usual I was making it too difficult!! Thank you! |
||||||||
|
|
|||||||
Anyway the if line shouldn't have thrown an error in the first place ... as said, it was syntactically correct |