KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Login Script

 
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting
View previous topic :: View next topic  
Author Message
nkhetani
KiXforms Novice
KiXforms Novice


Joined: 07 Nov 2007
Posts: 1

PostPosted: Wed Nov 07, 2007 6:01 pm    Post subject: Login Script Reply with quote

Hello Everyone,

I am working on logon script, i need help to do certain functions with the script. I would really appreciate any help from you.

The login script should

->Log off user when the user clicks on disagree
->proceed when he clicks on agree
->User shouldn't be able to close the msg
->user should choose agree or disagree inorder to proceed..(it should also disable the other functionality like opening browser or moving the message box.)
-> Maximize the message box to the full size or current screen resolution

In short The script needs to run in such
a way that users (a) can't minimize, (b) close, or (c) do anything but
answer the question for continuing into Windows.

Here is the code i am working on:


Break On
$System = CreateObject("Kixtart.System")
;This is an error check to see if KiXforms is installed on the machine that is running the

script
If Not $System
$= MessageBox("KiXforms Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf


; Form Basics
$Form = $System.Form()
$Form.Caption = "SSB"
$Form.ScaleHeight = 638
$Form.ScaleWidth = 804
$Form.FontName = "Arial"
$Form.FontSize = 9
$Form.Center
$Form.SysMenu = 0
$Form.Resizable = 0
$Form.backcolor = White
$Form.SetFocus
$Form.OnClosing = "CloseWarning()"

; Frame Details

;should use a groupbox rather than a frame (the frame control is an old control and replaced

with the groupbox)
;$FrameDetails = $Form.Frame("")
$FrameDetails = $Form.Controls.GroupBox("User Aggreement:")
$FrameDetails.Height = 520
$FrameDetails.Left = 8
$FrameDetails.Top = 105
$FrameDetails.Width = 790



; Banner Details
$FrameBanner = $Form.Controls.PictureBox()
$FrameBanner.BackColor = $Form.RGB(255,255,255)
$FrameBanner.Height = 80
$FrameBanner.Left = 10
$FrameBanner.Top = 10
$FrameBanner.Width = 785

; Banner Picture
$PictureBanner = $FrameBanner.Image()
$PictureBanner.Picture = "%WINDIR%\System32\shell32.dll;18"
$PictureBanner.Height = 60
$PictureBanner.Left = 5
$PictureBanner.Top = 5
$PictureBanner.Width = 60

$FrameBanner.FontSize = 24
$FrameBanner.ForeColor = $Form.RGB(0,100,100)
$FrameBanner.PrintXY(70,0,"Welcome %USERNAME%")
$FrameBanner.FontSize = 20
$FrameBanner.FontName = "lucida"
$FrameBanner.ForeColor = 0
$FrameBanner.FontBold = 1
$FrameBanner.FontBold = 0
$FrameBanner.FontSize = 10
$FrameBanner.ForeColor = $Form.RGB(0,50,200)


; Exit Button
$CmdConcordo = $FrameDetails.Controls.CommandButton("I Agree")
$CmdConcordo.FontName = "Arial"
$CmdConcordo.FontSize = 10
$CmdConcordo.FontBold = 1
$CmdConcordo.Top = 495
$CmdConcordo.Width = 100
$CmdConcordo.Height = 19
$CmdConcordo.Left = 550
$CmdConcordo.OnClick = "CloseForm()"

; Exit Button
$CmdConcordo = $FrameDetails.Controls.CommandButton("I Disagree")
$CmdConcordo.FontName = "Arial"
$CmdConcordo.FontSize = 10
$CmdConcordo.FontBold = 1
$CmdConcordo.Top = 495
$CmdConcordo.Width = 100
$CmdConcordo.Height = 19
$CmdConcordo.Left = 685
$CmdConcordo.OnClick = "Logoff(1)"

; Execute Form
$TextBoxUsername.SetFocus
$Form.Show

While $Form.Visible
$= Execute($Form.DoEvents())
Loop

Function CloseForm()
Quit()
EndFunction

Function CloseWarning()
$Return = MessageBox("You must click the 'I Agree' button in order to

proceed."+@CRLF+"You may click 'Yes' to logoff or click 'No' To return to the

form","Error",262164)
If $Return = 6
$WMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\" +

@WKSTA + "\root\cimv2")
$OperatingSystems = $WMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each $OperatingSystem in $OperatingSystems
$OperatingSystem.Win32Shutdown(4)
Next
Else
Return
EndIf
EndFunction


Really appreciate your help.
Thanks.
Back to top
View user's profile Send private message
It Took My Prozac
KiXforms Supporter
KiXforms Supporter


Joined: 15 Feb 2005
Posts: 65

PostPosted: Wed Nov 14, 2007 1:04 am    Post subject: Reply with quote

Instead of putting a logon condition in a logon script, why don't you use group policy to display a message before logon?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group