home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / bnddmp10.zip / BINDDUMP.MNU < prev    next >
Text File  |  1992-12-14  |  5KB  |  180 lines

  1. Comment
  2. ==========================================================
  3.  
  4. Copyright 1992 by Marc Perkel * All right reserved.
  5.  
  6. This utility will dump the contents of the NetWare bindery to a
  7. file or printer.
  8.  
  9. USAGE: BINDDUMP <file>
  10.  
  11. Example:
  12.   BINDDUMP BINDARY.TXT   ;output to file
  13.   BINDDUMP PRN           ;to print bindary
  14.  
  15. Price $50 per customer. Unlimited Servers.
  16. Written in MarxMenu. Comes free with the Network Survival Kit.
  17.  
  18. =========================================================
  19. EndComment
  20.  
  21.  
  22. Var
  23.   Objects
  24.   Obj
  25.   Prop
  26.   Ty
  27.   Values
  28.   ObjStatic
  29.   PropType
  30.   PropStatic
  31.   TypeName
  32.   TypeNumber
  33.  
  34. Qualifier
  35.   ObjName
  36.   ObjType
  37.  
  38.  
  39. OutFile = ParamStr(2)
  40.  
  41. StandardIO
  42.  
  43. if OutFile = ''
  44.    Writeln
  45.    Writeln 'Computer Tyme BindDump * Copyright 1992 by Marc Perkel'
  46.    Writeln 'All Rights Reserved * Version 1.1 * Release Date: 05-20-92'
  47.    Writeln
  48.    Writeln 'Computer Tyme * 411 North Sherman, Suite 300 * Springfield Mo. 65802'
  49.    Writeln '(800) 548-5353 Sales * (417) 866-1222 Voice * (417) 866-1665 Data'
  50.    Writeln
  51.    Writeln 'This utility will dump the contents of the NetWare bindery to a'
  52.    Writeln 'file or printer.'
  53.    Writeln
  54.    Writeln 'USAGE: BINDDUMP <file>
  55.    Writeln
  56.    Writeln 'Example:'
  57.    Writeln '  BINDDUMP BINDARY.TXT   ;output to file
  58.    Writeln '  BINDDUMP PRN           ;to print bindary
  59.    Writeln
  60.    Writeln 'Price $50 per Server.'
  61.    Writeln 'Written in MarxMenu. Comes free with the Network Survival Kit.'
  62.    exitmenu
  63. endif
  64.  
  65. NovObjects (Objects)
  66.  
  67. SetTypeNames
  68.  
  69. Main
  70.  
  71. ;=============================================
  72.  
  73. ;----- Subroutines
  74.  
  75. Procedure Main
  76. var St ObjSecurity PropSecurity
  77.    Loop Objects
  78.       Obj = Objects[LoopIndex].ObjName
  79.       Ty = Objects[LoopIndex].ObjType
  80.       WriteError 'Processing ' Obj ' ' ObjType(Ty) ' ... '
  81.       ObjSecurity = NovObjectSecurity (Obj,Ty)
  82.       if NovStaticObject (Obj, Ty)
  83.          ObjStatic = 'Static      '
  84.       else
  85.          ObjStatic = 'Dynamic     '
  86.       endif
  87.       Write PadRight(Obj,31) 'Type: ' PadRight(ObjType(Ty),10)
  88.       Write ' Write: ' ObjSecurity / 16 '  Read: ' ObjSecurity and 15
  89.       Writeln '  ' ObjStatic
  90.       Writeln
  91.       NovScanProperties (Prop,Obj,Ty)
  92.       Loop Prop
  93.          PropSecurity = NovPropertySecurity (Obj,Prop[LoopIndex],Ty)
  94.          if NovSetProperty (Obj, Prop[LoopIndex],Ty)
  95.             PropType = 'SET       '
  96.          else
  97.             PropType = 'ITEM      '
  98.          endif
  99.          if NovStaticProperty (Obj, Prop[LoopIndex],Ty)
  100.             PropStatic = 'Static      '
  101.          else
  102.             PropStatic = 'Dynamic     '
  103.          endif
  104.          Write PadRight('   ' + Prop[LoopIndex],31) 'Type: ' PropType
  105.          Write ' Write: ' PropSecurity / 16 '  Read: ' PropSecurity and 15
  106.          Writeln '  ' PropStatic
  107.          Writeln
  108.          if NovSetProperty (Obj, Prop[LoopIndex],Ty)
  109.             NovPropertyValues(Values,Obj,Prop[LoopIndex],Ty)
  110.             Loop Values
  111.                Writeln '      ' Values[LoopIndex]
  112.             EndLoop
  113.          else
  114.             NovPropertyValues(Values,Obj,Prop[LoopIndex],Ty)
  115.             Loop Values
  116.                DumpString(Values[LoopIndex])
  117.                if LoopIndex < NumberOfElements(Values) then Writeln
  118.             EndLoop
  119.          endif
  120.          Writeln
  121.       EndLoop
  122.       Writeln
  123.       WritelnError
  124.    EndLoop
  125. EndProc
  126.  
  127.  
  128. ;----- Known Object Types
  129.  
  130. Procedure SetTypeNames
  131.    AppendArray(TypeName,'user')
  132.    AppendArray(TypeName,'group')
  133.    AppendArray(TypeName,'queue')
  134.    AppendArray(TypeName,'server')
  135.    AppendArray(TypeName,'job serv')
  136.    AppendArray(TypeName,'gateway')
  137.    AppendArray(TypeName,'prn serv')
  138.  
  139.    AppendArray(TypeNumber,'1')
  140.    AppendArray(TypeNumber,'2')
  141.    AppendArray(TypeNumber,'3')
  142.    AppendArray(TypeNumber,'4')
  143.    AppendArray(TypeNumber,'5')
  144.    AppendArray(TypeNumber,'6')
  145.    AppendArray(TypeNumber,'7')
  146. EndProc
  147.  
  148.  
  149. Procedure ObjType (Ty)
  150. var P St
  151.    Ty = Str(Ty)
  152.    P = PosInList(Ty,TypeNumber)
  153.    if P > 0
  154.       St = TypeName[P]
  155.    else
  156.       St = Ty
  157.    endif
  158.    Return '(' + St + ')'
  159. EndProc
  160.  
  161.  
  162. Procedure DumpString (St)
  163. var X St2 Ch
  164.    Loop 8
  165.       Write '      '
  166.       St2 = ''
  167.       Loop 16
  168.          X = X + 1
  169.          Ch = Mid(St,X,1)
  170.          Write HexString(ord(Ch),2) ' '
  171.          if (Ch >= ' ') and (Ch <= '~')
  172.             St2 = St2 + Ch
  173.          else
  174.             St2 = St2 + '.'
  175.          endif
  176.       endloop
  177.       Writeln '   ' St2
  178.    endloop
  179. EndProc
  180.