Ignore:
Timestamp:
Sep 22, 2009, 4:17:24 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

GUI-Tools: Fix problem in smbusers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/guitools-1.0/smbusers/smbusers.VRX

    r305 r333  
    642642
    643643EnterCredentials:
    644     if Credentials.!username = "" | Credentials.!password = "" then window = VRLoadSecondary( "Credentials", "W" )
     644    if Credentials.!username = "" | Credentials.!password = "" then window = VRLoadSecondary( "SW_LOGIN", "W" )
    645645
    646646    if pos("4OS2", value("COMSPEC",,"OS2ENVIRONMENT")) = 0
     
    12351235                call _ShowMsg
    12361236            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 */
    12381239                parse var sline.i name':'.
    12391240                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.. */
    12411246                i = i - 1
    12421247            end
     
    25632568return
    25642569
    2565 /*:VRX         Credentials_Close
    2566 */
    2567 Credentials_Close:
    2568     call Credentials_Fini
    2569 return
    2570 
    2571 /*:VRX         Credentials_Create
    2572 */
    2573 Credentials_Create:
    2574     call Credentials_Init
    2575     CALL NLVSetText 'Credentials',     'Caption', 31
    2576     CALL NLVSetText 'DT_LoginUser',    'Caption', 32
    2577     CALL NLVSetText 'DT_LoginPassword','Caption', 33
    2578     CALL NLVSetText 'PB_LoginOK',      'Caption', 2
    2579     CALL NLVSetText 'PB_LoginAbort',   'Caption', 3
    2580 
    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 do
    2586         Msg.Title =VRGet("Main", "caption")
    2587         Msg.Type = "E"
    2588         Msg.Text = NLVGetMessage(111, VRGet("EF_LoginUser","Value"))
    2589         call _ShowMsg
    2590         ok = VRSet("EF_LoginUser","Value","root")
    2591     end
    2592 
    2593     if VRGet("EF_LoginUser","Value") <> "" then ok = VRMethod("EF_LoginPassword","Setfocus")
    2594 return
    2595 
    2596 /*:VRX         Credentials_Fini
    2597 */
    2598 Credentials_Fini:
    2599     window = VRInfo( "Window" )
    2600     call VRDestroy window
    2601     drop window
    2602 return
    2603 /*:VRX         Credentials_Init
    2604 */
    2605 Credentials_Init:
    2606     window = VRInfo( "Object" )
    2607     if( \VRIsChildOf( window, "Notebook" ) ) then do
    2608         call VRMethod window, "CenterWindow"
    2609         call VRSet window, "Visible", 1
    2610         call VRMethod window, "Activate"
    2611     end
    2612     drop window
    2613 return
    2614 
    26152570/*:VRX         DDCB_GID_Change
    26162571*/
     
    26972652/*  say keystr */
    26982653    select
    2699         when keystr = "{Enter}" then call PB_LoginOK_Click
    2700         when keystr = "{Newline}" then call PB_LoginOK_Click
    2701         when keystr  = "{Esc}" then call PB_LoginAbort_Click
     2654        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
    27022657        otherwise nop
    27032658    end
     
    27132668        when keystr = "{Enter}" then ok = VRMethod( "EF_LoginPassword", "SetFocus" )
    27142669        when keystr = "{Newline}" then ok = VRMethod( "EF_LoginPassword", "SetFocus" )
    2715         when keystr  = "{Esc}" then call PB_LoginAbort_Click
     2670        when keystr  = "{Esc}" then call PB_LOGIN_CANCEL_Click
    27162671        otherwise nop
    27172672    end
     
    34373392    end
    34383393
    3439     if length(VRGet("EF_password","Value")) < MinPWLength then do
     3394    if length(VRGet("EF_password","Value")) < MinPWLength & \(VRGet("CB_NoPassword","Set") | VRGet("CB_MachineAccount","Set")) then do
    34403395        Msg.type  = "E"
    34413396        Msg.Text  = NLVGetMessage( 117 )
     
    36583613return
    36593614
    3660 /*:VRX         PB_LoginAbort_Click
    3661 */
    3662 PB_LoginAbort_Click:
     3615/*:VRX         PB_LOGIN_CANCEL_Click
     3616*/
     3617PB_LOGIN_CANCEL_Click:
    36633618    say "  Login Abort"
    3664     call Credentials_Close
     3619    call SW_LOGIN_Close
    36653620    exit 0
    36663621return
    36673622
    3668 /*:VRX         PB_LoginOK_Click
    3669 */
    3670 PB_LoginOK_Click:
    3671     IF options.!debug == 1 THEN say "  Credentials OK started"
     3623/*:VRX         PB_LOGIN_OK_Click
     3624*/
     3625PB_LOGIN_OK_Click:
     3626    IF options.!debug == 1 THEN say "  SW_LOGIN OK started"
    36723627    Credentials.!Username = VRGet("EF_LoginUser","Value")
    36733628    Credentials.!Password = VRGet("EF_LoginPassword","Value")
     
    36773632        else UserCred = '--user='Credentials.!username'%%'Credentials.!password
    36783633
    3679     Call Credentials_Close
    3680     IF options.!debug == 1 THEN say "  Credentials OK done"
     3634    Call SW_LOGIN_Close
     3635    IF options.!debug == 1 THEN say "  SW_LOGIN OK done"
    36813636return
    36823637
     
    39053860return
    39063861
     3862/*:VRX         SW_LOGIN_Close
     3863*/
     3864SW_LOGIN_Close:
     3865    call SW_LOGIN_Fini
     3866return
     3867
     3868/*:VRX         SW_LOGIN_Create
     3869*/
     3870SW_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")
     3891return
     3892
     3893/*:VRX         SW_LOGIN_Fini
     3894*/
     3895SW_LOGIN_Fini:
     3896    window = VRInfo( "Window" )
     3897    call VRDestroy window
     3898    drop window
     3899return
     3900/*:VRX         SW_LOGIN_Init
     3901*/
     3902SW_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
     3910return
     3911
    39073912/*:VRX         TAB_1_Click
    39083913*/
Note: See TracChangeset for help on using the changeset viewer.