|
|
|||||||
Hi, Wonder how to force user to validate and enter a password using kixforms GUI before execute a kix script. Any good tips? /Cy |
||||||||
|
|
|||||||
Create a KiXforms form with two text input objects, one of them in password mode. Upon valid data entry launch the separate KiXtart script. |
||||||||
|
|
|||||||
what do u meen with "password mode"? is it a buildin mode state? if so, how do i call it then? Once the user enter his/her password it sould be "*******" in the passwd textbox. How do i make it hide the input passwd? |
||||||||
|
|
|||||||
See the KiXforms Manual under the TextBox object and the PasswordChar property. |
||||||||
|
|
|||||||
It works fine. thnx a lot \C |
||||||||
|
|
|||||||
I want the authentication script to be in the same script, insted of call and launching the secound script if authentication is OK. I try using goto and gosub to make it run the rest of script if passwd is ok. But its not working. . . $PSWB.OnClick = "PasswdC()" Function PasswdC() . . Endfuction :Start (run the script if passwd ok) . . |
||||||||
|
|
|||||||
You don't show any code. Never use GOTOs! |
||||||||
|
|
|||||||
Sorry, Here is the code: $=SetConsole("minimize") Break On ;Dim $Form $Form = CreateObject("Kixtart.FORM") $Form.CAPTION = "Authentication for @FULLNAME" $Form.SCALEWIDTH = 300 $Form.SCALEHEIGHT = 60 $Form.FONTSIZE = 8 $Form.FONTNAME = "Verdana" $Form.PrintXY(15,6,"Enter authenticity Key and press Button") $Form.CENTER $txtpassword = $form.textbox("",15,30,100,20) $txtpassword.passwordchar = "*" $txtpassword.text = "" $PSWB = $form.Button("Validate",125,30,100,20) $PSWB.OnClick = "PasswdC()" $Form.Show While $Form.Visible $=Execute($Form.DoEvents()) ;Loop Exit 1 Function PasswdC() If $txtpassword.text = 'validate' Dim $Form $Form = CreateObject("Kixtart.FORM") $Form.CAPTION = "Done!" $Form.SCALEWIDTH = 325 $Form.SCALEHEIGHT = 30 $Form.FONTSIZE = 10 $Form.FONTNAME = "Verdana" $Form.PrintXY(10,6,"Passwd OK") $Form.CENTER $Form.Show Sleep 3 ; (Somewhere here i want to jump to start of secound script) Else Dim $Form1 $Form1 = CreateObject("Kixtart.FORM") $Form1.CAPTION = "Faild" $Form1.SCALEWIDTH = 325 $Form1.SCALEHEIGHT = 30 $Form1.FONTSIZE = 10 $Form1.FONTNAME = "Verdana" $Form1.PrintXY(10,6,"Wrong code") $Form1.CENTER $Form1.Show Sleep 3 EndIf Exit ;(Here i will to give the user one more chance or make it exit the script) EndFunction ; (Here will the secound script begins, if Authentication is OK ) Break On $Form = CreateObject('Kixtart.Form') $Form.BackColor = 212,208,200 $Form.ControlBox = "True" $Form.DrawGrid = "True" $Form.FontBold = "False" $Form.FontItalic = "False" $Form.FontName = "Tahoma" $Form.FontSize = 8 $Form.FontUnderline = "False" $Form.ForeColor = 0,0,0 $Form.FormBorderStyle = 3 $Form.Height = 580 $Form.Left = 11 $Form.MaximizeBox = "False" $Form.MinimizeBox = "True" $Form.SizeGripStyle = 2 $Form.StartPosition = 4 $Form.Tag = "" $Form.Text = "My Script" $Form.Top = 3 $Form.ToolTipText = "" $Form.TopMost = "False" $Form.Width = 800 $Form.WindowState = 0 . . . |
||||||||
|
|
|||||||
Jens, need your help on this one too. Could u please check the code and see what Im doing wrong or how should i do? Thanx /C |
||||||||
|
|
|||||||
I'd completely rewrite the whole thing along these liens: Code:
there are other ways to do thsi, e.g. initializing the KiXforms system first, then create the password prompt. If success create the main form else display a messagebox and exit. |
||||||||
|
|
|||||||
Maybe I'm missing something, but what is the point of password protecting a script if the user can edit the script and read or bypass the password? That, to me, is just security by ignorance. I would opt for another approach. Setup a resource that the user needs to authenticate against and put the second script in that resource. If the user fails to authenticate, it is end of story. There is no way for the user to circumvent the security. |
||||||||
|
|
|||||||
I'm giving up on wondering why people want to do things in a certain (non-secure) way. |
||||||||
|
|
|||||||
Security has to be commensurate with what one is securing. You don't protect a $2,000 bike with a $10 lock. I wonder though, what ppl are thinking when they protect (???) their head with a $10 crash helmet? |
||||||||
|
|
|||||||
Maybe the contents is only worth $10? How much does some hot air cost nowadays? ;-) |
||||||||
|
|
|||||||
Dont get me wrong. I will compile the script to make a exe file of that. I suppose once its compiled user cannot read the code inside the script. Or mayby Im wrong.... Should I do it in otherway? Thanx a lot Jens :-) |
||||||||
|
|
|||||||
Quote: There is no such thing as a KiX compiler (secure or other). All that exist are packagers and their security can easily be defeated. |
||||||||
|
|
|||||||
Hummm, That was not good... so what are u then suggesting? Mayby I could package it and then use Installshield..... There is always a way :-) (at least I hope it is) |
||||||||
|
|
|||||||
Since we have absolutely no clue at all what exactly you try to do, we won't be able to help you. |
||||||||
|
|
|||||||
Have to admit, Les is right: Security has to be commensurate with what one is securing. You don't protect a $2,000 bike with a $10 lock. I wonder though, what ppl are thinking when they protect (???) their head with a $10 crash helmet? :-) This case is closed! |
||||||||
|
|
|||||||
not really. no real solutions here yet... |
||||||||
|
|
|||||||
eyyy dont blame me :-) I solve my issue, using if @Userid not ingroup "balblabla" ... dont realy need any password... If u got better idea.... lets rock then :-) |
||||||||
|
|
|||||||
Code:
is not KiXtart-compliant code and thus will not have solved your problem. |
||||||||
|
|
|||||||
This will: Break On If NOT InGroup ("kixart") $Form = CreateObject("Kixtart.FORM") $Form.CAPTION = "Authentication for @FULLNAME" $Form.SCALEWIDTH = 300 $Form.SCALEHEIGHT = 70 $Form.FONTSIZE = 8 $Form.forecolor = &000AAA $Form.FONTbold = "true" $Form.FONTNAME = "Verdana" $Form.PrintXY(15,5," Authentication faild!") $Form.PrintXY(15,20,"Please conntact your local helpdesk!") $Form.CENTER $Obtn = $form.Button("OK",100,40,100,20) $Obtn.OnClick = "OKbtn()" $Form.Show While $Form.Visible $=Execute($Form.DoEvents()) Loop $Form=0 Exit EndIf Function OKbtn() Quit EndFunction |
||||||||
|
|
|||||||
Two items I see. If NOT InGroup ("kixart") Would be faster and easier to find if you also specified the Domain If NOT InGroup ("MyDomain\kixart") When using the QUIT it might be a good idea to set some sort of error level as well. |
||||||||
|
|
|||||||
Will do, thanx Doc :-) What r u suggesting on the other thread Tracking/log system |