@@ -9,7 +9,7 @@ Use this template to create a new dialog-box. Alter this default template or cre
99&Scoped-define FRAME-NAME Connect
1010&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Connect
1111/************************************************************************
12- * Copyright (C) 2000,2009 by Progress Software Corporation. *
12+ * Copyright (C) 2000,2009,2022 by Progress Software Corporation. *
1313* All rights reserved. Prior versions of this work may contain portions *
1414* contributed by participants of Possenet. *
1515* *
@@ -70,7 +70,8 @@ Modified:
7070 (sometimes people just enter pf-file. In this
7171 case we need to ignore the other parameters)
7272 rkamboj 08/08/11 fixed issue of login when special chracter in password
73- at the time of db connect. Applied set-db-client method.
73+ at the time of db connect. Applied set-db-client method.
74+ tmasood 02/24/22 Added the support for -Pin argument
7475
7576---------------------------------------------------------------------------- */
7677/* This .W file was created with the Progress UIB. */
@@ -162,10 +163,10 @@ btn_Options Btn_Help
162163/* OPTIONAL-FIELDS,ENABLE-OPTIONAL,List-3,List-4,List-5,List-6 */
163164&Scoped-define OPTIONAL-FIELDS Network Multi_User Pass_Phrase Host_Name ~
164165Service_Name User_Id Pass_word Trig_Loc btn_filep Parm_File btn_filet ~
165- Unix_Parms Unix_Label
166+ Unix_Parms Unix_Label Pin
166167&Scoped-define ENABLE-OPTIONAL Network Multi_User Pass_Phrase Host_Name ~
167168Service_Name User_Id Pass_word Trig_Loc btn_filep Parm_File btn_filet ~
168- Unix_Parms Unix_Label
169+ Unix_Parms Unix_Label Pin
169170
170171/* _UIB-PREPROCESSOR-BLOCK-END */
171172&ANALYZE-RESUME
@@ -279,6 +280,11 @@ DEFINE VARIABLE Pass_Phrase AS LOGICAL INITIAL no
279280 VIEW-AS TOGGLE-BOX
280281 SIZE 17 BY .76 NO-UNDO .
281282
283+ DEFINE VARIABLE Pin AS LOGICAL INITIAL no
284+ LABEL " Pin"
285+ VIEW-AS TOGGLE-BOX
286+ SIZE 7.8 BY .81 NO-UNDO .
287+
282288
283289/* ************************ Frame Definitions *********************** */
284290
@@ -293,7 +299,8 @@ DEFINE FRAME Connect
293299 DB_Type AT ROW 4.33 COL 18 COLON-ALIGNED
294300 Network AT ROW 5.86 COL 18.2 COLON-ALIGNED
295301 Multi_User AT ROW 5.86 COL 44
296- Pass_Phrase AT ROW 5.86 COL 64
302+ Pass_Phrase AT ROW 5.86 COL 62.2
303+ Pin AT ROW 5.91 COL 77.4 WIDGET-ID 2
297304 Host_Name AT ROW 7.19 COL 18 COLON-ALIGNED
298305 Service_Name AT ROW 7.19 COL 62 COLON-ALIGNED
299306 User_Id AT ROW 8.52 COL 18 COLON-ALIGNED
@@ -304,7 +311,7 @@ DEFINE FRAME Connect
304311 btn_filet AT ROW 12.67 COL 71
305312 Unix_Parms AT ROW 14.81 COL 4 NO-LABEL
306313 Unix_Label AT ROW 14 COL 1
307- SPACE (35.99 ) SKIP (3.23 )
314+ SPACE (36.40 ) SKIP (3.23 )
308315 WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER
309316 SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE
310317 TITLE " Connect Database"
@@ -367,6 +374,11 @@ ASSIGN
367374ASSIGN
368375 Pass_Phrase :HIDDEN IN FRAME Connect = TRUE .
369376
377+ /* SETTINGS FOR TOGGLE-BOX Pin IN FRAME Connect
378+ NO-DISPLAY NO-ENABLE 1 2 */
379+ ASSIGN
380+ Pin :HIDDEN IN FRAME Connect = TRUE .
381+
370382/* SETTINGS FOR FILL-IN Pass_word IN FRAME Connect
371383 NO-DISPLAY NO-ENABLE 1 2 */
372384ASSIGN
@@ -803,6 +815,7 @@ PROCEDURE Pressed_OK :
803815 input frame connect DB_Type
804816 input frame connect Multi_User
805817 input frame connect Pass_Phrase
818+ INPUT FRAME connect Pin
806819 input frame connect Network
807820 input frame connect Host_Name
808821 input frame connect Service_Name
@@ -884,29 +897,43 @@ PROCEDURE Pressed_OK :
884897 return error .
885898 end .
886899 else do :
887- IF NOT Pass_Phrase THEN DO :
900+ IF NOT Pass_Phrase AND NOT Pin THEN DO :
888901 run adecomm / _setcurs.p (" WAIT" ).
889902 connect VALUE (args ) VALUE (p_Unix_Parms ) NO-ERROR .
890903 run adecomm / _setcurs.p (" " ).
891904 END .
892905
893- IF Pass_Phrase OR (ERROR-STATUS :ERROR AND ERROR-STATUS :GET-NUMBER (1 ) = 15271 ) THEN DO :
894- /* if missing or incorrect passphrase for a database
906+ IF Pass_Phrase OR Pin OR
907+ (ERROR-STATUS :ERROR AND
908+ (ERROR-STATUS :GET-NUMBER (1 ) = 15271 OR ERROR-STATUS :GET-NUMBER (1 ) = 20409 )) THEN DO :
909+ /* if missing or incorrect passphrase/pin for a database
895910 with encryption enabled and manual start, prompt
896911 for the passphrase now.
897912 */
898913 DEFINE VARIABLE cpassPhrase AS CHARACTER NO-UNDO .
914+ DEFINE VARIABLE cPin AS CHARACTER NO-UNDO .
915+ DEFINE VARIABLE cKeyStoreParams AS CHARACTER NO-UNDO INITIAL " " .
899916
900- RUN _passphrase.p (OUTPUT cpassPhrase ).
917+ RUN _passphrase.p (INPUT Pass_Phrase ,
918+ INPUT Pin ,
919+ OUTPUT cpassPhrase ,
920+ OUTPUT cPin ).
901921
902- /* if they don't specify a passphrase when asked to, we will
922+ /* if they don't specify a passphrase/pin when asked to, we will
903923 just display the errors we got above.
904924 */
905925 IF cpassPhrase <> ? AND length (cpassPhrase ) > 0 THEN DO :
906- /* this will let them try once. If it fails, then they will
926+ ASSIGN cKeyStoreParams = " -KeyStorePassPhrase " + QUOTER (cpassPhrase ).
927+ END .
928+ IF cPin <> ? AND length (cPin ) > 0 THEN DO :
929+ ASSIGN cKeyStoreParams = cKeyStoreParams + " -KeyStorePin " + QUOTER (cPin ).
930+ END .
931+
932+ IF cKeyStoreParams NE " " THEN DO :
933+ /* this will let them try once. If it fails, then they will
907934 need to try to connect again.
908- */
909- connect VALUE (args ) VALUE (" -KeyStorePassPhrase " + QUOTER ( cpassPhrase ) ) VALUE (p_Unix_Parms ) NO-ERROR .
935+ */
936+ connect VALUE (args ) VALUE (cKeyStoreParams ) VALUE (p_Unix_Parms ) NO-ERROR .
910937 END .
911938 END .
912939 if NUM-DBS > num then ASSIGN currentdb = LDBNAME (num + 1 ).
0 commit comments