Page 1 of 1 1
Topic Options
#91647 - 2003-03-04 03:38 AM KixForms question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4350
Loc: New Jersey
Um, I'm running out of hairs tonight...

I've defined a text box for a password, and defined the PasswordChar = "*" for that field.

Later, I want to put a clear text string "UNDEFINED" in the password field to show it hasn't yet been entered.. The form allows new objects to be defined (requiring secure entry of the P/W) and editing of existing objects.

Redefining the PasswordChar to "" doesn't work. Am I missing something or does KixForms remember the value once it is set? Is there another way to toggle the security on and off?

Thanks!

Glenn

code:
 
; this is the definition early on in the script..
$lblPass = $fraSec.Label()
$lblPass.Caption = "Password:"
$lblPass.Left = 255
$lblPass.Top = 25
$lblPass.Width = 70
$lblPass.Height = 20
$txtPass = $fraSec.TextBox()
$txtPass.Left = 325
$txtPass.Top = 20
$txtPass.Width = 125
$txtPass.Height = 20
$txtPass.PasswordChar = "*"

; much later, we read the defined account name
; and display it. Since we can't read the P/W,
; and require that it be re-entered, I'd like
; to display clear text in the field and OnFocus
; change the passwordchar back to "*", like:


$txtPass.PasswordChar = ""
$txtPass.Value = "UNDEFINED"

; but it still displays "********"


_________________________
Actually I am a Rocket Scientist! \:D

Top
#91648 - 2003-03-04 04:49 AM Re: KixForms question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
How about a OnGotFocus() event that then switches the textbox to a password-textbox?
_________________________
There are two types of vessels, submarines and targets.

Top
#91649 - 2003-03-04 05:02 AM Re: KixForms question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4350
Loc: New Jersey
You mean define two text boxes at the same coordinates, one clear and one "password protected" and - depending on what I want displayed, alternately make one hidden and one visible? Hmmm.

code:
 
$txtPassClr = $frmMain.Text("",5,5)
$txtPassHdn = $frmMain.Text("",5,5)
$txtPassHdn.PasswordChar = "*"

$txtPassHdn.Visible = 0
$txtPassClr.Visible = 1

$txtPassHdn.OnGotFocus = "flipPW()"

The FlipPW function would reverse the settings of the Hdn & Clr text fields and reset the focus to the Hdn field.

Am I on target?

Thanks!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#91650 - 2003-03-04 05:06 AM Re: KixForms question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Glenn,

This was just "fixed" (implemented really) in the next release (Build 38).

Top
#91651 - 2003-03-04 05:10 AM Re: KixForms question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4350
Loc: New Jersey
OK, so all I have to do (besides [wait for/get] the next release) is change the character from "*" to null? Makes my life easier!

I'll block out the code for now & focus on the more important stuff. Thanks!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#91652 - 2003-03-04 05:26 AM Re: KixForms question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
The way its working right now is that in the next release, PasswordChar can be reset like this:

$TextBox.PasswordChar = ""

but while reviewing dotnet, it appears that the kixscript equivalent would be something like this:

$TextBox.PasswordChar = CHR(0)

but I don't know - think the first way is a bit more intuitive - can't really think why anyone would want to SET the PasswordChar to a "" - and what would that really mean anyways ? So as far as I can see - the "" string is a good candidate to serve as a reset. Unless I'm missing something.

-Shawn

Top
#91653 - 2003-03-04 05:39 AM Re: KixForms question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4350
Loc: New Jersey
Well, my $0.02 -

We have to enter long and complex passwords. In one application I have in mind, I'd like to be able to display it in clear text as it's entered and then mask it as focus of the field is lost.

Since we're entering a PW that will then get pushed to potentially hundreds of servers, the effect of a bad PW can be more than just aggravating. This method lets us review what we've typed before hitting the COMMIT button.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#91654 - 2003-03-04 05:46 AM Re: KixForms question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I wasn't debating the usefullness of resetting the PasswordChar because imho - its really usefull - just discussing using the null "" string to reset it vs the CHR(0) dotnet style. I think the CHR(0) isn't very intuitive - what was your first thought in terms of what would have reset PasswordChar ?
Top
#91655 - 2003-03-04 06:14 AM Re: KixForms question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4350
Loc: New Jersey
Chr(0) ?? Who the $%#% thought that up?

PasswordChar = "" would be my thought of "Reasonable", although another thought that flashed in my head was - set it to "" so NOTHING is echoed. Hmmm..

Honestly, I'd expect two params.. one to define the character and another (Bool) to enable/disable it. This way, enabled & Char="" echos nothing, Char="*" echos "****" while enabled and "pAsS" when disabled.

I think the boolean goes beyond echo - if the field has data, PWChar="*", and PWCharEnable=1, the field shows "****", but simply change the PWCharEnable to 0 and the field shows clear text. OK - maybe with a field.Refresh..

I'm not sure I'm the best one to be discussing this - to me, OOP is what I say when I cut myself shaving [Wink]

I don't have the same comfort level in VB as I do in past "scripting" languages - unix shell or perl - but Kix is kind of helping me cross the bridge, especially the KixForms.. but I'm dyin' here without Dox.. Lots of "gee, what's this do" and "how's this work" going on tonight.

Anyway - them's my thoughts...

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#91656 - 2003-03-04 06:27 AM Re: KixForms question
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11611
Loc: CA
Glenn,

From a Security standpoint... (imho) I would REALLY be careful about copying/altering/storing and other methods of similar implementation.

There are different laws in different States and Countries that deal with when/how this information can get manipulated. You also take what may have been a secure or semi-secure method over years of programming and testing and reduce it down to an easily compromised system.

If you do decide to do what project it is you're doing, I'd say maybe do a DUAL blank screen. Kind of like most Windows apps do anyways. They DO NOT show you the password, but make you blindly type it TWICE to guarantee that you typed the same password before committing the change.

Top
#91657 - 2003-03-04 02:50 PM Re: KixForms question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4350
Loc: New Jersey
NTDOC

I recognize your concerns.. I'm building a GUI front end to a command-line app that requires the userID and password as parameters (clear text). This tool and the interface I'm creating is for use by the admin staff (we have no local "end users" who could access the script or tool).

The GUI doesn't "store" the password, except temporarily as a variable content. It passes it directly to the command-line it generates and then clears the Var. I'm actually debating whether or not to even mask it, other than as an exercise in programming.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 284 anonymous users online.
Newest Members
Praveer, Ollero, rayyo, Foxlicht, DonChild
17742 Registered Users

Generated in 0.079 seconds in which 0.054 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