Page 1 of 1 1
Topic Options
#31972 - 2002-11-07 01:49 PM call function and maybe more
Randy_V Offline
Lurker

Registered: 2002-11-07
Posts: 2
Hello,

I'm trying to make a loginscript for a school. At the point of logging in, the script must find the group the user is a member of and run a second script (call function i've read.)

I'm trying but it wont work to get a second script running. (the first script "log.kix" goes ok.)
here is the script:

$userid="1"

If Ingroup("klas-awebb") = 1
call "\\server1\login\log.kix"
else
Endif
If Ingroup("klas") = 1
call "\\server1\login\log.kix"
else
Endif
If Ingroup("klas-awebo") = 1
call "\\server1\login\log2.kix"
else
Endif

It's a win2k enviroment.
Mabye it's very simple but i can't find on the forum and i'm very new whit this so please help.

Top
#31973 - 2002-11-07 02:00 PM Re: call function and maybe more
Wizard Offline
Hey THIS is FUN
*****

Registered: 2000-12-05
Posts: 264
Loc: Bristol, England
Hello Randy and welcome to the board.

There are a couple of mistates you have in your script, take a look at this...

code:
If Ingroup("klas-awebb")
call "\\server1\netlogin\log.kix"
Endif
If Ingroup("klas")
call "\\server1\netlogin\log.kix"
Endif
If Ingroup("klas-awebo")
call "\\server1\netlogin\log2.kix"
Endif

I have removed the ELSE lines as you are not using them.

Also, you really don't need the =1 at the end of INGROUP

I am also assuming that your scripts are in the netlogon share, and I have changed the CALL line as such.

Hope this helps.

Wizard

[ 07. November 2002, 14:02: Message edited by: Wizard ]
_________________________
Wizard
There's no place like 127.0.0.1

vb | kix | batch | html | cfm | js | english

Top
#31974 - 2002-11-07 02:06 PM Re: call function and maybe more
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
You should've called the folder netlogon then , no ?

Where have I seen that recently ... [Wink]

[ 07. November 2002, 14:06: Message edited by: jpols ]
_________________________



Top
#31975 - 2002-11-07 02:07 PM Re: call function and maybe more
Wizard Offline
Hey THIS is FUN
*****

Registered: 2000-12-05
Posts: 264
Loc: Bristol, England
bugger.!

Thanks J

W
_________________________
Wizard
There's no place like 127.0.0.1

vb | kix | batch | html | cfm | js | english

Top
#31976 - 2002-11-07 03:23 PM Re: call function and maybe more
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I hope you are aware how the CALL function works? It does not initiate a second KiXtart session but just runs the code inside the second KiXtart script.

And please post your code inside [CODE] tags as specified in ABC's of KiXtart board etiquette and message to new forum users

[ 07. November 2002, 15:24: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#31977 - 2002-11-07 03:31 PM Re: call function and maybe more
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Assuming that the subsequent scripts reside in the same folder as the calling script you can also call it like this:

code:
call @scriptdir + "\script.kix" 

J.
_________________________



Top
#31978 - 2002-11-07 03:51 PM Re: call function and maybe more
Randy_V Offline
Lurker

Registered: 2002-11-07
Posts: 2
Hello,

Sorry for not putting the script into the code bar. Your tips from above didn't help. Can't i use the call-function to run different script for different users when they log on, and if not what is a good alternative?


The reason i'm asking is this:

When a user logs-on the script must look-up in Active Directory of which group he is a member of(can only be a member of one group) After finding it there must run a text-box which is different for every group,(that's the reason i thought of using the call function)(there will be about 3 or 4 different text-boxes.)

Maybe some know a better way of doing this.

Top
#31979 - 2002-11-07 03:54 PM Re: call function and maybe more
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If you followed the advise given and it still doesn't work then the problem is not with the CALL command. Run the script in debug to see where it is failing.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#31980 - 2002-11-07 03:56 PM Re: call function and maybe more
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Why not look up which group the user belongs to and set appropriate variables or use GOSUB? Since the groups are mutually exclusive, you'd do
code:
SELECT
CASE Ingroup('klas-awebb')
$group=1
GOSUB group1
CASE Ingroup('klas"'
$group=2
GOSUB group2
CASE Ingroup('klas-awebo')
$group=3
GOSUB group3
CASE 1
$group=0
ENDSELECT

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

Top
#31981 - 2002-12-08 03:35 PM Re: call function and maybe more
MCA Offline
KiX Supporter
*****

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

Did you find aleasy a solution?
Please return a status update.

To see "why your CALL doesn't work" add a print statement to it.
The result can be
code:
If Ingroup("klas-awebb")
call "\\server1\netlogin\log.kix"
? "Warning KIX-CALL-awebb: status @error (@serror)"
Endif
If Ingroup("klas")
call "\\server1\netlogin\log.kix"
? "Warning KIX-CALL: status @error (@serror)"
Endif
If Ingroup("klas-awebo")
call "\\server1\netlogin\log2.kix"
? "Warning KIX-CALL-awebo: status @error (@serror)"
Endif

For other information about debugging see our tool kixstrip, which you can
find on our site.
greetings.

btw: symbol  - on our homepage has been linked to related http://kixtart.org topic.
_________________________
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
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 581 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.059 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