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).]