Changeset 1028


Ignore:
Timestamp:
Jun 7, 2017, 3:14:10 PM (4 years ago)
Author:
Herwig Bauernfeind
Message:

SMBMon Add ACLS browser

Location:
trunk/guitools/smbmon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/guitools/smbmon/smbmon.rc

    r990 r1028  
    1515icon 52 .\rc\icons\share.ico
    1616icon 53 .\rc\icons\settings.ico
     17icon 80 .\rc\icons\PDF.ICO
     18icon 81 .\rc\icons\ooo_base_doc.ico
     19icon 82 .\rc\icons\ooo_calc_doc.ico
     20icon 83 .\rc\icons\ooo_draw_doc.ico
     21icon 84 .\rc\icons\ooo_impress_doc.ico
     22icon 85 .\rc\icons\ooo_math_doc.ico
     23icon 86 .\rc\icons\ooo_writer_doc.ico
     24icon 87 .\rc\icons\fw.ico
     25icon 88 .\rc\icons\image.ico
     26icon 89 .\rc\icons\movie.ico
     27icon 90 .\rc\icons\snd.ico
     28icon 91 .\rc\icons\wpi.ico
     29icon 92 .\rc\icons\zip.ico
     30icon 93 .\rc\icons\inf.ico
     31icon 94 .\rc\icons\txt.ico
    1732BITMAP 111 ..\shared\rc\throbber\frame_01.bmp
    1833BITMAP 112 ..\shared\rc\throbber\frame_02.bmp
  • trunk/guitools/smbmon/smbmon.vrp

    r991 r1028  
    66RunParameters:
    77RunDirectory: U:\Develop\Samba\trunk\guitools\smbmon
    8 VRXWindow: __VREMainWindow,1,2180,3614,1024,6769
    9 VRXWindow: __VRESectionListWindow,1,4252,9010,7372,7685
    10 VRXWindow: __VREToolsWindow,1,2156,1494,6992,1661
    11 VRXWindow: __VREWindListWindow,1,964,11708,5372,3150
     8VRXWindow: __VREMainWindow,1,2168,3614,1024,6769
     9VRXWindow: __VRESectionListWindow,1,3963,14213,10130,5059
     10VRXWindow: __VREToolsWindow,1,2879,1975,6989,1659
     11VRXWindow: __VREWindListWindow,1,952,11708,5372,3150
    1212UserFile: 1
    1313UserWindow: Main,1
    14 UserWindow: About,1
    15 UserWindow: SW_FILES,1
    1614UserWindow: SW_SETTINGS,1
     15UserWindow: SW_LOGIN,1
  • trunk/guitools/smbmon/smbmon.vrx

    r1024 r1028  
    107107__VXREXX____APPENDS__:
    108108/*
    109 #append U:\Develop\Samba\trunk\guitools\shared\inittempdir.vrs
    110 #append U:\Develop\Samba\trunk\guitools\shared\sambainit.vrs
    111 #append U:\Develop\Samba\trunk\guitools\shared\nlv.vrs
    112 #append U:\Develop\Samba\trunk\guitools\shared\smbtree.vrs
     109#append ..\shared\inittempdir.vrs
     110#append ..\shared\sambainit.vrs
     111#append ..\shared\nlv.vrs
     112#append ..\shared\smbtree.vrs
     113#append ..\shared\browse.VRS
     114#append ..\shared\usercredmem.vrs
     115#append ..\shared\rxrpclib.vrs
    113116*/
    114117return
     
    293296
    294297    /* SMBTree */
    295     WorkgroupFH = VRMethod( "CN_smbtree", "AddField", "String", NLVGetMessage(150)  )
    296     NBFH        = VRMethod( "CN_smbtree", "AddField", "String", "NetBIOS name" )
    297     IpFH        = VRMethod( "CN_smbtree", "AddField", "String",  NLVGetMessage(147)  )
    298     MBFH        = VRMethod( "CN_smbtree", "AddField", "String", "DMB/LMB" )   
    299     OSFH        = VRMethod( "CN_smbtree", "AddField", "String", "OS" )
     298    WorkgroupFH = VRMethod( "CN_SMBTREE", "AddField", "String", NLVGetMessage(150)  )
     299    NBFH        = VRMethod( "CN_SMBTREE", "AddField", "String", "NetBIOS name" )
     300    IpFH        = VRMethod( "CN_SMBTREE", "AddField", "String",  NLVGetMessage(147)  )
     301    MBFH        = VRMethod( "CN_SMBTREE", "AddField", "String", "DMB/LMB" )   
     302    OSFH        = VRMethod( "CN_SMBTREE", "AddField", "String", "OS" )
    300303 /* VersionFH   = VRMethod( "CN_SmbTree", "AddField", "String", "Version" ) */
    301     CommentFH   = VRMethod( "CN_smbtree", "AddField", "String", NLVGetMessage(151) )
    302     MacFH       = VRMethod( "CN_smbtree", "AddField", "String", "MAC" )
    303 
    304     ok = VRMethod("CN_smbtree","SetfieldAttr",IPFH,       "ReadOnly", 1)
    305     ok = VRMethod("CN_smbtree","SetfieldAttr",NBFH,       "ReadOnly", 1)
    306     ok = VRMethod("CN_smbtree","SetfieldAttr",MBFH,       "ReadOnly", 1)
    307     ok = VRMethod("CN_smbtree","SetfieldAttr",WorkGroupFH,"ReadOnly", 1)
    308     ok = VRMethod("CN_smbtree","SetfieldAttr",OSFH,       "ReadOnly", 1)
    309     ok = VRMethod("CN_smbtree","SetfieldAttr",MacFH,      "ReadOnly", 1)
     304    CommentFH   = VRMethod( "CN_SMBTREE", "AddField", "String", NLVGetMessage(151) )
     305    MacFH       = VRMethod( "CN_SMBTREE", "AddField", "String", "MAC" )
     306
     307    ok = VRMethod("CN_SMBTREE","SetfieldAttr",IPFH,       "ReadOnly", 1)
     308    ok = VRMethod("CN_SMBTREE","SetfieldAttr",NBFH,       "ReadOnly", 1)
     309    ok = VRMethod("CN_SMBTREE","SetfieldAttr",MBFH,       "ReadOnly", 1)
     310    ok = VRMethod("CN_SMBTREE","SetfieldAttr",WorkGroupFH,"ReadOnly", 1)
     311    ok = VRMethod("CN_SMBTREE","SetfieldAttr",OSFH,       "ReadOnly", 1)
     312    ok = VRMethod("CN_SMBTREE","SetfieldAttr",MacFH,      "ReadOnly", 1)
    310313
    311314    /* ChkTdb */
     
    330333    ok = VRSet( Container, "Sort", SortOrder )
    331334    ok = VRMethod( Container, "SortRecords" )
     335return
     336
     337/*:VRX         _ContextMenuSelectedSet
     338*/
     339_ContextMenuSelectedSet:
     340    ok = VRSet("ContextMenu_Tree_Tree",        "Visible", 0)
     341    ok = VRSet("ContextMenu_Tree_Details",     "Visible", 0)
     342    ok = VRSet("ContextMenu_Tree_Icons",       "Visible", 0)
     343    ok = VRSet("ContextMenu_Tree_Sort",        "Visible", 0)
     344    ok = VRSet("ContextMenu_Tree_MiniIcons",   "Visible", 0)
     345    ok = VRSet("ContextMenu_Tree_Login",       "Visible", 0)
     346    ok = VRSet("ContextMenu_Tree_ACLS",        "Visible", 0)
     347    ok = VRSet("ContextMenu_Tree_SendMsg",     "Visible", 0)
     348say SMBObj.udatatype
     349    select
     350        when SMBObj.udatatype = "WORKGROUP" then do
     351            ok = VRSet("ContextMenu_Tree_MiniIcons",   "Visible", 1)
     352        end
     353        when SMBObj.udatatype = "SERVER" then do
     354            ok = VRSet("ContextMenu_Tree_Login",       "Visible", 1)
     355            ok = VRSet("ContextMenu_Tree_SendMsg",     "Visible", 1)
     356        end
     357        when SMBObj.udatatype = "DISK" then do
     358            ok = VRSet("ContextMenu_Tree_MiniIcons",   "Visible", 1)
     359        end
     360        when SMBObj.udatatype = "PRINTER" then do
     361            ok = VRSet("ContextMenu_Tree_MiniIcons",   "Visible", 1)
     362        end
     363        when SMBObj.udatatype = "DIRECTORY" then do
     364            ok = VRSet("ContextMenu_Tree_ACLS",             "Visible", 1)
     365        end
     366        when SMBObj.udatatype = "FILE" then do
     367            ok = VRSet("ContextMenu_Tree_ACLS",             "Visible", 1)
     368        end
     369        otherwise do /* No other value known - default */
     370            ok = VRSet("ContextMenu_Tree_Tree",        "Visible", 1)
     371            ok = VRSet("ContextMenu_Tree_Details",     "Visible", 1)
     372            ok = VRSet("ContextMenu_Tree_Icons",       "Visible", 1)
     373            ok = VRSet("ContextMenu_Tree_Sort",        "Visible", 1)
     374        end
     375    end
    332376return
    333377
     
    439483    ok = VRSet("CN_Service",  "Font", Font.!Service)
    440484    ok = VRSet("CN_Daemons",  "Font", Font.!Daemons)
    441     ok = VRSet("CN_SMBTree",  "Font", Font.!SMBTree)
     485    ok = VRSet("CN_SMBTREE",  "Font", Font.!SMBTree)
    442486
    443487    CALL NLVSetText 'DT_Refresh',      'Caption',  25
     
    478522
    479523    ok = VRSet("CN_Daemons",      "View", DaemonView)
    480     ok = VRSet("CN_smbtree",      "View", TreeView)
     524    ok = VRSet("CN_SMBTREE",      "View", TreeView)
    481525    ok = VRSet("CB_NoMsgBox",     "Set",  NoMsgBox)
    482526    ok = VRSet("CB_WPSStartStop", "Set",  WPSStartStop)
     
    487531    call _INILayoutRead "CN_Service"
    488532    call _INILayoutRead "CN_Daemons"
    489     call _INILayoutRead "CN_smbtree"
     533    call _INILayoutRead "CN_SMBTREE"
    490534
    491535    ok = VRset("CN_DAEMONS", "MiniIcons", \advanced.!bigicons)
     
    600644    if options.!Debug then ok = VRRedirectStdIO("ON")
    601645                      else ok = VRRedirectStdIO("OFF")
     646    options.!storecreds = VRGetIni('Settings', 'StoreCreds', OurINI, 'NoClose')
     647say "options.!storecreds = "options.!storecreds
     648    IF options.!storecreds == '' then options.!storecreds = 1
     649say "options.!storecreds = "options.!storecreds
     650    IF _ucChkObj() = 0 then options.!storecreds = 0
     651say "options.!storecreds = "options.!storecreds
     652
    602653
    603654    advanced.!bigicons = VRGetIni( "Settings", "BigIcons", OurINI)
     
    613664    /* For Refresh tree display code */
    614665    RefreshMode =""
     666
     667    call _BrowseIconsInit
    615668
    616669    smbdpidhandle.0 = 0
     
    639692    ok = VRSetIni( "Settings", "CurrentPageNr",CurrentPageNr,                  OurINI,'NoClose')
    640693    ok = VRSetIni( "Settings", "DaemonView",   VRGet("CN_Daemons","View"),     OurINI,'NoClose')
    641     ok = VRSetIni( "Settings", "TreeView",     VRGet("CN_smbtree","View"),     OurINI,'NoClose')
     694    ok = VRSetIni( "Settings", "TreeView",     VRGet("CN_SMBTREE","View"),     OurINI,'NoClose')
    642695    ok = VRSetIni( "Settings", "NoMsgBox",     NoMsgBox,                       OurINI,'NoClose')
    643696    ok = VRSetIni( "Settings", "WPSStartStop", WPSStartStop,                   OurINI,'NoClose')
    644697    ok = VRSetIni( "Settings", "BigIcons",     \VRGet("CN_SMBTREE", "MiniIcons"),OurINI,'NoClose')
    645698    ok = VRSetIni( "Settings", "DetectZombies",DetectZombies,                  OurINI,'NoClose')
     699    call VRSetIni 'Settings', 'StoreCreds',    options.!storecreds  ,          OurINI, 'NoClose'
    646700
    647701    ok = VRSetIni( "Options",  "Debug",    options.!debug,             OurINI, 'NoClose' )     
     
    651705    call _INILayoutWrite "CN_Service"
    652706    call _INILayoutWrite "CN_Daemons"
    653     call _INILayoutWrite "CN_smbtree"
     707    call _INILayoutWrite "CN_SMBTREE"
    654708
    655709    if VRGet("CN_USERS",   "Font") <> "<default>" then ok = VRSet("SW_USERS",  "Font", VRGet("CN_USERS",  "Font"))
     
    13431397return
    13441398
     1399/*:VRX         _UserCredUpdate
     1400*/
     1401_UserCredUpdate:
     1402    if options.!debug == 1 then say time()' _UserCredUpdate started'
     1403    credentials.!username = VRGet("EF_USER1","Value")
     1404    credentials.!password = VRGet("EF_PASSWORD1","Value")
     1405
     1406    if pos("4OS2", value("COMSPEC",,"OS2ENVIRONMENT")) = 1 | pos(left(credentials.!password,1),'01234567890') > 0
     1407        then UserCred = '--user='Credentials.!username'%%'Credentials.!password
     1408        else UserCred = '--user='Credentials.!username'%'Credentials.!password
     1409
     1410    if options.!storecreds = 1 & \(UserCred   = 'USERCRED'   | UserCred = '' | UserCred = '--user=%' | UserCred = '--user=%%' | UserCred = '-N') then do
     1411        ok = _ucSetUc()
     1412/*      ok = VRSet("Pict_PWINMEM","PicturePath","#36") */
     1413        if options.!debug == 1 then call beep 2400, 10
     1414    end
     1415    else do
     1416        if options.!debug == 1 then call beep 200, 20
     1417/*      ok = VRSet("Pict_PWINMEM","PicturePath","#37") */
     1418    end
     1419    if options.!debug == 1 then say time()' _UserCredUpdate done'
     1420return
    13451421/*:VRX         About_Close
    13461422*/
     
    15431619return
    15441620
    1545 /*:VRX         CN_smbtree_Click
    1546 */
    1547 CN_smbtree_Click:
     1621/*:VRX         CN_SMBTREE_Click
     1622*/
     1623CN_SMBTREE_Click:
    15481624    rh = VRInfo('Record')
    15491625    if VRMethod( 'CN_SMBTREE', "ValidateRecord", rh) <> 1 then return
    1550     userdata = VRMethod('CN_smbtree', 'GetRecordAttr', rh, 'UserData')
     1626    userdata = VRMethod('CN_SMBTREE', 'GetRecordAttr', rh, 'UserData')
    15511627    parse var userdata . '|' userdata
    15521628    ok = VRset("Main","StatusText", userdata)
     
    15551631return
    15561632
    1557 /*:VRX         CN_smbtree_ContextMenu
    1558 */
    1559 CN_smbtree_ContextMenu:
    1560     if VRInfo("Top") < 400 & VRGet("CN_smbtree", "View") = "Detail" then call _ColumnsMenu "CN_smbtree"
     1633/*:VRX         CN_SMBTREE_ContextMenu
     1634*/
     1635CN_SMBTREE_ContextMenu:
     1636    if options.!debug == 1 then say time()' CN_SMBTREE_ContextMenu started'
     1637    if VRInfo("Top") < 400 & VRGet("CN_SMBTREE", "View") = "Detail" then call _ColumnsMenu "CN_SMBTREE"
    15611638    else do
     1639        call _dropdeprecated
    15621640        RH = VRInfo("Record")
    15631641        if RH <> "" then do
    1564             CurMachine = word(VRMethod( "CN_smbtree", "GetRecordAttr", RH, "Caption" ),1)
     1642            call _GetSmbObjectProperties RH
     1643            call _ContextMenuSelectedSet
     1644
     1645            BrowsePath = _browsebuildpath(SMBObj.rh)
     1646
     1647            /* call _BrowseResetObject(SmbObj.rh) */
     1648
     1649            parse var browsepath '\\'machine'\'sharename '\' browsepath
     1650
     1651            CurMachine = SMBObj.Resname
    15651652            ok = VRMethod( "Contextmenu_Tree", "Popup", , , "", "PositionOnItem" )
    15661653        end
    1567     end
    1568 return
    1569 
     1654        else do
     1655            call _ContextMenuSelectedSet
     1656        end
     1657    end
     1658    if options.!debug == 1 then say time()' CN_SMBTREE_ContextMenu done'
     1659return
     1660
     1661/*:VRX         CN_SMBTREE_DoubleClick
     1662*/
     1663CN_SMBTREE_DoubleClick:
     1664    if options.!debug == 1 then say time()' CN_SMBTREE_DoubleClick started'
     1665
     1666    call _dropdeprecated
     1667    call _GetSmbObjectProperties VRInfo('Record')
     1668
     1669/*  if options.!debug == 1 then say time()' CN_SMBTREE_DoubleClick done'
     1670return */
     1671    /* Enable last 2 lines for 2.0.x (to disable on the fly browsing) */
     1672
     1673    if options.!debug == 1 then say '  Browsing "'SMBObj.udatatype'"'
     1674
     1675    If SMBObj.udatatype = "DIRECTORY" then do
     1676        BrowsePath = _browsebuildpath(SMBObj.rh)
     1677
     1678        call _BrowseResetObject(SmbObj.rh)
     1679
     1680        parse var browsepath '\\'machine'\'sharename '\' browsepath
     1681        browsepath = browsepath'\*'
     1682
     1683        call _BrowseDirectory
     1684    end
     1685
     1686    If SMBObj.udatatype = "FILE" then do
     1687        BrowsePath = _browsebuildpath(SMBObj.rh)
     1688        call _BrowseResetObject(SmbObj.rh)
     1689
     1690        parse var browsepath '\\'machine'\'sharename '\' browsepath
     1691
     1692        OpenOk = _browseobjectopen(machine,sharename,browsepath)
     1693
     1694        if \OpenOK then do
     1695            say "  Not connected - trying to connect"
     1696            ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", sharerh, "Selected", 1)
     1697            call PB_SMBTREE_CONNECT_Click
     1698            ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", SMBObj.rh, "Selected", 1)
     1699
     1700            OpenOk = _browseobjectopen(machine,sharename,browsepath)
     1701
     1702            if \OpenOk then do
     1703                say "  Not connected - cannot open - aborting!"
     1704            end
     1705        end
     1706    end
     1707
     1708    if SMBObj.udatatype = "DISK" then do
     1709        machine  = VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.parentrh,"Caption")
     1710        parse var machine machine '0D0A'x .
     1711        machine = strip(machine)
     1712
     1713        call _BrowseResetObject(SmbObj.rh)
     1714
     1715        sharename = SMBObj.resname
     1716        BrowsePath = ""
     1717
     1718        call _BrowseDirectory
     1719    end
     1720    if options.!debug == 1 then say time()' CN_SMBTREE_DoubleClick done'
     1721return
    15701722/*:VRX         CN_Users_ContextMenu
    15711723*/
     
    17821934return
    17831935
     1936/*:VRX         ContextMenu_Tree_ACLS_Click
     1937*/
     1938ContextMenu_Tree_ACLS_Click:
     1939    if options.!debug == 1 then say '  List ACLS for  "'SMBObj.udatatype'"'
     1940    window = VRLoadSecondary( "SW_ACLS", "W" )
     1941return
     1942
    17841943/*:VRX         ContextMenu_Tree_Details_Click
    17851944*/
    17861945ContextMenu_Tree_Details_Click:
    1787     ok = VRset("CN_smbtree","View","Detail")
     1946    ok = VRset("CN_SMBTREE","View","Detail")
    17881947    ok = VRset("ContextMenu_Tree_Tree","Enabled",1)
    17891948    ok = VRset("ContextMenu_Tree_Details","Enabled",0)
     
    17971956*/
    17981957ContextMenu_Tree_Icons_Click:
    1799     ok = VRset("CN_smbtree","View","Icon")
     1958    ok = VRset("CN_SMBTREE","View","Icon")
    18001959    ok = VRset("ContextMenu_Tree_Icons","Enabled",0)
    18011960    ok = VRset("ContextMenu_Tree_Tree","Enabled",1)
     
    18061965return
    18071966
     1967/*:VRX         ContextMenu_Tree_LOGIN_Click
     1968*/
     1969ContextMenu_Tree_LOGIN_Click:
     1970    window = VRLoadSecondary( "SW_LOGIN", "W" )
     1971
     1972    /* call _UserCredUpdate */
     1973
     1974return
     1975
    18081976/*:VRX         ContextMenu_Tree_MiniIcons_Click
    18091977*/
     
    18311999*/
    18322000ContextMenu_Tree_Tree_Click:
    1833     ok = VRset("CN_smbtree","View","IconTree")
     2001    ok = VRset("CN_SMBTREE","View","IconTree")
    18342002    ok = VRset("ContextMenu_Tree_Tree","Enabled",0)
    18352003    ok = VRset("ContextMenu_Tree_Details","Enabled",1)
     
    20072175
    20082176    ok = VRSet("PB_Refresh","left",pbtn_pos + pbtn_dist * (pbtn_nr - 5))
    2009     ok = VRSet("PB_Help",   "left",pbtn_pos + pbtn_dist * (pbtn_nr - 4))
    2010     ok = VRSet("PB_About",  "left",pbtn_pos + pbtn_dist * (pbtn_nr - 3))
    2011     ok = VRSet("PB_Apply",  "left",pbtn_pos + pbtn_dist * (pbtn_nr - 2))
     2177    ok = VRSet("PB_Apply",  "left",pbtn_pos + pbtn_dist * (pbtn_nr - 4))
     2178    ok = VRSet("PB_Help",   "left",pbtn_pos + pbtn_dist * (pbtn_nr - 3))
     2179    ok = VRSet("PB_About",  "left",pbtn_pos + pbtn_dist * (pbtn_nr - 2))
    20122180    ok = VRSet("PB_Cancel", "left",pbtn_pos + pbtn_dist * (pbtn_nr - 1))
    20132181
     
    21862354return
    21872355
     2356/*:VRX         PB_ACLS_OK_Click
     2357*/
     2358PB_ACLS_OK_Click:
     2359    call SW_ACLS_close
     2360return
     2361
    21882362/*:VRX         PB_Apply_Click
    21892363*/
     
    22062380    say 'DetectZombies = "'DetectZombies'"'
    22072381
     2382    options.!storecreds = VRGet("CB_STORECREDS","Set")
     2383    say "options.!storecreds = "options.!storecreds
     2384
    22082385    if advanced.!smbconfchanged = 1 then do
    22092386        log_level    = VRGet("SPIN_log_level","Value")
     
    22582435PB_Help_Click:
    22592436    ok = VRMethod("Main", "InvokeHelp" )
     2437return
     2438
     2439/*:VRX         PB_LOGIN_CANCEL_Click
     2440*/
     2441PB_LOGIN_CANCEL_Click:
     2442    credentials.!entered = 0
     2443    call SW_LOGIN_Close
     2444return
     2445
     2446/*:VRX         PB_LOGIN_OK_Click
     2447*/
     2448PB_LOGIN_OK_Click:
     2449/*  ok = VRSet("EF_USER","Value",VRGet("EF_USER1","Value"))
     2450    ok = VRSet("EF_PASSWORD","Value",VRGet("EF_PASSWORD1","Value")) */
     2451    options.!storecreds = VRGet("CB_STORECREDS1","Set")
     2452    credentials.!entered = 1
     2453    p_server = SMBObj.resname
     2454    if p_server <> "" then do
     2455        ok = _rpcqueryuser(p_server, VRGet("EF_USER1","Value"), VRGet("EF_PASSWORD1","Value"), VRGet("EF_USER1","Value"))
     2456
     2457        if word(ok,1) = "1" then do
     2458            call _StatusBarWrapper NLVGetMessage(107, rpc.queryuser.FULL_NAME)
     2459            say 'rpc.queryuser.DIR_DRIVE    = "'rpc.queryuser.DIR_DRIVE'"'
     2460            say 'rpc.queryuser.LOGON_SCRIPT = "'rpc.queryuser.LOGON_SCRIPT'"'
     2461            call _UserCredUpdate
     2462        end
     2463        else do
     2464            call _StatusBarWrapper VRGet("EF_USER1","Value")" \\"p_server": "rpc.queryuser.LOGONSTATUS
     2465        end
     2466    end
     2467
     2468    call SW_LOGIN_Close
    22602469return
    22612470
     
    24612670return
    24622671
     2672/*:VRX         SW_ACLS_Close
     2673*/
     2674SW_ACLS_Close:
     2675    call SW_ACLS_Fini
     2676return
     2677
     2678/*:VRX         SW_ACLS_Create
     2679*/
     2680SW_ACLS_Create:
     2681    call SW_ACLS_Init
     2682
     2683    ok = VRSet("SW_ACLS","Caption",'ACLS \\'machine'\'sharename' "'browsepath'"')
     2684
     2685    ACL.typeFH  = VRMethod( "CN_ACLS", "AddField", "String", "Type" )
     2686    ACL.valueFH = VRMethod( "CN_ACLS", "AddField", "String", "Value" )
     2687
     2688    /* Make sure credentials are usable */
     2689    if UserCred   = 'USERCRED'   | UserCred = '' | UserCred = '--user=%' then UserCred = '-N'
     2690
     2691    /* We have to remove the double % for smbclient.exe - not entirely clear why */
     2692    OldUserCred = ""
     2693    if pos('%%',UserCred) > 0 & pos("4OS2", value("COMSPEC",,"OS2ENVIRONMENT")) = 0  then do
     2694        OldUserCred = UserCred
     2695        parse var UserCred '--user='username'%%'password
     2696        UserCred = '--user='username'%'password
     2697        say "  Strip double %%!!!"
     2698    end
     2699
     2700    say '  'samba.!smbcaclsexe' \\'machine'\'sharename' "'browsepath'" 'UserCred
     2701    address cmd samba.!smbcaclsexe' \\'machine'\'sharename' "'browsepath'" 'UserCred' 'debuglevel' 2>'samba.!error' 1>'samba.!msg
     2702
     2703    ok = file2stem(samba.!error,"aclserror.","DEL")
     2704
     2705    if aclserror.0 = 0 then do
     2706        call _StatusBarWrapper "NT_STATUS_OK"
     2707
     2708        ok = file2stem(samba.!msg,"aclsmsg.","DEL")     
     2709        do I = 1 to aclsmsg.0
     2710            parse var aclsmsg.I aclstype':'aclsvalue
     2711            DummyRH = VRMethod('CN_ACLS', 'AddRecord')
     2712            ok = VRMethod("CN_ACLS", "SetFieldData", DummyRH, ACL.typeFH, aclstype, ACL.valueFH, aclsvalue)
     2713        end
     2714    end
     2715    else do
     2716        call _StatusBarWrapper aclserror.1
     2717        call SW_ACLS_close
     2718    end
     2719return
     2720/*:VRX         SW_ACLS_Fini
     2721*/
     2722SW_ACLS_Fini:
     2723    window = VRInfo( "Window" )
     2724    call VRDestroy window
     2725    drop window
     2726return
     2727/*:VRX         SW_ACLS_Init
     2728*/
     2729SW_ACLS_Init:
     2730    window = VRInfo( "Object" )
     2731    if( \VRIsChildOf( window, "Notebook" ) ) then do
     2732        call VRMethod window, "CenterWindow"
     2733        call VRSet window, "Visible", 1
     2734        call VRMethod window, "Activate"
     2735    end
     2736    drop window
     2737return
     2738
    24632739/*:VRX         SW_CHKTDB_Close
    24642740*/
     
    25472823    window = VRInfo( "Object" )
    25482824    if( \VRIsChildOf( window, "TDL" ) ) then do
     2825        call VRMethod window, "CenterWindow"
     2826        call VRSet window, "Visible", 1
     2827        call VRMethod window, "Activate"
     2828    end
     2829    drop window
     2830return
     2831
     2832/*:VRX         SW_LOGIN_Close
     2833*/
     2834SW_LOGIN_Close:
     2835    call SW_LOGIN_Fini
     2836return
     2837
     2838/*:VRX         SW_LOGIN_Create
     2839*/
     2840SW_LOGIN_Create:
     2841    call SW_LOGIN_Init
     2842/*  ok = VRSet("SW_LOGIN","Caption",NLVGetMessage(136)' 'strip(p_workgroup' \\'p_server'\'p_share,'T','\'))
     2843    CALL NLVSetText 'DT_USER1',       "Caption", 25
     2844    CALL NLVSetText 'DT_PASSWORD1',   "Caption", 26
     2845    CALL NLVSetText 'CB_STORECREDS1', "Caption", 135
     2846    CALL NLVSetText 'PB_LOGIN_OK',    "Caption", 2
     2847    CALL NLVSetText 'PB_LOGIN_CANCEL',"Caption", 3 */
     2848
     2849    if VRIsValidObject(SMBObj.rh) then do
     2850        select
     2851            when pos("PDC",VRMethod("CN_smbtree", "GetFieldData", SMBObj.rh, MBFH)) > 0 then LoginIcon = "#63:PMWP.DLL" /* icons.!pdc */
     2852            when SMBObj.udatatype = "WORKGROUP" then LoginIcon = SMBObj.Icon
     2853            when SMBObj.udatatype = "SERVER"    then LoginIcon = SMBObj.Icon
     2854            when SMBObj.udatatype = "DISK"      then do
     2855                if pos("PDC",VRMethod("CN_smbtree", "GetFieldData", SMBObj.parentrh, MBFH)) > 0
     2856                    then LoginIcon = "#63:PMWP.DLL" /* icons.!pdc */
     2857                    else LoginIcon = "#35:PMWP.DLL" /* icons.!pdc */
     2858            end
     2859            otherwise LoginIcon = "#35:PMWP.DLL" /* icons.!machine_awake */
     2860        end
     2861        say loginicon
     2862        ok = VRSet("Pict_Login","PicturePath", LoginIcon)
     2863    end
     2864/*  ok = VRSet("EF_USER1","Value",VRGet("EF_USER","Value"))
     2865    ok = VRSet("EF_PASSWORD1","Value",VRGet("EF_PASSWORD","Value")) */
     2866say options.!storecreds
     2867    ok = VRSet("CB_STORECREDS1","Set",options.!storecreds)
     2868return
     2869
     2870/*:VRX         SW_LOGIN_Fini
     2871*/
     2872SW_LOGIN_Fini:
     2873    window = VRInfo( "Window" )
     2874    call VRDestroy window
     2875    drop window
     2876return
     2877/*:VRX         SW_LOGIN_Init
     2878*/
     2879SW_LOGIN_Init:
     2880    window = VRInfo( "Object" )
     2881    if( \VRIsChildOf( window, "Notebook" ) ) then do
    25492882        call VRMethod window, "CenterWindow"
    25502883        call VRSet window, "Visible", 1
     
    27713104        when page = 2 then do /* smbtree */
    27723105            ok = VRSet("Main","WindowIcon","$1")
    2773             ok = VRMethod( "CN_SMBTree", "GetRecordList", "All", "handle." )
     3106            ok = VRMethod( "CN_SMBTREE", "GetRecordList", "All", "handle." )
    27743107            /* if the page is empty, populate it */
    27753108            if handle.0 = 0 then call PB_Refresh_Click
     
    28243157        otherwise say "RefreshMode = "RefreshMode
    28253158    end
     3159return
     3160
     3161/*:VRX         TM_STATUSBAR_Trigger
     3162*/
     3163TM_STATUSBAR_Trigger:
     3164    call _StatusBarReset
    28263165return
    28273166
Note: See TracChangeset for help on using the changeset viewer.