Page 1 of 1 1
Topic Options
#52654 - 2000-12-09 07:03 PM Here's one for the Kix Guru's
Anonymous
Unregistered


I work in a university where students can logon to our network from anywhere on campus or by dial-in.

When the student logs-on to out NT network, I need to display a Code of Conduct msg(no problem so far).

At the end of the msg there is to be 2 prompts "Accept" / "Decline". I need to write the user name and whether they have accepted or declined to a file with a date/time stamp.

Here's the piece that's got me... Once they have accepted, I do not want to display the msg on subsequent logons.

Ideally I'd like to store this info in SQL.

One solution I've thought of is to create a web page, which handles sql, but the problem I've encounterd is how to launch the users default browser and point it to a page from within kix.

Any ideas/comments will be greatly appreciated. I'm open to other soultions as well.

Thanks in advance.

Top
#52655 - 2000-12-09 09:29 PM Re: Here's one for the Kix Guru's
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
You can try and go the XML route that I've been working on. I haven't played with retrieving data from the database yet, but since add and update work, I'm sure that querying wouldn't be so hard. When I get a chance I will look into it and see if it will work. You can see what I've done so far Here

Enjoy

------------------

"He was a good little monkey and always very curious..."

_________________________
He was a good little monkey and always very curious...

Top
#52656 - 2000-12-10 08:23 PM Re: Here's one for the Kix Guru's
Anonymous
Unregistered


To launch a web page with the users default browser, you can use the following command.
code:
shell '%comspec% /c start http://server.com/webpage.html'[/CODE] 

Mark P.

Top
#52657 - 2000-12-11 02:57 PM Re: Here's one for the Kix Guru's
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Ja:

Here's a quick and dirty way to do this...

This script uses a registry cookie to determine if the code of conduct message has been presented and agreed to by the user.

If your user's have roaming profiles, they'll get this message only once. If not roaming, they'll get this the first time they log into any new workstation...


code:

break on


$key= "software\yourcompany\logon"
$value= "conduct"
$yes= 6


$title= "Code of Conduct"


$notice="


Hey You !


Do you promise to be a good boy ?


"


if val(readvalue ("$key","$value")) <> $yes


$answer= messagebox("$notice","$title",4)


if $answer= $yes


$= addkey("$key")
$= writevalue("$key","$value","$answer","REG_DWORD")


else


?"how dare you... logout!"


endif


endif

exit


Hope this helps...

Shawn.

[This message has been edited by Shawn (edited 11 December 2000).]

Top
#52658 - 2000-12-11 06:49 PM Re: Here's one for the Kix Guru's
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
ja_sper:

If you want the check to be performed without increasing your logon time, you should try this:

You can use the functions: ReadProfileString/WriteProfileString
(The manual says that these functions are provided for compatibility with 16 bit applications,
but they can be usefull for other purposes such as this.)

Two examples:

Example one:
There is a limit using this example because of the max filesize for ReadProfileString/WriteProfileString (64 k),
Maximum number of users will be about 2000 (3000 if you omit the time)

Make the share: \\server\share with read/write access for domain users containing the file: CodeOfC.ini

Then you can use this script:

code:
If ReadProfileString("\\server\share\CodeOfC.ini", "Accept", "@UserId") = ""
; Your Code of Conduct msg
If $Accept ; Result of your Code of Conduct msg
$Err = WriteProfileString("\\server\share\CodeOfC.ini", "Decline", "@UserId", "") ; delete decline entry
$Err = WriteProfileString("\\server\share\CodeOfC.ini", "Accept", "@UserId", "@Date")
Else
$Err = WriteProfileString("\\server\share\CodeOfC.ini", "Decline", "@UserId", "@Date")
EndIf
EndIf

Example two:
Another way WITH NO LIMITATIONS

Let each users logon script create/edit an ini-file containing global setting for that user.
Create a share: \\server\share with read/write/create for domain users and use this script:

code:
If ReadProfileString("\\server\share\@UserId.ini", "CodeOfConduct", "Accept") = ""
; Your Code of Conduct msg
If $Accept ; Result of your Code of Conduct msg
$Err = WriteProfileString("\\server\share\@UserId.ini", "CodeOfConduct", "Decline", "") ; delete decline entry
$Err = WriteProfileString("\\server\share\@UserId.ini", "CodeOfConduct", "Accept", "@Date")
Else
$Err = WriteProfileString("\\server\share\@UserId.ini", "CodeOfConduct", "Decline", "@Date")
EndIf
EndIf


The second script can be expanded to contain other global user settings. Besides the size of the ini-file will be small, this is important for RAS/WAN clients!


PS. If you want to build a database of logon/user-info, you can make a script to read the ini-file(s) and convert it(them) to a csv-file and read
it with ExCell or you can export it to a db-file using Paul_Berquam's suggestion.

Erik

[This message has been edited by kholm (edited 11 December 2000).]

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
0 registered and 1114 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

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