Comment ========================================================== Computer Tyme Trust Ease * Copyright 1993-95 by Marc Perkel All Rights Reserved Computer Tyme * 309 North Jefferson, #220 * Springfield Mo. 65806 (800) 548-5353 Sales * (417) 866-1222 Voice * (417) 866-1665 Data/Fax ========================================================== EndComment ;#Define Shareware ;------ Create Variables Var Users Groups ReadData WriteData ClearData TextName TextFile Main ExitMenu ;======================= P R O C E D U R E S =========================== Procedure FWrite ($St) FileWriteln(TextFile,St) EndProc Procedure SaveTrustees var Trustees Writeln 'Reading Trustee Information into File: ' TextName Writeln FileAssign(TextFile,TextName) FileCreate(TextFile) NovUsers(Users) Loop Users Write 'Reading User: ' LoopVal ' ... ' FWrite LoopVal ' ' 1 NovScanTrusteePaths(Trustees,LoopVal,1) Loop Trustees FWrite ' ' LoopVal[1] ' ' LoopVal[2] EndLoop FWrite '' Writeln EndLoop Writeln NovGroups(Groups) Loop Groups Write 'Reading Group: ' LoopVal ' ... ' FWrite LoopVal ' ' 2 NovScanTrusteePaths(Trustees,LoopVal,2) Loop Trustees FWrite ' ' LoopVal[1] ' ' LoopVal[2] EndLoop FWrite '' Writeln EndLoop FileClose(TextFile) EndProc Procedure NukeTrustees var Name Trustees NovUsers(Users) Loop Users Name = LoopVal Write 'Clearing User: ' Name ' ... ' NovScanTrusteePaths(Trustees,Name,1) Loop Trustees NovDeleteTrustee(LoopVal[1],Name,1) EndLoop Writeln EndLoop Writeln NovGroups(Groups) Loop Groups Name = LoopVal Write 'Clearing Group: ' Name ' ... ' NovScanTrusteePaths(Trustees,Name,2) Loop Trustees NovDeleteTrustee(LoopVal[1],Name,2) EndLoop Writeln EndLoop EndProc Procedure RestoreTrustees var St Name Type TypeName Trustees Path Rights P if not ExistFile(TextName) Writeln 'Error: ' TextName ' not Found!' ExitMenu endif if ClearData NukeTrustees Writeln endif Writeln 'Writing Trustee Information from File: ' TextName Writeln FileAssign(TextFile,TextName) FileOpen(TextFile) while not EndOfFile(TextFile) St = FileReadln(TextFile) if Left(St,1) > ' ' P = pos(' ',St) Name = Left(St,P-1) Type = Value(Mid(St,P+1,255)) if Type = 1 then TypeName = 'User' else TypeName = 'Group' Writeln 'Restoring ' TypeName ': ' Name elseif length(St) > 2 Trim(St) P = pos(' ',St) Path = Left(St,P-1) Rights = Value(Mid(St,P+1,255)) NovAddTrustee(Path,Rights,Name,Type) endif endwhile EndProc Procedure Pause var Ch Write 'Press and Key ... ' Ch = ReadKey Write CR ' ' CR EndProc Procedure Help Include 'ADDRESS.INC' Writeln 'This program can read the directory trustee information into a' Writeln 'text file or restore trustee information from a text file. This' Writeln "is useful if your tape backup system doesn't save trustee information" Writeln 'and you want to save it in a text file so that you can restore it if' Writeln 'you have to. In this case you would want to run this program just before' Writeln 'you do a tape backup.' Writeln Writeln 'Or, if you are making changes in your directory of volume structures,' Writeln 'this program can read trustee information to a text file where it can' Writeln 'be modified with an editor and the trustee information written back.' Writeln Pause Writeln ' Usage: TRUSTEZ /W/R/C' Writeln Writeln ' Example: TRUSTEZ TEST.TXT /R ;reads data into TEST.TXT' Writeln Writeln ' /R = Read Trustee Information into a File' Writeln ' /W = Write Trustee Information from a File' Writeln ' /C = Clear all existing Trustee Information' Writeln Writeln 'When using the /C with /R the data is read and then cleared. If /C is' Writeln 'used with /W then the trustees are cleared and the new data written.' Writeln Writeln 'This program requires a Novell Network to run.' Writeln Writeln 'Trust Ease is licensed for $95/fileserver.' ExitMenu EndProc #If Shareware Procedure Beg BoxBorderColor Green Blue BoxInsideColor White Blue BoxHeaderColor Yellow Mag BoxHeader ' * Shameless Beg Screen * ' DrawBox 10 8 61 6 Writeln WriteCenter '* TrustEZ Evaluation Copy *' Writeln WriteCenter 'Please remember to register this software.' Wait 600 EraseTopWindow ClearKbdBuffer EndProc #Endif Procedure Setup var P O #If Shareware Beg #Endif ExitCode = 0 StandardIO Writeln Writeln 'Computer Tyme Trust Ease * Copyright 1994-97 by Marc Perkel' Writeln 'All Rights Reserved * Version 1.2 * Release Date: 06-09-97' ReadData = OptionSwitch(CmdLine,'R') WriteData = OptionSwitch(CmdLine,'W') ClearData = OptionSwitch(CmdLine,'C') if ClearData and not WriteData then ReadData = True TextName = UpperCase(CmdLine) Trim(TextName) if (pos('/?',CmdLine) > 0) or (TextName = '') Help endif if NovConnection = 0 Writeln 'This utility works only with NetWare!' ExitCode = 1 ExitMenu endif EndProc Procedure Main Setup Writeln if ReadData SaveTrustees if ClearData Writeln NukeTrustees endif elseif WriteData RestoreTrustees endif EndProc