Page 1 of 1 1
Topic Options
#24581 - 2002-07-09 12:59 AM If InGroup not working
woodstock Offline
Lurker

Registered: 2002-07-09
Posts: 3
This portion of my login script is not working.
Here is an example of what I have.
if InGroup ("beth&les")
use i: "\\russet\beth&les" /persistent
endif

Why isn't this working? If I just use the "use" command without the if it works fine.

Any help would be great.
Thanks

Top
#24582 - 2002-07-09 01:19 AM Re: If InGroup not working
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Welcome to the board.

Please try following script and return output to the board.
code:
IF (Ingroup("beth&les") <> 0)
? "user @userid is member of BETH&LES"
ELSE
? "user no mber of"
ENDIF

USE LIST
IF (Ingroup(""beth&les") <> 0)
USE i: "\\russet\beth&les"
IF (@error <> 0) THEN
? "Warning KIX-USE: error @error (@serror)"
ELSE
? "Informative KIX-USE: no error"
ENDIF
ENDIF

Try also script for another group without special "&"-symbol in it.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#24583 - 2002-07-09 04:03 PM Re: If InGroup not working
woodstock Offline
Lurker

Registered: 2002-07-09
Posts: 3
Still nothing happening
Top
#24584 - 2002-07-09 04:08 PM Re: If InGroup not working
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
What do you mean, nothing happens?
Does the example code provided to you say that the suer is or is not a member of the group BETH&LES? If you try the same code for a group that dows not contain any special characters like '&' do you still have problems.

Create a user with membership in the following two groups: TESTGROUP, TEST&GROUP, the run this little piece of code:
code:
if ingroup('TESTGROUP')
? 'user '+@USERID'+'is a member of group TESTGROUP'
else
? 'user '+@USERID'+'is NOT a member of group TESTGROUP'
endif
if ingroup('TEST&GROUP')
? 'user '+@USERID'+'is a member of group TEST&GROUP'
else
? 'user '+@USERID'+'is NOT a member of group TEST&GROUP'
endif

Please report back after running this with all error messages that might ahve been created and the results for both IF-ENFIF evaluations.
_________________________
There are two types of vessels, submarines and targets.

Top
#24585 - 2002-07-09 05:10 PM Re: If InGroup not working
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Try following script and return the output of file %tmp%\kixdebug.txt to the board.
At the begin a messagebox will be presented.
code:
                                                           CLS
COLOR C+/N
AT (1,1) " "

$_debug_file="kixdebug.txt" ; - %tmp% directory -
;
IF (len($_debug_file) <> 0)
IF (substr(ExpandEnvironmentVars("%tmp%"),len(ExpandEnvironmentVars("%tmp%")),1) = "\")
$_debug_file=ExpandEnvironmentVars("%tmp%")+$_debug_file
ELSE
$_debug_file=ExpandEnvironmentVars("%tmp%")+"\"+$_debug_file
ENDIF
ENDIF
;$_debug_file="c:\kixdebug.txt"
$_debug_file=LCASE($_debug_file)
IF RedirectOutput($_debug_file)
ENDIF

? "-"+LCASE(@day)+" "+@date+" "+@time+"- kixtart "+@kix+"/3.13e script starting."
? "-"
? "-curdir: "+LCASE(@curdir)
? "-scriptdir: "+LCASE(@scriptdir)
IF (instr("-4.1x-","-"+substr(@kix,1,3)+"x-") <> 0)
? "-scriptname: "+LCASE(@scriptname)
ENDIF
? "-startdir: "+LCASE(@startdir)
? "-"
? "-userid: "+LCASE(@userid)+"/"+LCASE(@wuserid)
? "-user priv: "+LCASE(@priv)
IF (instr("-4.xx-","-"+substr(@kix,1,2)+"xx-") <> 0)
? "-version: inwin="+@inwin+"/dos="+@dos"/productsuite="+@productsuite+"/producttype="+@producttype"/csd="+LTRIM(RTRIM(@csd))
ELSE
? "-version: inwin="+@inwin+"/dos="+@dos
ENDIF

DIM $_debug_name
$_debug_name=""
IF (instr("-4.xx-","-"+substr(@kix,1,2)+"xx-") <> 0)
$_debug_name=@msecs
SELECT
CASE (len($_debug_name) = 1)
$_debug_name="00"+$_debug_name
CASE (len($_debug_name) = 2)
$_debug_name="0"+$_debug_name
ENDSELECT
$_debug_name="."+$_debug_name
IF srnd(@msecs)
ENDIF
ENDIF
$_debug_name=substr(@date,1,4)+substr(@date,6,2)+substr(@date,9,2)+"_"+substr(@time,1,2)+substr(@time,4,2)+substr(@time,7,2)+$_debug_name+"_"+rnd(32767)
IF (len($_debug_name) < 25)
$_debug_name=substr($_debug_name+" ",1,25)
ENDIF
IF (instr("-4.1x-","-"+substr(@kix,1,3)+"x-") <> 0)
IF (len(@scriptname) < 12)
$_debug_name=$_debug_name+" "+LCASE(substr(@scriptname+" ",1,12))
ELSE
$_debug_name=$_debug_name+" "+LCASE(@scriptname)
ENDIF
ENDIF
? "-debug file: "+$_debug_file
? "-debug name: "+$_debug_name
? "-"
?"----- start-"+@time+"-"+$_debug_name+"- @error @serror"?
IF (MessageBox("kixtart @kix starting","kixtart info",0,5) <> 0)
ENDIF
?"- 1-"+@time+"-"+$_debug_name+"- @error @serror"? IF (Ingroup("beth&les") <> 0)
?"- 2-"+@time+"-"+$_debug_name+"- @error @serror"? ? "user @userid is member of BETH&LES"
?"- 3-"+@time+"-"+$_debug_name+"- @error @serror"? ELSE
?"- 4-"+@time+"-"+$_debug_name+"- @error @serror"? ? "user no mber of"
?"- 5-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 6-"+@time+"-"+$_debug_name+"- @error @serror"?
?"- 7-"+@time+"-"+$_debug_name+"- @error @serror"? USE LIST
?"- 8-"+@time+"-"+$_debug_name+"- @error @serror"? IF (Ingroup("beth&les") <> 0)
?"- 9-"+@time+"-"+$_debug_name+"- @error @serror"? USE i: "\\russet\beth&les"
?"- 10-"+@time+"-"+$_debug_name+"- @error @serror"? IF (@error <> 0) THEN
?"- 11-"+@time+"-"+$_debug_name+"- @error @serror"? ? "Warning KIX-USE: error @error (@serror)"
?"- 12-"+@time+"-"+$_debug_name+"- @error @serror"? ELSE
?"- 13-"+@time+"-"+$_debug_name+"- @error @serror"? ? "Informative KIX-USE: no error"
?"- 14-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 15-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF

?"------- end-"+@time+"-"+$_debug_name+"- @error @serror"?
? "-"
? "-"+LCASE(@day)+" "+@date+" "+@time+"- kixtart "+@kix+"/3.13e script ending."
? "-"
IF (instr("-4.1x-","-"+substr(@kix,1,3)+"x-") <> 0)
? "-"+@cpu+" ("+@mhz+" Mhz, memory "+MemorySize()+" MB)"
ENDIF
? "-"
IF RedirectOutput("CON")
ENDIF
COLOR C+/N
?
? "debugging information "+CHR(34)+$_debug_file+CHR(34)
IF RedirectOutput($_debug_file)
ENDIF

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#24586 - 2002-07-10 06:26 PM Re: If InGroup not working
woodstock Offline
Lurker

Registered: 2002-07-09
Posts: 3
I tried running this script but I get a script error Error in parameters in str ExpandenvironmentVars
Top
#24587 - 2002-07-10 06:33 PM Re: If InGroup not working
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
try with this shorter one:
code:
?"----- start-"+@time+"-"+$_debug_name+"- @error @serror"?
IF (MessageBox("kixtart @kix starting","kixtart info",0,5) <> 0)
ENDIF
?"- 1-"+@time+"-"+$_debug_name+"- @error @serror"? IF (Ingroup("beth&les") <> 0)
?"- 2-"+@time+"-"+$_debug_name+"- @error @serror"? ? "user @userid is member of BETH&LES"
?"- 3-"+@time+"-"+$_debug_name+"- @error @serror"? ELSE
?"- 4-"+@time+"-"+$_debug_name+"- @error @serror"? ? "user no mber of"
?"- 5-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 6-"+@time+"-"+$_debug_name+"- @error @serror"?
?"- 7-"+@time+"-"+$_debug_name+"- @error @serror"? USE LIST
?"- 8-"+@time+"-"+$_debug_name+"- @error @serror"? IF (Ingroup("beth&les") <> 0)
?"- 9-"+@time+"-"+$_debug_name+"- @error @serror"? USE i: "\\russet\beth&les"
?"- 10-"+@time+"-"+$_debug_name+"- @error @serror"? IF (@error <> 0) THEN
?"- 11-"+@time+"-"+$_debug_name+"- @error @serror"? ? "Warning KIX-USE: error @error (@serror)"
?"- 12-"+@time+"-"+$_debug_name+"- @error @serror"? ELSE
?"- 13-"+@time+"-"+$_debug_name+"- @error @serror"? ? "Informative KIX-USE: no error"
?"- 14-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 15-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF

?"------- end-"+@time+"-"+$_debug_name+"- @error @serror"?
? "-"
?"press enter to quit"
gets $nothing

and copy the output to post.

cheers,

[ 10 July 2002, 18:34: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#24588 - 2002-07-10 06:51 PM Re: If InGroup not working
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear woodstock,

Which kixtart version running? This function was introducing at Kixtart 3.61 release.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#24589 - 2002-07-10 06:55 PM Re: If InGroup not working
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Addtionally, there was no mention of Win9x nor NT.. If this Win9x, you want to be sure KXRPC is deployed on your DCs.

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

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 400 anonymous users online.
Newest Members
jtpk2022, Rayvenhaus, Insecurity, KGSOFT, fobrien
17791 Registered Users

Generated in 0.056 seconds in which 0.023 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