I have made the following modifations to the scripts.
AMSUTIL.KIX
Added the loop for making folders and corrected the caseselects for deleting old log files to IF statement. Removed all of the additional
Code:
$System= CreateObject("Kixtart.System")
Changed the creation of the startup logs to a UDF shortening the script.
Code:
If NOT Exist ($netlogs+$userlog)
$htmlinfo=@FULLNAME
Open (9,$netlogs+$userlog,5)
StartUpLogs()
Close (9)
EndIf
If NOT Exist ($readlog+"index.html")
$htmlinfo="Log Viewer"
Open (9,$readlog+"index.html",5)
StartUpLogs()
Close (9)
EndIf
If NOT Exist ($netlogs+"index.html")
$htmlinfo="Log Viewer"
Open (9,$netlogs+"index.html",5)
StartUpLogs()
Close (9)
EndIf
If NOT Exist ($netlogs+$listhtml)
$htmlinfo="Log Veiwer"
Open (9,$netlogs+$listhtml,5)
StartUp()
WriteLine (9,'<a HREF="'+$netlogs+$userlog+'" TARGET="display_area">Details--@DATE</a></b><br>'+@CRLF)
Close (9)
FUNC.KIX
Changed the Add_Click() function because the cancel button was not working.
Code:
Function StartUpLogs()
WriteLine (9,'<div align="center">'+@CRLF)
WriteLine (9,'<body bgcolor="#c0c0c0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">'+@CRLF)
WriteLine (9,"<HTML>"+@CRLF)
WriteLine (9,"<HEAD>"+@CRLF)
WriteLine (9,'<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">'+@CRLF)
WriteLine (9,"<TITLE>" + $HTMLInfo + "</TITLE>"+@CRLF)
WriteLine (9,"</HEAD>"+@CRLF)
WriteLine (9,"<BODY>"+@CRLF)
WriteLine (9,"<TABLE BORDER>"+@CRLF)
WriteLine (9,"<B>"+$HTMLInfo+"</B><P>"+@CRLF)
EndFunction
Function Add_Click()
$FrmAdd.Show
$FrmAdd.SetFocus
While $FrmAdd.Visible AND $FrmAdd.Tag=0
$=Execute($FrmAdd.DoEvents())
Loop
If $FrmAdd.Tag=1
If $txtAddFullName.Text = "" OR $txtAddNetID.Text = "" OR $txtAddCPUName.Text = ""
$msgbox.Show ("Please Fill out All Fields for Primary User","Add User")
Return
EndIf
If $chkbxAddAltUser.CheckState = 1
If $txtAddAltFullName.Text = "" OR $txtAddAltNetID.Text = "" OR $txtAddAltCPUName.Text = ""
$msgbox.Show ("Please Fill out All Fields for Alternate User","Add User")
Return
EndIf
EndIf
If Exist ($netpath+"nodes\"+$txtAddFullName.Text)
$msgbox.Show ("User Already Exists.","Add User")
Return
EndIf
WriteProfileString ($netpath+"nodes\"+$txtAddFullName.Text,"Primary","NetID",$txtAddNetID.Text)
WriteProfileString ($netpath+"nodes\"+$txtAddFullName.Text,"Primary","CPU",$txtAddCPUName.Text)
WriteProfileString ($netpath+"vuia.dat","User",$txtAddNetID.Text,$txtAddCPUName.Text)
If $chkbxAddAltUser.CheckState = 1 OR $chkbxEditaltUser.CheckState = 1
WriteProfileString ($netpath+"nodes\"+$txtAddFullName.Text,"Alt","Name",$txtAddAltFullName.Text)
WriteProfileString ($netpath+"nodes\"+$txtAddFullName.Text,"Alt","NetID",$txtAddAltNetID.Text)
WriteProfileString ($netpath+"nodes\"+$txtAddFullName.Text,"Alt","CPU",$txtAddAltCPUName.Text)
WriteProfileString ($netpath+"nodes\"+$txtAddFullName.Text,"Alt","Checkbox","1")
WriteProfileString ($netpath+"vuia.dat","Alt",$txtAddAltNetID.Text,$txtAddCPUName.Text)
$txtAddAltFullName.Text = ""
$txtAddAltNetID.Text = ""
$txtAddAltCPUName.Text = ""
EndIf
EndIf
$txtAddFullName.Text = ""
$txtAddNetID.Text = ""
$txtAddCPUName.Text = ""
$chkbxAddAltUser.CheckState = 0
AddAltCheckbox()
$FrmAdd.Tag=0
$FrmAdd.Hide
Reload()
EndFunction
I moved all of the varibles at the end outside the IF statement this allows the cancel button to work properly.