Page 1 of 1 1
Topic Options
#119490 - 2004-05-13 02:19 PM SELECT CASE and INGROUP stopped working!
jwalker Offline
Fresh Scripter

Registered: 2004-05-13
Posts: 6
Last week I know this code was working. Now, it seems to have stopped. If I run it in debug mode, it displays the SELECT line, but I don't see it run anything after that. It is reading the user's group memberships because I can see them in the user's registry hive. But, it does not seem to be doing anything with this information. Please help! I have users calling left and right because this functionality is broken.

Code:

$BRIO = ReadValue ("HKEY_CURRENT_USER\SOFTWARE\BRIO SOFTWARE\BRIOQRY\BRIOQRY", "MODENUMBER")

SELECT
CASE InGroup("CX_Brio Designer")
IF $BRIO <> "XXX-XXX"
WriteValue ("HKEY_CURRENT_USER\SOFTWARE\BRIO SOFTWARE\BRIOQRY\BRIOQRY","MODENUMBER", "XXX-XXX","REG_SZ")
IF @ERROR = 0
? "The update of your registry was successful"
ELSE
? " The system could not write the registry value"
ENDIF
ENDIF
CASE InGroup("COR_CX_Brio Designer")
IF $BRIO <> "XXX-XXX"
WriteValue ("HKEY_CURRENT_USER\SOFTWARE\BRIO SOFTWARE\BRIOQRY\BRIOQRY","MODENUMBER", "XXX-XXX","REG_SZ")
IF @ERROR = 0
? "The update of your registry was successful"
ELSE
? " The system could not write the registry value"
ENDIF
ENDIF
CASE InGroup("CX_Brio Explorer")
IF $BRIO <> "XXX-XXX"
WriteValue ("HKEY_CURRENT_USER\SOFTWARE\BRIO SOFTWARE\BRIOQRY\BRIOQRY","MODENUMBER", "2L55-8282T","REG_SZ")
IF @ERROR = 0
? "The update of your registry was successful"
ELSE
? " The system could not write the registry value"
ENDIF
ENDIF
CASE InGroup("COR_CX_Brio Explorer")
IF $BRIO <> "XXX-XXX"
WriteValue ("HKEY_CURRENT_USER\SOFTWARE\BRIO SOFTWARE\BRIOQRY\BRIOQRY","MODENUMBER", "XXX-XXX","REG_SZ")
IF @ERROR = 0
? "The update of your registry was successful"
ELSE
? " The system could not write the registry value"
ENDIF
ENDIF
ENDSELECT


Top
#119491 - 2004-05-13 02:25 PM Re: SELECT CASE and INGROUP stopped working!
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
You can simplify your code quite a bit..

NOTE: The addition of @ERROR and @SERROR
Code:

$REG="HKCU\SOFTWARE\BRIO SOFTWARE\BRIOQRY\BRIOQRY"
$BRIO=ReadValue($REG,"MODENUMBER")
IF InGroup("CX_Brio Designer","COR_CX_Brio Designer","CX_Brio Explorer","COR_CX_Brio Explorer")
IF $BRIO <> "XXX-XXX"
$RC=WriteValue ($REG,"MODENUMBER", "XXX-XXX","REG_SZ")
IF @ERROR = 0
? "The update of your registry was successful"
ELSE
? " The system could not write the registry value"
@ERROR+" "+@SERROR
SLEEP 3
ENDIF
ENDIF
ENDIF



HTH,

Kent

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

Top
#119492 - 2004-05-13 02:30 PM Re: SELECT CASE and INGROUP stopped working!
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Things you may need..

Flush your token cache for group detection..

In your INGROUP checking, you may need to precede the group with a domain name -
Code:

IF InGroup("DOMAINA\CX_Brio Designer","DOMAINB\COR_CX_Brio Designer","DOMAINB\CX_Brio Explorer","DOMAINB\COR_CX_Brio Explorer")
; ... other code....

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

Top
#119493 - 2004-05-13 03:31 PM Re: SELECT CASE and INGROUP stopped working!
jwalker Offline
Fresh Scripter

Registered: 2004-05-13
Posts: 6
Thank you for the response. Actually, I cannot combine those. It uses different mode numbers depending upon a user's group membership. I just blanked them out with XXX-XXX.
Top
#119494 - 2004-05-13 03:33 PM Re: SELECT CASE and INGROUP stopped working!
jwalker Offline
Fresh Scripter

Registered: 2004-05-13
Posts: 6
I did try preceding the groups with domain names, but still no luck. It's not entering the registry key/value.
Top
#119495 - 2004-05-13 03:39 PM Re: SELECT CASE and INGROUP stopped working!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh.
reading your first post, sounds like there indeed is something wrong with the groups.

you don't have "case 1" there, so you should add it for testing.
simple:
case 1
? "not in any of these groups" ?

would do wonders in tracking the problem.

_________________________
!

download KiXnet

Top
#119496 - 2004-05-13 04:25 PM Re: SELECT CASE and INGROUP stopped working!
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Did you try to add in the @ERROR+' '@SERROR code?

That will tell you why this does not WRITEVALUE.

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

Top
#119497 - 2004-05-13 05:09 PM Re: SELECT CASE and INGROUP stopped working!
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
My guess is a stray quote " got in your script and it is now wonked. Run it through KiXstrip and see what shakes out.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#119498 - 2004-05-13 07:46 PM Re: SELECT CASE and INGROUP stopped working!
jwalker Offline
Fresh Scripter

Registered: 2004-05-13
Posts: 6
Kixstrip doesn't show any errors.

The @ERROR+' '@SERROR code doesn't show anything.

The case 1 entry appears to be showing that the userid isn't a member of any of the groups mentioned. But, the userid is a member of one of the groups. If I look in the token cache, that group is listed.

Top
#119499 - 2004-05-13 08:31 PM Re: SELECT CASE and INGROUP stopped working!
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Are you sure this is the right Reg Key to modify?

HKEY_CURRENT_USER\SOFTWARE\BRIO SOFTWARE\BRIOQRY\BRIOQRY

Maybe try using the RegSnap tool from the Registry Tools FAQ here? Then apply the changes using the before and after snapshots to see what is really going on.

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

Top
#119500 - 2004-05-13 08:39 PM Re: SELECT CASE and INGROUP stopped working!
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
don't go there.
we first need to verify that the code PASSES the INGROUP.
if it does not go into the case, how in the jurassic park's name it would do anything?
_________________________
!

download KiXnet

Top
#119501 - 2004-05-14 10:43 AM Re: SELECT CASE and INGROUP stopped working!
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Add a little debug code if you drop into the "default" case.

Use EnumGroup() to enumerate group memberships and dump the information somewhere - it might expose the problem. The example in the manual will get you most of the way there.

Top
#119502 - 2004-05-14 07:25 PM Re: SELECT CASE and INGROUP stopped working!
jwalker Offline
Fresh Scripter

Registered: 2004-05-13
Posts: 6
The script appears to be working again. Although, I'm not certain why it's working. I changed the group names to all lower case (even though it worked before and the case I was using matched the domain groups).
Top
#119503 - 2004-05-14 07:45 PM Re: SELECT CASE and INGROUP stopped working!
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Did you change the version of KiXtart you were using when the problem started? If so, what versions were involved.


_________________________
Home page: http://www.kixhelp.com/hb/

Top
#119504 - 2004-05-14 08:37 PM Re: SELECT CASE and INGROUP stopped working!
jwalker Offline
Fresh Scripter

Registered: 2004-05-13
Posts: 6
I didn't change the version of kixtart at all. Version 412 is installed. I should probably think about changing to 422, but I haven't done so yet.
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
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

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