Changeset 333 for branches/guitools-1.0/smbusers/smbusers.VRX
- Timestamp:
- Sep 22, 2009, 4:17:24 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/guitools-1.0/smbusers/smbusers.VRX
r305 r333 642 642 643 643 EnterCredentials: 644 if Credentials.!username = "" | Credentials.!password = "" then window = VRLoadSecondary( " Credentials", "W" )644 if Credentials.!username = "" | Credentials.!password = "" then window = VRLoadSecondary( "SW_LOGIN", "W" ) 645 645 646 646 if pos("4OS2", value("COMSPEC",,"OS2ENVIRONMENT")) = 0 … … 1235 1235 call _ShowMsg 1236 1236 end 1237 otherwise do 1237 when pos(':[',translate(sline.i)) > 0 & pos(']:LCT-',translate(sline.i)) > 0 then do 1238 /* we guess a valid smbdpasswd user entry here */ 1238 1239 parse var sline.i name':'. 1239 1240 sname.i = translate(name) 1240 if sname.i = '' then 1241 /* still something wrong - we got no name, trash this line */ 1242 if sname.i = '' then i = i - 1 1243 end 1244 otherwise do 1245 /* if we did not find a valid line in the previous check this line is garbage, likely debug output.. */ 1241 1246 i = i - 1 1242 1247 end … … 2563 2568 return 2564 2569 2565 /*:VRX Credentials_Close2566 */2567 Credentials_Close:2568 call Credentials_Fini2569 return2570 2571 /*:VRX Credentials_Create2572 */2573 Credentials_Create:2574 call Credentials_Init2575 CALL NLVSetText 'Credentials', 'Caption', 312576 CALL NLVSetText 'DT_LoginUser', 'Caption', 322577 CALL NLVSetText 'DT_LoginPassword','Caption', 332578 CALL NLVSetText 'PB_LoginOK', 'Caption', 22579 CALL NLVSetText 'PB_LoginAbort', 'Caption', 32580 2581 if Credentials.!Username = ""2582 then ok = VRSet("EF_LoginUser","Value", value("USER",,"OS2ENVIRONMENT"))2583 else ok = VRSet("EF_LoginUser","Value", Credentials.!Username)2584 2585 if \_UserIsValid(VRGet("EF_LoginUser","Value")) & value("USER",,"OS2ENVIRONMENT") <> "" then do2586 Msg.Title =VRGet("Main", "caption")2587 Msg.Type = "E"2588 Msg.Text = NLVGetMessage(111, VRGet("EF_LoginUser","Value"))2589 call _ShowMsg2590 ok = VRSet("EF_LoginUser","Value","root")2591 end2592 2593 if VRGet("EF_LoginUser","Value") <> "" then ok = VRMethod("EF_LoginPassword","Setfocus")2594 return2595 2596 /*:VRX Credentials_Fini2597 */2598 Credentials_Fini:2599 window = VRInfo( "Window" )2600 call VRDestroy window2601 drop window2602 return2603 /*:VRX Credentials_Init2604 */2605 Credentials_Init:2606 window = VRInfo( "Object" )2607 if( \VRIsChildOf( window, "Notebook" ) ) then do2608 call VRMethod window, "CenterWindow"2609 call VRSet window, "Visible", 12610 call VRMethod window, "Activate"2611 end2612 drop window2613 return2614 2615 2570 /*:VRX DDCB_GID_Change 2616 2571 */ … … 2697 2652 /* say keystr */ 2698 2653 select 2699 when keystr = "{Enter}" then call PB_L oginOK_Click2700 when keystr = "{Newline}" then call PB_L oginOK_Click2701 when keystr = "{Esc}" then call PB_L oginAbort_Click2654 when keystr = "{Enter}" then call PB_LOGIN_OK_Click 2655 when keystr = "{Newline}" then call PB_LOGIN_OK_Click 2656 when keystr = "{Esc}" then call PB_LOGIN_CANCEL_Click 2702 2657 otherwise nop 2703 2658 end … … 2713 2668 when keystr = "{Enter}" then ok = VRMethod( "EF_LoginPassword", "SetFocus" ) 2714 2669 when keystr = "{Newline}" then ok = VRMethod( "EF_LoginPassword", "SetFocus" ) 2715 when keystr = "{Esc}" then call PB_L oginAbort_Click2670 when keystr = "{Esc}" then call PB_LOGIN_CANCEL_Click 2716 2671 otherwise nop 2717 2672 end … … 3437 3392 end 3438 3393 3439 if length(VRGet("EF_password","Value")) < MinPWLength then do3394 if length(VRGet("EF_password","Value")) < MinPWLength & \(VRGet("CB_NoPassword","Set") | VRGet("CB_MachineAccount","Set")) then do 3440 3395 Msg.type = "E" 3441 3396 Msg.Text = NLVGetMessage( 117 ) … … 3658 3613 return 3659 3614 3660 /*:VRX PB_L oginAbort_Click3661 */ 3662 PB_L oginAbort_Click:3615 /*:VRX PB_LOGIN_CANCEL_Click 3616 */ 3617 PB_LOGIN_CANCEL_Click: 3663 3618 say " Login Abort" 3664 call Credentials_Close3619 call SW_LOGIN_Close 3665 3620 exit 0 3666 3621 return 3667 3622 3668 /*:VRX PB_L oginOK_Click3669 */ 3670 PB_L oginOK_Click:3671 IF options.!debug == 1 THEN say " CredentialsOK started"3623 /*:VRX PB_LOGIN_OK_Click 3624 */ 3625 PB_LOGIN_OK_Click: 3626 IF options.!debug == 1 THEN say " SW_LOGIN OK started" 3672 3627 Credentials.!Username = VRGet("EF_LoginUser","Value") 3673 3628 Credentials.!Password = VRGet("EF_LoginPassword","Value") … … 3677 3632 else UserCred = '--user='Credentials.!username'%%'Credentials.!password 3678 3633 3679 Call Credentials_Close3680 IF options.!debug == 1 THEN say " CredentialsOK done"3634 Call SW_LOGIN_Close 3635 IF options.!debug == 1 THEN say " SW_LOGIN OK done" 3681 3636 return 3682 3637 … … 3905 3860 return 3906 3861 3862 /*:VRX SW_LOGIN_Close 3863 */ 3864 SW_LOGIN_Close: 3865 call SW_LOGIN_Fini 3866 return 3867 3868 /*:VRX SW_LOGIN_Create 3869 */ 3870 SW_LOGIN_Create: 3871 call SW_LOGIN_Init 3872 CALL NLVSetText 'SW_LOGIN', 'Caption', 31 3873 CALL NLVSetText 'DT_LoginUser', 'Caption', 32 3874 CALL NLVSetText 'DT_LoginPassword','Caption', 33 3875 CALL NLVSetText 'PB_LOGIN_OK', 'Caption', 2 3876 CALL NLVSetText 'PB_LOGIN_CANCEL', 'Caption', 3 3877 3878 if Credentials.!Username = "" 3879 then ok = VRSet("EF_LoginUser","Value", value("USER",,"OS2ENVIRONMENT")) 3880 else ok = VRSet("EF_LoginUser","Value", Credentials.!Username) 3881 3882 if \_UserIsValid(VRGet("EF_LoginUser","Value")) & value("USER",,"OS2ENVIRONMENT") <> "" then do 3883 Msg.Title =VRGet("Main", "caption") 3884 Msg.Type = "E" 3885 Msg.Text = NLVGetMessage(111, VRGet("EF_LoginUser","Value")) 3886 call _ShowMsg 3887 ok = VRSet("EF_LoginUser","Value","root") 3888 end 3889 3890 if VRGet("EF_LoginUser","Value") <> "" then ok = VRMethod("EF_LoginPassword","Setfocus") 3891 return 3892 3893 /*:VRX SW_LOGIN_Fini 3894 */ 3895 SW_LOGIN_Fini: 3896 window = VRInfo( "Window" ) 3897 call VRDestroy window 3898 drop window 3899 return 3900 /*:VRX SW_LOGIN_Init 3901 */ 3902 SW_LOGIN_Init: 3903 window = VRInfo( "Object" ) 3904 if( \VRIsChildOf( window, "Notebook" ) ) then do 3905 call VRMethod window, "CenterWindow" 3906 call VRSet window, "Visible", 1 3907 call VRMethod window, "Activate" 3908 end 3909 drop window 3910 return 3911 3907 3912 /*:VRX TAB_1_Click 3908 3913 */
Note:
See TracChangeset
for help on using the changeset viewer.