xBrowse CRYPT

xBrowse CRYPT

Postby Otto » Fri Mar 08, 2013 11:23 pm

Dear Mr. Rao,
would you be so kind to show how to use decrypt/encrypt with EDIT_GET edit type.
Best regards,
Otto

Code: Select all  Expand view


oBrw:PASSWORD:bEditValue   := { || Decrypt( ALLTRIM( FIELD->PASSWORD ), cPW )  }
oBrw:PASSWORD:nEditType    := EDIT_BUTTON
oBrw:PASSWORD:bEditBlock   := { | r, c, o | EditPASSWORD( r, c, o ) }

oBrw:PASSWORD:bEditValue   := { || Decrypt( ALLTRIM( FIELD->PASSWORD ), cPW )  }
oBrw:PASSWORD:nEditType    := EDIT_GET



 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: xBrowse CRYPT

Postby nageswaragunupudi » Sat Mar 09, 2013 5:19 am

When we want to edit a column, it is advisable to assign bEditValue with SETGET block.
Code: Select all  Expand view

:bEditValue := { |x| If( x != nil, FIELD->PASSWORD := Encrypt( x, cPw ), nil ), Decrypt( FIELD->PASSWORD, cPW ) }
 


Now you can use either EDIT_GET or EDIT_BUTTON.
In case of EDIT_BUTTON, bEditBlock should return the new password without encryption. In case edit is cancelled bEditBlock should return NIL.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Antonio Linares, Google [Bot] and 87 guests