diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index 6c90e2b..3c130fe 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -19,23 +19,29 @@ jobs: - uses: actions/checkout@v4 - name: run build run: | - vamos -c /usr/amiga/.vamosrc --cwd esource: -V system:/usr/amiga -V esource:$GITHUB_WORKSPACE make - vamos -c /usr/amiga/.vamosrc --cwd esource:axSetupTool -V system:/usr/amiga -V esource:$GITHUB_WORKSPACE make + vamos -c /usr/amiga/.vamosrc --cwd esource: -V system:/usr/amiga -V esource:$GITHUB_WORKSPACE make build=release + vamos -c /usr/amiga/.vamosrc --cwd esource:axSetupTool -V system:/usr/amiga -V esource:$GITHUB_WORKSPACE make build=release - name: add build artifacts to publish run: | + apk add lha mkdir downloads mkdir downloads/utils cp $GITHUB_WORKSPACE/express5 downloads - cp $GITHUB_WORKSPACE/acp downloads - cp $GITHUB_WORKSPACE/jsonimport downloads/utils + cp $GITHUB_WORKSPACE/ACP downloads + cp $GITHUB_WORKSPACE/jsonImport downloads/utils cp $GITHUB_WORKSPACE/icon2cfg downloads/utils cp $GITHUB_WORKSPACE/qwk downloads/utils cp $GITHUB_WORKSPACE/ftn downloads/utils - cp $GITHUB_WORKSPACE/axSetupTool/axSetupTool downloads/utils - - - name: Use the Upload Artifact GitHub Action - uses: actions/upload-artifact@v2 - with: - name: amiExpress-nightly${{ github.sha }} - path: downloads + cp $GITHUB_WORKSPACE/axSetupTool/axSetupTool downloads/utils + cd downloads + lha a ../amiExpress-nightly${{ github.sha }}.lha * + ls ../ + + - name: Update nightly release + uses: pyTooling/Actions/releaser@main + with: + tag: dev-build + rm: true + token: ${{ secrets.GITHUB_TOKEN }} + files: amiExpress-nightly${{ github.sha }}.lha diff --git a/ACP.e b/ACP.e index 18dc532..3821fca 100644 --- a/ACP.e +++ b/ACP.e @@ -46,6 +46,8 @@ ENUM ERR_NONE,ERR_ALREADY_RUNNING,ERR_STARTUP, ERR_VALIDATE,ERR_NO_DISKFONT,ERR_FDS_RANGE +CONST AX_SETUP_TOOL='BBS:Utils/axSetupTool' + CONST LISTENQ=100 CONST EINTR=4 CONST MAX_LINE=255 @@ -59,9 +61,11 @@ CONST TAG_END=0 CONST NODECONFIG=1 CONST RUNMCP=2 +CONST LAST_CALLERS=0 CONST LAST_UPLOADS=1 CONST LAST_DOWNLOADS=2 -CONST LAST_CALLERS=0 +CONST SYSTEM_STATS=3 +CONST SESSION_STATS=4 CONST CHAT_ENTER=5 CONST CHAT_EXIT=4 @@ -297,6 +301,7 @@ DEF nodeIdle[MAX_NODES]:ARRAY OF CHAR DEF startUp=FALSE/*** Set startup scripts to none ***/ DEF zipOn=FALSE/*** Turn ZIPPED window off ***/ DEF notDone=1 +DEF shuttingDown=0 DEF down[MAX_NODES]:ARRAY OF CHAR DEF activeNodes[MAX_NODES]:ARRAY OF CHAR DEF publicName[200]:STRING @@ -311,6 +316,10 @@ DEF telnetNode[MAX_NODES]:ARRAY OF INT DEF ftpNode[MAX_NODES]:ARRAY OF INT DEF bbsStack +DEF startTime:datestamp +DEF startCalls +DEF ulCount=0,dlCount=0 + DEF nodes[MAX_NODES]:ARRAY OF INT DEF suspend[MAX_NODES]:ARRAY OF INT DEF showAbout=0 @@ -329,6 +338,8 @@ DEF dosCheckTime=60 DEF dosCheckTrigger=5 DEF dosBanTime=60 +DEF menuSelect=FALSE + DEF masterPort[100]:STRING DEF cmds[MAX_NODES]:ARRAY OF LONG @@ -535,6 +546,25 @@ PROC getSystemTime() startds:=DateStamp(currDate) ENDPROC Mul(Mul(startds.days,1440),60)+(startds.minute*60)+(startds.tick/50) +PROC formatLongDateTime(dt:PTR TO datetime,outDateStr) + DEF datestr[10]:STRING + DEF daystr[10]:STRING + DEF timestr[10]:STRING + DEF dateVal + + + dt.format:=FORMAT_DOS + dt.flags:=0 + dt.strday:=0 + dt.strdate:=datestr + dt.strtime:=timestr + + IF DateToStr(dt) + StringF(outDateStr,'\s[7]\d\s \s',datestr,IF dt.stamp.days>=8035 THEN 20 ELSE 19,datestr+7,timestr) + RETURN TRUE + ENDIF +ENDPROC FALSE + PROC trimStr(src:PTR TO CHAR, dest:PTR TO CHAR) DEF i StrCopy(dest,TrimStr(src)) @@ -559,14 +589,11 @@ PROC myrequest(s:PTR TO CHAR) END myES[5] ENDPROC -PROC menunum(n) -ENDPROC ((n) AND $1F) +PROC menunum(n) IS ((n) AND $1F) -PROC itemnum(n) -ENDPROC (Shr((n),5) AND $3F) +PROC itemnum(n) IS (Shr((n),5) AND $3F) -PROC subnum(n) -ENDPROC (Shr((n),11) AND $1F) +PROC subnum(n) IS (Shr((n),11) AND $1F) ->/* ***** Free the Gadlist and return ***** */ PROC freeGads() @@ -909,6 +936,16 @@ PROC findClose() dir_info:=NIL ENDPROC +EXPORT PROC readIntFromFile(filename: PTR TO CHAR) + DEF fh + DEF v[100]:STRING + IF((fh:=Open(filename,MODE_OLDFILE)))<>0 + ReadStr(fh,v) + Close(fh) + RETURN Val(v) + ENDIF +ENDPROC -1 + /* ***** Do BevelBorders ***** */ PROC drawborders() /* *** Stats *** */ @@ -1029,6 +1066,7 @@ PROC createCustomMenus(nodes) maddItem( NM_SUB,' Stephan Schiemann ',0,0,0,0) maddItem( NM_SUB,' Eddie Oniel ',0,0,0,0) + maddItem( NM_ITEM, 'Iconify',0,0,0,0) maddItem( NM_ITEM, 'Quit',0,0,0,0) maddItem( NM_TITLE, 'Master Control',0,0,0,0) @@ -1036,10 +1074,8 @@ PROC createCustomMenus(nodes) maddNodes(nodes) maddItem( NM_ITEM, 'Instant Login',0, 0, 0, 0) maddNodes(nodes) - IF shellMode - maddItem( NM_ITEM, 'AEShell',0, 0, 0, 0) - maddNodes(nodes) - ENDIF + maddItem( NM_ITEM, 'Shell',0, 0, 0, 0) + maddNodes(nodes) maddItem( NM_ITEM, 'Toggle Chat',0, 0, 0, 0) maddNodes(nodes) maddItem( NM_ITEM, 'Exit Node',0, 0, 0, 0) @@ -1062,6 +1098,7 @@ PROC createCustomMenus(nodes) maddNodes(nodes) maddItem( NM_ITEM,'Set NRAMS',0,0,0,0) maddNodes(nodes) + maddItem( NM_ITEM,'Config Editor',0,IF FileLength(AX_SETUP_TOOL)>=0 THEN 0 ELSE ITEMENABLED,0,0) maddItem( NM_TITLE, 'Custom Control',0,0,0,0) @@ -1180,7 +1217,7 @@ PROC initGads(scr:PTR TO screen) IF (gad = NIL) THEN RETURN 0 ->IF(initGadsagain=FALSE) THEN ngAry[GAD_TOPS].topedge:=ngAry[GAD_TOPS].topedge+(-110+(theight*11)) - gad:= CreateGadgetA(CYCLE_KIND, gad, ngAry [GAD_TOPS], [GTCY_LABELS,['Last Five Callers','Last Five Uploads','Last Five Downloads',NIL],GTCY_ACTIVE,topOption,TAG_END]) + gad:= CreateGadgetA(CYCLE_KIND, gad, ngAry [GAD_TOPS], [GTCY_LABELS,['Last Five Callers','Last Five Uploads','Last Five Downloads','System Stats','Session Stats',NIL],GTCY_ACTIVE,topOption,TAG_END]) IF (gad = NIL) THEN RETURN 0 ->IF(initGadsagain=FALSE) THEN ngAry[GAD_TOPSBOX].topedge:=ngAry[GAD_TOPSBOX].topedge+(-110+(theight*11)) @@ -1280,12 +1317,10 @@ PROC doControl(node) DisplayBeep(scr) ENDIF CASE SV_AESHELL - IF shellMode - IF(users[node].actionVal=ENV_AWAITCONNECT) - callNode(node,SV_AESHELL) - ELSE - DisplayBeep(scr) - ENDIF + IF(users[node].actionVal=ENV_AWAITCONNECT) + callNode(node,SV_AESHELL) + ELSE + DisplayBeep(scr) ENDIF CASE SV_CHATTOGGLE cd:=users[node].actionVal @@ -1320,6 +1355,10 @@ PROC doControl(node) showNdLastUploads(eWin,node) CASE LAST_DOWNLOADS showNdLastDownloads(eWin,node) + CASE SYSTEM_STATS + showSystemStats(eWin) + CASE SESSION_STATS + showSessionStats(eWin) ENDSELECT ENDSELECT control:=0 @@ -1443,10 +1482,14 @@ PROC handleEditGadget(im:PTR TO intuimessage,ig) IF(button) IF(nutton(2)=FALSE) THEN doButton(2,0) ELSE - IF shellMode + IF shellMode OR menuSelect IF(control) THEN control:=0 ELSE control:=SV_AESHELL ELSE - selectAndRunConfig('','','') + IF FileLength(AX_SETUP_TOOL)>=0 + Execute(AX_SETUP_TOOL,0,0) + ELSE + selectAndRunConfig('','','') + ENDIF ENDIF ENDIF CASE GAD_TOGGLECHAT @@ -1457,7 +1500,7 @@ PROC handleEditGadget(im:PTR TO intuimessage,ig) ENDIF CASE GAD_TOPS topOption++ - IF(topOption>2) THEN topOption:=0 + IF(topOption>SESSION_STATS) THEN topOption:=0 SELECT topOption CASE LAST_CALLERS showLastUser(eWin) @@ -1465,9 +1508,13 @@ PROC handleEditGadget(im:PTR TO intuimessage,ig) showLastDownloads(eWin) CASE LAST_UPLOADS showLastUploads(eWin) + CASE SYSTEM_STATS + showSystemStats(eWin) + CASE SESSION_STATS + showSessionStats(eWin) ENDSELECT CASE GAD_TOPSBOX - IF(control) + IF(control) OR (topOption>=SYSTEM_STATS) control:=0 SELECT topOption CASE LAST_CALLERS @@ -1476,6 +1523,10 @@ PROC handleEditGadget(im:PTR TO intuimessage,ig) showLastUploads(eWin) CASE LAST_DOWNLOADS showLastDownloads(eWin) + CASE SYSTEM_STATS + showSystemStats(eWin) + CASE SESSION_STATS + showSessionStats(eWin) ENDSELECT ELSE control:=SV_TOPS @@ -1586,6 +1637,8 @@ PROC updateNode(name:PTR TO CHAR,location:PTR TO CHAR,action:PTR TO CHAR,baud:PT StrCopy(action2,'Node Inactive ') IF activeNodes[node] THEN activeNodeCount-- activeNodes[node]:=FALSE + down[node]:=TRUE + IF (activeNodeCount=0) AND (shuttingDown) THEN notDone:=0 /*if(ActiveNodeCount==0) notDone=0;*/ CASE ENV_MULTICHAT StrCopy(action2,'MultiNode Chat ') @@ -1658,6 +1711,10 @@ PROC updateNode(name:PTR TO CHAR,location:PTR TO CHAR,action:PTR TO CHAR,baud:PT showLastUploads(eWin) CASE LAST_DOWNLOADS showLastDownloads(eWin) + CASE SYSTEM_STATS + showSystemStats(eWin) + CASE SESSION_STATS + showSessionStats(eWin) ENDSELECT saveState() ENDIF @@ -1830,6 +1887,77 @@ PROC regNodeUser(name:PTR TO CHAR,dateStr:PTR TO CHAR, node) list.add(name,dateStr) ENDPROC +PROC showSystemStats(win:PTR TO window) + DEF i=0 + DEF rowTop + DEF tempStr[255]:STRING + DEF systemCalls + rowTop:=topOffset+(theight*11)+BTOP_TOPSBOX + SetAPen(win.rport,0) + RectFill(win.rport,BLEF_TOPSBOX+5,rowTop+1,BLEF_TOPSBOX+BWID_TOPSBOX-10,rowTop+BHEI_TOPSBOX-2) + SetAPen(win.rport,1) + + StringF(tempStr,'\sSystemStats',bbsPath) + systemCalls:=readIntFromFile(tempStr) + + StringF(tempStr,'System Calls: \d',systemCalls) + rowTop:=topOffset+155-110+(theight*11) + printMyText(win.rport,tempStr,GLEF_TOPS+5,rowTop) + + StringF(tempStr,'Number of users: \d',Div(FileLength('bbs:user.data'),$e8 )) + rowTop+=10 + printMyText(win.rport,tempStr,GLEF_TOPS+5,rowTop) + + formatLongDateTime(startTime,tempStr) + StringF(tempStr,'Startup: \s',tempStr) + rowTop+=10 + printMyText(win.rport,tempStr,GLEF_TOPS+5,rowTop) + + StringF(tempStr,'Available memory: \d',AvailMem(0)) + rowTop+=10 + printMyText(win.rport,tempStr,GLEF_TOPS+5,rowTop) +ENDPROC + +PROC showSessionStats(win:PTR TO window) + DEF i=0 + DEF rowTop + DEF tempStr[255]:STRING + DEF systemCalls,uptime + DEF systemTime:datestamp + rowTop:=topOffset+(theight*11)+BTOP_TOPSBOX + SetAPen(win.rport,0) + RectFill(win.rport,BLEF_TOPSBOX+5,rowTop+1,BLEF_TOPSBOX+BWID_TOPSBOX-10,rowTop+BHEI_TOPSBOX-2) + SetAPen(win.rport,1) + + DateStamp(systemTime) + uptime:=Mul(systemTime.days-startTime.days,1440)+systemTime.minute-startTime.minute + + formatLongDateTime(startTime,tempStr) + StringF(tempStr,'Startup: \s',tempStr) + rowTop:=topOffset+155-110+(theight*11) + printMyText(win.rport,tempStr,GLEF_TOPS+5,rowTop) + + StringF(tempStr,'Uptime: \d days \r\z\d[2]:\r\z\d[2]',Div(uptime,1440),Div(Mod(uptime,1440),60),Mod(uptime,60)) + rowTop+=10 + printMyText(win.rport,tempStr,GLEF_TOPS+5,rowTop) + + StringF(tempStr,'\sSystemStats',bbsPath) + systemCalls:=readIntFromFile(tempStr) + + StringF(tempStr,'System calls: \d',systemCalls-startCalls) + rowTop+=10 + printMyText(win.rport,tempStr,GLEF_TOPS+5,rowTop) + + + StringF(tempStr,'Uploads: \d',ulCount) + rowTop+=10 + printMyText(win.rport,tempStr,GLEF_TOPS+5,rowTop) + + StringF(tempStr,'Downloads: \d',dlCount) + rowTop+=10 + printMyText(win.rport,tempStr,GLEF_TOPS+5,rowTop) +ENDPROC + PROC showLastUser(win:PTR TO window) DEF i=0 DEF rowTop @@ -2026,6 +2154,9 @@ PROC checkMasterSig(signals) ELSEIF(cpymsg.command=SV_ACPALERT) myrequest(cpymsg.user) ReplyMsg(cpymsg) + ELSEIF(cpymsg.command=SV_ACPSHUTDOWN) + attemptShutdown() + ReplyMsg(cpymsg) ELSEIF(cpymsg.command=SV_STARTNODE) StringF(temp,'AmiExpress_Node.\d',cpymsg.node) IF(FindPort(temp))=FALSE @@ -2055,8 +2186,10 @@ PROC checkMasterSig(signals) getSystemDate(datestr) regLastDownloads(tempstr2,datestr,msg.node) + dlCount++ saveState() IF topOption = LAST_DOWNLOADS THEN showLastDownloads(eWin) + IF topOption = SESSION_STATS THEN showSessionStats(eWin) StringF(temp,'DL: \s',msg.user) StringF(temp1,'\d',SV_NEWMSG) updateNode(temp,msg.location,temp1,msg.baud,msg.node) @@ -2070,8 +2203,10 @@ PROC checkMasterSig(signals) getSystemDate(datestr) regLastUploads(tempstr2,datestr,msg.node) + ulCount++ saveState() IF topOption = LAST_UPLOADS THEN showLastUploads(eWin) + IF topOption = SESSION_STATS THEN showSessionStats(eWin) StringF(temp,'UL: \s',msg.user) StringF(temp1,'\d',SV_NEWMSG) updateNode(temp,msg.location,temp1,msg.baud,msg.node) @@ -2747,6 +2882,18 @@ PROC readStartUp(s:PTR TO CHAR) dobj,cfg:=getToolTypes(s) IF (dobj=NIL) + acpError:=1 + ELSEIF(FindToolType(dobj.tooltypes,'SYSOP_NAME')=0) OR (FindToolType(dobj.tooltypes,'BBS_NAME')=0) OR + (FindToolType(dobj.tooltypes,'BBS_LOCATION')=0) OR (FindToolType(dobj.tooltypes,'BBS_GEOGRAPHIC')=0) + acpError:=1 + ENDIF + + IF acpError + IF FileLength(AX_SETUP_TOOL)>=0 + Execute(AX_SETUP_TOOL,0,0) + RETURN + ENDIF + acpError:=0 selectAndRunConfig('','s:','aeicon.json') dobj,cfg:=getToolTypes(s) @@ -2757,7 +2904,7 @@ PROC readStartUp(s:PTR TO CHAR) ENDIF ENDIF oldtooltypes:=dobj.tooltypes - + IF(t:=FindToolType(oldtooltypes,'ACPFONT')) StrCopy(fontName,t) ENDIF @@ -3229,7 +3376,8 @@ ENDPROC PROC attemptShutdown() DEF i - + + shuttingDown:=TRUE IF(activeNodeCount=0) notDone:=0 ELSE @@ -3237,7 +3385,7 @@ PROC attemptShutdown() IF(StrLen(startNode[i])>0) IF((users[i].actionVal=ENV_AWAITCONNECT) AND (down[i])=FALSE) control:=SV_NODEOFFHOOK - down[i]:=TRUE + ->down[i]:=TRUE doControl(i) ENDIF ELSE @@ -3780,6 +3928,8 @@ PROC main() HANDLE KickVersion(37) -> E-Note: requires V37 + DateStamp(startTime) + updateVersion(myVerStr,myBuildStr) FOR i:=0 TO MAX_NODES-1 @@ -3913,6 +4063,9 @@ PROC main() HANDLE readStartUp(iconStartName) IF acpError THEN Raise(ERR_STARTUP) + StringF(tempstr,'\sSystemStats',bbsPath) + startCalls:=readIntFromFile(tempstr) + loadConnectionList(connectionList) IF commodityEnabled @@ -4047,6 +4200,7 @@ PROC main() HANDLE WA_MAXHEIGHT, -1, WA_ZOOM, dim, WA_AUTOADJUST, 1, + WA_NEWLOOKMENUS, 1, WA_PUBSCREEN, IF EstrLen(publicName)=0 THEN NIL ELSE scr, WA_PUBSCREENFALLBACK, 1, WA_GADGETS, gadgets, @@ -4141,6 +4295,10 @@ PROC main() HANDLE showLastUploads(eWin) CASE LAST_DOWNLOADS showLastDownloads(eWin) + CASE SYSTEM_STATS + showSystemStats(eWin) + CASE SESSION_STATS + showSessionStats(eWin) ENDSELECT FOR i:=0 TO MAX_NODES-1 IF(StrLen(startNode[i])>0) @@ -4153,15 +4311,23 @@ PROC main() HANDLE CASE GADGETUP handleEditGadget(im,0) CASE MENUPICK + ->iconify + IF(menunum(im.code)=0) AND (itemnum(im.code)=5) THEN ZipWindow(eWin) ->quit menu item - IF(menunum(im.code)=0) AND (itemnum(im.code)=5) THEN attemptShutdown() - - IF(menunum(im.code)=1) - i:=button - button:=0 - handleEditGadget(NIL,GAD_SYSOPLOGIN+itemnum(im.code)) - handleEditGadget(NIL,GAD_NODES+subnum(im.code)) - button:=i + IF(menunum(im.code)=0) AND (itemnum(im.code)=6) THEN attemptShutdown() + + IF(menunum(im.code)=1) + IF (itemnum(im.code)=14) + IF FileLength(AX_SETUP_TOOL)>=0 THEN Execute(AX_SETUP_TOOL,0,0) + ELSE + i:=button + button:=0 + menuSelect:=TRUE + handleEditGadget(NIL,GAD_SYSOPLOGIN+itemnum(im.code)) + handleEditGadget(NIL,GAD_NODES+subnum(im.code)) + button:=i + menuSelect:=FALSE + ENDIF ENDIF IF(menunum(im.code)=2) num:=itemnum(im.code) @@ -4205,6 +4371,7 @@ EXCEPT DO Permit() ENDIF ENDIF + FreeMenus(eWinM) IF msg THEN FreeMem(msg,SIZEOF acpMessage) diff --git a/MiscFuncs.e b/MiscFuncs.e index 36adeb3..0796292 100644 --- a/MiscFuncs.e +++ b/MiscFuncs.e @@ -24,25 +24,6 @@ EXPORT PROC setFDS(fds:PTR TO LONG,socketVal) fds[n]:=fds[n] OR (Shl(1,socketVal AND 31)) ENDPROC -EXPORT PROC getFileSize(s: PTR TO CHAR) -/* returns the file size of a given file or 8192 if an error occured */ - DEF fBlock: fileinfoblock - DEF fLock - DEF fsize=8192 - - IF((fLock:=Lock(s,ACCESS_READ)))=NIL - RETURN 8192 - ENDIF - - IF((fBlock:=AllocDosObject(DOS_FIB,NIL)))=NIL - UnLock(fLock) - RETURN 8192 - ENDIF - IF(Examine(fLock,fBlock)) THEN fsize:=fBlock.size - UnLock(fLock) - FreeDosObject(DOS_FIB,fBlock) -ENDPROC fsize - EXPORT PROC fileExists(filename) /* checks to see if a file exists and returns TRUE OR FALSE */ DEF lh @@ -288,7 +269,11 @@ EXPORT PROC formatUnsignedLong(val,outStr) RawDoFmt('%lu',{val},{asmputchar},outputTxt) StrCopy(outStr,outputTxt) -EXPORT ENDPROC +ENDPROC + +EXPORT PROC formatIP(val,outStr) + StringF(outStr,'\d.\d.\d.\d',Shr(val,24) AND $FF,Shr(val,16) AND $FF,Shr(val,8) AND $FF,val AND $FF) +ENDPROC EXPORT PROC formatLongDate(cDateVal,outDateStr) DEF d : PTR TO datestamp @@ -647,6 +632,27 @@ EXPORT PROC parsePatternNoCase2(source:PTR TO CHAR,dest:PTR TO CHAR, len) DisposeLink(s) ENDPROC r +EXPORT PROC dirLineNewFile(s:PTR TO CHAR) + DEF str,res,ch + + str:=AstrClone(s) + stripAnsi2(str) + ch:=str[0] + res:=(ch<>0) AND (ch<>32) AND (ch<>"\n") + DisposeLink(str) +ENDPROC res + +EXPORT PROC stripAnsi2(s:PTR TO CHAR) + DEF ansi:ansi + DEF newStr + + stripAnsi(0,0,1,0,ansi) + newStr:=String(StrLen(s)) + stripAnsi(s,newStr,0,0,ansi) + StrCopy(s,newStr) + DisposeLink(newStr) +ENDPROC + EXPORT PROC stripAnsi(s: PTR TO CHAR, d: PTR TO CHAR, resetit, strip, ansi:PTR TO ansi) DEF i,j,k,p,c IF resetit diff --git a/README.md b/README.md index 43f9405..a20da12 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,33 @@ I have also updated the documentation for AmiExpress as many existing features w ### Want to help out? I am currently the sole developer on this project. If you are experienced with running /X on the Amiga platform and wish to help out, please feel free to contact me. I am always looking for ideas on how to improve this product. + +### License + +Copyright (c)2024 Darren Coles + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Installer and Installer project icon +(c) Copyright 1995-96 Escom AG. All Rights Reserved. +Reproduced and distributed under license from Escom AG. + +INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE; +NO WARRANTIES ARE MADE. ALL USE IS AT YOUR OWN RISK. NO LIABILITY +OR RESPONSIBILITY IS ASSUMED. \ No newline at end of file diff --git a/axSetupTool/axSetupTool.e b/axSetupTool/axSetupTool.e new file mode 100644 index 0000000..69e34bf --- /dev/null +++ b/axSetupTool/axSetupTool.e @@ -0,0 +1,141 @@ +OPT OSVERSION = 37,LARGE,RUNBG +OPT PREPROCESS + +/* + user editor + callers log viewer + msgbase viewer + screens viewer +*/ + +->///////////////////////////////////////////////////////////////////////////// +->//////////////////////////////////////////////////////////// MODULE ... ///// +->///////////////////////////////////////////////////////////////////////////// +MODULE 'locale' +MODULE 'muimaster' , 'libraries/mui' +MODULE 'utility/tagitem' +MODULE 'tools/boopsi' +MODULE 'icon','intuition/classusr' + +MODULE '*frmMain','*axedit','*helpText' + +PROC main() HANDLE + DEF frmMain=NIL: PTR TO frmMain + DEF app=NIL: PTR TO app_obj + + IF ( muimasterbase := OpenLibrary( 'muimaster.library' , MUIMASTER_VMIN ) ) = NIL THEN Throw( "LIB" , "muim" ) + IF (iconbase := OpenLibrary( 'icon.library' , 0 )) = NIL THEN Throw( "LIB" , "icon" ) + + NEW app.create(NIL) + helpTextInitialise() + + domethod(app.gr_ax_image,[OM_ADDMEMBER,BodychunkObject, + MUIA_Frame , MUIV_Frame_ImageButton , + MUIA_Bodychunk_Body, + [$FF,$00,$03,$FE,$03,$F8,$00,$FB,$00,$05,$00,$01,$FF,$07,$FC, + $00,$FB,$00,$05,$00,$03,$F1,$8F,$C6,$00,$FF,$00,$03,$0E,$00, + $38,$00,$05,$00,$07,$E0,$DF,$8C,$00,$FF,$00,$03,$1F,$00,$70, + $00,$05,$00,$0F,$C4,$7F,$18,$00,$FF,$00,$03,$3B,$80,$E0,$00, + $05,$00,$1F,$8E,$3E,$30,$00,$FF,$00,$03,$71,$C1,$C0,$00,$05, + $00,$3F,$1F,$1C,$60,$00,$FF,$00,$03,$E0,$E3,$80,$00,$05,$00, + $7E,$3F,$88,$C0,$00,$05,$00,$01,$C0,$77,$00,$00,$05,$00,$FC, + $6F,$C1,$80,$00,$05,$00,$03,$80,$3E,$00,$00,$05,$01,$F8,$C7, + $E3,$00,$00,$05,$00,$07,$00,$1C,$00,$00,$05,$03,$F1,$8F,$C1, + $80,$00,$05,$00,$0E,$00,$3E,$00,$00,$05,$07,$E3,$1F,$88,$C0, + $00,$05,$00,$1C,$00,$77,$00,$00,$05,$0F,$C6,$3F,$1C,$60,$00, + $05,$00,$38,$00,$E3,$80,$00,$05,$1F,$8C,$7E,$3E,$30,$00,$05, + $00,$70,$01,$C1,$C0,$00,$05,$3F,$18,$FC,$7F,$18,$00,$05,$00, + $E0,$03,$80,$E0,$00,$05,$7E,$31,$F8,$DF,$8C,$00,$05,$01,$C0, + $07,$00,$70,$00,$05,$FC,$63,$F1,$8F,$C6,$00,$05,$03,$80,$0E, + $00,$38,$00,$05,$FC,$C3,$F3,$07,$E6,$00,$05,$03,$00,$0C,$00, + $18,$00,$05,$FF,$83,$FE,$03,$FE,$00,$FB,$00,$05,$7F,$01,$FC, + $01,$FC,$00,$FB,$00,$FB,$00,$FB,$00]:CHAR, + MUIA_Bodychunk_Masking, 2, + MUIA_Bodychunk_Compression, 1, + MUIA_Bodychunk_Depth, 2, + MUIA_Bitmap_Height, 21, + MUIA_Bitmap_Width, 40, + MUIA_FixHeight, 21, + MUIA_FixWidth, 40, + End]) + + + NEW frmMain.create(app) + + frmMain.doMain() + +EXCEPT DO + + SELECT exception + + CASE "HLP" + SELECT exceptioninfo + CASE "LIST" + error_simple( 'error: Increase help text list size' ) + ENDSELECT + + CASE "LIB" + + SELECT exceptioninfo + + CASE "muim" + + error_simple( 'Can''t open muimaster.library !' ) + + CASE "icon" + + error_simple( 'Can''t open icon.library !' ) + + ENDSELECT + + CASE "MEM" + + error_simple( 'Not enough memory !' ) + + CASE "MUI" + + SELECT exceptioninfo + + CASE MUIE_OutOfMemory + + error_simple( 'Not enough memory !' ) + + CASE MUIE_OutOfGfxMemory + + error_simple( 'Not enough chip memory !' ) + + CASE MUIE_MissingLibrary + + error_simple( 'Can''t open a needed library !' ) + + CASE MUIE_NoARexx + + error_simple( 'Can''t create arexx port !' ) + + DEFAULT + + error_simple( 'Internal problem !' ) + + ENDSELECT + + ENDSELECT + + IF app + app.dispose() + END app + ENDIF + IF frmMain THEN END frmMain + helpTextDeinitialise() + + IF iconbase THEN CloseLibrary( iconbase ) + IF muimasterbase THEN CloseLibrary( muimasterbase ) +ENDPROC + + +->///////////////////////////////////////////////////////////////////////////// +->/////////////////// Prints an error message with an intuition requester ///// +->///////////////////////////////////////////////////////////////////////////// +PROC error_simple( message : PTR TO CHAR ) IS EasyRequestArgs( NIL , [ 20 , 0 , + 'error !' , + message , + '_OK' ] , NIL , NIL ) diff --git a/axSetupTool/axSetupTool.info b/axSetupTool/axSetupTool.info new file mode 100644 index 0000000..3c6b7b5 Binary files /dev/null and b/axSetupTool/axSetupTool.info differ diff --git a/axSetupTool/axedit.e b/axSetupTool/axedit.e new file mode 100644 index 0000000..c718bbe --- /dev/null +++ b/axSetupTool/axedit.e @@ -0,0 +1,1769 @@ +OPT MODULE +OPT PREPROCESS + + +->///////////////////////////////////////////////////////////////////////////// +->////////////////////////////////////////////////////// External modules ///// +->///////////////////////////////////////////////////////////////////////////// +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi' +MODULE 'utility/tagitem' , 'utility/hooks' + + +->///////////////////////////////////////////////////////////////////////////// +->//////////////////////////////////////////////////// Object definitions ///// +->///////////////////////////////////////////////////////////////////////////// +EXPORT OBJECT app_display + editConfs : hook +ENDOBJECT + +EXPORT OBJECT app_obj + app : PTR TO LONG + winMain : PTR TO LONG + mn_label_1 : PTR TO LONG + mnlabel1About : PTR TO LONG + mnlabel1AboutMui : PTR TO LONG + mnlabel1Exit : PTR TO LONG + mnlabel1Donotremovefolder1 : PTR TO LONG + mnlabel1Removefolder1 : PTR TO LONG + mnlabel1Ask1 : PTR TO LONG + mnlabel1NodeDelete : PTR TO LONG + mnlabel1Donotremovefolder2 : PTR TO LONG + mnlabel1Removefolder2 : PTR TO LONG + mnlabel1Ask2 : PTR TO LONG + btnSystem : PTR TO LONG + btnServer : PTR TO LONG + btnBackup : PTR TO LONG + btnRestrict : PTR TO LONG + btnNodes : PTR TO LONG + btnConfs : PTR TO LONG + btnSecurity : PTR TO LONG + btnCommands : PTR TO LONG + btnComputers : PTR TO LONG + btnProtocols : PTR TO LONG + btnNamesNotAllowed : PTR TO LONG + btnScreenTypes : PTR TO LONG + btnLanguages : PTR TO LONG + btnDrives : PTR TO LONG + btnCheckers : PTR TO LONG + btnConnect : PTR TO LONG + btnZoom : PTR TO LONG + btnUsers : PTR TO LONG + tx_label_0 : PTR TO LONG + gr_ax_image : PTR TO LONG + btnAbout : PTR TO LONG + btnTools : PTR TO LONG + btnExit : PTR TO LONG + wi_conf_edit : PTR TO LONG + btnFirstConf : PTR TO LONG + btnPrevConf : PTR TO LONG + strConfName : PTR TO LONG + strConfNum : PTR TO LONG + btnNextConf : PTR TO LONG + btnLastConf : PTR TO LONG + btnAddConf : PTR TO LONG + btnConfClone : PTR TO LONG + btnRemoveConf : PTR TO LONG + gr_conf_pages : PTR TO LONG + gr_conf_settings : PTR TO LONG + gr_conf_more : PTR TO LONG + lv_download_paths : PTR TO LONG + pa_downloadpath : PTR TO LONG + stR_PA_downloadpath : PTR TO LONG + bt_dlpath_add : PTR TO LONG + bt_dlpath_remove : PTR TO LONG + lv_upload_paths : PTR TO LONG + pa_uploadpath : PTR TO LONG + stR_PA_uploadpath : PTR TO LONG + bt_ulpath_add : PTR TO LONG + bt_ulpath_remove : PTR TO LONG + lvMsgbases : PTR TO LONG + btnMsgbaseAdd : PTR TO LONG + btnMsgbaseEdit : PTR TO LONG + btnMsgbaseDelete : PTR TO LONG + btnSaveConf : PTR TO LONG + btnCancelConf : PTR TO LONG + wi_nodeEdit : PTR TO LONG + btnFirstNode : PTR TO LONG + btnPrevNode : PTR TO LONG + str_Node_Number : PTR TO LONG + btnNextNode : PTR TO LONG + btnLastNode : PTR TO LONG + btnAddNode : PTR TO LONG + btnNodeClone : PTR TO LONG + btnRemoveNode : PTR TO LONG + gr_node_pages : PTR TO LONG + gr_node_settings : PTR TO LONG + gr_node_second_settings : PTR TO LONG + gr_node_more_settings : PTR TO LONG + gr_node_serial_settings : PTR TO LONG + gr_node_window_settings : PTR TO LONG + gr_node_time_settings : PTR TO LONG + str300start : PTR TO LONG + str300end : PTR TO LONG + str1200start : PTR TO LONG + str1200end : PTR TO LONG + str2400start : PTR TO LONG + str2400end : PTR TO LONG + str4800start : PTR TO LONG + str4800end : PTR TO LONG + str9600start : PTR TO LONG + str9600end : PTR TO LONG + str12000start : PTR TO LONG + str12000end : PTR TO LONG + str14400start : PTR TO LONG + str14400end : PTR TO LONG + str16800start : PTR TO LONG + str16800end : PTR TO LONG + str19200start : PTR TO LONG + str19200end : PTR TO LONG + str21600start : PTR TO LONG + str21600end : PTR TO LONG + str24000start : PTR TO LONG + str24000end : PTR TO LONG + str26400start : PTR TO LONG + str26400end : PTR TO LONG + str28800start : PTR TO LONG + str28800end : PTR TO LONG + str31200start : PTR TO LONG + str31200end : PTR TO LONG + str33600start : PTR TO LONG + str33600end : PTR TO LONG + str38400start : PTR TO LONG + str38400end : PTR TO LONG + str57600start : PTR TO LONG + str57600end : PTR TO LONG + str115200start : PTR TO LONG + str115200end : PTR TO LONG + btnNodeSave : PTR TO LONG + btnNodeCancel : PTR TO LONG + wi_listEdit : PTR TO LONG + grp_arrange : PTR TO LONG + lv_list : PTR TO LONG + grp_computers_add : PTR TO LONG + strListItem : PTR TO LONG + btnItemAdd : PTR TO LONG + btnItemEdit : PTR TO LONG + btnItemRemove : PTR TO LONG + btnListSave : PTR TO LONG + btnListCancel : PTR TO LONG + wi_security : PTR TO LONG + btnAccess : PTR TO LONG + btnAreas : PTR TO LONG + btnPresets : PTR TO LONG + wi_systemdata : PTR TO LONG + gr_settings : PTR TO LONG + btnSettingsSave : PTR TO LONG + btnSettingsCancel : PTR TO LONG + wi_add_item : PTR TO LONG + gr_item_detail1 : PTR TO LONG + la_item_detail1 : PTR TO LONG + stR_item_detail1e : PTR TO LONG + gr_item_detail2 : PTR TO LONG + la_item_detail2 : PTR TO LONG + stR_item_detail2 : PTR TO LONG + bt_new_item_save : PTR TO LONG + bt_new_item_cancel : PTR TO LONG + wi_presets : PTR TO LONG + ra_presets : PTR TO LONG + gr_preset_settings : PTR TO LONG + btnPresetSave : PTR TO LONG + btnPresetClose : PTR TO LONG + wi_areas : PTR TO LONG + la_area : PTR TO LONG + stR_area : PTR TO LONG + gr_area_main : PTR TO LONG + bt_area_save : PTR TO LONG + bt_area_cancel : PTR TO LONG + wi_commands : PTR TO LONG + grpCommands : PTR TO LONG + btnBBSCmd : PTR TO LONG + btnSysCmd : PTR TO LONG + winTools : PTR TO LONG + tx_label_3 : PTR TO LONG + txtAcpStatus : PTR TO LONG + tx_label_4 : PTR TO LONG + txtNodeCount : PTR TO LONG + tx_label_6 : PTR TO LONG + txtConfCount : PTR TO LONG + btnShutdown : PTR TO LONG + btnStart : PTR TO LONG + btnRestart : PTR TO LONG + btnClose : PTR TO LONG + stR_TX_label_0 : PTR TO CHAR + stR_TX_label_3 : PTR TO CHAR + stR_txtAcpStatus : PTR TO CHAR + stR_TX_label_4 : PTR TO CHAR + stR_txtNodeCount : PTR TO CHAR + stR_TX_label_6 : PTR TO CHAR + stR_txtConfCount : PTR TO CHAR + stR_gr_conf_pages : PTR TO LONG + stR_gr_node_pages : PTR TO LONG + ra_presetsContent : PTR TO LONG +ENDOBJECT + + +->///////////////////////////////////////////////////////////////////////////// +->/////////// Creates one instance of one object or the whole application ///// +->///////////////////////////////////////////////////////////////////////////// +PROC create( display : PTR TO app_display ) OF app_obj + + DEF mnlabel1File , mnlabel1Settings , mnlabel1ConferenceDelete + DEF grOUP_ROOT_0 , gr_grp_1 , gr_grp_2 , grOUP_ROOT_2 + DEF gr_confselect , obj_aux0 , obj_aux1 , obj_aux2 , obj_aux3 + DEF gr_grp_13 , gr_downloadpaths , gr_grp_20 , gr_uploadpaths + DEF gr_grp_22 , gr_messagebases , gr_grp_46 , gr_save + DEF grOUP_ROOT_3 , gr_nodeSelect , obj_aux4 , obj_aux5 + DEF gr_grp_50 , lbl300start , lbl300end , lbl1200start + DEF lbl1200end , lbl2400start , lbl2400end , lbl4800start + DEF lbl4800end , lbl9600start , lbl9600end , lbl12000start + DEF lbl12000end , lbl14400start , lbl14400end , lbl16800start + DEF lbl16800end , lbl19200start , lbl19200end , lbl21600start + DEF lbl21600end , lbl24000start , lbl24000end , lbl26400start + DEF lbl26400end , lbl28800start , lbl28800end , lbl31200start + DEF lbl31200end , lbl33600start , lbl33600end , lbl38400start + DEF lbl38400end , lbl57600start , lbl57600end , lbl115200start + DEF lbl115200end , gr_nodesave , grp_root_listitems , space_28 + DEF gr_grp_28 , grOUP_ROOT_5 , grOUP_ROOT_6 + DEF gr_settingsSaveCancel , grOUP_ROOT_7 , gr_item_buttons + DEF grOUP_ROOT_8 , gr_grp_39 , gr_grp_36 , gr_grp_38 + DEF grOUP_ROOT_9 , gr_grp_43 , gr_area_save , grOUP_ROOT_11 + DEF gr_grp_48 , space_29 , gr_grp_49 , space_30 + + self.stR_TX_label_0 := '\ec/X\nSetup Tool' + self.stR_TX_label_3 := 'ACP Status' + self.stR_txtAcpStatus := NIL + self.stR_TX_label_4 := 'Nodes' + self.stR_txtNodeCount := NIL + self.stR_TX_label_6 := 'Conferences' + self.stR_txtConfCount := NIL + self.stR_gr_conf_pages := [ + 'Main' , + 'More' , + 'Download Paths' , + 'Upload Paths' , + 'Message bases' , + NIL ] + self.stR_gr_node_pages := [ + 'Main' , + 'Second' , + 'More' , + 'Serial/Modem' , + 'Window' , + 'Time restrictions' , + NIL ] + self.ra_presetsContent := [ + '1' , + '2' , + '3' , + '4' , + '5' , + '6' , + '7' , + '8' , + '9' , + NIL ] + + self.btnSystem := SimpleButton( 'System' ) + + self.btnServer := SimpleButton( 'Server' ) + + self.btnBackup := SimpleButton( 'Backup' ) + + self.btnRestrict := SimpleButton( 'Restricted' ) + + self.btnNodes := SimpleButton( 'Nodes' ) + + self.btnConfs := SimpleButton( 'Conferences' ) + + self.btnSecurity := SimpleButton( 'Security' ) + + self.btnCommands := SimpleButton( 'Commands' ) + + self.btnComputers := SimpleButton( 'Computers' ) + + self.btnProtocols := SimpleButton( 'Protocols' ) + + self.btnNamesNotAllowed := SimpleButton( 'Names Not Allowed' ) + + self.btnScreenTypes := SimpleButton( 'Screen Types' ) + + self.btnLanguages := SimpleButton( 'Languages' ) + + self.btnDrives := SimpleButton( 'Drives' ) + + self.btnCheckers := SimpleButton( 'File Checkers' ) + + self.btnConnect := SimpleButton( 'Connect' ) + + self.btnZoom := SimpleButton( 'Zoom' ) + + self.btnUsers := SimpleButton( 'Users' ) + + gr_grp_1 := GroupObject , + MUIA_HelpNode , 'GR_grp_1' , + MUIA_Weight , 66 , + MUIA_Frame , MUIV_Frame_Button , + MUIA_Group_Columns , 3 , + Child , self.btnSystem , + Child , self.btnServer , + Child , self.btnBackup , + Child , self.btnRestrict , + Child , self.btnNodes , + Child , self.btnConfs , + Child , self.btnSecurity , + Child , self.btnCommands , + Child , self.btnComputers , + Child , self.btnProtocols , + Child , self.btnNamesNotAllowed , + Child , self.btnScreenTypes , + Child , self.btnLanguages , + Child , self.btnDrives , + Child , self.btnCheckers , + Child , self.btnConnect , + Child , self.btnZoom , + Child , self.btnUsers , + End + + self.tx_label_0 := TextObject , + MUIA_Background , MUII_TextBack , + MUIA_Frame , MUIV_Frame_Group , + MUIA_Text_Contents , self.stR_TX_label_0 , + MUIA_Text_SetMin , MUI_TRUE , + End + + self.gr_ax_image := GroupObject , + MUIA_HelpNode , 'GR_ax_image' , + End + + self.btnAbout := SimpleButton( 'About' ) + + self.btnTools := SimpleButton( 'Tools' ) + + self.btnExit := SimpleButton( 'Exit' ) + + gr_grp_2 := GroupObject , + MUIA_HelpNode , 'GR_grp_2' , + MUIA_Weight , 32 , + MUIA_Frame , MUIV_Frame_Button , + MUIA_Group_SameWidth , MUI_TRUE , + MUIA_Group_VertSpacing , 5 , + Child , self.tx_label_0 , + Child , self.gr_ax_image , + Child , self.btnAbout , + Child , self.btnTools , + Child , self.btnExit , + End + + grOUP_ROOT_0 := GroupObject , + MUIA_Group_Horiz , MUI_TRUE , + Child , gr_grp_1 , + Child , gr_grp_2 , + End + + self.mnlabel1About := MenuitemObject , + MUIA_Menuitem_Title , 'About' , + End + + self.mnlabel1AboutMui := MenuitemObject , + MUIA_Menuitem_Title , 'About Mui...' , + End + + self.mnlabel1Exit := MenuitemObject , + MUIA_Menuitem_Title , 'Exit' , + End + + mnlabel1File := MenuitemObject , + MUIA_Menuitem_Title , 'File' , + MUIA_Family_Child , self.mnlabel1About , + MUIA_Family_Child , self.mnlabel1AboutMui , + MUIA_Family_Child , self.mnlabel1Exit , + End + + self.mnlabel1Donotremovefolder1 := MenuitemObject , + MUIA_Menuitem_Title , 'Do not remove folder' , + MUIA_Menuitem_Checkit , MUI_TRUE , + End + + self.mnlabel1Removefolder1 := MenuitemObject , + MUIA_Menuitem_Title , 'Remove Folder' , + MUIA_Menuitem_Checkit , MUI_TRUE , + End + + self.mnlabel1Ask1 := MenuitemObject , + MUIA_Menuitem_Title , 'Ask' , + MUIA_Menuitem_Checkit , MUI_TRUE , + End + + mnlabel1ConferenceDelete := MenuitemObject , + MUIA_Menuitem_Title , 'Conference Delete' , + MUIA_Family_Child , self.mnlabel1Donotremovefolder1 , + MUIA_Family_Child , self.mnlabel1Removefolder1 , + MUIA_Family_Child , self.mnlabel1Ask1 , + End + + self.mnlabel1Donotremovefolder2 := MenuitemObject , + MUIA_Menuitem_Title , 'Do not remove folder' , + MUIA_Menuitem_Checkit , MUI_TRUE , + End + + self.mnlabel1Removefolder2 := MenuitemObject , + MUIA_Menuitem_Title , 'Remove Folder' , + MUIA_Menuitem_Checkit , MUI_TRUE , + End + + self.mnlabel1Ask2 := MenuitemObject , + MUIA_Menuitem_Title , 'Ask' , + MUIA_Menuitem_Checkit , MUI_TRUE , + End + + self.mnlabel1NodeDelete := MenuitemObject , + MUIA_Menuitem_Title , 'Node Delete' , + MUIA_Family_Child , self.mnlabel1Donotremovefolder2 , + MUIA_Family_Child , self.mnlabel1Removefolder2 , + MUIA_Family_Child , self.mnlabel1Ask2 , + End + + mnlabel1Settings := MenuitemObject , + MUIA_Menuitem_Title , 'Settings' , + MUIA_Family_Child , mnlabel1ConferenceDelete , + MUIA_Family_Child , self.mnlabel1NodeDelete , + End + + self.mn_label_1 := MenustripObject , + MUIA_Family_Child , mnlabel1File , + MUIA_Family_Child , mnlabel1Settings , + End + + self.winMain := WindowObject , + MUIA_Window_Title , 'Ami-Express Setup Tool' , + MUIA_Window_Menustrip , self.mn_label_1 , + MUIA_Window_ID , "0WIN" , + MUIA_Window_AppWindow , MUI_TRUE , + WindowContents , grOUP_ROOT_0 , + End + + self.btnFirstConf := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , '<<' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnFirstConf' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnPrevConf := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , '<' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnPrevConf' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.strConfName := StringObject , + MUIA_Disabled , MUI_TRUE , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'strConfName' , + End + + obj_aux1 := Label2( 'Conference' ) + + obj_aux0 := GroupObject , + MUIA_Group_Columns , 2 , + Child , obj_aux1 , + Child , self.strConfName , + End + + self.strConfNum := StringObject , + MUIA_Disabled , MUI_TRUE , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'strConfNum' , + MUIA_String_Accept , '-0123456789' , + End + + obj_aux3 := Label2( 'Number' ) + + obj_aux2 := GroupObject , + MUIA_Group_Columns , 2 , + MUIA_Weight , 0 , + Child , obj_aux3 , + Child , self.strConfNum , + End + + self.btnNextConf := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , '>' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnNextConf' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnLastConf := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , '>>' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnLastConf' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnAddConf := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Add' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnAddConf' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnConfClone := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Clone' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnConfClone' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnRemoveConf := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Remove' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnRemoveConf' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + gr_confselect := GroupObject , + MUIA_HelpNode , 'GR_confselect' , + MUIA_Frame , MUIV_Frame_Group , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.btnFirstConf , + Child , self.btnPrevConf , + Child , obj_aux0 , + Child , obj_aux2 , + Child , self.btnNextConf , + Child , self.btnLastConf , + Child , self.btnAddConf , + Child , self.btnConfClone , + Child , self.btnRemoveConf , + End + + self.gr_conf_settings := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_conf_settings' , + MUIA_Group_Columns , 4 , + MUIA_Group_HorizSpacing , 4 , + End + + self.gr_conf_settings := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_conf_settings , + End + + self.gr_conf_more := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_conf_more' , + MUIA_Group_Columns , 4 , + MUIA_Group_HorizSpacing , 4 , + End + + self.gr_conf_more := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_conf_more , + End + + self.lv_download_paths := ListObject , + MUIA_Frame , MUIV_Frame_InputList , + End + + self.lv_download_paths := ListviewObject , + MUIA_HelpNode , 'LV_download_paths' , + MUIA_Listview_MultiSelect , MUIV_Listview_MultiSelect_Default , + MUIA_Listview_List , self.lv_download_paths , + End + + self.stR_PA_downloadpath := StringMUI( '' , 80 ) + + self.pa_downloadpath := PopButton( MUII_PopDrawer ) + + self.pa_downloadpath := PopaslObject , + MUIA_HelpNode , 'PA_downloadpath' , + MUIA_Popasl_Type , 0 , + MUIA_Popstring_String , self.stR_PA_downloadpath , + MUIA_Popstring_Button , self.pa_downloadpath , + End + + self.bt_dlpath_add := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Add' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'BT_dlpath_add' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.bt_dlpath_remove := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Remove' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'BT_dlpath_remove' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + gr_grp_20 := GroupObject , + MUIA_HelpNode , 'GR_grp_20' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.pa_downloadpath , + Child , self.bt_dlpath_add , + Child , self.bt_dlpath_remove , + End + + gr_downloadpaths := GroupObject , + MUIA_HelpNode , 'GR_downloadpaths' , + Child , self.lv_download_paths , + Child , gr_grp_20 , + End + + self.lv_upload_paths := ListObject , + MUIA_Frame , MUIV_Frame_InputList , + End + + self.lv_upload_paths := ListviewObject , + MUIA_HelpNode , 'LV_upload_paths' , + MUIA_Listview_MultiSelect , MUIV_Listview_MultiSelect_Default , + MUIA_Listview_List , self.lv_upload_paths , + End + + self.stR_PA_uploadpath := StringMUI( '' , 80 ) + + self.pa_uploadpath := PopButton( MUII_PopDrawer ) + + self.pa_uploadpath := PopaslObject , + MUIA_HelpNode , 'PA_uploadpath' , + MUIA_Popasl_Type , 0 , + MUIA_Popstring_String , self.stR_PA_uploadpath , + MUIA_Popstring_Button , self.pa_uploadpath , + End + + self.bt_ulpath_add := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Add' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'BT_ulpath_add' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.bt_ulpath_remove := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Remove' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'BT_ulpath_remove' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + gr_grp_22 := GroupObject , + MUIA_HelpNode , 'GR_grp_22' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.pa_uploadpath , + Child , self.bt_ulpath_add , + Child , self.bt_ulpath_remove , + End + + gr_uploadpaths := GroupObject , + MUIA_HelpNode , 'GR_uploadpaths' , + Child , self.lv_upload_paths , + Child , gr_grp_22 , + End + + self.lvMsgbases := ListObject , + MUIA_Frame , MUIV_Frame_InputList , + End + + self.lvMsgbases := ListviewObject , + MUIA_HelpNode , 'lvMsgbases' , + MUIA_Listview_MultiSelect , MUIV_Listview_MultiSelect_Default , + MUIA_Listview_List , self.lvMsgbases , + End + + self.btnMsgbaseAdd := SimpleButton( 'Add' ) + + self.btnMsgbaseEdit := SimpleButton( 'Edit' ) + + self.btnMsgbaseDelete := SimpleButton( 'Remove' ) + + gr_grp_46 := GroupObject , + MUIA_HelpNode , 'GR_grp_46' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.btnMsgbaseAdd , + Child , self.btnMsgbaseEdit , + Child , self.btnMsgbaseDelete , + End + + gr_messagebases := GroupObject , + MUIA_HelpNode , 'GR_messagebases' , + Child , self.lvMsgbases , + Child , gr_grp_46 , + End + + self.gr_conf_pages := RegisterObject , + MUIA_Register_Titles , self.stR_gr_conf_pages , + MUIA_HelpNode , 'gr_conf_pages' , + Child , self.gr_conf_settings , + Child , self.gr_conf_more , + Child , gr_downloadpaths , + Child , gr_uploadpaths , + Child , gr_messagebases , + End + + gr_grp_13 := GroupObject , + MUIA_HelpNode , 'GR_grp_13' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.gr_conf_pages , + End + + self.btnSaveConf := SimpleButton( 'Save' ) + + self.btnCancelConf := SimpleButton( 'Close' ) + + gr_save := GroupObject , + MUIA_HelpNode , 'GR_save' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.btnSaveConf , + Child , self.btnCancelConf , + End + + grOUP_ROOT_2 := GroupObject , + Child , gr_confselect , + Child , gr_grp_13 , + Child , gr_save , + End + + self.wi_conf_edit := WindowObject , + MUIA_Window_Title , 'Conference Editor' , + MUIA_Window_ID , "1WIN" , + WindowContents , grOUP_ROOT_2 , + End + + self.btnFirstNode := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , '<<' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnFirstNode' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnPrevNode := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , '<' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnPrevNode' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.str_Node_Number := StringObject , + MUIA_Disabled , MUI_TRUE , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str_Node_Number' , + MUIA_String_Accept , '-0123456789' , + End + + obj_aux5 := Label2( 'Node Number' ) + + obj_aux4 := GroupObject , + MUIA_Group_Columns , 2 , + Child , obj_aux5 , + Child , self.str_Node_Number , + End + + self.btnNextNode := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , '>' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnNextNode' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnLastNode := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , '>>' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnLastNode' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnAddNode := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Add' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnAddNode' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnNodeClone := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Clone' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnNodeClone' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnRemoveNode := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Remove' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnRemoveNode' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + gr_nodeSelect := GroupObject , + MUIA_HelpNode , 'GR_nodeSelect' , + MUIA_Frame , MUIV_Frame_Group , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.btnFirstNode , + Child , self.btnPrevNode , + Child , obj_aux4 , + Child , self.btnNextNode , + Child , self.btnLastNode , + Child , self.btnAddNode , + Child , self.btnNodeClone , + Child , self.btnRemoveNode , + End + + self.gr_node_settings := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_node_settings' , + MUIA_Group_Columns , 4 , + MUIA_Group_HorizSpacing , 4 , + End + + self.gr_node_settings := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_node_settings , + End + + self.gr_node_second_settings := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_node_second_settings' , + MUIA_Group_Columns , 2 , + MUIA_Group_HorizSpacing , 4 , + End + + self.gr_node_second_settings := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_node_second_settings , + End + + self.gr_node_more_settings := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_node_more_settings' , + MUIA_Group_Columns , 2 , + MUIA_Group_HorizSpacing , 4 , + End + + self.gr_node_more_settings := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_node_more_settings , + End + + self.gr_node_serial_settings := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_node_serial_settings' , + MUIA_Group_HorizSpacing , 4 , + End + + self.gr_node_serial_settings := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_node_serial_settings , + End + + self.gr_node_window_settings := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_node_window_settings' , + MUIA_Group_HorizSpacing , 4 , + End + + self.gr_node_window_settings := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_node_window_settings , + End + + lbl300start := Label( '300 Baud' ) + + self.str300start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str300start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl300end := Label( '\ecto' ) + + self.str300end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str300end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl1200start := Label( '1200 Baud' ) + + self.str1200start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str1200start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl1200end := Label( '\ecto' ) + + self.str1200end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str1200end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl2400start := Label( '2400 Baud' ) + + self.str2400start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str2400start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl2400end := Label( '\ecto' ) + + self.str2400end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str2400end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl4800start := Label( '4800 Baud' ) + + self.str4800start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str4800start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl4800end := Label( '\ecto' ) + + self.str4800end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str4800end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl9600start := Label( '9600 Baud' ) + + self.str9600start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str9600start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl9600end := Label( '\ecto' ) + + self.str9600end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str9600end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl12000start := Label( '12000 Baud' ) + + self.str12000start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str12000start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl12000end := Label( '\ecto' ) + + self.str12000end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str12000end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl14400start := Label( '14400 Baud' ) + + self.str14400start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str14400start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl14400end := Label( '\ecto' ) + + self.str14400end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str14400end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl16800start := Label( '16800 Baud' ) + + self.str16800start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str16800start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl16800end := Label( '\ecto' ) + + self.str16800end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str16800end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl19200start := Label( '19200 Baud' ) + + self.str19200start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str19200start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl19200end := Label( '\ecto' ) + + self.str19200end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str19200end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl21600start := Label( '21600 Baud' ) + + self.str21600start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str21600start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl21600end := Label( '\ecto' ) + + self.str21600end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str21600end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl24000start := Label( '24000 Baud' ) + + self.str24000start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str24000start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl24000end := Label( '\ecto' ) + + self.str24000end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str24000end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl26400start := Label( '26400 Baud' ) + + self.str26400start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str26400start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl26400end := Label( '\ecto' ) + + self.str26400end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str26400end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl28800start := Label( '28800 Baud' ) + + self.str28800start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str28800start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl28800end := Label( '\ecto' ) + + self.str28800end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str28800end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl31200start := Label( '31200 Baud' ) + + self.str31200start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str31200start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl31200end := Label( '\ecto' ) + + self.str31200end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str31200end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl33600start := Label( '33600 Baud' ) + + self.str33600start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str33600start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl33600end := Label( '\ecto' ) + + self.str33600end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str33600end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl38400start := Label( '38400 Baud' ) + + self.str38400start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str38400start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl38400end := Label( '\ecto' ) + + self.str38400end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str38400end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl57600start := Label( '57600 Baud' ) + + self.str57600start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str57600start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl57600end := Label( '\ecto' ) + + self.str57600end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str57600end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl115200start := Label( '115200 Baud' ) + + self.str115200start := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str115200start' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + lbl115200end := Label( '\ecto' ) + + self.str115200end := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'str115200end' , + MUIA_String_Accept , '0123456789' , + MUIA_String_MaxLen , 5 , + End + + self.gr_node_time_settings := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_node_time_settings' , + MUIA_Group_Columns , 4 , + MUIA_Group_SameWidth , MUI_TRUE , + MUIA_Group_HorizSpacing , 4 , + Child , lbl300start , + Child , self.str300start , + Child , lbl300end , + Child , self.str300end , + Child , lbl1200start , + Child , self.str1200start , + Child , lbl1200end , + Child , self.str1200end , + Child , lbl2400start , + Child , self.str2400start , + Child , lbl2400end , + Child , self.str2400end , + Child , lbl4800start , + Child , self.str4800start , + Child , lbl4800end , + Child , self.str4800end , + Child , lbl9600start , + Child , self.str9600start , + Child , lbl9600end , + Child , self.str9600end , + Child , lbl12000start , + Child , self.str12000start , + Child , lbl12000end , + Child , self.str12000end , + Child , lbl14400start , + Child , self.str14400start , + Child , lbl14400end , + Child , self.str14400end , + Child , lbl16800start , + Child , self.str16800start , + Child , lbl16800end , + Child , self.str16800end , + Child , lbl19200start , + Child , self.str19200start , + Child , lbl19200end , + Child , self.str19200end , + Child , lbl21600start , + Child , self.str21600start , + Child , lbl21600end , + Child , self.str21600end , + Child , lbl24000start , + Child , self.str24000start , + Child , lbl24000end , + Child , self.str24000end , + Child , lbl26400start , + Child , self.str26400start , + Child , lbl26400end , + Child , self.str26400end , + Child , lbl28800start , + Child , self.str28800start , + Child , lbl28800end , + Child , self.str28800end , + Child , lbl31200start , + Child , self.str31200start , + Child , lbl31200end , + Child , self.str31200end , + Child , lbl33600start , + Child , self.str33600start , + Child , lbl33600end , + Child , self.str33600end , + Child , lbl38400start , + Child , self.str38400start , + Child , lbl38400end , + Child , self.str38400end , + Child , lbl57600start , + Child , self.str57600start , + Child , lbl57600end , + Child , self.str57600end , + Child , lbl115200start , + Child , self.str115200start , + Child , lbl115200end , + Child , self.str115200end , + End + + self.gr_node_time_settings := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_node_time_settings , + End + + self.gr_node_pages := RegisterObject , + MUIA_Register_Titles , self.stR_gr_node_pages , + MUIA_HelpNode , 'gr_node_pages' , + Child , self.gr_node_settings , + Child , self.gr_node_second_settings , + Child , self.gr_node_more_settings , + Child , self.gr_node_serial_settings , + Child , self.gr_node_window_settings , + Child , self.gr_node_time_settings , + End + + gr_grp_50 := GroupObject , + MUIA_HelpNode , 'GR_grp_50' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.gr_node_pages , + End + + self.btnNodeSave := SimpleButton( 'Save' ) + + self.btnNodeCancel := SimpleButton( 'Close' ) + + gr_nodesave := GroupObject , + MUIA_HelpNode , 'GR_nodesave' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.btnNodeSave , + Child , self.btnNodeCancel , + End + + grOUP_ROOT_3 := GroupObject , + Child , gr_nodeSelect , + Child , gr_grp_50 , + Child , gr_nodesave , + End + + self.wi_nodeEdit := WindowObject , + MUIA_Window_Title , 'Node Editor' , + MUIA_Window_ID , "2WIN" , + WindowContents , grOUP_ROOT_3 , + End + + self.lv_list := ListObject , + MUIA_Frame , MUIV_Frame_InputList , + End + + self.lv_list := ListviewObject , + MUIA_HelpNode , 'LV_list' , + MUIA_Listview_MultiSelect , MUIV_Listview_MultiSelect_Default , + MUIA_Listview_List , self.lv_list , + End + + self.strListItem := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'strListItem' , + End + + self.btnItemAdd := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Add' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnItemAdd' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnItemEdit := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Edit' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnItemEdit' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + self.btnItemRemove := TextObject , + ButtonFrame , + MUIA_Weight , 0 , + MUIA_Background , MUII_ButtonBack , + MUIA_Text_Contents , 'Remove' , + MUIA_Text_PreParse , '\ec' , + MUIA_HelpNode , 'btnItemRemove' , + MUIA_InputMode , MUIV_InputMode_RelVerify , + End + + space_28 := VSpace( 0 ) + + self.grp_computers_add := GroupObject , + MUIA_HelpNode , 'grp_computers_add' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.strListItem , + Child , self.btnItemAdd , + Child , self.btnItemEdit , + Child , self.btnItemRemove , + Child , space_28 , + End + + self.grp_arrange := GroupObject , + MUIA_HelpNode , 'grp_arrange' , + Child , self.lv_list , + Child , self.grp_computers_add , + End + + self.btnListSave := SimpleButton( 'Save' ) + + self.btnListCancel := SimpleButton( 'Close' ) + + gr_grp_28 := GroupObject , + MUIA_HelpNode , 'GR_grp_28' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.btnListSave , + Child , self.btnListCancel , + End + + grp_root_listitems := GroupObject , + Child , self.grp_arrange , + Child , gr_grp_28 , + End + + self.wi_listEdit := WindowObject , + MUIA_Window_Title , 'Edit ' , + MUIA_Window_ID , "3WIN" , + WindowContents , grp_root_listitems , + End + + self.btnAccess := SimpleButton( 'Access Levels' ) + + self.btnAreas := SimpleButton( 'Areas' ) + + self.btnPresets := SimpleButton( 'Presets' ) + + grOUP_ROOT_5 := GroupObject , + Child , self.btnAccess , + Child , self.btnAreas , + Child , self.btnPresets , + End + + self.wi_security := WindowObject , + MUIA_Window_Title , 'Security' , + MUIA_Window_ID , "4WIN" , + WindowContents , grOUP_ROOT_5 , + End + + self.gr_settings := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_settings' , + MUIA_Group_Columns , 2 , + End + + self.gr_settings := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_settings , + End + + self.btnSettingsSave := SimpleButton( 'Save' ) + + self.btnSettingsCancel := SimpleButton( 'Close' ) + + gr_settingsSaveCancel := GroupObject , + MUIA_HelpNode , 'GR_settingsSaveCancel' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.btnSettingsSave , + Child , self.btnSettingsCancel , + End + + grOUP_ROOT_6 := GroupObject , + Child , self.gr_settings , + Child , gr_settingsSaveCancel , + End + + self.wi_systemdata := WindowObject , + MUIA_Window_Title , 'System Data' , + MUIA_Window_ID , "5WIN" , + WindowContents , grOUP_ROOT_6 , + End + + self.la_item_detail1 := Label( 'item label' ) + + self.stR_item_detail1e := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'STR_item_detail1e' , + End + + self.gr_item_detail1 := GroupObject , + MUIA_HelpNode , 'GR_item_detail1' , + MUIA_Group_Columns , 2 , + Child , self.la_item_detail1 , + Child , self.stR_item_detail1e , + End + + self.la_item_detail2 := Label( 'detail' ) + + self.stR_item_detail2 := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'STR_item_detail2' , + End + + self.gr_item_detail2 := GroupObject , + MUIA_HelpNode , 'GR_item_detail2' , + MUIA_Group_Columns , 2 , + Child , self.la_item_detail2 , + Child , self.stR_item_detail2 , + End + + self.bt_new_item_save := SimpleButton( 'Ok' ) + + self.bt_new_item_cancel := SimpleButton( 'Cancel' ) + + gr_item_buttons := GroupObject , + MUIA_HelpNode , 'GR_item_buttons' , + MUIA_Group_Columns , 2 , + Child , self.bt_new_item_save , + Child , self.bt_new_item_cancel , + End + + grOUP_ROOT_7 := GroupObject , + Child , self.gr_item_detail1 , + Child , self.gr_item_detail2 , + Child , gr_item_buttons , + End + + self.wi_add_item := WindowObject , + MUIA_Window_Title , 'Add ' , + MUIA_Window_ID , "6WIN" , + WindowContents , grOUP_ROOT_7 , + End + + self.ra_presets := RadioObject , + MUIA_HelpNode , 'RA_presets' , + MUIA_Radio_Entries , self.ra_presetsContent , + End + + gr_grp_36 := GroupObject , + MUIA_HelpNode , 'GR_grp_36' , + Child , self.ra_presets , + End + + self.gr_preset_settings := GroupObject , + MUIA_HelpNode , 'GR_preset_settings' , + MUIA_Group_Columns , 2 , + End + + gr_grp_39 := GroupObject , + MUIA_HelpNode , 'GR_grp_39' , + MUIA_Group_Horiz , MUI_TRUE , + Child , gr_grp_36 , + Child , self.gr_preset_settings , + End + + self.btnPresetSave := SimpleButton( 'Save' ) + + self.btnPresetClose := SimpleButton( 'Close' ) + + gr_grp_38 := GroupObject , + MUIA_HelpNode , 'GR_grp_38' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.btnPresetSave , + Child , self.btnPresetClose , + End + + grOUP_ROOT_8 := GroupObject , + Child , gr_grp_39 , + Child , gr_grp_38 , + End + + self.wi_presets := WindowObject , + MUIA_Window_Title , 'Edit Presets' , + MUIA_Window_ID , "7WIN" , + WindowContents , grOUP_ROOT_8 , + End + + self.la_area := Label( 'Area Name' ) + + self.stR_area := StringObject , + MUIA_Frame , MUIV_Frame_String , + MUIA_HelpNode , 'STR_area' , + End + + gr_grp_43 := GroupObject , + MUIA_HelpNode , 'GR_grp_43' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.la_area , + Child , self.stR_area , + End + + self.gr_area_main := VirtgroupObject , + VirtualFrame , + MUIA_HelpNode , 'GR_area_main' , + MUIA_Group_Columns , 2 , + End + + self.gr_area_main := ScrollgroupObject , + MUIA_Scrollgroup_Contents , self.gr_area_main , + End + + self.bt_area_save := SimpleButton( 'Ok' ) + + self.bt_area_cancel := SimpleButton( 'Cancel' ) + + gr_area_save := GroupObject , + MUIA_HelpNode , 'GR_area_save' , + MUIA_Group_Horiz , MUI_TRUE , + Child , self.bt_area_save , + Child , self.bt_area_cancel , + End + + grOUP_ROOT_9 := GroupObject , + Child , gr_grp_43 , + Child , self.gr_area_main , + Child , gr_area_save , + End + + self.wi_areas := WindowObject , + MUIA_Window_Title , 'window_title' , + MUIA_Window_ID , "8WIN" , + WindowContents , grOUP_ROOT_9 , + End + + self.btnBBSCmd := SimpleButton( 'Edit BBSCmd' ) + + self.btnSysCmd := SimpleButton( 'Edit SysCmd' ) + + self.grpCommands := GroupObject , + Child , self.btnBBSCmd , + Child , self.btnSysCmd , + End + + self.wi_commands := WindowObject , + MUIA_Window_Title , 'Commands' , + MUIA_Window_ID , "9WIN" , + WindowContents , self.grpCommands , + End + + self.tx_label_3 := TextObject , + MUIA_Background , MUII_WindowBack , + MUIA_Text_Contents , self.stR_TX_label_3 , + MUIA_Text_SetMin , MUI_TRUE , + End + + self.txtAcpStatus := TextObject , + MUIA_Background , MUII_WindowBack , + MUIA_Frame , MUIV_Frame_Text , + MUIA_Text_Contents , self.stR_txtAcpStatus , + MUIA_Text_SetMin , MUI_TRUE , + End + + self.tx_label_4 := TextObject , + MUIA_Background , MUII_WindowBack , + MUIA_Text_Contents , self.stR_TX_label_4 , + MUIA_Text_SetMin , MUI_TRUE , + End + + self.txtNodeCount := TextObject , + MUIA_Background , MUII_WindowBack , + MUIA_Frame , MUIV_Frame_Text , + MUIA_Text_Contents , self.stR_txtNodeCount , + MUIA_Text_SetMin , MUI_TRUE , + End + + self.tx_label_6 := TextObject , + MUIA_Background , MUII_WindowBack , + MUIA_Text_Contents , self.stR_TX_label_6 , + MUIA_Text_SetMin , MUI_TRUE , + End + + self.txtConfCount := TextObject , + MUIA_Background , MUII_WindowBack , + MUIA_Frame , MUIV_Frame_Text , + MUIA_Text_Contents , self.stR_txtConfCount , + MUIA_Text_SetMin , MUI_TRUE , + End + + space_29 := VSpace( 0 ) + + gr_grp_48 := GroupObject , + MUIA_HelpNode , 'GR_grp_48' , + Child , self.tx_label_3 , + Child , self.txtAcpStatus , + Child , self.tx_label_4 , + Child , self.txtNodeCount , + Child , self.tx_label_6 , + Child , self.txtConfCount , + Child , space_29 , + End + + self.btnShutdown := SimpleButton( 'Shutdown' ) + + self.btnStart := SimpleButton( 'Start' ) + + self.btnRestart := SimpleButton( 'Restart' ) + + self.btnClose := SimpleButton( 'Close' ) + + space_30 := HVSpace + + gr_grp_49 := GroupObject , + MUIA_HelpNode , 'GR_grp_49' , + MUIA_Weight , 49 , + Child , self.btnShutdown , + Child , self.btnStart , + Child , self.btnRestart , + Child , self.btnClose , + Child , space_30 , + End + + grOUP_ROOT_11 := GroupObject , + MUIA_Group_Columns , 2 , + Child , gr_grp_48 , + Child , gr_grp_49 , + End + + self.winTools := WindowObject , + MUIA_Window_Title , 'Tools' , + MUIA_Window_ID , "10WI" , + WindowContents , grOUP_ROOT_11 , + End + + self.app := ApplicationObject , + //( IF icon THEN MUIA_Application_DiskObject ELSE TAG_IGNORE ) , icon , + //( IF arexx THEN MUIA_Application_Commands ELSE TAG_IGNORE ) , ( IF arexx THEN arexx.commands ELSE NIL ) , + //( IF arexx THEN MUIA_Application_RexxHook ELSE TAG_IGNORE ) , ( IF arexx THEN arexx.error ELSE NIL ) , + //( IF menu THEN MUIA_Application_Menu ELSE TAG_IGNORE ) , menu , + MUIA_Application_Author , 'Darren Coles' , + MUIA_Application_Base , 'NONE' , + MUIA_Application_Title , 'Ami-Express Configuration Editor' , + MUIA_Application_Copyright , '(c)2023 Darren Coles' , + MUIA_Application_HelpFile , 'axsys.guide' , + SubWindow , self.winMain , + SubWindow , self.wi_conf_edit , + SubWindow , self.wi_nodeEdit , + SubWindow , self.wi_listEdit , + SubWindow , self.wi_security , + SubWindow , self.wi_systemdata , + SubWindow , self.wi_add_item , + SubWindow , self.wi_presets , + SubWindow , self.wi_areas , + SubWindow , self.wi_commands , + SubWindow , self.winTools , + End + +ENDPROC self.app + + +->///////////////////////////////////////////////////////////////////////////// +->////////////////////////// Disposes the object or the whole application ///// +->///////////////////////////////////////////////////////////////////////////// +PROC dispose() OF app_obj IS ( IF self.app THEN Mui_DisposeObject( self.app ) ELSE NIL ) + + diff --git a/axSetupTool/axsys.MUIB b/axSetupTool/axsys.MUIB new file mode 100644 index 0000000..4389395 Binary files /dev/null and b/axSetupTool/axsys.MUIB differ diff --git a/axSetupTool/configObject.e b/axSetupTool/configObject.e new file mode 100644 index 0000000..6cc8a8d --- /dev/null +++ b/axSetupTool/configObject.e @@ -0,0 +1,241 @@ + +OPT MODULE + + MODULE '*/stringlist' + +EXPORT OBJECT fChecker + filename:PTR TO CHAR + checker:PTR TO CHAR + error1:PTR TO CHAR + error2:PTR TO CHAR + error3:PTR TO CHAR + error4:PTR TO CHAR + error5:PTR TO CHAR + error6:PTR TO CHAR + error7:PTR TO CHAR + error8:PTR TO CHAR + error9:PTR TO CHAR + error10:PTR TO CHAR + options:PTR TO CHAR + priority:PTR TO CHAR + script:PTR TO CHAR + stack:PTR TO CHAR +ENDOBJECT + +EXPORT PROC create() OF fChecker + self.filename:=String(255) + self.checker:=String(255) + self.error1:=String(255) + self.error2:=String(255) + self.error3:=String(255) + self.error4:=String(255) + self.error5:=String(255) + self.error6:=String(255) + self.error7:=String(255) + self.error8:=String(255) + self.error9:=String(255) + self.error10:=String(255) + self.options:=String(255) + self.priority:=String(255) + self.script:=String(255) + self.stack:=String(255) +ENDPROC + +EXPORT PROC end() OF fChecker + DisposeLink(self.filename) + DisposeLink(self.checker) + DisposeLink(self.error1) + DisposeLink(self.error2) + DisposeLink(self.error3) + DisposeLink(self.error4) + DisposeLink(self.error5) + DisposeLink(self.error6) + DisposeLink(self.error7) + DisposeLink(self.error8) + DisposeLink(self.error9) + DisposeLink(self.error10) + DisposeLink(self.options) + DisposeLink(self.priority) + DisposeLink(self.script) + DisposeLink(self.stack) +ENDPROC + +EXPORT OBJECT protocol + filename:PTR TO CHAR + options:PTR TO CHAR + httpHost:PTR TO CHAR + httpTemp:PTR TO CHAR + ftpHost:PTR TO CHAR + ftpAuth:CHAR + txWindow:PTR TO CHAR + rxWindow:PTR TO CHAR +ENDOBJECT + +EXPORT PROC create() OF protocol + self.filename:=String(255) + self.options:=String(255) + self.httpHost:=String(255) + self.httpTemp:=String(255) + self.ftpHost:=String(255) + self.ftpAuth:=0 + self.txWindow:=String(255) + self.rxWindow:=String(255) +ENDPROC + +EXPORT PROC end() OF protocol + DisposeLink(self.filename) + DisposeLink(self.options) + DisposeLink(self.httpHost) + DisposeLink(self.httpTemp) + DisposeLink(self.ftpHost) + DisposeLink(self.txWindow) + DisposeLink(self.rxWindow) +ENDPROC + +EXPORT OBJECT command + filename:PTR TO CHAR + name:PTR TO CHAR + location:PTR TO CHAR + access:PTR TO CHAR + internal:PTR TO CHAR + mimicVer:PTR TO CHAR + password:PTR TO CHAR + passParams:PTR TO CHAR + priority:PTR TO CHAR + resident:CHAR + quickMode:CHAR + stack:PTR TO CHAR + type:PTR TO CHAR + trapon:CHAR + expertMode:CHAR + doorSilent:CHAR + logInputs:CHAR + scriptCheck:CHAR + multiNode:CHAR + banner:PTR TO CHAR +ENDOBJECT + +EXPORT PROC create() OF command + self.filename:=String(255) + self.name:=String(255) + self.location:=String(255) + self.access:=String(255) + self.internal:=String(255) + self.mimicVer:=String(255) + self.password:=String(255) + self.passParams:=String(255) + self.priority:=String(255) + self.resident:=0 + self.quickMode:=0 + self.stack:=String(255) + self.type:=String(255) + self.trapon:=0 + self.expertMode:=0 + self.doorSilent:=0 + self.logInputs:=0 + self.scriptCheck:=0 + self.multiNode:=0 + self.banner:=String(255) +ENDPROC + +EXPORT PROC end() OF command + DisposeLink(self.filename) + DisposeLink(self.name) + DisposeLink(self.location) + DisposeLink(self.access) + DisposeLink(self.internal) + DisposeLink(self.mimicVer) + DisposeLink(self.password) + DisposeLink(self.passParams) + DisposeLink(self.priority) + DisposeLink(self.stack) + DisposeLink(self.type) + DisposeLink(self.banner) +ENDPROC + +EXPORT OBJECT msgbase + name:PTR TO CHAR + location:PTR TO CHAR + extSend:CHAR + username:CHAR + realname:CHAR + internetname:CHAR +ENDOBJECT + +EXPORT PROC create() OF msgbase + self.name:=String(255) + self.location:=String(255) + self.extSend:=0 + self.username:=0 + self.realname:=0 + self.internetname:=0 +ENDPROC + +EXPORT PROC end() OF msgbase + DisposeLink(self.name) + DisposeLink(self.location) +ENDPROC + +EXPORT OBJECT area + filename:PTR TO CHAR + confList:PTR TO LONG +ENDOBJECT + +EXPORT PROC create() OF area + self.filename:=String(255) + self.confList:=0 +ENDPROC + +EXPORT PROC end() OF area + DisposeLink(self.filename) +ENDPROC + + +EXPORT OBJECT accessLevel + filename:PTR TO CHAR + accessList:PTR TO stringlist +ENDOBJECT + +EXPORT PROC create() OF accessLevel + DEF newList:PTR TO stringlist + self.filename:=String(255) + + NEW newList.stringlist(200) + self.accessList:=newList + +ENDPROC + +EXPORT PROC end() OF accessLevel + DisposeLink(self.filename) + END self.accessList +ENDPROC + +EXPORT PROC getAccessLevels() + DEF result:PTR TO LONG + result:= + ['ACS.MAX_PAGES','ACS.ACCOUNT_EDITING','ACS.READ_BULLETINS','ACS.COMMENT_TO_SYSOP','ACS.DOWNLOAD','ACS.UPLOAD','ACS.ENTER_MESSAGE','ACS.FILE_LISTINGS','ACS.JOIN_CONFERENCE','ACS.NEW_FILES_SINCE', + 'ACS.PAGE_SYSOP','ACS.READ_MESSAGE','ACS.REMOTE_SHELL','ACS.DISPLAY_USER_STATS','ACS.VIEW_A_FILE','ACS.EDIT_USER_INFO','ACS.EDIT_INTERNET_NAME','ACS.EDIT_USER_LOCATION', + 'ACS.EDIT_PHONE_NUMBER','ACS.EDIT_PASSWORD','ACS.ZIPPY_TEXT_SEARCH','ACS.OVERRIDE_CHAT','ACS.SYSOP_DOWNLOAD','ACS.SYSOP_VIEW','ACS.SYSOP_READ','ACS.KEEP_UPLOAD_CREDIT', + 'ACS.OVERRIDE_TIMES','ACS.CLEAR_SCREEN_MSG','ACS.FREE_RESUMING','ACS.ONE_TIME_BULLETINS','ACS.DO_CALLERSLOG','ACS.SENTBY_FILES','ACS.DO_UD_LOG','ACS.SCREEN_TO_FRONT', + 'ACS.DEFAULT_CHAT_ON','ACS.EALL_MESSAGES','ACS.DUPE_FILECHECK','ACS.MESSAGE_EDIT','ACS.LIST_NODES','ACS.MSG_LEVEL','ACS.MSG_EXPERATION','ACS.DELETE_MESSAGE','ACS.ATTACH_FILES', + 'ACS.CUSTOMCOMMANDS','ACS.JOIN_SUB_CONFERENCE','ACS.ZOOM_MAIL','ACS.MCI_MSG','ACS.EDIT_DIRS','ACS.EDIT_FILES','ACS.BREAK_CHAT','ACS.QUIET_NODE','ACS.SYSOP_COMMANDS','ACS.WHO_IS_ONLINE', + 'ACS.RELOGON','ACS.ULSTATS','ACS.XPR_RECEIVE','ACS.XPR_SEND','ACS.WILDCARDS','ACS.CONFERENCE_ACCOUNTING','ACS.PRI_MSGFILES','ACS.PUB_MSGFILES','ACS.FULL_EDIT','ACS.CONFFLAGS', + 'ACS.OLM','ACS.HIDE_FILES','ACS.SHOW_PAYMENTS','ACS.CREDIT_ACCESS','ACS.VOTE','ACS.MODIFY_VOTE','ACS.FILE_EXPANSION','ACS.EDIT_REAL_NAME','ACS.EDIT_USER_NAME','ACS.CENSORED', + 'ACS.ACCOUNT_VIEW','ACS.TRANSLATION','ACS.UNKNOWN','ACS.CREATE_CONFERENCE','ACS.LOCAL_DOWNLOADS','ACS.OVERRIDE_DEFAULTS','ACS.HOLD_ACCESS','ACS.EDIT_EMAIL', + 'ACS.READ_PRIV_EALL','ACS.READ_PRIV_ALL','ACS.OVERRIDE_TIMELIMIT','ACS.OVERRIDE_CHATLIMIT','ACS.NO_TIMEOUT','ACS.USER_ULSTATS'] +ENDPROC result + +EXPORT PROC getAccessNames() + DEF result:PTR TO LONG + result:= + ['Max sysop pages','Account editing','Read bulletins','Comment to sysop','Download files','Upload files','Send message','View file listings','Join a conference','View new files', + 'Page sysop','Read messages','Remote shell','Display user stats','View a file','Edit user info','Edit internet name','Edit location', + 'Edit phone number','Edit password','Text search (zippy)','Override chat','Sysop download','Sysop view','Sysop read','Upload credit (unused)', + 'Override times','Clear screen (unused)','Free resuming (unused)','One time bulletins (unused)','Enable callerslog (unused)','Add sentby line (unused)','Enable UD log (unused)','Bring screen to front (unused)', + 'Default chat on (unused)','Send EALL messages','dupe filecheck (unused)','Edit messages','View callerslogs','Message Level (unused)','Message expiration (unused)','Delete Messages','Attach files to messages', + 'Custom commands (unused)','Join sub conf (unused)','Zoom mail','Enable MCI messages','Edit Dirs','Edit Files','Break from chat','Allow quiet mode','Sysop commands','See node users (WHO)', + 'Relogon','Show sysop UL stats','External protocol upload','External protocol download','Wildcards (unused)','Enable conference accounting','Private messages','Public messages','Change screen editor','Edit conf flags', + 'Online messages','Hide filenames in WHO','Show Payments','Credit Account Access','Voting','Edit Votes','Enable file expansion','Edit real name','Edit user name','User censored', + 'Account view (unused)','Enable translation','Unknown (unused)','Create conference (unused)','Local downloads','Override defaults','Allow hold access','Edit emails', + 'Read private EALL msgs','Read private ALL msgs','Override time limits','Override chat limits','Don''t time out','Show user upload stats'] +ENDPROC result \ No newline at end of file diff --git a/axSetupTool/controls.e b/axSetupTool/controls.e new file mode 100644 index 0000000..f1fd649 --- /dev/null +++ b/axSetupTool/controls.e @@ -0,0 +1,367 @@ + OPT MODULE + +MODULE 'muimaster','libraries/mui','tools/boopsi','intuition/classusr','utility/hooks','tools/installhook','libraries/asl' +MODULE '*helpText' + +EXPORT ENUM TYPE_STRING,TYPE_INT,TYPE_CYCLE,TYPE_CHECKBOX,TYPE_DIRSELECT,TYPE_FILESELECT,TYPE_MODESELECT +EXPORT OBJECT control + hook:PTR TO LONG + hook2:PTR TO LONG + muiLabel: PTR TO LONG + group: PTR TO LONG + muiControl: PTR TO LONG + type:INT +ENDOBJECT + +PROC makeLabel(caption,helpText) OF control + DEF lbl + lbl := TextObject , + MUIA_Text_PreParse , '\el' , + MUIA_Text_Contents , caption , + MUIA_ShortHelp,helpText, + MUIA_Weight,0, + MUIA_InnerLeft , 0 , + MUIA_InnerRight , 0 , + End +ENDPROC lbl + +EXPORT PROC createString(labelCaption,helpTextId,app,changeHook, window) OF control + DEF helpText + + helpText:=getHelpText(helpTextId) + self.hook:=0 + self.hook2:=0 + self.muiLabel:=self.makeLabel(labelCaption,helpText) + self.group:=NIL + self.muiControl:=StringObject, + MUIA_Frame,MUIV_Frame_String, + MUIA_ShortHelp,helpText, + MUIA_Weight,100, + End + + domethod( self.muiControl, [ + MUIM_Notify , MUIA_String_Contents , MUIV_EveryTime , + app, + 3 , + MUIM_CallHook , changeHook, window ]) + + self.type:=TYPE_STRING +ENDPROC + +EXPORT PROC createStringInt(labelCaption,helpTextId,app,changeHook, window) OF control + DEF helpText + + helpText:=getHelpText(helpTextId) + self.hook:=0 + self.hook2:=0 + self.muiLabel:=self.makeLabel(labelCaption,helpText) + self.group:=NIL + self.muiControl:=StringObject, + MUIA_Frame,MUIV_Frame_String, + MUIA_ShortHelp,helpText, + MUIA_Weight,100, + MUIA_String_Accept , '0123456879', + End + + domethod( self.muiControl, [ + MUIM_Notify , MUIA_String_Contents , MUIV_EveryTime , + app, + 3 , + MUIM_CallHook , changeHook, window ]) + self.type:=TYPE_INT +ENDPROC + +EXPORT PROC createCycle(labelCaption,helpTextId,values,app,changeHook, window) OF control + DEF helpText + + helpText:=getHelpText(helpTextId) + self.hook:=0 + self.hook2:=0 + self.muiLabel:=self.makeLabel(labelCaption,helpText) + self.group:=NIL + self.muiControl:=CycleObject, + MUIA_Frame,MUIV_Frame_Button, + MUIA_ShortHelp,helpText, + MUIA_Weight,100, + MUIA_Cycle_Entries,values, + End + + domethod( self.muiControl, [ + MUIM_Notify , MUIA_Cycle_Active , MUIV_EveryTime , + app, + 3 , + MUIM_CallHook , changeHook, window ]) + + self.type:=TYPE_CYCLE +ENDPROC + +EXPORT PROC createCheckBox(labelCaption,helpTextId,app,changeHook, window) OF control + DEF helpText + + helpText:=getHelpText(helpTextId) + self.hook:=0 + self.hook2:=0 + self.muiLabel:=self.makeLabel(labelCaption,helpText) + self.muiControl:=CheckMark( FALSE ) + self.group:=GroupObject , + MUIA_ShortHelp,helpText, + MUIA_Group_Horiz , MUI_TRUE , + Child , HVSpace , + Child , self.muiControl , + Child , HVSpace , + End + + domethod( self.muiControl, [ + MUIM_Notify , MUIA_Selected , MUIV_EveryTime , + app, + 3 , + MUIM_CallHook , changeHook, window ]) + self.type:=TYPE_CHECKBOX +ENDPROC + +PROC setaslflags() OF control + DEF tags:PTR TO LONG + MOVE.L A1,tags + + WHILE tags[]<>0 DO tags++ + tags[]:=ASLFR_DRAWERSONLY + tags++ + tags[]:=-1 + tags++ + tags[]:=0 + +ENDPROC TRUE + +EXPORT PROC createDirSelect(labelCaption,helpTextId,app,changeHook, window) OF control + DEF hook:PTR TO hook + DEF helpText + + helpText:=getHelpText(helpTextId) + self.muiLabel:=self.makeLabel(labelCaption,helpText) + self.group:=NIL + NEW hook + self.hook:=hook + installhook( hook, {setaslflags}) + self.hook2:=0 + + self.muiControl:=PopaslObject, + MUIA_ShortHelp,helpText, + MUIA_Popasl_Type,0, + MUIA_Weight,100, + MUIA_Popasl_StartHook,hook, + MUIA_Popstring_String,StringMUI( '' , 80 ), + MUIA_Popstring_Button,PopButton( MUII_PopDrawer ), + End + + domethod( self.muiControl, [ + MUIM_Notify , MUIA_String_Contents , MUIV_EveryTime , + app, + 3 , + MUIM_CallHook , changeHook, window ]) + + self.type:=TYPE_DIRSELECT +ENDPROC + +EXPORT PROC createFileSelect(labelCaption,helpTextId,app,changeHook, window) OF control + DEF helpText + + helpText:=getHelpText(helpTextId) + self.hook:=0 + self.hook2:=0 + self.muiLabel:=self.makeLabel(labelCaption,helpText) + self.group:=NIL + self.muiControl:=PopaslObject, + MUIA_ShortHelp,helpText, + MUIA_Popasl_Type,0, + MUIA_Weight,100, + MUIA_Popstring_String,StringMUI( '' , 80 ), + MUIA_Popstring_Button,PopButton( MUII_PopFile ), + End + + domethod( self.muiControl, [ + MUIM_Notify , MUIA_String_Contents , MUIV_EveryTime , + app, + 3 , + MUIM_CallHook , changeHook, window ]) + + self.type:=TYPE_FILESELECT +ENDPROC + +PROC setaslmodeflags() OF control + DEF tags:PTR TO LONG + DEF control:PTR TO LONG + DEF str,val + MOVE.L A1,tags + MOVE.L A2,control + + get(control,MUIA_String_Contents,{str}) + + IF StrLen(str)=0 + val:=$8000 + ELSE + val:=Val(str) + ENDIF + + WHILE tags[]<>0 DO tags++ + tags[]:=ASLSM_INITIALDISPLAYID + tags++ + tags[]:=val + tags++ + tags[]:=0 + +ENDPROC TRUE + +PROC getmodeid() OF control + DEF asl:PTR TO screenmoderequester + DEF control + DEF str[20]:STRING + MOVE.L A1,asl + MOVE.L A2,control + StringF(str,'\d',asl.displayid) + set(control,MUIA_String_Contents,str) +ENDPROC + +EXPORT PROC createModeSelect(labelCaption,helpTextId,app,changeHook, window) OF control + DEF hook:PTR TO hook + DEF helpText + + helpText:=getHelpText(helpTextId) + NEW hook + self.hook:=hook + NEW hook + self.hook2:=hook + installhook( self.hook, {setaslmodeflags}) + installhook( self.hook2, {getmodeid}) + self.muiLabel:=self.makeLabel(labelCaption,helpText) + self.group:=NIL + self.muiControl:=PopaslObject, + MUIA_ShortHelp,helpText, + MUIA_Popasl_Type,2, + MUIA_Popasl_StartHook,self.hook, + MUIA_Popasl_StopHook,self.hook2, + MUIA_Weight,100, + MUIA_Popstring_String,StringMUI( '' , 80 ), + MUIA_Popstring_Button,PopButton( MUII_PopFile ), + End + + domethod( self.muiControl, [ + MUIM_Notify , MUIA_String_Contents , MUIV_EveryTime , + app, + 3 , + MUIM_CallHook , changeHook, window]) + + self.type:=TYPE_MODESELECT +ENDPROC + +EXPORT PROC addToGroup(group) OF control + domethod(group,[OM_ADDMEMBER,self.muiLabel]) + IF self.group + domethod(group,[OM_ADDMEMBER,self.group]) + ELSE + domethod(group,[OM_ADDMEMBER,self.muiControl]) + ENDIF +ENDPROC + +EXPORT PROC removeFromGroup(group) OF control + domethod(group,[OM_REMMEMBER,self.muiLabel]) + IF self.group + domethod(group,[OM_REMMEMBER,self.group]) + ELSE + domethod(group,[OM_REMMEMBER,self.muiControl]) + ENDIF +ENDPROC + +EXPORT PROC setValueStr(newValue) OF control + SELECT self.type + CASE TYPE_STRING + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,newValue]) + CASE TYPE_DIRSELECT + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,newValue]) + CASE TYPE_FILESELECT + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,newValue]) + CASE TYPE_MODESELECT + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,newValue]) + CASE TYPE_INT + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,newValue]) + //CASE TYPE_CHECKBOX + //do nothing + //CASE TYPE_CYCLE + //do nothing + ENDSELECT +ENDPROC + +EXPORT PROC setValue(newValue) OF control + SELECT self.type + CASE TYPE_STRING + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,newValue]) + CASE TYPE_DIRSELECT + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,newValue]) + CASE TYPE_FILESELECT + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,newValue]) + CASE TYPE_MODESELECT + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,newValue]) + CASE TYPE_INT + IF newValue=-1 + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Contents,'']) + ELSE + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_String_Integer,newValue]) + ENDIF + CASE TYPE_CHECKBOX + domethod(self.muiControl,[MUIM_NoNotifySet,MUIA_Selected,IF newValue THEN MUI_TRUE ELSE FALSE]) + //CASE TYPE_CYCLE + //do nothing + ENDSELECT +ENDPROC + +EXPORT PROC getValue() OF control + DEF currVal,index,items:PTR TO LONG + SELECT self.type + CASE TYPE_STRING + get(self.muiControl, MUIA_String_Contents,{currVal}) + CASE TYPE_DIRSELECT + get(self.muiControl, MUIA_String_Contents,{currVal}) + CASE TYPE_FILESELECT + get(self.muiControl, MUIA_String_Contents,{currVal}) + CASE TYPE_INT + get(self.muiControl, MUIA_String_Contents,{currVal}) + CASE TYPE_CHECKBOX + get(self.muiControl,MUIA_Selected,{currVal}) + CASE TYPE_CYCLE + get(self.muiControl,MUIA_Cycle_Active,{index}) + IF index>=0 + get(self.muiControl,MUIA_Cycle_Entries,{items}) + currVal:=items[index] + ENDIF + CASE TYPE_MODESELECT + get(self.muiControl, MUIA_String_Contents,{currVal}) + ENDSELECT +ENDPROC currVal + +EXPORT PROC setValueIndex(newIndex) OF control + IF self.type=TYPE_CYCLE + set(self.muiControl,MUIA_Cycle_Active,newIndex) + ENDIF +ENDPROC + +EXPORT PROC getValueIndex() OF control + DEF index=-1 + IF self.type=TYPE_CYCLE + get(self.muiControl,MUIA_Cycle_Active,{index}) + ENDIF +ENDPROC index + +EXPORT PROC disable(newVal) OF control + set( self.muiControl, MUIA_Disabled , IF newVal THEN MUI_TRUE ELSE FALSE) +ENDPROC + +EXPORT PROC end() OF control + Mui_DisposeObject(self.muiLabel) + IF self.group + Mui_DisposeObject(self.group) + ELSE + Mui_DisposeObject(self.muiControl) + ENDIF + IF self.hook THEN END self.hook + IF self.hook2 THEN END self.hook2 +ENDPROC + diff --git a/axSetupTool/frmAccess.e b/axSetupTool/frmAccess.e new file mode 100644 index 0000000..5742365 --- /dev/null +++ b/axSetupTool/frmAccess.e @@ -0,0 +1,87 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi','workbench/workbench','icon','intuition/classusr' +MODULE 'utility/tagitem','utility/hooks','tools/installhook','exec/lists' +MODULE '*axedit','*frmBase','*frmPresetsEdit','*frmEditList' + +EXPORT OBJECT frmAccess OF frmBase + btnAccess : PTR TO LONG + btnAreas : PTR TO LONG + btnPresets : PTR TO LONG + + acpConfigName : PTR TO CHAR + + btnAccessClick: hook + btnAreasClick: hook + btnPresetsClick: hook +ENDOBJECT + +PROC create(app:PTR TO app_obj) OF frmAccess + DEF group + SUPER self.create(app) + self.winMain:=app.wi_security + + self.btnAccess:=app.btnAccess + self.btnAreas:=app.btnAreas + self.btnPresets:=app.btnPresets +ENDPROC + +PROC goAccess() OF frmAccess + DEF editList:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW editList.create(self.app) + editList.editAccessLevel(self.acpConfigName) + END editList + self.wake() +ENDPROC + +PROC goAreas() OF frmAccess + DEF editList:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW editList.create(self.app) + editList.editAreas(self.acpConfigName) + END editList + self.wake() +ENDPROC + +PROC goPresets() OF frmAccess + DEF presetsEdit:PTR TO frmPresetsEdit + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW presetsEdit.create(self.app) + presetsEdit.editPresets(self.acpConfigName) + END presetsEdit + self.wake() +ENDPROC + +PROC addNotifications() OF frmAccess + + self.setupButtonClick(self.btnAccess,self.btnAccessClick,{goAccess}) + self.setupButtonClick(self.btnAreas,self.btnAreasClick,{goAreas}) + self.setupButtonClick(self.btnPresets,self.btnPresetsClick,{goPresets}) +ENDPROC + +PROC removeNotifications() OF frmAccess + domethod(self.btnAccess,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnAreas,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnPresets,[MUIM_KillNotify,MUIA_Pressed]) +ENDPROC + +PROC editAccess(acpConfigName:PTR TO CHAR) OF frmAccess + self.addNotifications() + + self.acpConfigName:=acpConfigName + + self.showModal() + self.removeNotifications() +ENDPROC diff --git a/axSetupTool/frmAddComplexItem.e b/axSetupTool/frmAddComplexItem.e new file mode 100644 index 0000000..2d738a2 --- /dev/null +++ b/axSetupTool/frmAddComplexItem.e @@ -0,0 +1,942 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi','dos/dos','libraries/asl' +MODULE 'utility/tagitem' , 'utility/hooks', 'tools/installhook' +MODULE '*axedit','*frmBase','*controls','*/stringlist','*tooltypes','*configobject','*helpText' + +EXPORT OBJECT frmAddComplexItem OF frmBase + lblAreaName: LONG + txtAreaName: LONG + grpAreaSettings: LONG + confControls: PTR TO stdlist + accessControls: PTR TO stdlist + fCheckControls: PTR TO stdlist + protocolControls: PTR TO stdlist + commandControls: PTR TO stdlist + msgbaseControls: PTR TO stdlist + acpName: PTR TO CHAR + confConfig: PTR TO CHAR + changed: LONG + btnSave: LONG + btnCancel: LONG + setChangedHook:hook + existingItems:PTR TO stringlist +ENDOBJECT + +PROC setChangedFlag() OF frmAddComplexItem + DEF txtval + MOVE.L (A1),self + GetA4() + self.changed:=TRUE + get(self.txtAreaName, MUIA_String_Contents,{txtval}) + + IF ((self.changed) AND (StrLen(txtval)>0)) + set( self.btnSave,MUIA_Disabled,FALSE) + ELSE + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + ENDIF +ENDPROC + +PROC addNotifications() OF frmAddComplexItem + domethod( self.btnCancel , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , MUIA_Window_CloseRequest ] ) + + domethod( self.btnSave , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , ID_SAVE ] ) + + domethod( self.txtAreaName , [ + MUIM_Notify , MUIA_String_Contents , MUIV_EveryTime , + self.app.app, + 3 , + MUIM_CallHook , self.setChangedHook, self] ) + +ENDPROC + +PROC removeNotifications() OF frmAddComplexItem + domethod(self.btnCancel,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnSave,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.txtAreaName,[MUIM_KillNotify,MUIA_String_Contents]) +ENDPROC + +PROC create(app:PTR TO app_obj) OF frmAddComplexItem + DEF group + SUPER self.create(app) + self.winMain:=app.wi_areas + + self.btnSave:=app.bt_area_save + self.btnCancel:=app.bt_area_cancel + + get(app.gr_area_main,MUIA_Scrollgroup_Contents,{group}) + self.grpAreaSettings:=group + self.lblAreaName:=app.la_area + self.txtAreaName:=app.stR_area +ENDPROC + +PROC freeControl(control:PTR TO control) OF frmAddComplexItem + control.removeFromGroup(self.grpAreaSettings) + END control +ENDPROC + +PROC canClose() OF frmAddComplexItem + MOVE.L (A1),self + GetA4() + IF self.changed + IF self.unsavedChangesWarning()=0 THEN RETURN FALSE + ENDIF +ENDPROC TRUE + +PROC canSave() OF frmAddComplexItem + DEF newName,i + + MOVE.L (A1),self + GetA4() + + get(self.txtAreaName, MUIA_String_Contents,{newName}) + + IF self.existingItems ANDALSO self.existingItems.contains(newName) + Mui_RequestA(0,self.winMain,0,'Error','*Ok','An item already exists with this name.',0) + RETURN FALSE + ENDIF +ENDPROC TRUE + +PROC unsavedChangesWarning() OF frmAddComplexItem + DEF win + get(self.winMain,MUIA_Window_Window,{win}) + IF Mui_RequestA(0,self.winMain,0,'Unsaved changes','*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE + +ENDPROC TRUE + +PROC editArea(acpName,areaName,oldArea:PTR TO area, existingAreas:PTR TO stdlist) OF frmAddComplexItem + DEF res,v1=0,v2=0 + DEF confControls:PTR TO stdlist + DEF bbsPath[255]:STRING + DEF confCount,i + DEF tempStr[255]:STRING + DEF confName[100]:STRING + DEF control:PTR TO control + DEF closeHook:PTR TO hook + DEF canSaveHook:PTR TO hook + DEF newArea:PTR TO area + DEF existingList:PTR TO stringlist + DEF areaItem:PTR TO area + + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + NEW canSaveHook + installhook(canSaveHook,{canSave}) + self.canSaveHook:=canSaveHook + + set( self.winMain, MUIA_Window_Title,'Edit Area Access') + set( self.winMain, MUIA_Window_ID, "FARE") + + set( self.lblAreaName, MUIA_Text_Contents,'Area Name') + set( self.lblAreaName, MUIA_ShortHelp , getHelpText(AREAS_NAME)) + set( self.txtAreaName, MUIA_ShortHelp , getHelpText(AREAS_NAME)) + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(50)) + + NEW existingList.stringlist(existingAreas.count()) + self.existingItems:=existingList + FOR i:=0 TO existingAreas.count()-1 + areaItem:=existingAreas.item(i) + IF areaItem<>oldArea THEN existingList.add(areaItem.filename) + ENDFOR + + self.acpName:=acpName + newArea:=0 + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + self.confConfig:=String(255) + StringF(self.confConfig,'\sCONFCONFIG',bbsPath) + + confCount:=readToolTypeInt(self.confConfig,'NCONFS') + + set(self.txtAreaName, MUIA_String_Contents,areaName) + + domethod(self.grpAreaSettings,[MUIM_Group_InitChange]) + + set(self.grpAreaSettings, MUIA_Group_Columns , 2) + + NEW confControls.stdlist(25) + self.confControls:=confControls + + FOR i:=1 TO confCount + + StringF(tempStr,'NAME.\d',i) + readToolType(self.confConfig,tempStr,confName) + + NEW control.createCheckBox(confName,ACCESS_AREA_NAME,self.app.app,self.setChangedHook,self) + + self.confControls.add(control) + control.addToGroup(self.grpAreaSettings) + + IF oldArea + IF oldArea.confList + control.setValue(IF oldArea.confList[i-1] THEN MUI_TRUE ELSE FALSE) + ENDIF + ENDIF + ENDFOR + domethod(self.grpAreaSettings,[MUIM_Group_ExitChange]) + + installhook( self.setChangedHook, {setChangedFlag}) + self.addNotifications() + + res:=self.showModal() + IF res + NEW newArea.create() + newArea.confList:=List(confCount) + get(self.txtAreaName, MUIA_String_Contents,{v1}) + StrCopy(newArea.filename,v1) + FOR i:=0 TO confCount-1 + control:=confControls.item(i) + ListAddItem(newArea.confList,IF control.getValue() THEN TRUE ELSE FALSE) + ENDFOR + ENDIF + + self.removeNotifications() + FOR i:=0 TO confCount-1 + control:=confControls.item(i) + self.freeControl(control) + ENDFOR + + + END existingList + END confControls + END closeHook + END canSaveHook + + DisposeLink(self.confConfig) +ENDPROC res,v1,newArea + +PROC editAccess(acpName,accessName,oldAccessLevel:PTR TO accessLevel, existingAccessLevels:PTR TO stdlist) OF frmAddComplexItem + DEF res,v1=0,v2=0 + DEF accessControls:PTR TO stdlist + DEF accessControlCodes:PTR TO stringlist + DEF bbsPath[255]:STRING + DEF i + DEF tempStr[255]:STRING + DEF control:PTR TO control + DEF canSaveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF newAccessLevel:PTR TO accessLevel + DEF acsNames:PTR TO LONG + DEF acsValues:PTR TO LONG + DEF existingList:PTR TO stringlist + DEF accessLevel:PTR TO accessLevel + + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + NEW canSaveHook + installhook(canSaveHook,{canSave}) + self.canSaveHook:=canSaveHook + + set( self.winMain, MUIA_Window_Title,'Edit Area Access') + set( self.winMain, MUIA_Window_ID, "FACS") + + set( self.lblAreaName, MUIA_Text_Contents,'Access Level') + set( self.lblAreaName, MUIA_ShortHelp , getHelpText(ACS_NAME)) + set( self.txtAreaName, MUIA_ShortHelp , getHelpText(ACS_NAME)) + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(50)) + + NEW existingList.stringlist(existingAccessLevels.count()) + self.existingItems:=existingList + FOR i:=0 TO existingAccessLevels.count()-1 + accessLevel:=existingAccessLevels.item(i) + IF accessLevel<>oldAccessLevel THEN existingList.add(accessLevel.filename) + ENDFOR + + self.acpName:=acpName + newAccessLevel:=0 + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + + set(self.txtAreaName, MUIA_String_Contents,accessName) + + domethod(self.grpAreaSettings,[MUIM_Group_InitChange]) + + set(self.grpAreaSettings, MUIA_Group_Columns , 4) + + NEW accessControlCodes.stringlist(25) + + NEW accessControls.stdlist(25) + self.accessControls:=accessControls + + acsNames:=getAccessNames() + acsValues:=getAccessLevels() + + FOR i:=0 TO ListLen(acsValues)-1 + IF i=0 + NEW control.createStringInt(acsNames[i],ACCESS_NAME_MAX_PAGES,self.app.app,self.setChangedHook,self) + ELSE + NEW control.createCheckBox(acsNames[i],ACCESS_NAME,self.app.app,self.setChangedHook,self) + ENDIF + accessControls.add(control) + accessControlCodes.add(acsValues[i]) + control.addToGroup(self.grpAreaSettings) + ENDFOR + + IF oldAccessLevel + FOR i:=0 TO accessControlCodes.count()-1 + control:=accessControls.item(i) + IF i=0 + control.setValueStr(oldAccessLevel.accessList.item(0)) + ELSE + control.setValue(IF oldAccessLevel.accessList.contains(accessControlCodes.item(i)) THEN MUI_TRUE ELSE FALSE) + ENDIF + ENDFOR + ENDIF + + domethod(self.grpAreaSettings,[MUIM_Group_ExitChange]) + + installhook( self.setChangedHook, {setChangedFlag}) + self.addNotifications() + + res:=self.showModal() + IF res + NEW newAccessLevel.create() + + get(self.txtAreaName, MUIA_String_Contents,{v1}) + StrCopy(newAccessLevel.filename,v1) + FOR i:=0 TO accessControls.count()-1 + control:=accessControls.item(i) + IF i=0 + newAccessLevel.accessList.add(control.getValue()) + ELSE + IF control.getValue() + newAccessLevel.accessList.add(accessControlCodes.item(i)) + ENDIF + ENDIF + ENDFOR + ENDIF + + FOR i:=0 TO accessControls.count()-1 + control:=accessControls.item(i) + self.freeControl(control) + ENDFOR + self.removeNotifications() + + END existingList + END accessControls + END accessControlCodes + END closeHook + END canSaveHook +ENDPROC res,v1,newAccessLevel + +PROC editFileCheck(acpName,fCheckName,oldfCheck:PTR TO fChecker,existingFcheckers:PTR TO stdlist) OF frmAddComplexItem + DEF res,v1=0,v2=0 + DEF fCheckControls:PTR TO stdlist + DEF bbsPath[255]:STRING + DEF i + DEF tempStr[255]:STRING + DEF control:PTR TO control + DEF closeHook:PTR TO hook + DEF canSaveHook:PTR TO hook + DEF newfChecker:PTR TO fChecker + DEF controlChecker:PTR TO control + DEF controlError1:PTR TO control + DEF controlError2:PTR TO control + DEF controlError3:PTR TO control + DEF controlError4:PTR TO control + DEF controlError5:PTR TO control + DEF controlError6:PTR TO control + DEF controlError7:PTR TO control + DEF controlError8:PTR TO control + DEF controlError9:PTR TO control + DEF controlError10:PTR TO control + DEF controlOptions:PTR TO control + DEF controlPriority:PTR TO control + DEF controlScript:PTR TO control + DEF controlStack:PTR TO control + DEF existingList:PTR TO stringlist + DEF fCheckItem:PTR TO command + + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + NEW canSaveHook + installhook(canSaveHook,{canSave}) + self.canSaveHook:=canSaveHook + + set( self.winMain, MUIA_Window_Title,'Edit File Checker') + set( self.winMain, MUIA_Window_ID, "EFCH") + + set( self.lblAreaName, MUIA_Text_Contents,'File Type') + set( self.lblAreaName, MUIA_ShortHelp , getHelpText(FCHK_NAME)) + set( self.txtAreaName, MUIA_ShortHelp , getHelpText(FCHK_NAME)) + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(50)) + + NEW existingList.stringlist(existingFcheckers.count()) + self.existingItems:=existingList + FOR i:=0 TO existingFcheckers.count()-1 + fCheckItem:=existingFcheckers.item(i) + IF fCheckItem<>oldfCheck THEN existingList.add(fCheckItem.filename) + ENDFOR + + self.acpName:=acpName + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + + set(self.txtAreaName, MUIA_String_Contents,fCheckName) + + domethod(self.grpAreaSettings,[MUIM_Group_InitChange]) + + set(self.grpAreaSettings, MUIA_Group_Columns , 2) + + NEW fCheckControls.stdlist(25) + self.fCheckControls:=fCheckControls + + newfChecker:=0 + + NEW controlChecker.createFileSelect('Checker',CHECKER_FILE,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlChecker) + NEW controlError1.createString('Error 1',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError1) + NEW controlError2.createString('Error 2',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError2) + NEW controlError3.createString('Error 3',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError3) + NEW controlError4.createString('Error 4',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError4) + NEW controlError5.createString('Error 5',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError5) + NEW controlError6.createString('Error 6',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError6) + NEW controlError7.createString('Error 7',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError7) + NEW controlError8.createString('Error 8',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError8) + NEW controlError9.createString('Error 9',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError9) + NEW controlError10.createString('Error 10',CHECKER_ERROR,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlError10) + + NEW controlOptions.createString('Options',CHECKER_OPTIONS,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlOptions) + + NEW controlPriority.createStringInt('Priority',CHECKER_PRIORITY,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlPriority) + + NEW controlScript.createFileSelect('Script',CHECKER_SCRIPT,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlScript) + + NEW controlStack.createStringInt('Stack',CHECKER_STACK,self.app.app,self.setChangedHook,self) + fCheckControls.add(controlStack) + + FOR i:=0 TO fCheckControls.count()-1 + control:=fCheckControls.item(i) + control.addToGroup(self.grpAreaSettings) + ENDFOR + + domethod(self.grpAreaSettings,[MUIM_Group_ExitChange]) + + installhook( self.setChangedHook, {setChangedFlag}) + self.addNotifications() + + IF oldfCheck + //set controls according to oldfcheck + + controlChecker.setValue(oldfCheck.checker) + controlError1.setValue(oldfCheck.error1) + controlError2.setValue(oldfCheck.error2) + controlError3.setValue(oldfCheck.error3) + controlError4.setValue(oldfCheck.error4) + controlError5.setValue(oldfCheck.error5) + controlError6.setValue(oldfCheck.error6) + controlError7.setValue(oldfCheck.error7) + controlError8.setValue(oldfCheck.error8) + controlError9.setValue(oldfCheck.error9) + controlError10.setValue(oldfCheck.error10) + controlOptions.setValue(oldfCheck.options) + controlPriority.setValueStr(oldfCheck.priority) + controlScript.setValue(oldfCheck.script) + controlStack.setValueStr(oldfCheck.stack) + ENDIF + self.changed:=FALSE + + res:=self.showModal() + IF res + + NEW newfChecker.create() + //set fchecker according to controls + get(self.txtAreaName, MUIA_String_Contents,{v1}) + StrCopy(newfChecker.filename,v1) + StrCopy(newfChecker.checker,controlChecker.getValue()) + StrCopy(newfChecker.error1,controlError1.getValue()) + StrCopy(newfChecker.error2,controlError2.getValue()) + StrCopy(newfChecker.error3,controlError3.getValue()) + StrCopy(newfChecker.error4,controlError4.getValue()) + StrCopy(newfChecker.error5,controlError5.getValue()) + StrCopy(newfChecker.error6,controlError6.getValue()) + StrCopy(newfChecker.error7,controlError7.getValue()) + StrCopy(newfChecker.error8,controlError8.getValue()) + StrCopy(newfChecker.error9,controlError9.getValue()) + StrCopy(newfChecker.error10,controlError10.getValue()) + StrCopy(newfChecker.options,controlOptions.getValue()) + StrCopy(newfChecker.priority,controlPriority.getValue()) + StrCopy(newfChecker.script,controlScript.getValue()) + StrCopy(newfChecker.stack,controlStack.getValue()) + ENDIF + + FOR i:=0 TO fCheckControls.count()-1 + control:=fCheckControls.item(i) + self.freeControl(control) + ENDFOR + self.removeNotifications() + + END existingList + END fCheckControls + END closeHook + END canSaveHook +ENDPROC res,v1,newfChecker + +PROC editProtocol(acpName,protocolName,oldProtocol:PTR TO protocol,existingProtocols:PTR TO stdlist) OF frmAddComplexItem + DEF res,v1=0,v2=0 + DEF protocolControls:PTR TO stdlist + DEF bbsPath[255]:STRING + DEF i + DEF tempStr[255]:STRING + DEF control:PTR TO control + DEF closeHook:PTR TO hook + DEF canSaveHook:PTR TO hook + DEF newProtocol:PTR TO protocol + DEF controlOptions:PTR TO control + DEF controlHttpHost:PTR TO control + DEF controlHttpTemp:PTR TO control + DEF controlFtpAuth:PTR TO control + DEF controlFtpHost:PTR TO control + DEF controlRxWindow:PTR TO control + DEF controlTxWindow:PTR TO control + DEF existingList:PTR TO stringlist + DEF protocolItem:PTR TO protocol + + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + NEW canSaveHook + installhook(canSaveHook,{canSave}) + self.canSaveHook:=canSaveHook + + set( self.winMain, MUIA_Window_Title,'Edit Protocol') + set( self.winMain, MUIA_Window_ID, "EPCL") + + set( self.lblAreaName, MUIA_Text_Contents,'Protocol') + set( self.lblAreaName, MUIA_ShortHelp , getHelpText(PCOL_NAME)) + set( self.txtAreaName, MUIA_ShortHelp , getHelpText(PCOL_NAME)) + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(50)) + + NEW existingList.stringlist(existingProtocols.count()) + self.existingItems:=existingList + FOR i:=0 TO existingProtocols.count()-1 + protocolItem:=existingProtocols.item(i) + IF protocolItem<>oldProtocol THEN existingList.add(protocolItem.filename) + ENDFOR + + self.acpName:=acpName + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + + set(self.txtAreaName, MUIA_String_Contents,protocolName) + + domethod(self.grpAreaSettings,[MUIM_Group_InitChange]) + + set(self.grpAreaSettings, MUIA_Group_Columns , 2) + + NEW protocolControls.stdlist(25) + self.protocolControls:=protocolControls + + newProtocol:=0 + + NEW controlOptions.createString('Options',PROTOCOL_OPTIONS,self.app.app,self.setChangedHook,self) + protocolControls.add(controlOptions) + NEW controlRxWindow.createStringInt('Hydra Rx Window',HYDRA_RX_WINDOW,self.app.app,self.setChangedHook,self) + protocolControls.add(controlRxWindow) + NEW controlTxWindow.createStringInt('Hydra Tx Window',HYDRA_TX_WINDOW,self.app.app,self.setChangedHook,self) + protocolControls.add(controlTxWindow) + NEW controlHttpHost.createString('Http Host',HTTP_HOSTNAME,self.app.app,self.setChangedHook,self) + protocolControls.add(controlHttpHost) + NEW controlHttpTemp.createDirSelect('Http TempDir',HTTP_TEMPDIR,self.app.app,self.setChangedHook,self) + protocolControls.add(controlHttpTemp) + NEW controlFtpHost.createString('Ftp Host',FTP_HOSTNAME,self.app.app,self.setChangedHook,self) + protocolControls.add(controlFtpHost) + NEW controlFtpAuth.createCheckBox('Ftp Authentication',FTP_AUTH,self.app.app,self.setChangedHook,self) + protocolControls.add(controlFtpAuth) + + FOR i:=0 TO protocolControls.count()-1 + control:=protocolControls.item(i) + control.addToGroup(self.grpAreaSettings) + ENDFOR + + domethod(self.grpAreaSettings,[MUIM_Group_ExitChange]) + + installhook( self.setChangedHook, {setChangedFlag}) + self.addNotifications() + + IF oldProtocol + //set controls according to oldProtocol + + controlOptions.setValue(oldProtocol.options) + controlHttpHost.setValue(oldProtocol.httpHost) + controlHttpTemp.setValue(oldProtocol.httpTemp) + controlFtpAuth.setValue(oldProtocol.ftpAuth) + controlFtpHost.setValue(oldProtocol.ftpHost) + controlRxWindow.setValueStr(oldProtocol.rxWindow) + controlTxWindow.setValueStr(oldProtocol.txWindow) + ENDIF + self.changed:=FALSE + + res:=self.showModal() + IF res + get(self.txtAreaName, MUIA_String_Contents,{v1}) + NEW newProtocol.create() + //set protocol according to controls + StrCopy(newProtocol.filename,v1) + StrCopy(newProtocol.options,controlOptions.getValue()) + StrCopy(newProtocol.httpHost,controlHttpHost.getValue()) + StrCopy(newProtocol.httpTemp,controlHttpTemp.getValue()) + newProtocol.ftpAuth:=controlFtpAuth.getValue() + StrCopy(newProtocol.ftpHost,controlFtpHost.getValue()) + StrCopy(newProtocol.rxWindow,controlRxWindow.getValue()) + StrCopy(newProtocol.txWindow,controlTxWindow.getValue()) + + ENDIF + + FOR i:=0 TO protocolControls.count()-1 + control:=protocolControls.item(i) + self.freeControl(control) + ENDFOR + self.removeNotifications() + + + END existingList + END protocolControls + END closeHook + END canSaveHook +ENDPROC res,v1,newProtocol + + +PROC editCommand(acpName,commandName,commandFolder,oldCommand:PTR TO command,existingCommands:PTR TO stdlist) OF frmAddComplexItem + DEF res,v1=0,v2=0 + DEF commandControls:PTR TO stdlist + DEF bbsPath[255]:STRING + DEF i,item + DEF tempStr[255]:STRING + DEF control:PTR TO control + DEF closeHook:PTR TO hook + DEF canSaveHook:PTR TO hook + DEF newCommand:PTR TO command + DEF controlName:PTR TO control + DEF controlLocation:PTR TO control + DEF controlAccess:PTR TO control + DEF controlInternal:PTR TO control + DEF controlMimicVer:PTR TO control + DEF controlPassword:PTR TO control + DEF controlPassParams:PTR TO control + DEF controlPriority:PTR TO control + DEF controlResident:PTR TO control + DEF controlQuickMode:PTR TO control + DEF controlStack:PTR TO control + DEF controlType:PTR TO control + DEF controlTrapon:PTR TO control + DEF controlExpertMode:PTR TO control + DEF controlDoorSilent:PTR TO control + DEF controlLogInputs:PTR TO control + DEF controlScriptCheck:PTR TO control + DEF controlBanner:PTR TO control + DEF typeList:PTR TO LONG + DEF existingList:PTR TO stringlist + DEF cmdItem:PTR TO command + + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + NEW canSaveHook + installhook(canSaveHook,{canSave}) + self.canSaveHook:=canSaveHook + + set( self.winMain, MUIA_Window_Title,'Edit Command') + set( self.winMain, MUIA_Window_ID, "ECMD") + + set( self.lblAreaName, MUIA_Text_Contents,'Command') + set( self.lblAreaName, MUIA_ShortHelp , getHelpText(CMDS_NAME)) + set( self.txtAreaName, MUIA_ShortHelp , getHelpText(CMDS_NAME)) + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(50)) + + NEW existingList.stringlist(existingCommands.count()) + self.existingItems:=existingList + FOR i:=0 TO existingCommands.count()-1 + cmdItem:=existingCommands.item(i) + IF cmdItem<>oldCommand THEN existingList.add(cmdItem.filename) + ENDFOR + + self.acpName:=acpName + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + + set(self.txtAreaName, MUIA_String_Contents,commandName) + + domethod(self.grpAreaSettings,[MUIM_Group_InitChange]) + + set(self.grpAreaSettings, MUIA_Group_Columns , 2) + + NEW commandControls.stdlist(25) + self.commandControls:=commandControls + + newCommand:=0 + + typeList:=['XIM','AIM','TIM','IIM','SIM','MCI',0] + + installhook( self.setChangedHook, {setChangedFlag}) + + NEW controlName.createString('Name',COMMAND_NAME,self.app.app,self.setChangedHook,self) + commandControls.add(controlName) + NEW controlLocation.createString('Location',COMMAND_LOCATION,self.app.app,self.setChangedHook,self) + commandControls.add(controlLocation) + NEW controlAccess.createStringInt('Access',COMMAND_ACCESS,self.app.app,self.setChangedHook,self) + commandControls.add(controlAccess) + NEW controlInternal.createString('Internal',COMMAND_INTERNAL,self.app.app,self.setChangedHook,self) + commandControls.add(controlInternal) + NEW controlMimicVer.createString('Mimic Version',COMMAND_MIMIC_VER,self.app.app,self.setChangedHook,self) + commandControls.add(controlMimicVer) + NEW controlPassword.createString('Password',COMMAND_PASSWORD,self.app.app,self.setChangedHook,self) + commandControls.add(controlPassword) + NEW controlPassParams.createCycle('Pass Params',COMMAND_PASS_PARAMS,['N/A','No execute','Swap and retain','Swap, retain and redo','Bypass BBSCMD',0],self.app.app,self.setChangedHook,self) + commandControls.add(controlPassParams) + NEW controlPriority.createString('Priority',COMMAND_PRIORITY,self.app.app,self.setChangedHook,self) + commandControls.add(controlPriority) + NEW controlStack.createStringInt('Stack',COMMAND_STACK,self.app.app,self.setChangedHook,self) + commandControls.add(controlStack) + NEW controlType.createCycle('Type',COMMAND_TYPE,typeList,self.app.app,self.setChangedHook,self) + commandControls.add(controlType) + NEW controlBanner.createString('Banner',COMMAND_BANNER,self.app.app,self.setChangedHook,self) + commandControls.add(controlBanner) + + NEW controlResident.createCheckBox('Resident',COMMAND_RESIDENT,self.app.app,self.setChangedHook,self) + commandControls.add(controlResident) + NEW controlQuickMode.createCheckBox('Quick Mode',COMMAND_QUICK_MODE,self.app.app,self.setChangedHook,self) + commandControls.add(controlQuickMode) + NEW controlTrapon.createCheckBox('Trap On',COMMAND_TRAP_ON,self.app.app,self.setChangedHook,self) + commandControls.add(controlTrapon) + NEW controlExpertMode.createCheckBox('Expert mode',COMMAND_EXPERT_MODE,self.app.app,self.setChangedHook,self) + commandControls.add(controlExpertMode) + NEW controlDoorSilent.createCheckBox('Silent',COMMAND_SILENT,self.app.app,self.setChangedHook,self) + commandControls.add(controlDoorSilent) + NEW controlLogInputs.createCheckBox('Log Inputs',COMMAND_LOG_INPUTS,self.app.app,self.setChangedHook,self) + commandControls.add(controlLogInputs) + NEW controlScriptCheck.createCheckBox('Script Check',COMMAND_SCRIPT_CHECK,self.app.app,self.setChangedHook,self) + commandControls.add(controlScriptCheck) + + FOR i:=0 TO commandControls.count()-1 + control:=commandControls.item(i) + control.addToGroup(self.grpAreaSettings) + ENDFOR + + domethod(self.grpAreaSettings,[MUIM_Group_ExitChange]) + + self.addNotifications() + + IF oldCommand + //set controls according to oldCommand + controlName.setValue(oldCommand.name) + controlLocation.setValue(oldCommand.location) + controlAccess.setValueStr(oldCommand.access) + controlInternal.setValue(oldCommand.internal) + controlMimicVer.setValue(oldCommand.mimicVer) + controlPassword.setValue(oldCommand.password) + + IF EstrLen(oldCommand.passParams)=0 + controlPassParams.setValueIndex(0) + ELSE + controlPassParams.setValueIndex(Val(oldCommand.passParams)) + ENDIF + controlPriority.setValueStr(oldCommand.priority) + controlResident.setValue(oldCommand.resident) + controlQuickMode.setValue(oldCommand.quickMode) + controlStack.setValueStr(oldCommand.stack) + + i:=0 + ForAll({item},typeList,`IF item ANDALSO StriCmp(item,oldCommand.type) THEN controlType.setValueIndex(i++) ELSE i++) + controlTrapon.setValue(oldCommand.trapon) + controlExpertMode.setValue(oldCommand.expertMode) + controlDoorSilent.setValue(oldCommand.doorSilent) + controlLogInputs.setValue(oldCommand.logInputs) + controlScriptCheck.setValue(oldCommand.scriptCheck) + controlBanner.setValue(oldCommand.banner) + ENDIF + self.changed:=FALSE + + res:=self.showModal() + IF res + NEW newCommand.create() + //set command according to controls + + get(self.txtAreaName, MUIA_String_Contents,{v1}) + + StrCopy(newCommand.filename,v1) + StrCopy(newCommand.name,controlName.getValue()) + StrCopy(newCommand.location,controlLocation.getValue()) + StrCopy(newCommand.access,controlAccess.getValue()) + StrCopy(newCommand.internal,controlInternal.getValue()) + StrCopy(newCommand.mimicVer,controlMimicVer.getValue()) + StrCopy(newCommand.password,controlPassword.getValue()) + v2:=controlPassParams.getValueIndex() + IF v2=0 + StrCopy(newCommand.passParams,'') + ELSE + StringF(newCommand.passParams,'\d',v2) + ENDIF + + StrCopy(newCommand.priority,controlPriority.getValue()) + newCommand.resident:=controlResident.getValue() + newCommand.quickMode:=controlQuickMode.getValue() + StrCopy(newCommand.stack,controlStack.getValue()) + StrCopy(newCommand.type,typeList[controlType.getValueIndex()]) + newCommand.trapon:=controlTrapon.getValue() + newCommand.expertMode:=controlExpertMode.getValue() + newCommand.doorSilent:=controlDoorSilent.getValue() + newCommand.logInputs:=controlLogInputs.getValue() + newCommand.scriptCheck:=controlScriptCheck.getValue() + StrCopy(newCommand.banner,controlBanner.getValue()) + ENDIF + + FOR i:=0 TO commandControls.count()-1 + control:=commandControls.item(i) + self.freeControl(control) + ENDFOR + self.removeNotifications() + + END commandControls + END existingList + END closeHook + END canSaveHook +ENDPROC res,v1,newCommand + + +PROC editMsgbase(acpName,msgbaseName,oldMsgbase:PTR TO msgbase) OF frmAddComplexItem + DEF res,v1=0,v2=0 + DEF msgbaseControls:PTR TO stdlist + DEF bbsPath[255]:STRING + DEF i + DEF tempStr[255]:STRING + DEF control:PTR TO control + DEF closeHook:PTR TO hook + DEF newMsgbase:PTR TO msgbase + DEF controlMsgbaseLocation:PTR TO control + DEF controlExtSend:PTR TO control + DEF controlUserNames:PTR TO control + DEF controlRealNames:PTR TO control + DEF controlInternetNames:PTR TO control + + + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + set( self.winMain, MUIA_Window_Title,'Edit Messagebase') + set( self.winMain, MUIA_Window_ID, "EMBS") + + set( self.lblAreaName, MUIA_Text_Contents,'Name') + + set( self.lblAreaName, MUIA_ShortHelp , getHelpText(MBASE_NAME)) + set( self.txtAreaName, MUIA_ShortHelp , getHelpText(MBASE_NAME)) + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(50)) + + self.acpName:=acpName + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + + set(self.txtAreaName, MUIA_String_Contents,msgbaseName) + + domethod(self.grpAreaSettings,[MUIM_Group_InitChange]) + + set(self.grpAreaSettings, MUIA_Group_Columns , 2) + + NEW msgbaseControls.stdlist(10) + self.msgbaseControls:=msgbaseControls + + newMsgbase:=0 + + NEW controlMsgbaseLocation.createDirSelect('Location',MSGBASE_LOCATION,self.app.app,self.setChangedHook,self) + msgbaseControls.add(controlMsgbaseLocation) + NEW controlExtSend.createCheckBox('Send External',MSGBASE_SEND_EXTERNAL,self.app.app,self.setChangedHook,self) + msgbaseControls.add(controlExtSend) + NEW controlUserNames.createCheckBox('Uses Usernames',MSGBASE_USES_USERNAMES,self.app.app,self.setChangedHook,self) + msgbaseControls.add(controlUserNames) + NEW controlRealNames.createCheckBox('Uses real names',MSGBASE_USES_REALNAMES,self.app.app,self.setChangedHook,self) + msgbaseControls.add(controlRealNames) + NEW controlInternetNames.createCheckBox('Uses internet names',MSGBASE_USES_INETNAMES,self.app.app,self.setChangedHook,self) + msgbaseControls.add(controlInternetNames) + + FOR i:=0 TO msgbaseControls.count()-1 + control:=msgbaseControls.item(i) + control.addToGroup(self.grpAreaSettings) + ENDFOR + + domethod(self.grpAreaSettings,[MUIM_Group_ExitChange]) + + installhook( self.setChangedHook, {setChangedFlag}) + self.addNotifications() + + IF oldMsgbase + //set controls according to oldMsgbase + controlMsgbaseLocation.setValue(oldMsgbase.location) + controlExtSend.setValue(oldMsgbase.extSend) + controlUserNames.setValue(oldMsgbase.username) + controlRealNames.setValue(oldMsgbase.realname) + controlInternetNames.setValue(oldMsgbase.internetname) + ENDIF + self.changed:=FALSE + + res:=self.showModal() + IF res + NEW newMsgbase.create() + //set protocol according to controls + StrCopy(newMsgbase.location,controlMsgbaseLocation.getValue()) + newMsgbase.extSend:=controlExtSend.getValue() + newMsgbase.username:=controlUserNames.getValue() + newMsgbase.realname:=controlRealNames.getValue() + newMsgbase.internetname:=controlInternetNames.getValue() + ENDIF + + FOR i:=0 TO msgbaseControls.count()-1 + control:=msgbaseControls.item(i) + self.freeControl(control) + ENDFOR + self.removeNotifications() + + get(self.txtAreaName, MUIA_String_Contents,{v1}) + + END msgbaseControls + END closeHook +ENDPROC res,v1,newMsgbase diff --git a/axSetupTool/frmAddItem.e b/axSetupTool/frmAddItem.e new file mode 100644 index 0000000..7d85798 --- /dev/null +++ b/axSetupTool/frmAddItem.e @@ -0,0 +1,180 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi','dos/dos','libraries/asl' +MODULE 'utility/tagitem' , 'utility/hooks', 'tools/installhook' +MODULE '*axedit','*frmBase','*helpText' + +EXPORT OBJECT frmAddItem OF frmBase + lblItemDetail1: LONG + lblItemDetail2: LONG + txtItemDetail1: LONG + txtItemDetail2: LONG + grpItemDetail2: LONG + btnSave: LONG + btnCancel: LONG + changeHook: hook +ENDOBJECT + +PROC changed() OF frmAddItem + MOVE.L (A1),self + GetA4() + + set( self.btnSave , MUIA_Disabled , FALSE) +ENDPROC + +PROC addNotifications() OF frmAddItem + domethod( self.btnCancel , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , MUIA_Window_CloseRequest ] ) + + domethod( self.btnSave , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , ID_SAVE ] ) + + domethod( self.txtItemDetail1, [ + MUIM_Notify , MUIA_String_Contents , MUIV_EveryTime , + self.app.app, + 3 , + MUIM_CallHook , self.changeHook, self ]) + + domethod( self.txtItemDetail2, [ + MUIM_Notify , MUIA_String_Contents , MUIV_EveryTime , + self.app.app, + 3 , + MUIM_CallHook , self.changeHook, self ]) + + installhook( self.changeHook, {changed}) + +ENDPROC + +PROC removeNotifications() OF frmAddItem + domethod(self.btnCancel,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnSave,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.txtItemDetail1,[MUIM_KillNotify,MUIA_String_Contents]) + domethod(self.txtItemDetail2,[MUIM_KillNotify,MUIA_String_Contents]) +ENDPROC + +PROC create(app:PTR TO app_obj) OF frmAddItem + DEF group + SUPER self.create(app) + self.winMain:=app.wi_add_item + + self.btnSave:=app.bt_new_item_save + self.btnCancel:=app.bt_new_item_cancel + self.lblItemDetail1:=app.la_item_detail1 + self.lblItemDetail2:=app.la_item_detail2 + self.txtItemDetail1:=app.stR_item_detail1e + self.txtItemDetail2:=app.stR_item_detail2 + self.grpItemDetail2:=app.gr_item_detail2 +ENDPROC + +PROC addScreen(title) OF frmAddItem + DEF res,v1=0,v2=0 + set( self.winMain, MUIA_Window_Title,'Add Screen') + set( self.lblItemDetail1, MUIA_Text_Contents,'Screen Title') + set( self.lblItemDetail2, MUIA_Text_Contents,'Extension') + + set( self.lblItemDetail1, MUIA_ShortHelp , getHelpText(SCRN_NAME)) + set( self.txtItemDetail1, MUIA_ShortHelp , getHelpText(SCRN_NAME)) + set( self.lblItemDetail2, MUIA_ShortHelp , getHelpText(SCRN_EXT)) + set( self.txtItemDetail2, MUIA_ShortHelp , getHelpText(SCRN_EXT)) + + set( self.btnSave,MUIA_Disabled,FALSE) + + set( self.txtItemDetail1, MUIA_String_Contents,title) + set( self.txtItemDetail2, MUIA_String_Contents,'') + + self.addNotifications() + + res:=self.showModal() + IF res + get( self.txtItemDetail1, MUIA_String_Contents,{v1}) + get( self.txtItemDetail2, MUIA_String_Contents,{v2}) + ENDIF + self.removeNotifications() + +ENDPROC res,v1,v2 + +PROC editScreen(title,extension) OF frmAddItem + DEF res,v1=0,v2=0 + set( self.winMain, MUIA_Window_Title,'Edit Screen') + set( self.lblItemDetail1, MUIA_Text_Contents,'Screen Title') + set( self.lblItemDetail2, MUIA_Text_Contents,'Extension') + + set( self.lblItemDetail1, MUIA_ShortHelp , getHelpText(SCRN_NAME)) + set( self.txtItemDetail1, MUIA_ShortHelp , getHelpText(SCRN_NAME)) + set( self.lblItemDetail2, MUIA_ShortHelp , getHelpText(SCRN_EXT)) + set( self.txtItemDetail2, MUIA_ShortHelp , getHelpText(SCRN_EXT)) + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + set( self.txtItemDetail1, MUIA_String_Contents,title) + set( self.txtItemDetail2, MUIA_String_Contents,extension) + + self.addNotifications() + + res:=self.showModal() + IF res + get( self.txtItemDetail1, MUIA_String_Contents,{v1}) + get( self.txtItemDetail2, MUIA_String_Contents,{v2}) + ENDIF + self.removeNotifications() + +ENDPROC res,v1,v2 + +PROC editConnectionString(connectString,baudString) OF frmAddItem + DEF res,v1=0,v2=0 + set( self.winMain, MUIA_Window_Title,'Edit Connection String') + set( self.lblItemDetail1, MUIA_Text_Contents,'Connection String') + set( self.lblItemDetail2, MUIA_Text_Contents,'Baud Rate') + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + set( self.txtItemDetail1, MUIA_String_Contents,connectString) + set( self.txtItemDetail2, MUIA_String_Contents,baudString) + + set( self.lblItemDetail1, MUIA_ShortHelp , getHelpText(CONN_TEXT)) + set( self.txtItemDetail1, MUIA_ShortHelp , getHelpText(CONN_TEXT)) + set( self.lblItemDetail2, MUIA_ShortHelp , getHelpText(CONN_BAUD)) + set( self.txtItemDetail2, MUIA_ShortHelp , getHelpText(CONN_BAUD)) + + + self.addNotifications() + + res:=self.showModal() + IF res + get( self.txtItemDetail1, MUIA_String_Contents,{v1}) + get( self.txtItemDetail2, MUIA_String_Contents,{v2}) + ENDIF + self.removeNotifications() + +ENDPROC res,v1,v2 + +PROC editSingleItem(title,itemDesc,value) OF frmAddItem + DEF res,v1=0,v2=0 + set( self.winMain, MUIA_Window_Title,title) + + set( self.grpItemDetail2, MUIA_ShowMe , FALSE) + + set( self.lblItemDetail1, MUIA_Text_Contents,itemDesc) + set( self.txtItemDetail1, MUIA_String_Contents,value) + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + + self.addNotifications() + + res:=self.showModal() + IF res + get( self.txtItemDetail1, MUIA_String_Contents,{v1}) + ENDIF + self.removeNotifications() + set( self.grpItemDetail2, MUIA_ShowMe , MUI_TRUE) + +ENDPROC res,v1 diff --git a/axSetupTool/frmBase.e b/axSetupTool/frmBase.e new file mode 100644 index 0000000..5fae612 --- /dev/null +++ b/axSetupTool/frmBase.e @@ -0,0 +1,106 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi','tools/installhook','amigalib/boopsi' +MODULE 'utility/tagitem' , 'utility/hooks','*axedit' + +EXPORT CONST ID_SAVE=1 + +EXPORT OBJECT frmBase + app : PTR TO app_obj + winMain : PTR TO LONG + showHook : PTR TO hook + saveHook : PTR TO hook + canSaveHook : PTR TO hook + closeHook : PTR TO hook +ENDOBJECT + +PROC create(app:PTR TO app_obj) OF frmBase + self.app:=app + self.saveHook:=NIL + self.showHook:=NIL + self.canSaveHook:=NIL + self.closeHook:=NIL +ENDPROC + +PROC show() OF frmBase + set( self.winMain ,MUIA_Window_Open , MUI_TRUE ) +ENDPROC + +PROC hide() OF frmBase + set( self.winMain ,MUIA_Window_Open , FALSE ) +ENDPROC + +PROC sleep() OF frmBase + set( self.winMain ,MUIA_Window_Sleep , MUI_TRUE ) +ENDPROC + +PROC wake() OF frmBase + set( self.winMain ,MUIA_Window_Sleep , FALSE ) +ENDPROC + +PROC setupButtonClick(button, hook, code) OF frmBase + domethod( button , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 3, + MUIM_CallHook , hook, self ] ) + installhook( hook , code) +ENDPROC + +PROC showModal() OF frmBase + DEF running = TRUE , result_domethod , signal,result = FALSE + + self.show() + + domethod( self.winMain , [ + MUIM_Notify , MUIA_Window_CloseRequest , MUI_TRUE , + self.app.app, + 2 , + MUIM_Application_ReturnID , MUIA_Window_CloseRequest ] ) + + IF self.showHook THEN callHookA(self.showHook,0,{self}) + + WHILE running + + result_domethod := domethod( self.app.app, [ MUIM_Application_Input , {signal} ] ) + SELECT result_domethod + + CASE MUIA_Window_CloseRequest + IF self.closeHook + IF callHookA(self.closeHook,0,{self}) + running := FALSE + result:=FALSE + ENDIF + ELSE + running := FALSE + result:=FALSE + ENDIF + + CASE ID_SAVE + IF self.saveHook + callHookA(self.saveHook,0,{self}) + ELSE + IF self.canSaveHook + IF callHookA(self.canSaveHook,0,{self}) + running := FALSE + result:=TRUE + ENDIF + ELSE + running := FALSE + result:=TRUE + ENDIF + ENDIF + + CASE MUIV_Application_ReturnID_Quit + running := FALSE + result:=FALSE + ENDSELECT + + IF ( signal AND running ) THEN Wait( signal ) + ENDWHILE + domethod(self.winMain,[MUIM_KillNotify,MUIA_Window_CloseRequest]) + + self.hide() +ENDPROC result diff --git a/axSetupTool/frmCommands.e b/axSetupTool/frmCommands.e new file mode 100644 index 0000000..8736414 --- /dev/null +++ b/axSetupTool/frmCommands.e @@ -0,0 +1,152 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi','workbench/workbench','icon','intuition/classusr' +MODULE 'utility/tagitem','utility/hooks','tools/installhook','exec/lists' +MODULE '*axedit','*frmBase','*frmEditList','*tooltypes','*/stringlist' + +EXPORT OBJECT frmCommands OF frmBase + btnBBSCmd : PTR TO LONG + btnSysCmd : PTR TO LONG + btnList : PTR TO stdlist + + acpConfigName : PTR TO CHAR + + btnBBSCmdClick: hook + btnSysCmdClick: hook + editBtnClick : hook +ENDOBJECT + +PROC create(app:PTR TO app_obj) OF frmCommands + DEF group + SUPER self.create(app) + self.winMain:=app.wi_commands + + self.btnBBSCmd:=app.btnBBSCmd + self.btnSysCmd:=app.btnSysCmd +ENDPROC + +PROC btnClick() OF frmCommands + DEF editList:PTR TO frmEditList + DEF btn,text + MOVE.L (A1),self + MOVE.L 4(A1),btn + GetA4() + + btn:=self.btnList.item(btn) + get( btn, MUIA_Text_Contents, {text}) + + self.sleep() + NEW editList.create(self.app) + editList.editCommands(self.acpConfigName,text+5) + END editList + self.wake() +ENDPROC + +PROC goBBSCmd() OF frmCommands + DEF editList:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW editList.create(self.app) + editList.editCommands(self.acpConfigName,'BBSCmd') + END editList + self.wake() +ENDPROC + +PROC goSysCmd() OF frmCommands + DEF editList:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW editList.create(self.app) + editList.editCommands(self.acpConfigName,'SysCmd') + END editList + self.wake() +ENDPROC + + +PROC addNotifications() OF frmCommands + DEF i + self.setupButtonClick(self.btnBBSCmd,self.btnBBSCmdClick,{goBBSCmd}) + self.setupButtonClick(self.btnSysCmd,self.btnSysCmdClick,{goSysCmd}) + + FOR i:=0 TO self.btnList.count()-1 + domethod( self.btnList.item(i) , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 4, + MUIM_CallHook , self.editBtnClick, self, i ] ) + ENDFOR + +ENDPROC + +PROC removeNotifications() OF frmCommands + DEF i + domethod(self.btnBBSCmd,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnSysCmd,[MUIM_KillNotify,MUIA_Pressed]) + FOR i:=0 TO self.btnList.count()-1 + domethod(self.btnList.item(i),[MUIM_KillNotify,MUIA_Pressed]) + ENDFOR + +ENDPROC + +PROC editCommands(acpConfigName:PTR TO CHAR) OF frmCommands + DEF nodeCount,confCount,i + DEF btnText[255]:STRING + DEF bbsPath[255]:STRING + DEF confConfig[255]:STRING + DEF btn:PTR TO LONG + DEF btnList:PTR TO stdlist + + self.acpConfigName:=acpConfigName + set(self.app.grpCommands, MUIA_Group_Columns , 3) + + nodeCount:=readToolTypeInt(acpConfigName,'NODES') + + readToolType(acpConfigName,'BBS_LOCATION',bbsPath) + StringF(confConfig,'\sCONFCONFIG',bbsPath) + confCount:=readToolTypeInt(confConfig,'NCONFS') + + NEW btnList.stdlist(20) + self.btnList:=btnList + + installhook( self.editBtnClick, {btnClick}) + + FOR i:=0 TO nodeCount-1 + StringF(btnText,'Edit Node\dCmd',i) + btn:=SimpleButton(btnText) + btnList.add(btn) + domethod(self.app.grpCommands,[OM_ADDMEMBER,btn]) + StringF(btnText,'Edit Node\dSysCmd',i) + btn:=SimpleButton(btnText) + btnList.add(btn) + domethod(self.app.grpCommands,[OM_ADDMEMBER,btn]) + ENDFOR + + FOR i:=1 TO confCount-1 + StringF(btnText,'Edit Conf\dCmd',i) + btn:=SimpleButton(btnText) + btnList.add(btn) + domethod(self.app.grpCommands,[OM_ADDMEMBER,btn]) + StringF(btnText,'Edit Conf\dSysCmd',i) + btn:=SimpleButton(btnText) + btnList.add(btn) + domethod(self.app.grpCommands,[OM_ADDMEMBER,btn]) + ENDFOR + self.addNotifications() + + self.showModal() + + self.removeNotifications() + FOR i:=0 TO btnList.count()-1 + btn:=btnList.item(i) + domethod(self.app.grpCommands,[OM_REMMEMBER,btn]) + Mui_DisposeObject(btn) + ENDFOR + END btnList + +ENDPROC diff --git a/axSetupTool/frmConfEdit.e b/axSetupTool/frmConfEdit.e new file mode 100644 index 0000000..366f454 --- /dev/null +++ b/axSetupTool/frmConfEdit.e @@ -0,0 +1,1169 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui','dos' +MODULE 'tools/boopsi','workbench/workbench','icon','intuition/classusr' +MODULE 'utility/tagitem','utility/hooks','tools/installhook','exec/lists','libraries/asl','dos/dos' +MODULE '*axedit','*frmBase','*tooltypes','*controls','*miscfuncs','*frmAddComplexItem','*configObject','*/stringlist','*helpText' + +EXPORT OBJECT frmConfEdit OF frmBase + confConfig : PTR TO CHAR + controlList : LONG + controlList2 : LONG + + strConfNumber : PTR TO LONG + strConfName : PTR TO LONG + grpConfSettings : PTR TO LONG + grpConfMore : PTR TO LONG + grpConfPages : PTR TO LONG + strConfName2 : PTR TO control + paConfPath : PTR TO control + boolFreeDownloads : PTR TO control + strForwardMail : PTR TO control + boolForceNewscan : PTR TO control + boolUseUsernames : PTR TO control + boolUseInternetNames : PTR TO control + strMenuPrompt : PTR TO control + strUploadPrompt : PTR TO control + paLocalULPath : PTR TO control + intFtpDirDays : PTR TO control + strFtpDirName : PTR TO control + boolCustomMail : PTR TO control + boolNoNewscan : PTR TO control + boolDefaultNewscan : PTR TO control + boolDefaultNewfiles: PTR TO control + boolDefaultZoom : PTR TO control + boolUseRealname : PTR TO control + boolShowNewFiles : PTR TO control + boolNoNewFiles : PTR TO control + boolNoFtpUploads : PTR TO control + boolFtpNoDirlist : PTR TO control + lvDownloadPaths : PTR TO LONG + strDownloadPath : PTR TO LONG + lvUploadPaths : PTR TO LONG + strUploadPath : PTR TO LONG + btnFirstConf : PTR TO LONG + btnPrevConf : PTR TO LONG + btnNextConf : PTR TO LONG + btnLastConf : PTR TO LONG + btnAddConf : PTR TO LONG + btnCloneConf : PTR TO LONG + btnRemoveConf : PTR TO LONG + btnConfSave : PTR TO LONG + btnConfCancel : PTR TO LONG + btnUlPathAdd : PTR TO LONG + btnUlPathRemove : PTR TO LONG + btnDlPathAdd : PTR TO LONG + btnDlPathRemove : PTR TO LONG + btnAddMsgbase : PTR TO LONG + btnEditMsgbase : PTR TO LONG + btnRemoveMsgbase : PTR TO LONG + + lvMsgBases : PTR TO LONG + + btnFirstConfClick: hook + btnLastConfClick: hook + btnNextConfClick: hook + btnPrevConfClick: hook + btnAddConfClick: hook + btnCloneConfClick: hook + btnRemoveConfClick: hook + btnDlPathAddClick: hook + btnDlPathRemoveClick: hook + btnUlPathAddClick: hook + btnUlPathRemoveClick: hook + + btnAddMsgbasesClick: hook + btnEditMsgbasesClick: hook + btnRemoveMsgbasesClick: hook + + setChangedHook:hook + strDlPathOnChange: hook + strUlPathOnChange: hook + uploadListOnChange: hook + downloadListOnChange: hook + msgbaseListOnChange: hook + + acpName:PTR TO CHAR + confCount:INT + currConf:INT + changed:INT + newConf:INT + olddlpathcount:INT + oldulpathcount:INT + oldmsgbasecount:INT + msgbaseLists: PTR TO stdlist +ENDOBJECT + +PROC setasldrawerflags() OF frmConfEdit + DEF tags:PTR TO LONG + MOVE.L A1,tags + + WHILE tags[]<>0 DO tags++ + tags[]:=ASLFR_DRAWERSONLY + tags++ + tags[]:=-1 + tags++ + tags[]:=0 +ENDPROC TRUE + +PROC dlPathChange() OF frmConfEdit + DEF str + MOVE.L (A1),self + GetA4() + get(self.strDownloadPath, MUIA_String_Contents,{str}) + set( self.btnDlPathAdd , MUIA_Disabled , IF StrLen(str)=0 THEN MUI_TRUE ELSE FALSE) + self.changed:=TRUE +ENDPROC + +PROC dlpathlistChange() OF frmConfEdit + DEF entry + MOVE.L (A1),self + GetA4() + get(self.lvDownloadPaths,MUIA_List_Active,{entry}) + set( self.btnDlPathRemove , MUIA_Disabled , IF entry=MUIV_List_Active_Off THEN MUI_TRUE ELSE FALSE) +ENDPROC + +PROC ulPathChange() OF frmConfEdit + DEF str + MOVE.L (A1),self + GetA4() + get(self.strUploadPath, MUIA_String_Contents,{str}) + set( self.btnUlPathAdd , MUIA_Disabled , IF StrLen(str)=0 THEN MUI_TRUE ELSE FALSE) + self.changed:=TRUE +ENDPROC + +PROC ulpathlistChange() OF frmConfEdit + DEF entry + MOVE.L (A1),self + GetA4() + get(self.lvUploadPaths,MUIA_List_Active,{entry}) + set( self.btnUlPathRemove , MUIA_Disabled , IF entry=MUIV_List_Active_Off THEN MUI_TRUE ELSE FALSE) +ENDPROC + +PROC msgBaseChange() OF frmConfEdit + DEF entry + MOVE.L (A1),self + GetA4() + get(self.lvMsgBases,MUIA_List_Active,{entry}) + set( self.btnEditMsgbase , MUIA_Disabled , IF entry=MUIV_List_Active_Off THEN MUI_TRUE ELSE FALSE) + set( self.btnRemoveMsgbase , MUIA_Disabled , IF entry=MUIV_List_Active_Off THEN MUI_TRUE ELSE FALSE) +ENDPROC + +PROC ulpathItemAdd() OF frmConfEdit + DEF str + MOVE.L (A1),self + GetA4() + + get(self.strUploadPath, MUIA_String_Contents,{str}) + domethod( self.lvUploadPaths , [ MUIM_List_InsertSingle , str , MUIV_List_Insert_Bottom ] ) + get (self.strUploadPath,MUIA_Popstring_String,{str}) + set(str, MUIA_String_Contents,'') + set( self.btnConfSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC ulpathItemRemove() OF frmConfEdit + DEF entry + MOVE.L (A1),self + GetA4() + + get(self.lvUploadPaths,MUIA_List_Active,{entry}) + + domethod(self.lvUploadPaths, [ MUIM_List_Remove, entry] ) + set( self.btnConfSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC addDlPathSubDirs(path) OF frmConfEdit + DEF dir_info:PTR TO fileinfoblock + DEF pdir + DEF subdir[255]:STRING + + IF ((dir_info:=AllocDosObject(DOS_FIB,NIL)) = NIL) + RETURN + ENDIF + + IF ((pdir:=Lock(path,ACCESS_READ)))=FALSE + FreeDosObject(DOS_FIB,dir_info) + RETURN + ENDIF + + IF(Examine(pdir, dir_info))=FALSE + FreeDosObject(DOS_FIB,dir_info) + UnLock(pdir) + RETURN + ENDIF + + WHILE(ExNext(pdir,dir_info)) + IF(dir_info.direntrytype >= 0) + StrCopy(subdir,path) + AddPart(subdir,dir_info.filename,255) + SetStr(subdir) + StrAdd(subdir,'/') + domethod( self.lvDownloadPaths , [ MUIM_List_InsertSingle , subdir , MUIV_List_Insert_Bottom ] ) + self.addDlPathSubDirs(subdir) + ENDIF + ENDWHILE + + UnLock(pdir) + FreeDosObject(DOS_FIB,dir_info) +ENDPROC + +PROC dlpathItemAdd() OF frmConfEdit + DEF str + MOVE.L (A1),self + GetA4() + + get(self.strDownloadPath, MUIA_String_Contents,{str}) + domethod( self.lvDownloadPaths , [ MUIM_List_InsertSingle , str , MUIV_List_Insert_Bottom ] ) + + IF Mui_RequestA(0,self.winMain,0,'Query', + '*Yes|No','Should we also scan for and add any sub-folders of this path?',0) + self.addDlPathSubDirs(str) + ENDIF + + + + get (self.strDownloadPath,MUIA_Popstring_String,{str}) + set(str, MUIA_String_Contents,'') + + set( self.btnConfSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC dlpathItemRemove() OF frmConfEdit + DEF entry + MOVE.L (A1),self + GetA4() + + get(self.lvDownloadPaths,MUIA_List_Active,{entry}) + + domethod(self.lvDownloadPaths, [ MUIM_List_Remove, entry] ) + set( self.btnConfSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC msgBaseItemAdd() OF frmConfEdit + DEF str,res,v1,v2 + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF msgbase:PTR TO msgbase + MOVE.L (A1),self + GetA4() + + NEW frmAddComplexItem.create(self.app) + res,v1,msgbase:=frmAddComplexItem.editMsgbase(self.acpName,'',NIL) + IF res + domethod( self.lvMsgBases , [ MUIM_List_InsertSingle , v1 , MUIV_List_Insert_Bottom ] ) + self.msgbaseLists.add(msgbase) + self.changed:=TRUE + set( self.btnConfSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddComplexItem +ENDPROC + +PROC msgBaseItemEdit() OF frmConfEdit + DEF str,res,v1,v2,entry + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF msgbase:PTR TO msgbase + DEF msgbase2:PTR TO msgbase + DEF i + + MOVE.L (A1),self + GetA4() + + NEW frmAddComplexItem.create(self.app) + + get(self.lvMsgBases,MUIA_List_Active,{entry}) + domethod(self.lvMsgBases,[MUIM_List_GetEntry,entry,{str}]) + + msgbase2:=self.msgbaseLists.item(entry) + + res,v1,msgbase:=frmAddComplexItem.editMsgbase(self.acpName,str,msgbase2) + IF res + domethod( self.lvMsgBases , [ MUIM_List_InsertSingle , v1 , entry+1 ] ) + domethod( self.lvMsgBases , [ MUIM_List_Remove, entry ] ) + self.changed:=TRUE + set( self.btnConfSave , MUIA_Disabled , FALSE) + + //copy protocol to protocol2 + StrCopy(msgbase2.location,msgbase.location) + msgbase2.extSend:=msgbase.extSend + msgbase2.username:=msgbase.username + msgbase2.realname:=msgbase.realname + msgbase2.internetname:=msgbase.internetname + ENDIF + END frmAddComplexItem +ENDPROC + +PROC msgBaseItemRemove() OF frmConfEdit + DEF entry,v1 + DEF msgbase:PTR TO msgbase + MOVE.L (A1),self + GetA4() + + get(self.lvMsgBases,MUIA_List_Active,{entry}) + + domethod(self.lvMsgBases,[MUIM_List_GetEntry,entry,{v1}]) + + msgbase:=self.msgbaseLists.item(entry) + END msgbase + self.msgbaseLists.remove(entry) + domethod( self.lvMsgBases , [ MUIM_List_Remove, entry] ) + set( self.btnConfSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + + +PROC create(app:PTR TO app_obj) OF frmConfEdit + DEF list,group + SUPER self.create(app) + self.winMain:=app.wi_conf_edit + + self.strConfName:=app.strConfName + self.strConfNumber:=app.strConfNum + self.btnFirstConf:=app.btnFirstConf + self.btnPrevConf:=app.btnPrevConf + self.btnNextConf:=app.btnNextConf + self.btnLastConf:=app.btnLastConf + self.btnAddConf:=app.btnAddConf + self.btnCloneConf:=app.btnConfClone + self.btnRemoveConf:=app.btnRemoveConf + self.btnConfSave:=app.btnSaveConf + self.btnConfCancel:=app.btnCancelConf + + self.btnAddMsgbase:=app.btnMsgbaseAdd + self.btnEditMsgbase:=app.btnMsgbaseEdit + self.btnRemoveMsgbase:=app.btnMsgbaseDelete + + self.lvMsgBases:=app.lvMsgbases + + self.lvDownloadPaths:=app.lv_download_paths + self.strDownloadPath:=app.pa_downloadpath + self.lvUploadPaths:=app.lv_upload_paths + self.strUploadPath:=app.pa_uploadpath + + self.btnUlPathAdd:=app.bt_ulpath_add + self.btnUlPathRemove:=app.bt_ulpath_remove + self.btnDlPathAdd:=app.bt_dlpath_add + self.btnDlPathRemove:=app.bt_dlpath_remove + + self.grpConfPages:=app.gr_conf_pages + get(app.gr_conf_settings,MUIA_Scrollgroup_Contents,{group}) + self.grpConfSettings:=group + + get(app.gr_conf_more,MUIA_Scrollgroup_Contents,{group}) + self.grpConfMore:=group + + set(self.grpConfSettings, MUIA_Group_Columns , 2) + set(self.grpConfMore, MUIA_Group_Columns , 2) + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(75)) + + get(self.lvDownloadPaths,MUIA_Listview_List,{list}) + set(list,MUIA_List_ConstructHook,MUIV_List_ConstructHook_String) + set(list,MUIA_List_DestructHook,MUIV_List_DestructHook_String) + + get(self.lvUploadPaths,MUIA_Listview_List,{list}) + set(list,MUIA_List_ConstructHook,MUIV_List_ConstructHook_String) + set(list,MUIA_List_DestructHook,MUIV_List_DestructHook_String) + + get(self.lvMsgBases,MUIA_Listview_List,{list}) + set(list,MUIA_List_ConstructHook,MUIV_List_ConstructHook_String) + set(list,MUIA_List_DestructHook,MUIV_List_DestructHook_String) + +ENDPROC + +PROC cloneNewConf() OF frmConfEdit + DEF tempStr[255]:STRING + MOVE.L (A1),self + GetA4() + + IF self.loadConf(self.currConf) + set(self.strConfName, MUIA_String_Contents,'**NEW**') + + + self.changed:=TRUE + self.newConf:=TRUE + self.confCount:=self.confCount+1 + self.currConf:=self.confCount + + StringF(tempStr,'\r\z\d[2]',self.currConf) + set(self.strConfNumber, MUIA_String_Contents,tempStr) + + set( self.btnPrevConf, MUIA_Disabled , FALSE) + set( self.btnNextConf, MUIA_Disabled , MUI_TRUE) + set( self.btnRemoveConf, MUIA_Disabled , FALSE) + + + set( self.btnConfSave,MUIA_Disabled,FALSE) + set( self.btnAddConf,MUIA_Disabled,MUI_TRUE) + set( self.btnCloneConf,MUIA_Disabled,MUI_TRUE) + ENDIF +ENDPROC + +PROC createNewConf() OF frmConfEdit + MOVE.L (A1),self + GetA4() + + IF self.loadConf(self.confCount+1) + set(self.strConfName, MUIA_String_Contents,'**NEW**') + self.changed:=TRUE + self.newConf:=TRUE + self.confCount:=self.confCount+1 + set( self.btnConfSave,MUIA_Disabled,FALSE) + set( self.btnAddConf,MUIA_Disabled,MUI_TRUE) + set( self.btnCloneConf,MUIA_Disabled,MUI_TRUE) + ENDIF +ENDPROC + +PROC deleteConfFolder(conf) OF frmConfEdit + DEF deleteStr[255]:STRING + DEF confPath[255]:STRING + DEF tempStr[255]:STRING + + StringF(tempStr,'LOCATION.\d',conf) + readToolType(self.confConfig,tempStr,confPath) + IF EstrLen(confPath)>0 + StringF(deleteStr,'DELETE \s ALL',confPath) + Execute(deleteStr,0,0) + + StringF(deleteStr,'DELETE \s.info ALL',confPath) + Execute(deleteStr,0,0) + ENDIF +ENDPROC + +PROC deleteCurrentConf() OF frmConfEdit + DEF deleteOption + DEF tempStr[255]:STRING + MOVE.L (A1),self + GetA4() + + get (self.app.mnlabel1Donotremovefolder1 , MUIA_Menuitem_Checked, {deleteOption}) + IF deleteOption + deleteOption:=1 + ELSE + get (self.app.mnlabel1Removefolder1, MUIA_Menuitem_Checked, {deleteOption}) + IF deleteOption + deleteOption:=2 + ELSE + deleteOption:=3 + ENDIF + ENDIF + + IF self.deleteConfWarning()=FALSE THEN RETURN + + IF self.loadConf(self.confCount-1) + self.confCount:=self.currConf + + //update confconfig + StringF(tempStr,'\d',self.confCount) + writeToolType(self.confConfig,'NCONFS',tempStr) + + StringF(tempStr,'NAME.\d',self.currConf+1) + deleteToolType(self.confConfig,tempStr) + + StringF(tempStr,'LOCATION.\d',self.currConf+1) + deleteToolType(self.confConfig,tempStr) + + set( self.btnNextConf, MUIA_Disabled , MUI_TRUE) + set( self.btnRemoveConf, MUIA_Disabled , (self.currConf0 + makeDir(msgbase.location) + ENDIF + ENDFOR + + ENDIF + + IF self.boolFreeDownloads.getValue() THEN writeToolType(confPath,'FREEDOWNLOADS') ELSE deleteToolType(confPath,'FREEDOWNLOADS') + + writeToolType(confPath,'FORWARDMAIL',self.strForwardMail.getValue()) + + IF self.boolForceNewscan.getValue() THEN writeToolType(confPath,'FORCE_NEWSCAN') ELSE deleteToolType(confPath,'FORCE_NEWSCAN') + IF self.boolUseUsernames.getValue() THEN writeToolType(confPath,'USERNAME') ELSE deleteToolType(confPath,'USERNAME') + IF self.boolUseInternetNames.getValue() THEN writeToolType(confPath,'INTERNETNAME') ELSE deleteToolType(confPath,'INTERNETNAME') + + writeToolType(confPath,'MENU_PROMPT',self.strMenuPrompt.getValue()) + writeToolType(confPath,'ULPROMPT',self.strUploadPrompt.getValue()) + writeToolType(confPath,'LOCAL_UPLOAD_PATH',self.paLocalULPath.getValue()) + writeToolType(confPath,'FTP_DIR_DAYS',self.intFtpDirDays.getValue()) + writeToolType(confPath,'FTPDIRNAME',self.strFtpDirName.getValue()) + + + IF self.boolCustomMail.getValue() THEN writeToolType(confPath,'CUSTOM') ELSE deleteToolType(confPath,'CUSTOM') + IF self.boolNoNewscan.getValue() THEN writeToolType(confPath,'NO_NEWSCAN') ELSE deleteToolType(confPath,'NO_NEWSCAN') + IF self.boolDefaultNewscan.getValue() THEN writeToolType(confPath,'DEFAULT_NEWSCAN') ELSE deleteToolType(confPath,'DEFAULT_NEWSCAN') + IF self.boolDefaultNewfiles.getValue() THEN writeToolType(confPath,'DEFAULT_NEW_FILES') ELSE deleteToolType(confPath,'DEFAULT_NEW_FILES') + IF self.boolDefaultZoom.getValue() THEN writeToolType(confPath,'DEFAULT_ZOOM') ELSE deleteToolType(confPath,'DEFAULT_ZOOM') + IF self.boolUseRealname.getValue() THEN writeToolType(confPath,'REALNAME') ELSE deleteToolType(confPath,'REALNAME') + IF self.boolShowNewFiles.getValue() THEN writeToolType(confPath,'SHOW_NEW_FILES') ELSE deleteToolType(confPath,'SHOW_NEW_FILES') + IF self.boolNoNewFiles.getValue() THEN writeToolType(confPath,'NO_NEW_FILES') ELSE deleteToolType(confPath,'NO_NEW_FILES') + IF self.boolNoFtpUploads.getValue() THEN writeToolType(confPath,'NO_FTP_UPLOADS') ELSE deleteToolType(confPath,'NO_FTP_UPLOADS') + IF self.boolFtpNoDirlist.getValue() THEN writeToolType(confPath,'FTP_NO_DIRLIST') ELSE deleteToolType(confPath,'FTP_NO_DIRLIST') + + get(self.lvDownloadPaths,MUIA_List_Entries,{count}) + FOR i:=1 TO count + domethod(self.lvDownloadPaths,[MUIM_List_GetEntry,i-1,{entry}]) + StringF(temppath,'DLPATH.\d',i) + writeToolType(confPath,temppath,entry) + ENDFOR + + FOR i:=count+1 TO self.olddlpathcount + StringF(temppath,'DLPATH.\d',i) + deleteToolType(confPath,temppath) + ENDFOR + + get(self.lvUploadPaths,MUIA_List_Entries,{count}) + FOR i:=1 TO count + domethod(self.lvUploadPaths,[MUIM_List_GetEntry,i-1,{entry}]) + StringF(temppath,'ULPATH.\d',i) + writeToolType(confPath,temppath,entry) + ENDFOR + + FOR i:=count+1 TO self.oldulpathcount + StringF(temppath,'ULPATH.\d',i) + deleteToolType(confPath,temppath) + ENDFOR + + StrCopy(temppath,confPath) + AddPart(temppath,'msgbases',255) + SetStr(temppath) + get(self.lvMsgBases,MUIA_List_Entries,{count}) + + FOR i:=1 TO count + domethod(self.lvMsgBases,[MUIM_List_GetEntry,i-1,{entry}]) + + StringF(tempStr,'NAME.\d',i) + IF (count=1) AND StrCmp(entry,'Default') + writeToolType(temppath,tempStr,'') + ELSE + writeToolType(temppath,tempStr,entry) + ENDIF + + msgbase:=self.msgbaseLists.item(i-1) + StringF(tempStr,'LOCATION.\d',i) + writeToolType(temppath,tempStr,msgbase.location) + StringF(tempStr,'EXTSEND.\d',i) + writeToolType(temppath,tempStr,IF msgbase.extSend THEN -1 ELSE FALSE) + StringF(tempStr,'USERNAME.\d',i) + writeToolType(temppath,tempStr,IF msgbase.username THEN -1 ELSE FALSE) + StringF(tempStr,'REALNAME.\d',i) + writeToolType(temppath,tempStr,IF msgbase.realname THEN -1 ELSE FALSE) + StringF(tempStr,'INTERNETNAME.\d',i) + writeToolType(temppath,tempStr,IF msgbase.internetname THEN -1 ELSE FALSE) + ENDFOR + + FOR i:=count+1 TO self.oldmsgbasecount + StringF(tempStr,'NAME.\d',i) + deleteToolType(temppath,tempStr) + StringF(tempStr,'LOCATION.\d',i) + deleteToolType(temppath,tempStr) + StringF(tempStr,'EXTSEND.\d',i) + deleteToolType(temppath,tempStr) + StringF(tempStr,'USERNAME.\d',i) + deleteToolType(temppath,tempStr) + StringF(tempStr,'REALNAME.\d',i) + deleteToolType(temppath,tempStr) + StringF(tempStr,'INTERNETNAME.\d',i) + deleteToolType(temppath,tempStr) + ENDFOR + saveCachedChanges() + + + set( self.btnConfSave,MUIA_Disabled,MUI_TRUE) + set( self.btnAddConf,MUIA_Disabled,FALSE) + set( self.btnCloneConf,MUIA_Disabled,FALSE) + self.changed:=FALSE + self.newConf:=FALSE + self.wake() + +ENDPROC + +PROC loadConf(conf) OF frmConfEdit + DEF tempStr[255]:STRING + DEF bbsPath[255]:STRING + DEF confName[100]:STRING + DEF confPath[255]:STRING + DEF temppath[255]:STRING + DEF tempTooltype[255]:STRING + DEF i,val + DEF msgbase:PTR TO msgbase + + IF self.changed + IF self.unsavedChangesWarning()=FALSE THEN RETURN FALSE + ENDIF + + IF self.newConf THEN self.confCount:=self.confCount-1 + self.currConf:=conf + + StringF(tempStr,'NAME.\d',conf) + readToolType(self.confConfig,tempStr,confName) + + StringF(tempStr,'LOCATION.\d',conf) + readToolType(self.confConfig,tempStr,confPath) + + StringF(tempStr,'\r\z\d[2]',conf) + set(self.strConfNumber, MUIA_String_Contents,tempStr) + set(self.strConfName, MUIA_String_Contents,confName) + self.strConfName2.setValue(confName) + self.paConfPath.setValue(confPath) + set( self.btnPrevConf, MUIA_Disabled , conf<=1) + set( self.btnNextConf, MUIA_Disabled , conf>=self.confCount) + set( self.btnRemoveConf, MUIA_Disabled , (conf0 + domethod( self.lvDownloadPaths , [ MUIM_List_InsertSingle , tempStr , MUIV_List_Insert_Bottom ] ) + i++ + ENDIF + UNTIL EstrLen(tempStr)=0 + self.olddlpathcount:=i + + i:=1 + REPEAT + StringF(temppath,'ULPATH.\d',i) + readToolType(confPath,temppath,tempStr) + IF EstrLen(tempStr)>0 + domethod( self.lvUploadPaths , [ MUIM_List_InsertSingle , tempStr , MUIV_List_Insert_Bottom ] ) + i++ + ENDIF + UNTIL EstrLen(tempStr)=0 + self.oldulpathcount:=i + + domethod( self.lvMsgBases , [ MUIM_List_Clear] ) + + FOR i:=0 TO self.msgbaseLists.count()-1 + msgbase:=self.msgbaseLists.item(i) + END msgbase + ENDFOR + self.msgbaseLists.clear() + + StrCopy(temppath,confPath) + AddPart(temppath,'MSGBASES',200) + SetStr(temppath) + val:=readToolTypeInt(temppath,'NMSGBASES') + IF val=-1 + domethod( self.lvMsgBases , [ MUIM_List_InsertSingle , 'Default' , MUIV_List_Insert_Bottom ] ) + NEW msgbase.create() + self.msgbaseLists.add(msgbase) + self.oldmsgbasecount:=0 + ELSE + FOR i:=1 TO val + StringF(tempTooltype,'NAME.\d',i) + readToolType(temppath,tempTooltype,tempStr) + domethod( self.lvMsgBases , [ MUIM_List_InsertSingle , tempStr , MUIV_List_Insert_Bottom ] ) + + NEW msgbase.create() + StringF(tempTooltype,'LOCATION.\d',i) + readToolType(temppath,tempTooltype,tempStr) + StrCopy(msgbase.location,tempStr) + + StringF(tempTooltype,'EXTSEND.\d',i) + msgbase.extSend:=checkToolTypeExists(temppath,tempTooltype) + + StringF(tempTooltype,'USERNAME.\d',i) + msgbase.username:=checkToolTypeExists(temppath,tempTooltype) + + StringF(tempTooltype,'REALNAME.\d',i) + msgbase.realname:=checkToolTypeExists(temppath,tempTooltype) + + StringF(tempTooltype,'INTERNETNAME.\d',i) + msgbase.internetname:=checkToolTypeExists(temppath,tempTooltype) + self.msgbaseLists.add(msgbase) + ENDFOR + self.oldmsgbasecount:=val + ENDIF + + + self.changed:=FALSE + set( self.btnConfSave, MUIA_Disabled , MUI_TRUE) + set( self.btnAddConf,MUIA_Disabled,FALSE) + set( self.btnCloneConf,MUIA_Disabled,FALSE) + self.newConf:=FALSE + +ENDPROC TRUE + +PROC editConfs(acpName) OF frmConfEdit + DEF count,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF aslflagsHook:PTR TO hook + DEF bbsPath[255]:STRING + DEF msgbaseList:PTR TO stdlist + DEF msgbase:PTR TO msgbase + + NEW saveHook + installhook( saveHook, {saveChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + NEW aslflagsHook + installhook( aslflagsHook, {setasldrawerflags}) + + self.acpName:=acpName + + set( self.btnEditMsgbase , MUIA_Disabled , MUI_TRUE) + set( self.btnRemoveMsgbase , MUIA_Disabled , MUI_TRUE) + + set( self.btnRemoveConf, MUIA_Disabled , MUI_TRUE) + set( self.btnUlPathAdd , MUIA_Disabled , MUI_TRUE) + set( self.btnDlPathAdd , MUIA_Disabled , MUI_TRUE) + set( self.btnUlPathRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnDlPathRemove , MUIA_Disabled , MUI_TRUE) + + set (self.strUploadPath,MUIA_Popasl_StartHook,aslflagsHook) + set (self.strDownloadPath,MUIA_Popasl_StartHook,aslflagsHook) + + set( self.lvDownloadPaths , MUIA_ShortHelp , getHelpText(DLPATHS_LVIEW)) + set( self.btnDlPathAdd , MUIA_ShortHelp , getHelpText(DLPATHS_ADD)) + set( self.btnDlPathRemove , MUIA_ShortHelp , getHelpText(DLPATHS_DELETE)) + set(self.strDownloadPath, MUIA_ShortHelp , getHelpText(DLPATHS_TEXT)) + + set( self.lvUploadPaths , MUIA_ShortHelp , getHelpText(ULPATHS_LVIEW)) + set( self.btnUlPathAdd , MUIA_ShortHelp , getHelpText(ULPATHS_ADD)) + set( self.btnUlPathRemove , MUIA_ShortHelp , getHelpText(ULPATHS_DELETE)) + set(self.strUploadPath, MUIA_ShortHelp , getHelpText(ULPATHS_TEXT)) + + set( self.lvMsgBases , MUIA_ShortHelp , getHelpText(MBASE_LVIEW)) + set( self.btnAddMsgbase , MUIA_ShortHelp , getHelpText(MBASE_ADD)) + set( self.btnEditMsgbase , MUIA_ShortHelp , getHelpText(MBASE_EDIT)) + set( self.btnRemoveMsgbase , MUIA_ShortHelp , getHelpText(MBASE_DELETE)) + + set( self.btnFirstConf, MUIA_ShortHelp , getHelpText(CONF_FIRST)) + set( self.btnPrevConf, MUIA_ShortHelp , getHelpText(CONF_PREV)) + set( self.btnNextConf, MUIA_ShortHelp , getHelpText(CONF_NEXT)) + set( self.btnLastConf, MUIA_ShortHelp , getHelpText(CONF_LAST)) + set( self.btnAddConf, MUIA_ShortHelp , getHelpText(CONF_ADD)) + set( self.btnCloneConf, MUIA_ShortHelp , getHelpText(CONF_CLONE)) + set( self.btnRemoveConf, MUIA_ShortHelp , getHelpText(CONF_DEL)) + + installhook( self.setChangedHook, {setChangedFlag}) + self.addControls() + self.addNotifications() + + set(self.grpConfPages,MUIA_Group_ActivePage,MUIV_Group_ActivePage_First) + + self.changed:=FALSE + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + self.confConfig:=String(255) + StringF(self.confConfig,'\sCONFCONFIG',bbsPath) + self.confCount:=readToolTypeInt(self.confConfig,'NCONFS') + + NEW msgbaseList.stdlist(20) + + self.msgbaseLists:=msgbaseList + + self.loadConf(1) + + self.showModal() + + FOR i:=0 TO self.msgbaseLists.count()-1 + msgbase:=self.msgbaseLists.item(i) + END msgbase + ENDFOR + END self.msgbaseLists + + self.removeNotifications() + self.removeControls() + END saveHook + END closeHook + END aslflagsHook + DisposeLink(self.confConfig) +ENDPROC diff --git a/axSetupTool/frmEditList.e b/axSetupTool/frmEditList.e new file mode 100644 index 0000000..05fc790 --- /dev/null +++ b/axSetupTool/frmEditList.e @@ -0,0 +1,2631 @@ +OPT MODULE,LARGE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi','workbench/workbench','icon','dos/dos' +MODULE 'utility/tagitem' , 'utility/hooks','tools/installhook' + +MODULE '*axedit','*frmBase','*tooltypes','*frmAddItem','*frmAddComplexItem','*/stringlist','*miscfuncs','*configobject','*helpText' + +EXPORT OBJECT frmEditList OF frmBase + oldcount : INT + computersTooltype : PTR TO CHAR + namesTooltype : PTR TO CHAR + drivesTooltype : PTR TO CHAR + languagesTooltype : PTR TO CHAR + screenTypesTooltype: PTR TO CHAR + connectDefToolType : PTR TO CHAR + lvList : PTR TO LONG + lList : PTR TO LONG + strItem : PTR TO LONG + btnItemAdd : PTR TO LONG + btnItemEdit : PTR TO LONG + btnItemRemove : PTR TO LONG + btnItemsSave : PTR TO LONG + btnItemsCancel : PTR TO LONG + + acpName: PTR TO CHAR + + titles: PTR TO stringlist + extensions: PTR TO stringlist + + connectlist: PTR TO stringlist + connectbaud: PTR TO stringlist + oldconnectionstrings: PTR TO stringlist + + areaLists: PTR TO stdlist + deleteAreas:PTR TO stringlist + accessLists: PTR TO stdlist + deleteAccessLevels:PTR TO stringlist + + fCheckLists: PTR TO stdlist + deletefCheckLists:PTR TO stringlist + + protocolLists: PTR TO stdlist + deleteProtocolLists:PTR TO stringlist + + commandLists: PTR TO stdlist + deleteCommandLists:PTR TO stringlist + commandPath:PTR TO CHAR + + editCaption1: PTR TO CHAR + editCaption2: PTR TO CHAR + + bbsPath:PTR TO CHAR + + strOnChange: hook + btnAddClick: hook + btnEditClick: hook + btnRemoveClick: hook + lvChange: hook + changed +ENDOBJECT + +PROC create(app:PTR TO app_obj) OF frmEditList + DEF list + SUPER self.create(app) + self.winMain:=app.wi_listEdit + self.lvList:=app.lv_list + get(self.lvList,MUIA_Listview_List,{list}) + self.lList:=list + self.strItem:=app.strListItem + self.btnItemAdd:=app.btnItemAdd + self.btnItemEdit:=app.btnItemEdit + self.btnItemRemove:=app.btnItemRemove + self.btnItemsSave:=app.btnListSave + self.btnItemsCancel:=app.btnListCancel + + set(self.lList,MUIA_List_ConstructHook,MUIV_List_ConstructHook_String) + set(self.lList,MUIA_List_DestructHook,MUIV_List_DestructHook_String) + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(50)) +ENDPROC + +PROC stringChange() OF frmEditList + DEF str + MOVE.L (A1),self + GetA4() + + get(self.strItem, MUIA_String_Contents,{str}) + set( self.btnItemAdd , MUIA_Disabled , IF StrLen(str)=0 THEN MUI_TRUE ELSE FALSE) +ENDPROC + +PROC listChange() OF frmEditList + DEF entry + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + set( self.btnItemRemove , MUIA_Disabled , IF entry=MUIV_List_Active_Off THEN MUI_TRUE ELSE FALSE) + set( self.btnItemEdit , MUIA_Disabled , IF entry=MUIV_List_Active_Off THEN MUI_TRUE ELSE FALSE) +ENDPROC + +PROC connectionitemAdd() OF frmEditList + DEF str,res,v1,v2 + DEF tempStr[255]:STRING + DEF frmAddItem: PTR TO frmAddItem + MOVE.L (A1),self + GetA4() + + NEW frmAddItem.create(self.app) + get(self.strItem, MUIA_String_Contents,{str}) + res,v1,v2:=frmAddItem.editConnectionString(str,'') + IF res + StringF(tempStr,'\s=\s',v1,v2) + domethod( self.lList , [ MUIM_List_InsertSingle , tempStr , MUIV_List_Insert_Bottom ] ) + self.connectlist.add(v1) + self.connectbaud.add(v2) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddItem + + set(self.strItem, MUIA_String_Contents,'') +ENDPROC + +PROC connectionitemEdit() OF frmEditList + DEF str,res,v1,v2,entry + DEF tempStr[255]:STRING + DEF frmAddItem: PTR TO frmAddItem + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + NEW frmAddItem.create(self.app) + res,v1,v2:=frmAddItem.editConnectionString(self.connectlist.item(entry),self.connectbaud.item(entry)) + IF res + StringF(tempStr,'\s=\s',v1,v2) + domethod( self.lList , [ MUIM_List_Remove, entry ] ) + domethod( self.lList , [ MUIM_List_InsertSingle , tempStr , entry ] ) + set(self.lList,MUIA_List_Active,entry) + set(self.lList,MUIA_List_Active,entry) + self.connectlist.setItem(entry,v1) + self.connectbaud.setItem(entry,v2) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddItem +ENDPROC + +PROC connectionitemRemove() OF frmEditList + DEF entry + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + self.connectlist.remove(entry) + self.connectbaud.remove(entry) + domethod( self.lList , [ MUIM_List_Remove, entry] ) + set( self.btnItemsSave , MUIA_Disabled , FALSE) + + self.changed:=TRUE +ENDPROC + +PROC commanditemAdd() OF frmEditList + DEF str,res,v1,v2 + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF command:PTR TO command + MOVE.L (A1),self + GetA4() + + NEW frmAddComplexItem.create(self.app) + get(self.strItem, MUIA_String_Contents,{str}) + res,v1,command:=frmAddComplexItem.editCommand(self.acpName,str,self.commandPath,NIL,self.commandLists) + IF res + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , MUIV_List_Insert_Bottom ] ) + self.commandLists.add(command) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddComplexItem + + set(self.strItem, MUIA_String_Contents,'') +ENDPROC + +PROC commanditemEdit() OF frmEditList + DEF str,res,v1,v2,entry + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF command:PTR TO command + DEF command2:PTR TO command + DEF i + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + domethod(self.lList,[MUIM_List_GetEntry,entry,{str}]) + + NEW frmAddComplexItem.create(self.app) + command2:=self.commandLists.item(entry) + res,v1,command:=frmAddComplexItem.editCommand(self.acpName,str,self.commandPath,command2,self.commandLists) + IF res + IF StriCmp(v1,str)=FALSE + //if we change the identifier then delete the old one + self.deleteCommandLists.add(str) + ENDIF + + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , entry+1 ] ) + domethod( self.lList , [ MUIM_List_Remove, entry ] ) + set(self.lList,MUIA_List_Active,entry) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + + //copy command to command2 + StrCopy(command2.name,command.name) + StrCopy(command2.location,command.location) + StrCopy(command2.access,command.access) + StrCopy(command2.internal,command.internal) + StrCopy(command2.mimicVer,command.mimicVer) + StrCopy(command2.password,command.password) + StrCopy(command2.passParams,command.passParams) + StrCopy(command2.priority,command.priority) + command2.resident:=command.resident + command2.quickMode:=command.quickMode + StrCopy(command2.stack,command.stack) + StrCopy(command2.type,command.type) + command2.trapon:=command.trapon + command2.expertMode:=command.expertMode + command2.doorSilent:=command.doorSilent + command2.logInputs:=command.logInputs + command2.scriptCheck:=command.scriptCheck + command2.multiNode:=command.multiNode + StrCopy(command2.banner,command.banner) + END command + ENDIF + END frmAddComplexItem +ENDPROC + +PROC commanditemRemove() OF frmEditList + DEF entry,v1 + DEF command:PTR TO command + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + domethod(self.lList,[MUIM_List_GetEntry,entry,{v1}]) + self.deleteCommandLists.add(v1) + + command:=self.commandLists.item(entry) + END command + self.commandLists.remove(entry) + domethod( self.lList , [ MUIM_List_Remove, entry] ) + set( self.btnItemsSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC protocolitemAdd() OF frmEditList + DEF str,res,v1,v2 + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF protocol:PTR TO protocol + MOVE.L (A1),self + GetA4() + + NEW frmAddComplexItem.create(self.app) + get(self.strItem, MUIA_String_Contents,{str}) + res,v1,protocol:=frmAddComplexItem.editProtocol(self.acpName,str,NIL,self.protocolLists) + IF res + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , MUIV_List_Insert_Bottom ] ) + self.protocolLists.add(protocol) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddComplexItem + + set(self.strItem, MUIA_String_Contents,'') +ENDPROC + +PROC protocolitemEdit() OF frmEditList + DEF str,res,v1,v2,entry + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF protocol:PTR TO protocol + DEF protocol2:PTR TO protocol + DEF i + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + domethod(self.lList,[MUIM_List_GetEntry,entry,{str}]) + + NEW frmAddComplexItem.create(self.app) + protocol2:=self.protocolLists.item(entry) + res,v1,protocol:=frmAddComplexItem.editProtocol(self.acpName,str,protocol2,self.protocolLists) + IF res + IF StriCmp(v1,str)=FALSE + //if we change the identifier then delete the old one + self.deleteProtocolLists.add(str) + ENDIF + + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , entry+1 ] ) + domethod( self.lList , [ MUIM_List_Remove, entry ] ) + set(self.lList,MUIA_List_Active,entry) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + + //copy protocol to protocol2 + StrCopy(protocol2.filename,protocol.filename) + StrCopy(protocol2.options,protocol.options) + StrCopy(protocol2.httpHost,protocol.httpHost) + StrCopy(protocol2.httpTemp,protocol.httpTemp) + protocol2.ftpAuth:=protocol.ftpAuth + StrCopy(protocol2.ftpHost,protocol.ftpHost) + StrCopy(protocol2.rxWindow,protocol.rxWindow) + StrCopy(protocol2.txWindow,protocol.txWindow) + END protocol + ENDIF + END frmAddComplexItem +ENDPROC + +PROC protocolitemRemove() OF frmEditList + DEF entry,v1 + DEF protocol:PTR TO protocol + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + domethod(self.lList,[MUIM_List_GetEntry,entry,{v1}]) + self.deleteProtocolLists.add(v1) + + protocol:=self.protocolLists.item(entry) + END protocol + self.protocolLists.remove(entry) + domethod( self.lList , [ MUIM_List_Remove, entry] ) + set( self.btnItemsSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC fileCheckitemAdd() OF frmEditList + DEF str,res,v1,v2 + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF fChecker:PTR TO fChecker + MOVE.L (A1),self + GetA4() + + NEW frmAddComplexItem.create(self.app) + get(self.strItem, MUIA_String_Contents,{str}) + res,v1,fChecker:=frmAddComplexItem.editFileCheck(self.acpName,str,NIL,self.fCheckLists) + IF res + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , MUIV_List_Insert_Bottom ] ) + self.fCheckLists.add(fChecker) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddComplexItem + + set(self.strItem, MUIA_String_Contents,'') +ENDPROC + +PROC fileCheckitemEdit() OF frmEditList + DEF str,res,v1,v2,entry + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF fChecker:PTR TO fChecker + DEF fChecker2:PTR TO fChecker + DEF i + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + domethod(self.lList,[MUIM_List_GetEntry,entry,{str}]) + + NEW frmAddComplexItem.create(self.app) + fChecker2:=self.fCheckLists.item(entry) + res,v1,fChecker:=frmAddComplexItem.editFileCheck(self.acpName,str,fChecker2,self.fCheckLists) + IF res + IF StriCmp(v1,str)=FALSE + //if we change the identifier then delete the old one + self.deletefCheckLists.add(str) + ENDIF + + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , entry+1 ] ) + domethod( self.lList , [ MUIM_List_Remove, entry ] ) + set(self.lList,MUIA_List_Active,entry) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + + //copy fchecker to fchecker2 + StrCopy(fChecker2.filename,fChecker.filename) + StrCopy(fChecker2.checker,fChecker.checker) + StrCopy(fChecker2.error1,fChecker.error1) + StrCopy(fChecker2.error2,fChecker.error2) + StrCopy(fChecker2.error3,fChecker.error3) + StrCopy(fChecker2.error4,fChecker.error4) + StrCopy(fChecker2.error5,fChecker.error5) + StrCopy(fChecker2.error6,fChecker.error6) + StrCopy(fChecker2.error7,fChecker.error7) + StrCopy(fChecker2.error8,fChecker.error8) + StrCopy(fChecker2.error9,fChecker.error9) + StrCopy(fChecker2.error10,fChecker.error10) + StrCopy(fChecker2.options,fChecker.options) + StrCopy(fChecker2.priority,fChecker.priority) + StrCopy(fChecker2.script,fChecker.script) + StrCopy(fChecker2.stack,fChecker.stack) + END fChecker + ENDIF + END frmAddComplexItem +ENDPROC + +PROC fileCheckitemRemove() OF frmEditList + DEF entry,v1 + DEF fChecker:PTR TO fChecker + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + domethod(self.lList,[MUIM_List_GetEntry,entry,{v1}]) + self.deletefCheckLists.add(v1) + + fChecker:=self.fCheckLists.item(entry) + END fChecker + self.fCheckLists.remove(entry) + domethod( self.lList , [ MUIM_List_Remove, entry] ) + set( self.btnItemsSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC accessLevelitemAdd() OF frmEditList + DEF str,res,v1,v2 + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF accessLevel:PTR TO accessLevel + MOVE.L (A1),self + GetA4() + + NEW frmAddComplexItem.create(self.app) + get(self.strItem, MUIA_String_Contents,{str}) + res,v1,accessLevel:=frmAddComplexItem.editAccess(self.acpName,str,NIL,self.accessLists) + IF res + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , MUIV_List_Insert_Bottom ] ) + self.accessLists.add(accessLevel) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddComplexItem + + set(self.strItem, MUIA_String_Contents,'') +ENDPROC + +PROC accessLevelitemEdit() OF frmEditList + DEF str,res,v1,v2,entry + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF accessLevel:PTR TO accessLevel + DEF accessLevel2:PTR TO accessLevel + DEF i + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + domethod(self.lList,[MUIM_List_GetEntry,entry,{str}]) + + NEW frmAddComplexItem.create(self.app) + accessLevel2:=self.accessLists.item(entry) + res,v1,accessLevel:=frmAddComplexItem.editAccess(self.acpName,str,accessLevel2,self.accessLists) + IF res + IF StriCmp(v1,str)=FALSE + //if we change the identifier then delete the old one + self.deleteAccessLevels.add(str) + ENDIF + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , entry+1 ] ) + domethod( self.lList , [ MUIM_List_Remove, entry ] ) + set(self.lList,MUIA_List_Active,entry) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + StrCopy(accessLevel2.filename,accessLevel.filename) + accessLevel2.accessList.clear() + FOR i:=0 TO accessLevel.accessList.count()-1 + accessLevel2.accessList.add(accessLevel.accessList.item(i)) + ENDFOR + END accessLevel + ENDIF + END frmAddComplexItem +ENDPROC + +PROC accessLevelitemRemove() OF frmEditList + DEF entry,v1 + DEF accessLevel:PTR TO accessLevel + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + domethod(self.lList,[MUIM_List_GetEntry,entry,{v1}]) + self.deleteAccessLevels.add(v1) + + accessLevel:=self.accessLists.item(entry) + END accessLevel + self.accessLists.remove(entry) + domethod( self.lList , [ MUIM_List_Remove, entry] ) + set( self.btnItemsSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC areaitemAdd() OF frmEditList + DEF str,res,v1,v2 + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF area:PTR TO area + MOVE.L (A1),self + GetA4() + + NEW frmAddComplexItem.create(self.app) + get(self.strItem, MUIA_String_Contents,{str}) + res,v1,area:=frmAddComplexItem.editArea(self.acpName,str,NIL,self.areaLists) + IF res + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , MUIV_List_Insert_Bottom ] ) + self.areaLists.add(area) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddComplexItem + + set(self.strItem, MUIA_String_Contents,'') +ENDPROC + +PROC areaitemEdit() OF frmEditList + DEF str,res,v1,v2,entry + DEF tempStr[255]:STRING + DEF frmAddComplexItem: PTR TO frmAddComplexItem + DEF area:PTR TO area + DEF area2:PTR TO area + DEF i + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + domethod(self.lList,[MUIM_List_GetEntry,entry,{str}]) + + NEW frmAddComplexItem.create(self.app) + area2:=self.areaLists.item(entry) + res,v1,area:=frmAddComplexItem.editArea(self.acpName,str,area2, self.areaLists) + IF res + IF StriCmp(v1,str)=FALSE + //if we change the identifier then delete the old one + self.deleteAreas.add(str) + ENDIF + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , entry+1 ] ) + domethod( self.lList , [ MUIM_List_Remove, entry ] ) + set(self.lList,MUIA_List_Active,entry) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + StrCopy(area2.filename,area.filename) + FOR i:=0 TO ListLen(area.confList)-1 + area2.confList[i]:=area.confList[i] + ENDFOR + END area + ENDIF + END frmAddComplexItem +ENDPROC + +PROC areaitemRemove() OF frmEditList + DEF entry,v1 + DEF area:PTR TO area + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + domethod(self.lList,[MUIM_List_GetEntry,entry,{v1}]) + self.deleteAreas.add(v1) + + area:=self.areaLists.item(entry) + END area + self.areaLists.remove(entry) + domethod( self.lList , [ MUIM_List_Remove, entry] ) + set( self.btnItemsSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC screenitemAdd() OF frmEditList + DEF str,res,v1,v2 + DEF tempStr[255]:STRING + DEF frmAddItem: PTR TO frmAddItem + MOVE.L (A1),self + GetA4() + + NEW frmAddItem.create(self.app) + get(self.strItem, MUIA_String_Contents,{str}) + res,v1,v2:=frmAddItem.addScreen(str) + IF res + StringF(tempStr,'\s (\s)',v1,v2) + domethod( self.lList , [ MUIM_List_InsertSingle , tempStr , MUIV_List_Insert_Bottom ] ) + self.extensions.add(v2) + self.titles.add(v1) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddItem + + set(self.strItem, MUIA_String_Contents,'') +ENDPROC + +PROC screenitemEdit() OF frmEditList + DEF str,res,v1,v2,entry + DEF tempStr[255]:STRING + DEF frmAddItem: PTR TO frmAddItem + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + NEW frmAddItem.create(self.app) + res,v1,v2:=frmAddItem.editScreen(self.titles.item(entry),self.extensions.item(entry)) + IF res + StringF(tempStr,'\s (\s)',v1,v2) + domethod( self.lList , [ MUIM_List_Remove, entry ] ) + domethod( self.lList , [ MUIM_List_InsertSingle , tempStr , entry ] ) + self.extensions.setItem(entry,v2) + self.titles.setItem(entry,v1) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddItem +ENDPROC + +PROC screenitemRemove() OF frmEditList + DEF entry + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + self.extensions.remove(entry) + self.titles.remove(entry) + domethod( self.lList , [ MUIM_List_Remove, entry] ) + set( self.btnItemsSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC itemAdd() OF frmEditList + DEF str + MOVE.L (A1),self + GetA4() + + get(self.strItem, MUIA_String_Contents,{str}) + domethod( self.lList , [ MUIM_List_InsertSingle , str , MUIV_List_Insert_Bottom ] ) + set(self.strItem, MUIA_String_Contents,'') + set( self.btnItemsSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC itemEdit() OF frmEditList + DEF str,res,v1,entry + DEF tempStr[255]:STRING + DEF frmAddItem: PTR TO frmAddItem + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + domethod(self.lList,[MUIM_List_GetEntry,entry,{v1}]) + + + NEW frmAddItem.create(self.app) + res,v1:=frmAddItem.editSingleItem(self.editCaption1,self.editCaption2,v1) + IF res + domethod( self.lList , [ MUIM_List_Remove, entry ] ) + domethod( self.lList , [ MUIM_List_InsertSingle , v1 , entry ] ) + set(self.lList,MUIA_List_Active,entry) + self.changed:=TRUE + set( self.btnItemsSave , MUIA_Disabled , FALSE) + ENDIF + END frmAddItem +ENDPROC + +PROC itemRemove() OF frmEditList + DEF entry + MOVE.L (A1),self + GetA4() + + get(self.lList,MUIA_List_Active,{entry}) + + domethod( self.lList , [ MUIM_List_Remove, entry] ) + set( self.btnItemsSave , MUIA_Disabled , FALSE) + self.changed:=TRUE +ENDPROC + +PROC addNotifications(customAdd=FALSE) OF frmEditList + domethod( self.btnItemsCancel , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , MUIA_Window_CloseRequest ] ) + + domethod( self.btnItemsSave , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , ID_SAVE ] ) + + domethod( self.strItem , [ + MUIM_Notify , MUIA_String_Contents , MUIV_EveryTime , + self.app.app, + 3 , + MUIM_CallHook , self.strOnChange, self] ) + installhook( self.strOnChange, {stringChange}) + + + domethod( self.lList , [ + MUIM_Notify , MUIA_List_Active , MUIV_EveryTime , + self.app.app, + 3 , + MUIM_CallHook , self.lvChange, self] ) + installhook( self.lvChange, {listChange}) + + IF customAdd=FALSE + self.setupButtonClick(self.btnItemAdd,self.btnAddClick,{itemAdd}) + self.setupButtonClick(self.btnItemEdit,self.btnEditClick,{itemEdit}) + self.setupButtonClick(self.btnItemRemove,self.btnRemoveClick,{itemRemove}) + ENDIF +ENDPROC + +PROC removeNotifications(customAdd=FALSE) OF frmEditList + domethod(self.btnItemsCancel,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemsSave,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.strItem,[MUIM_KillNotify,MUIA_String_Contents]) + domethod(self.lList,[MUIM_KillNotify,MUIA_List_Active]) + IF (customAdd=FALSE) + domethod(self.btnItemAdd,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemEdit,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemRemove,[MUIM_KillNotify,MUIA_Pressed]) + ENDIF +ENDPROC + +PROC canClose() OF frmEditList + MOVE.L (A1),self + GetA4() + IF self.changed + IF self.unsavedChangesWarning()=0 THEN RETURN FALSE + ENDIF +ENDPROC TRUE + +PROC unsavedChangesWarning() OF frmEditList + IF Mui_RequestA(0,self.winMain,0,'Unsaved changes', + '*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE +ENDPROC TRUE + + +PROC saveComputersChanges() OF frmEditList + DEF i,count,entry + DEF temppath[255]:STRING + DEF newCountStr[10]:STRING + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{entry}]) + StringF(temppath,'COMPUTER.\d',i) + writeToolType(self.computersTooltype,temppath,entry) + ENDFOR + FOR i:=count+1 TO self.oldcount + StringF(temppath,'COMPUTER.\d',i) + deleteToolType(self.computersTooltype,temppath) + ENDFOR + StringF(newCountStr,'\d',count) + writeToolType(self.computersTooltype,'COMPUTER.NUM',newCountStr) + self.oldcount:=count + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC editComputers(acpName) OF frmEditList + DEF count,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF bbsPath[200]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + + self.changed:=FALSE + + NEW saveHook + installhook( saveHook, {saveComputersChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Edit Computers' + self.editCaption2:='Computer' + + set(self.app.grp_arrange,MUIA_Group_Columns,1) + set(self.strItem,MUIA_ShowMe,MUI_TRUE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,MUI_TRUE) + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.computersTooltype:=String(255) + StringF(self.computersTooltype,'\sComputerList',bbsPath) + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , MUI_TRUE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(COMPS_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(COMPS_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(COMPS_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(COMPS_DELETE)) + set(self.strItem, MUIA_ShortHelp , getHelpText(COMPS_NAME)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Computers') + set( self.winMain, MUIA_Window_ID, "FCPS") + + self.addNotifications() + + count:=readToolTypeInt(self.computersTooltype,'COMPUTER.NUM') + IF (count>0) + FOR i:=1 TO count + StringF(temppath,'COMPUTER.\d',i) + readToolType(self.computersTooltype,temppath,tempstr) + domethod( self.lList , [ MUIM_List_InsertSingle , tempstr , MUIV_List_Insert_Bottom ] ) + ENDFOR + ENDIF + self.oldcount:=count + + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications() + END saveHook + END closeHook + DisposeLink(self.computersTooltype) +ENDPROC + +PROC saveNamesNotAllowedChanges() OF frmEditList + DEF i,count,entry + DEF temppath[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{entry}]) + StringF(temppath,'NAME.\d',i) + writeToolType(self.namesTooltype,temppath,entry) + ENDFOR + FOR i:=count+1 TO self.oldcount + StringF(temppath,'NAME.\d',i) + deleteToolType(self.namesTooltype,temppath) + ENDFOR + self.oldcount:=count + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC editNamesNotAllowed(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF bbsPath[200]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + + self.changed:=FALSE + + NEW saveHook + installhook( saveHook, {saveNamesNotAllowedChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + readToolType(acpName,'BBS_LOCATION',bbsPath) + + self.editCaption1:='Edit Names Not Allowed' + self.editCaption2:='Name' + + set(self.app.grp_arrange,MUIA_Group_Columns,1) + set(self.strItem,MUIA_ShowMe,MUI_TRUE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,MUI_TRUE) + + self.namesTooltype:=String(255) + StringF(self.namesTooltype,'\sNamesNotAllowed',bbsPath) + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , MUI_TRUE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(NNA_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(NNA_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(NNA_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(NNA_DELETE)) + set(self.strItem, MUIA_ShortHelp , getHelpText(NNA_NAME)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Names Not Allowed') + set( self.winMain, MUIA_Window_ID, "FNNS") + + self.addNotifications() + + loop:=TRUE + count:=0 + WHILE (loop) + StringF(temppath,'NAME.\d',count+1) + readToolType(self.namesTooltype,temppath,tempstr) + IF StrLen(tempstr)>0 + domethod( self.lList , [ MUIM_List_InsertSingle , tempstr , MUIV_List_Insert_Bottom ] ) + count++ + ELSE + loop:=FALSE + ENDIF + ENDWHILE + self.oldcount:=count + + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications() + END saveHook + END closeHook + DisposeLink(self.namesTooltype) +ENDPROC + +PROC saveDrivesChanges() OF frmEditList + DEF i,count,entry + DEF temppath[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{entry}]) + StringF(temppath,'DRIVE.\d',i) + writeToolType(self.drivesTooltype,temppath,entry) + ENDFOR + FOR i:=count+1 TO self.oldcount + StringF(temppath,'DRIVE.\d',i) + deleteToolType(self.drivesTooltype,temppath) + ENDFOR + self.oldcount:=count + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC editDrives(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF bbsPath[200]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + + self.changed:=FALSE + + NEW saveHook + installhook( saveHook, {saveDrivesChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Edit Drives' + self.editCaption2:='Drive' + + set(self.app.grp_arrange,MUIA_Group_Columns,1) + set(self.strItem,MUIA_ShowMe,MUI_TRUE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,MUI_TRUE) + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.drivesTooltype:=String(255) + StringF(self.drivesTooltype,'\sDrives',bbsPath) + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , MUI_TRUE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(DRV_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(DRV_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(DRV_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(DRV_DELETE)) + set(self.strItem, MUIA_ShortHelp , getHelpText(DRV_NAME)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Drives') + set( self.winMain, MUIA_Window_ID, "FDRS") + + self.addNotifications() + + loop:=TRUE + count:=0 + WHILE (loop) + StringF(temppath,'DRIVE.\d',count+1) + readToolType(self.drivesTooltype,temppath,tempstr) + IF StrLen(tempstr)>0 + domethod( self.lList , [ MUIM_List_InsertSingle , tempstr , MUIV_List_Insert_Bottom ] ) + count++ + ELSE + loop:=FALSE + ENDIF + ENDWHILE + self.oldcount:=count + + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + IF self.showModal() + ENDIF + self.removeNotifications() + END saveHook + END closeHook + DisposeLink(self.drivesTooltype) +ENDPROC + +PROC saveLanguagesChanges() OF frmEditList + DEF i,count,entry + DEF temppath[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{entry}]) + StringF(temppath,'LANGUAGE.\d',i) + writeToolType(self.languagesTooltype,temppath,entry) + ENDFOR + FOR i:=count+1 TO self.oldcount + StringF(temppath,'LANGUAGE.\d',i) + deleteToolType(self.languagesTooltype,temppath) + ENDFOR + self.oldcount:=count + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC editLanguages(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF bbsPath[200]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + + self.changed:=FALSE + + NEW saveHook + installhook( saveHook, {saveLanguagesChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Edit Languages' + self.editCaption2:='Language' + + set(self.app.grp_arrange,MUIA_Group_Columns,1) + set(self.strItem,MUIA_ShowMe,MUI_TRUE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,MUI_TRUE) + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.languagesTooltype:=String(255) + StringF(self.languagesTooltype,'\sLanguages',bbsPath) + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , MUI_TRUE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(LANG_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(LANG_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(LANG_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(LANG_DELETE)) + set(self.strItem, MUIA_ShortHelp , getHelpText(LANG_NAME)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Languages') + set( self.winMain, MUIA_Window_ID, "FLNS") + + self.addNotifications() + + loop:=TRUE + count:=0 + WHILE (loop) + StringF(temppath,'LANGUAGE.\d',count+1) + readToolType(self.languagesTooltype,temppath,tempstr) + IF StrLen(tempstr)>0 + domethod( self.lList , [ MUIM_List_InsertSingle , tempstr , MUIV_List_Insert_Bottom ] ) + count++ + ELSE + loop:=FALSE + ENDIF + ENDWHILE + self.oldcount:=count + + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + IF self.showModal() + ENDIF + self.removeNotifications() + END saveHook + END closeHook + DisposeLink(self.languagesTooltype) +ENDPROC + +PROC saveScreenTypesChanges() OF frmEditList + DEF i,count,entry + DEF temppath[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + FOR i:=1 TO count + StringF(temppath,'TYPE.\d',i) + writeToolType(self.screenTypesTooltype,temppath,self.extensions.item(i-1)) + + StringF(temppath,'TITLE.\d',i) + writeToolType(self.screenTypesTooltype,temppath,self.titles.item(i-1)) + ENDFOR + FOR i:=count+1 TO self.oldcount + StringF(temppath,'TYPE.\d',i) + deleteToolType(self.screenTypesTooltype,temppath) + + StringF(temppath,'TITLE.\d',i) + deleteToolType(self.screenTypesTooltype,temppath) + ENDFOR + self.oldcount:=count + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC editScreens(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING,tempstr2[255]:STRING + DEF bbsPath[200]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF titles:PTR TO stringlist + DEF extensions:PTR TO stringlist + + self.changed:=FALSE + + NEW saveHook + installhook( saveHook, {saveScreenTypesChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Edit Screentypes' + self.editCaption2:='Screentype' + + set(self.app.grp_arrange,MUIA_Group_Columns,2) + set(self.strItem,MUIA_ShowMe,FALSE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,FALSE) + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.screenTypesTooltype:=String(255) + StringF(self.screenTypesTooltype,'\sScreenTypes',bbsPath) + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , FALSE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(SCRN_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(SCRN_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(SCRN_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(SCRN_DELETE)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Screentypes') + set( self.winMain, MUIA_Window_ID, "FSTS") + + self.setupButtonClick(self.btnItemAdd,self.btnAddClick,{screenitemAdd}) + self.setupButtonClick(self.btnItemEdit,self.btnEditClick,{screenitemEdit}) + self.setupButtonClick(self.btnItemRemove,self.btnRemoveClick,{screenitemRemove}) + self.addNotifications(TRUE) + + NEW titles.stringlist(100) + self.titles:=titles + NEW extensions.stringlist(100) + self.extensions:=extensions + + loop:=TRUE + count:=0 + WHILE (loop) + StringF(temppath,'TYPE.\d',count+1) + readToolType(self.screenTypesTooltype,temppath,tempstr) + + StringF(temppath,'TITLE.\d',count+1) + readToolType(self.screenTypesTooltype,temppath,tempstr2) + + IF StrLen(tempstr2)>0 + self.extensions.add(tempstr) + self.titles.add(tempstr2) + IF StrLen(tempstr)>0 + StringF(tempstr,'\s (\s)',tempstr2,tempstr) + ELSE + StrCopy(tempstr,'\s',tempstr2) + ENDIF + ENDIF + + IF StrLen(tempstr)>0 + domethod( self.lList , [ MUIM_List_InsertSingle , tempstr , MUIV_List_Insert_Bottom ] ) + count++ + ELSE + loop:=FALSE + ENDIF + ENDWHILE + self.oldcount:=count + + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications(TRUE) + domethod(self.btnItemAdd,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemEdit,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemRemove,[MUIM_KillNotify,MUIA_Pressed]) + END saveHook + END closeHook + END titles + END extensions + DisposeLink(self.screenTypesTooltype) +ENDPROC + +PROC saveAreasChanges() OF frmEditList + DEF i,j,count + DEF temppath[255]:STRING + DEF accessPath[255]:STRING + DEF areaToolType[255]:STRING + DEF area:PTR TO area + DEF confToolType[20]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + + StringF(accessPath,'\saccess/',self.bbsPath) + + FOR i:=0 TO self.deleteAreas.count()-1 + StringF(areaToolType,'\sArea.\s.info',accessPath,self.deleteAreas.item(i)) + deleteFileFromCache(areaToolType) + DeleteFile(areaToolType) + ENDFOR + self.deleteAreas.clear() + + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{area}]) + StringF(areaToolType,'\sArea.\s',accessPath,area) + + area:=self.areaLists.item(i-1) + FOR j:=1 TO ListLen(area.confList) + StringF(confToolType,'CONF.\d',j) + IF area.confList[j-1] + writeToolType(areaToolType,confToolType,-1) + ELSE + deleteToolType(areaToolType,confToolType) + ENDIF + ENDFOR + ENDFOR + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC loadAreaNames(confCount) OF frmEditList + DEF accessPath[255]:STRING + DEF areaToolType[255]:STRING + DEF confToolType[20]:STRING + DEF dir_info:PTR TO fileinfoblock + DEF pdir,r,entry,i,n + DEF area:PTR TO area + + DEF confList:PTR TO LONG + + DEF buf[255]:STRING + DEF parseBuf[100]:STRING + DEF namesList:PTR TO stringlist + + StringF(accessPath,'\saccess/',self.bbsPath) + + IF ((dir_info:=AllocDosObject(DOS_FIB,NIL)) = NIL) + RETURN 0 + ENDIF + + IF ((pdir:=Lock(accessPath,ACCESS_READ)))=FALSE + FreeDosObject(DOS_FIB,dir_info) + RETURN 0 + ENDIF + + IF(Examine(pdir, dir_info))=FALSE + FreeDosObject(DOS_FIB,dir_info) + UnLock(pdir) + RETURN 0 + ENDIF + + IF ParsePatternNoCase('AREA.#?.info',parseBuf,100) =-1 THEN RETURN + + domethod( self.lList , [ MUIM_List_Clear] ) + + NEW namesList.stringlist(20) + + WHILE(ExNext(pdir,dir_info)) + IF(dir_info.direntrytype < 0) + + IF MatchPatternNoCase(parseBuf,dir_info.filename) + StrCopy(buf,dir_info.filename+5) + stripInfo(buf) + namesList.add(buf) + ENDIF + ENDIF + ENDWHILE + + UnLock(pdir) + FreeDosObject(DOS_FIB,dir_info) + + namesList.sort() + FOR n:=0 TO namesList.count()-1 + + NEW area.create() + + domethod( self.lList , [ MUIM_List_InsertSingle , namesList.item(n) , MUIV_List_Insert_Bottom ] ) + + StrCopy(area.filename,namesList.item(n)) + area.confList:=List(confCount) + StringF(areaToolType,'\sArea.\s',accessPath,namesList.item(n)) + FOR i:=0 TO confCount-1 + StringF(confToolType,'CONF.\d',i+1) + ListAddItem(area.confList,IF checkToolTypeExists(areaToolType,confToolType) THEN TRUE ELSE FALSE) + ENDFOR + self.areaLists.add(area) + ENDFOR + + END namesList +ENDPROC + +PROC editAreas(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING,tempstr2[255]:STRING + DEF bbsPath[255]:STRING + DEF confConfig[255]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF areaLists:PTR TO stdlist + DEF deleteAreas:PTR TO stringlist + DEF area:PTR TO area + DEF confCount + + self.changed:=FALSE + + self.acpName:=acpName + + NEW saveHook + installhook( saveHook, {saveAreasChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Edit Areas' + self.editCaption2:='Areas' + + set(self.app.grp_arrange,MUIA_Group_Columns,2) + set(self.strItem,MUIA_ShowMe,FALSE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,FALSE) + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.bbsPath:=bbsPath + + StringF(confConfig,'\sCONFCONFIG',bbsPath) + + confCount:=readToolTypeInt(confConfig,'NCONFS') + + NEW areaLists.stdlist(25) + self.areaLists:=areaLists + + NEW deleteAreas.stringlist(25) + self.deleteAreas:=deleteAreas + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , FALSE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(AREAS_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(AREAS_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(AREAS_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(AREAS_DELETE)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Areas') + set( self.winMain, MUIA_Window_ID, "FARS") + + self.setupButtonClick(self.btnItemAdd,self.btnAddClick,{areaitemAdd}) + self.setupButtonClick(self.btnItemEdit,self.btnEditClick,{areaitemEdit}) + self.setupButtonClick(self.btnItemRemove,self.btnRemoveClick,{areaitemRemove}) + self.addNotifications(TRUE) + + self.loadAreaNames(confCount) + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications(TRUE) + domethod(self.btnItemAdd,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemEdit,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemRemove,[MUIM_KillNotify,MUIA_Pressed]) + END saveHook + END closeHook + FOR i:=0 TO areaLists.count()-1 + area:=areaLists.item(i) + END area + ENDFOR + END areaLists + END deleteAreas +ENDPROC + +PROC saveAccessLevelChanges() OF frmEditList + DEF i,j,count + DEF temppath[255]:STRING + DEF accessLevel:PTR TO accessLevel + DEF accessPath[255]:STRING + DEF accessToolType[255]:STRING + DEF acs + DEF confToolType[20]:STRING + DEF acsValues:PTR TO LONG + DEF tempStr[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + + StringF(accessPath,'\saccess/',self.bbsPath) + + FOR i:=0 TO self.deleteAccessLevels.count()-1 + StringF(accessToolType,'\sACS.\s.info',accessPath,self.deleteAccessLevels.item(i)) + deleteFileFromCache(accessToolType) + DeleteFile(accessToolType) + ENDFOR + self.deleteAccessLevels.clear() + + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{acs}]) + StringF(accessToolType,'\sACS.\s',accessPath,acs) + + accessLevel:=self.accessLists.item(i-1) + + acsValues:=getAccessLevels() + + FOR j:=0 TO ListLen(acsValues)-1 + IF j=0 + writeToolType(accessToolType,'ACS.MAX_PAGES',accessLevel.accessList.item(0)) + ELSE + IF accessLevel.accessList.contains(acsValues[j]) THEN writeToolType(accessToolType,acsValues[j],-1) ELSE deleteToolType(accessToolType,acsValues[j]) + ENDIF + ENDFOR + ENDFOR + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC loadAccessLevels() OF frmEditList + DEF accessPath[255]:STRING + DEF accessToolType[255]:STRING + DEF dir_info:PTR TO fileinfoblock + DEF pdir,r,entry,i,n + DEF accessLevel:PTR TO accessLevel + DEF tempStr[255]:STRING + + DEF buf[255]:STRING + DEF parseBuf[100]:STRING + DEF namesList:PTR TO stringlist + DEF acsValues:PTR TO LONG + + StringF(accessPath,'\saccess/',self.bbsPath) + + IF ((dir_info:=AllocDosObject(DOS_FIB,NIL)) = NIL) + RETURN 0 + ENDIF + + IF ((pdir:=Lock(accessPath,ACCESS_READ)))=FALSE + FreeDosObject(DOS_FIB,dir_info) + RETURN 0 + ENDIF + + IF(Examine(pdir, dir_info))=FALSE + FreeDosObject(DOS_FIB,dir_info) + UnLock(pdir) + RETURN 0 + ENDIF + + IF ParsePatternNoCase('ACS.#?.info',parseBuf,100) =-1 THEN RETURN + + domethod( self.lList , [ MUIM_List_Clear] ) + + NEW namesList.stringlist(100) + + WHILE(ExNext(pdir,dir_info)) + IF(dir_info.direntrytype < 0) + + IF MatchPatternNoCase(parseBuf,dir_info.filename) + StrCopy(buf,dir_info.filename+4) + stripInfo(buf) + namesList.add(buf) + ENDIF + ENDIF + ENDWHILE + + UnLock(pdir) + FreeDosObject(DOS_FIB,dir_info) + + namesList.sort() + FOR n:=0 TO namesList.count()-1 + domethod( self.lList , [ MUIM_List_InsertSingle , namesList.item(n) , MUIV_List_Insert_Bottom ] ) + NEW accessLevel.create() + + StrCopy(accessLevel.filename,namesList.item(n)) + StringF(accessToolType,'\sACS.\s',accessPath,namesList.item(n)) + + acsValues:=getAccessLevels() + + FOR i:=0 TO ListLen(acsValues)-1 + IF i=0 + readToolType(accessToolType,acsValues[0],tempStr) + accessLevel.accessList.add(tempStr) + ELSE + IF checkToolTypeExists(accessToolType,acsValues[i]) THEN accessLevel.accessList.add(acsValues[i]) + ENDIF + ENDFOR + + self.accessLists.add(accessLevel) + ENDFOR + + END namesList +ENDPROC + +PROC editAccessLevel(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING,tempstr2[255]:STRING + DEF bbsPath[255]:STRING + DEF confConfig[255]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF accessLists:PTR TO stdlist + DEF deleteAccessLevels:PTR TO stringlist + DEF accessList:PTR TO stringlist + + self.changed:=FALSE + + self.acpName:=acpName + + NEW saveHook + installhook( saveHook, {saveAccessLevelChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Edit Access Levels' + self.editCaption2:='Access Level' + + set(self.app.grp_arrange,MUIA_Group_Columns,2) + set(self.strItem,MUIA_ShowMe,FALSE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,FALSE) + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.bbsPath:=bbsPath + + NEW accessLists.stdlist(25) + self.accessLists:=accessLists + + NEW deleteAccessLevels.stringlist(25) + self.deleteAccessLevels:=deleteAccessLevels + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , FALSE) + set(self.strItem, MUIA_String_Contents,'') + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Access Levels') + set( self.winMain, MUIA_Window_ID, "FALS") + + set( self.lvList , MUIA_ShortHelp , getHelpText(ACS_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(ACS_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(ACS_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(ACS_DELETE)) + + self.setupButtonClick(self.btnItemAdd,self.btnAddClick,{accessLevelitemAdd}) + self.setupButtonClick(self.btnItemEdit,self.btnEditClick,{accessLevelitemEdit}) + self.setupButtonClick(self.btnItemRemove,self.btnRemoveClick,{accessLevelitemRemove}) + self.addNotifications(TRUE) + + self.loadAccessLevels() + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications(TRUE) + domethod(self.btnItemAdd,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemEdit,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemRemove,[MUIM_KillNotify,MUIA_Pressed]) + + END saveHook + END closeHook + + FOR i:=0 TO accessLists.count()-1 + accessList:=accessLists.item(i) + END accessList + ENDFOR + END accessLists + END deleteAccessLevels +ENDPROC + +PROC saveFCheckChanges() OF frmEditList + DEF i,count + DEF fCheckPath[255]:STRING + DEF fCheckToolType[255]:STRING + DEF fcheckName + DEF fChecker:PTR TO fChecker + DEF tempStr[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + + StringF(fCheckPath,'\sfcheck/',self.bbsPath) + + FOR i:=0 TO self.deletefCheckLists.count()-1 + StringF(fCheckToolType,'\s\s.info',fCheckPath,self.deletefCheckLists.item(i)) + deleteFileFromCache(fCheckToolType) + DeleteFile(fCheckToolType) + ENDFOR + self.deletefCheckLists.clear() + + + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{fcheckName}]) + StringF(fCheckToolType,'\s\s',fCheckPath,fcheckName) + + fChecker:=self.fCheckLists.item(i-1) + + writeToolType(fCheckToolType,'CHECKER',fChecker.checker) + writeToolType(fCheckToolType,'ERROR.1',fChecker.error1) + writeToolType(fCheckToolType,'ERROR.2',fChecker.error2) + writeToolType(fCheckToolType,'ERROR.3',fChecker.error3) + writeToolType(fCheckToolType,'ERROR.4',fChecker.error4) + writeToolType(fCheckToolType,'ERROR.5',fChecker.error5) + writeToolType(fCheckToolType,'ERROR.6',fChecker.error6) + writeToolType(fCheckToolType,'ERROR.7',fChecker.error7) + writeToolType(fCheckToolType,'ERROR.8',fChecker.error8) + writeToolType(fCheckToolType,'ERROR.9',fChecker.error9) + writeToolType(fCheckToolType,'ERROR.10',fChecker.error10) + writeToolType(fCheckToolType,'OPTIONS',fChecker.options) + writeToolType(fCheckToolType,'PRIORITY',fChecker.priority) + writeToolType(fCheckToolType,'SCRIPT',fChecker.script) + writeToolType(fCheckToolType,'STACK',fChecker.stack) + ENDFOR + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC loadFileCheckers() OF frmEditList + DEF fCheckPath[255]:STRING + DEF fCheckToolType[255]:STRING + DEF tempStr[255]:STRING + DEF dir_info:PTR TO fileinfoblock + DEF pdir,r,entry,i,n + DEF fileChecker:PTR TO fChecker + + DEF buf[255]:STRING + DEF parseBuf[100]:STRING + DEF namesList:PTR TO stringlist + + StringF(fCheckPath,'\sfcheck/',self.bbsPath) + + IF ((dir_info:=AllocDosObject(DOS_FIB,NIL)) = NIL) + RETURN 0 + ENDIF + + IF ((pdir:=Lock(fCheckPath,ACCESS_READ)))=FALSE + FreeDosObject(DOS_FIB,dir_info) + RETURN 0 + ENDIF + + IF(Examine(pdir, dir_info))=FALSE + FreeDosObject(DOS_FIB,dir_info) + UnLock(pdir) + RETURN 0 + ENDIF + + IF ParsePatternNoCase('#?.info',parseBuf,100) =-1 THEN RETURN + + domethod( self.lList , [ MUIM_List_Clear] ) + + NEW namesList.stringlist(20) + + WHILE(ExNext(pdir,dir_info)) + IF(dir_info.direntrytype < 0) + + IF MatchPatternNoCase(parseBuf,dir_info.filename) + StrCopy(buf,dir_info.filename) + stripInfo(buf) + namesList.add(buf) + ENDIF + ENDIF + ENDWHILE + + UnLock(pdir) + FreeDosObject(DOS_FIB,dir_info) + + namesList.sort() + FOR n:=0 TO namesList.count()-1 + domethod( self.lList , [ MUIM_List_InsertSingle , namesList.item(n) , MUIV_List_Insert_Bottom ] ) + StringF(fCheckToolType,'\s\s',fCheckPath,namesList.item(n)) + + NEW fileChecker.create() + //load fcheck details + StrCopy(fileChecker.filename,namesList.item(n)) + readToolType(fCheckToolType,'CHECKER',tempStr) + StrCopy(fileChecker.checker,tempStr) + readToolType(fCheckToolType,'OPTIONS',tempStr) + StrCopy(fileChecker.options,tempStr) + readToolType(fCheckToolType,'SCRIPT',tempStr) + StrCopy(fileChecker.script,tempStr) + readToolType(fCheckToolType,'ERROR.1',tempStr) + StrCopy(fileChecker.error1,tempStr) + readToolType(fCheckToolType,'ERROR.2',tempStr) + StrCopy(fileChecker.error2,tempStr) + readToolType(fCheckToolType,'ERROR.3',tempStr) + StrCopy(fileChecker.error3,tempStr) + readToolType(fCheckToolType,'ERROR.4',tempStr) + StrCopy(fileChecker.error4,tempStr) + readToolType(fCheckToolType,'ERROR.5',tempStr) + StrCopy(fileChecker.error5,tempStr) + readToolType(fCheckToolType,'ERROR.6',tempStr) + StrCopy(fileChecker.error6,tempStr) + readToolType(fCheckToolType,'ERROR.7',tempStr) + StrCopy(fileChecker.error7,tempStr) + readToolType(fCheckToolType,'ERROR.8',tempStr) + StrCopy(fileChecker.error8,tempStr) + readToolType(fCheckToolType,'ERROR.9',tempStr) + StrCopy(fileChecker.error9,tempStr) + readToolType(fCheckToolType,'ERROR.10',tempStr) + StrCopy(fileChecker.error10,tempStr) + readToolType(fCheckToolType,'PRIORITY',tempStr) + StrCopy(fileChecker.priority,tempStr) + readToolType(fCheckToolType,'STACK',tempStr) + StrCopy(fileChecker.stack,tempStr) + + self.fCheckLists.add(fileChecker) + ENDFOR + END namesList +ENDPROC + +PROC editFileCheckers(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING,tempstr2[255]:STRING + DEF bbsPath[255]:STRING + DEF confConfig[255]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF fCheckLists:PTR TO stdlist + DEF deletefCheckLists:PTR TO stringlist + DEF fileChecker:PTR TO fChecker + + self.changed:=FALSE + + self.acpName:=acpName + + NEW saveHook + installhook( saveHook, {saveFCheckChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Edit File Checkers' + self.editCaption2:='File Checker' + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.bbsPath:=bbsPath + + NEW fCheckLists.stdlist(25) + self.fCheckLists:=fCheckLists + + NEW deletefCheckLists.stringlist(25) + self.deletefCheckLists:=deletefCheckLists + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , FALSE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(FCHK_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(FCHK_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(FCHK_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(FCHK_DELETE)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit File Checkers') + set( self.winMain, MUIA_Window_ID, "FCHK") + + set(self.app.grp_arrange,MUIA_Group_Columns,2) + set(self.strItem,MUIA_ShowMe,FALSE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,FALSE) + + self.setupButtonClick(self.btnItemAdd,self.btnAddClick,{fileCheckitemAdd}) + self.setupButtonClick(self.btnItemEdit,self.btnEditClick,{fileCheckitemEdit}) + self.setupButtonClick(self.btnItemRemove,self.btnRemoveClick,{fileCheckitemRemove}) + self.addNotifications(TRUE) + + self.loadFileCheckers() + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications(TRUE) + domethod(self.btnItemAdd,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemEdit,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemRemove,[MUIM_KillNotify,MUIA_Pressed]) + END saveHook + END closeHook + FOR i:=0 TO fCheckLists.count()-1 + fileChecker:=fCheckLists.item(i) + END fileChecker + ENDFOR + END fCheckLists + END deletefCheckLists +ENDPROC + +PROC saveProtocolChanges() OF frmEditList + DEF i,count + DEF protocolPath[255]:STRING + DEF protocolToolType[255]:STRING + DEF protocolName + DEF protocol:PTR TO protocol + DEF tempStr[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + + StringF(protocolPath,'\sprotocols/',self.bbsPath) + + FOR i:=0 TO self.deleteProtocolLists.count()-1 + StringF(protocolToolType,'\s\s.info',protocolPath,self.deleteProtocolLists.item(i)) + deleteFileFromCache(protocolToolType) + DeleteFile(protocolToolType) + ENDFOR + self.deleteProtocolLists.clear() + + + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{protocolName}]) + StringF(protocolToolType,'\s\s',protocolPath,protocolName) + + protocol:=self.protocolLists.item(i-1) + + writeToolType(protocolToolType,'OPTIONS',protocol.options) + writeToolType(protocolToolType,'HTTPHOST',protocol.httpHost) + writeToolType(protocolToolType,'HTTPTEMP',protocol.httpTemp) + writeToolType(protocolToolType,'FTPHOST',protocol.ftpHost) + IF protocol.ftpAuth THEN writeToolType(protocolToolType,'FTPAUTH',-1) ELSE deleteToolType(protocolToolType,'FTPAUTH') + writeToolType(protocolToolType,'RXWINDOW',protocol.rxWindow) + writeToolType(protocolToolType,'TXWINDOW',protocol.txWindow) + ENDFOR + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC loadProtocols() OF frmEditList + DEF protocolPath[255]:STRING + DEF protocolToolType[255]:STRING + DEF tempStr[255]:STRING + DEF dir_info:PTR TO fileinfoblock + DEF pdir,r,entry,i,n + DEF protocol:PTR TO protocol + + DEF buf[255]:STRING + DEF parseBuf[100]:STRING + DEF namesList:PTR TO stringlist + + StringF(protocolPath,'\sprotocols/',self.bbsPath) + + IF ((dir_info:=AllocDosObject(DOS_FIB,NIL)) = NIL) + RETURN 0 + ENDIF + + IF ((pdir:=Lock(protocolPath,ACCESS_READ)))=FALSE + FreeDosObject(DOS_FIB,dir_info) + RETURN 0 + ENDIF + + IF(Examine(pdir, dir_info))=FALSE + FreeDosObject(DOS_FIB,dir_info) + UnLock(pdir) + RETURN 0 + ENDIF + + IF ParsePatternNoCase('#?.info',parseBuf,100) =-1 THEN RETURN + + domethod( self.lList , [ MUIM_List_Clear] ) + + NEW namesList.stringlist(20) + + WHILE(ExNext(pdir,dir_info)) + IF(dir_info.direntrytype < 0) + + IF MatchPatternNoCase(parseBuf,dir_info.filename) + StrCopy(buf,dir_info.filename) + stripInfo(buf) + namesList.add(buf) + ENDIF + ENDIF + ENDWHILE + + UnLock(pdir) + FreeDosObject(DOS_FIB,dir_info) + + namesList.sort() + FOR n:=0 TO namesList.count()-1 + + domethod( self.lList , [ MUIM_List_InsertSingle , namesList.item(n) , MUIV_List_Insert_Bottom ] ) + StringF(protocolToolType,'\s\s',protocolPath,namesList.item(n)) + + NEW protocol.create() + //load protocol details + + StrCopy(protocol.filename,namesList.item(n)) + + readToolType(protocolToolType,'OPTIONS',tempStr) + StrCopy(protocol.options,tempStr) + + readToolType(protocolToolType,'HTTPHOST',tempStr) + StrCopy(protocol.httpHost,tempStr) + + readToolType(protocolToolType,'HTTPTEMP',tempStr) + StrCopy(protocol.httpTemp,tempStr) + + readToolType(protocolToolType,'FTPHOST',tempStr) + StrCopy(protocol.ftpHost,tempStr) + + protocol.ftpAuth:=checkToolTypeExists(protocolToolType,'FTPAUTH') + + readToolType(protocolToolType,'RXWINDOW',tempStr) + StrCopy(protocol.rxWindow,tempStr) + + readToolType(protocolToolType,'TXWINDOW',tempStr) + StrCopy(protocol.txWindow,tempStr) + + self.protocolLists.add(protocol) + ENDFOR + END namesList +ENDPROC + +PROC editProtocols(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING,tempstr2[255]:STRING + DEF bbsPath[255]:STRING + DEF confConfig[255]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF protocolLists:PTR TO stdlist + DEF deleteProtocolLists:PTR TO stringlist + DEF protocol:PTR TO protocol + + self.changed:=FALSE + + self.acpName:=acpName + + NEW saveHook + installhook( saveHook, {saveProtocolChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Edit Protocols' + self.editCaption2:='Protocol' + + set(self.app.grp_arrange,MUIA_Group_Columns,2) + set(self.strItem,MUIA_ShowMe,FALSE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,FALSE) + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.bbsPath:=bbsPath + + NEW protocolLists.stdlist(25) + self.protocolLists:=protocolLists + + NEW deleteProtocolLists.stringlist(25) + self.deleteProtocolLists:=deleteProtocolLists + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , FALSE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(PCOL_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(PCOL_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(PCOL_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(PCOL_DELETE)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Protocols') + set( self.winMain, MUIA_Window_ID, "PCOL") + + + self.setupButtonClick(self.btnItemAdd,self.btnAddClick,{protocolitemAdd}) + self.setupButtonClick(self.btnItemEdit,self.btnEditClick,{protocolitemEdit}) + self.setupButtonClick(self.btnItemRemove,self.btnRemoveClick,{protocolitemRemove}) + self.addNotifications(TRUE) + + self.loadProtocols() + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications(TRUE) + domethod(self.btnItemAdd,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemEdit,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemRemove,[MUIM_KillNotify,MUIA_Pressed]) + END saveHook + END closeHook + FOR i:=0 TO protocolLists.count()-1 + protocol:=protocolLists.item(i) + END protocol + ENDFOR + END protocolLists + END deleteProtocolLists +ENDPROC + +PROC saveCommandChanges() OF frmEditList + DEF i,count,val + DEF commandPath[255]:STRING + DEF commandToolType[255]:STRING + DEF commandName + DEF command:PTR TO command + DEF tempStr[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + + StringF(commandPath,'\scommands/\s/',self.bbsPath,self.commandPath) + + FOR i:=0 TO self.deleteCommandLists.count()-1 + StringF(commandToolType,'\s\s.info',commandPath,self.deleteCommandLists.item(i)) + deleteFileFromCache(commandToolType) + DeleteFile(commandToolType) + ENDFOR + self.deleteCommandLists.clear() + + makeDir(self.commandPath) + + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{commandName}]) + StringF(commandToolType,'\s\s',commandPath,commandName) + + command:=self.commandLists.item(i-1) + + writeToolType(commandToolType,'NAME',command.name) + writeToolType(commandToolType,'LOCATION',command.location) + writeToolType(commandToolType,'ACCESS',command.access) + writeToolType(commandToolType,'INTERNAL',command.internal) + writeToolType(commandToolType,'MIMICVER',command.mimicVer) + writeToolType(commandToolType,'PASSWORD',command.password) + + writeToolType(commandToolType,'PASS_PARAMETERS',command.passParams) + writeToolType(commandToolType,'PRIORITY',command.priority) + + IF command.resident THEN writeToolType(commandToolType,'RESIDENT',-1) ELSE deleteToolType(commandToolType,'RESIDENT') + IF command.quickMode THEN writeToolType(commandToolType,'QUICKMODE',-1) ELSE deleteToolType(commandToolType,'QUICKMODE') + + writeToolType(commandToolType,'STACK',command.stack) + writeToolType(commandToolType,'TYPE',command.type) + + IF command.trapon THEN writeToolType(commandToolType,'TRAPON',-1) ELSE deleteToolType(commandToolType,'TRAPON') + IF command.expertMode THEN writeToolType(commandToolType,'EXPERT_MODE',-1) ELSE deleteToolType(commandToolType,'EXPERT_MODE') + IF command.doorSilent THEN writeToolType(commandToolType,'DOORSILENT',-1) ELSE deleteToolType(commandToolType,'DOORSILENT') + IF command.logInputs THEN writeToolType(commandToolType,'LOG_INPUTS',-1) ELSE deleteToolType(commandToolType,'LOG_INPUTS') + IF command.scriptCheck THEN writeToolType(commandToolType,'SCRIPTCHECK',-1) ELSE deleteToolType(commandToolType,'SCRIPTCHECK') + + IF command.multiNode THEN writeToolType(commandToolType,'MULTINODE','YES') + writeToolType(commandToolType,'BANNER',command.banner) + ENDFOR + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC loadCommands() OF frmEditList + DEF commandPath[255]:STRING + DEF commandToolType[255]:STRING + DEF tempStr[255]:STRING + DEF dir_info:PTR TO fileinfoblock + DEF pdir,r,entry,i,n + DEF command:PTR TO command + DEF val + DEF c=0 + + DEF buf[255]:STRING + DEF parseBuf[100]:STRING + DEF namesList:PTR TO stringlist + + StringF(commandPath,'\scommands/\s/',self.bbsPath,self.commandPath) + + IF ((dir_info:=AllocDosObject(DOS_FIB,NIL)) = NIL) + RETURN 0 + ENDIF + + IF ((pdir:=Lock(commandPath,ACCESS_READ)))=FALSE + FreeDosObject(DOS_FIB,dir_info) + RETURN 0 + ENDIF + + IF(Examine(pdir, dir_info))=FALSE + FreeDosObject(DOS_FIB,dir_info) + UnLock(pdir) + RETURN 0 + ENDIF + + IF ParsePatternNoCase('#?.info',parseBuf,100) =-1 THEN RETURN + + domethod( self.lList , [ MUIM_List_Clear] ) + + NEW namesList.stringlist(100) + + WHILE(ExNext(pdir,dir_info)) + IF(dir_info.direntrytype < 0) + + IF MatchPatternNoCase(parseBuf,dir_info.filename) + StrCopy(buf,dir_info.filename) + stripInfo(buf) + namesList.add(buf) + ENDIF + ENDIF + ENDWHILE + + UnLock(pdir) + FreeDosObject(DOS_FIB,dir_info) + + namesList.sort() + FOR n:=0 TO namesList.count()-1 + domethod( self.lList , [ MUIM_List_InsertSingle , namesList.item(n) , MUIV_List_Insert_Bottom ] ) + StringF(commandToolType,'\s\s',commandPath,namesList.item(n)) + + NEW command.create() + + StrCopy(command.filename,namesList.item(n)) + + //load command details + readToolType(commandToolType,'NAME',tempStr) + StrCopy(command.name,tempStr) + readToolType(commandToolType,'LOCATION',tempStr) + StrCopy(command.location,tempStr) + readToolType(commandToolType,'ACCESS',tempStr) + StrCopy(command.access,tempStr) + readToolType(commandToolType,'INTERNAL',tempStr) + StrCopy(command.internal,tempStr) + readToolType(commandToolType,'MIMICVER',tempStr) + StrCopy(command.mimicVer,tempStr) + readToolType(commandToolType,'PASSWORD',tempStr) + StrCopy(command.password,tempStr) + readToolType(commandToolType,'PASS_PARAMETERS',tempStr) + StrCopy(command.passParams,tempStr) + readToolType(commandToolType,'PRIORITY',tempStr) + StrCopy(command.priority,tempStr) + command.resident:=checkToolTypeExists(commandToolType,'RESIDENT') + command.quickMode:=checkToolTypeExists(commandToolType,'QUICKMODE') + + readToolType(commandToolType,'STACK',tempStr) + StrCopy(command.stack,tempStr) + + readToolType(commandToolType,'TYPE',tempStr) + StrCopy(command.type,tempStr) + + command.trapon:=checkToolTypeExists(commandToolType,'TRAPON') + command.expertMode:=checkToolTypeExists(commandToolType,'EXPERT_MODE') + command.doorSilent:=checkToolTypeExists(commandToolType,'DOORSILENT') + command.logInputs:=checkToolTypeExists(commandToolType,'LOG_INPUTS') + command.scriptCheck:=checkToolTypeExists(commandToolType,'SCRIPTCHECK') + + readToolType(commandToolType,'MULTINODE',tempStr) + command.multiNode:=StriCmp(tempStr,'YES') + + readToolType(commandToolType,'BANNER',tempStr) + StrCopy(command.banner,tempStr) + + self.commandLists.add(command) + ENDFOR + END namesList + +ENDPROC + +PROC editCommands(acpName,commandFolder) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING,tempstr2[255]:STRING + DEF bbsPath[255]:STRING + DEF confConfig[255]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF commandLists:PTR TO stdlist + DEF deleteCommandLists:PTR TO stringlist + DEF command:PTR TO command + DEF editStr[255]:STRING + + self.changed:=FALSE + + self.acpName:=acpName + + NEW saveHook + installhook( saveHook, {saveCommandChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + StringF(editStr,'Edit Commands (\s)',commandFolder) + self.editCaption1:=editStr + self.editCaption2:='Command' + + set(self.app.grp_arrange,MUIA_Group_Columns,2) + set(self.strItem,MUIA_ShowMe,FALSE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,FALSE) + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.bbsPath:=bbsPath + + NEW commandLists.stdlist(25) + self.commandLists:=commandLists + + NEW deleteCommandLists.stringlist(25) + self.deleteCommandLists:=deleteCommandLists + + self.commandPath:=commandFolder + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , FALSE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(CMDS_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(CMDS_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(CMDS_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(CMDS_DELETE)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,editStr) + set( self.winMain, MUIA_Window_ID, "CMDL") + + + self.setupButtonClick(self.btnItemAdd,self.btnAddClick,{commanditemAdd}) + self.setupButtonClick(self.btnItemEdit,self.btnEditClick,{commanditemEdit}) + self.setupButtonClick(self.btnItemRemove,self.btnRemoveClick,{commanditemRemove}) + self.addNotifications(TRUE) + + self.loadCommands() + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications(TRUE) + domethod(self.btnItemAdd,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemEdit,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemRemove,[MUIM_KillNotify,MUIA_Pressed]) + END saveHook + END closeHook + FOR i:=0 TO commandLists.count()-1 + command:=commandLists.item(i) + END command + ENDFOR + END commandLists + END deleteCommandLists +ENDPROC + +PROC saveConnectionChanges() OF frmEditList + DEF i,count,entry + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + + FOR i:=0 TO self.oldconnectionstrings.count()-1 + IF self.connectlist.contains(self.oldconnectionstrings.item(i))=FALSE + deleteToolType(self.connectDefToolType,self.oldconnectionstrings.item(i)) + ENDIF + ENDFOR + self.oldconnectionstrings.clear() + FOR i:=0 TO count-1 + writeToolType(self.connectDefToolType,self.connectlist.item(i),self.connectbaud.item(i)) + self.oldconnectionstrings.add(self.connectlist.item(i)) + ENDFOR + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC editConnectionStrings(acpName) OF frmEditList + DEF count,i,j,entry,temppath[255]:STRING,tempstr[255]:STRING,tempstr2[255]:STRING + DEF bbsPath[200]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF connectionstrings:PTR TO stringlist + DEF oldconnectionstrings:PTR TO stringlist + DEF baudrates:PTR TO stringlist + + self.changed:=FALSE + + NEW saveHook + installhook( saveHook, {saveConnectionChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Connection String' + self.editCaption2:='Baud' + + set(self.app.grp_arrange,MUIA_Group_Columns,2) + set(self.strItem,MUIA_ShowMe,FALSE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,FALSE) + + readToolType(acpName,'BBS_LOCATION',bbsPath) + self.connectDefToolType:=String(255) + StringF(self.connectDefToolType,'\sConnect.def',bbsPath) + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , FALSE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(CONN_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(CONN_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(CONN_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(CONN_DELETE)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Connection Strings') + set( self.winMain, MUIA_Window_ID, "CDEF") + + self.setupButtonClick(self.btnItemAdd,self.btnAddClick,{connectionitemAdd}) + self.setupButtonClick(self.btnItemEdit,self.btnEditClick,{connectionitemEdit}) + self.setupButtonClick(self.btnItemRemove,self.btnRemoveClick,{connectionitemRemove}) + self.addNotifications(TRUE) + + NEW connectionstrings.stringlist(100) + self.connectlist:=connectionstrings + NEW baudrates.stringlist(100) + self.connectbaud:=baudrates + + NEW oldconnectionstrings.stringlist(100) + self.oldconnectionstrings:=oldconnectionstrings + + readAllToolTypes(self.connectDefToolType,connectionstrings) + FOR j:=0 TO connectionstrings.count()-1 + domethod( self.lList , [ MUIM_List_InsertSingle , connectionstrings.item(j), MUIV_List_Insert_Bottom ] ) + + StrCopy(tempstr,connectionstrings.item(j)) + StrCopy(tempstr2,'') + i:=0 + WHILE i" " THEN StrAddChar(tempstr2,tempstr[i]) + i++ + ENDWHILE + i++ + connectionstrings.setItem(j,tempstr2) + oldconnectionstrings.add(tempstr2) + + StrCopy(tempstr2,'') + WHILE i" " THEN StrAddChar(tempstr2,tempstr[i]) + i++ + ENDWHILE + baudrates.setItem(j,tempstr2) + ENDFOR + self.oldcount:=count + + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications(TRUE) + domethod(self.btnItemAdd,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemEdit,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnItemRemove,[MUIM_KillNotify,MUIA_Pressed]) + END saveHook + END closeHook + END connectionstrings + END oldconnectionstrings + END baudrates + DisposeLink(self.connectDefToolType) +ENDPROC + +PROC saveRestrictedChanges() OF frmEditList + DEF i,count,entry + DEF temppath[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{entry}]) + StringF(temppath,'RESTRICT.\d',i) + writeToolType(self.acpName,temppath,entry) + ENDFOR + FOR i:=count+1 TO self.oldcount + StringF(temppath,'RESTRICT.\d',i) + deleteToolType(self.acpName,temppath) + ENDFOR + self.oldcount:=count + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC editRestricted(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + + self.changed:=FALSE + self.acpName:=acpName + + NEW saveHook + installhook( saveHook, {saveRestrictedChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Restricted files' + self.editCaption2:='File' + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , MUI_TRUE) + set(self.strItem, MUIA_String_Contents,'') + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Restricted Files') + set( self.winMain, MUIA_Window_ID, "FRST") + + set( self.lvList , MUIA_ShortHelp , getHelpText(RESTRICT_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(RESTRICT_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(RESTRICT_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(RESTRICT_DELETE)) + set(self.strItem, MUIA_ShortHelp , getHelpText(RESTRICT_TEXT)) + + set(self.app.grp_arrange,MUIA_Group_Columns,1) + set(self.strItem,MUIA_ShowMe,MUI_TRUE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,MUI_TRUE) + + self.addNotifications() + + loop:=TRUE + count:=0 + WHILE (loop) + StringF(temppath,'RESTRICT.\d',count+1) + readToolType(acpName,temppath,tempstr) + IF StrLen(tempstr)>0 + domethod( self.lList , [ MUIM_List_InsertSingle , tempstr , MUIV_List_Insert_Bottom ] ) + count++ + ELSE + loop:=FALSE + ENDIF + ENDWHILE + self.oldcount:=count + + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications() + END saveHook + END closeHook +ENDPROC + +PROC saveBackupChanges() OF frmEditList + DEF i,count,entry + DEF temppath[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + get(self.lList,MUIA_List_Entries,{count}) + FOR i:=1 TO count + domethod(self.lList,[MUIM_List_GetEntry,i-1,{entry}]) + StringF(temppath,'BACKUP.\d',i) + writeToolType(self.acpName,temppath,entry) + ENDFOR + FOR i:=count+1 TO self.oldcount + StringF(temppath,'BACKUP.\d',i) + deleteToolType(self.acpName,temppath) + ENDFOR + self.oldcount:=count + saveCachedChanges() + + set( self.btnItemsSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC editBackup(acpName) OF frmEditList + DEF count,loop,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + + self.changed:=FALSE + self.acpName:=acpName + + NEW saveHook + installhook( saveHook, {saveBackupChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.editCaption1:='Backup files' + self.editCaption2:='File' + + set(self.app.grp_arrange,MUIA_Group_Columns,1) + set(self.strItem,MUIA_ShowMe,MUI_TRUE) + set(self.app.grp_computers_add,MUIA_Group_Horiz,MUI_TRUE) + + set( self.btnItemRemove , MUIA_Disabled , MUI_TRUE) + set( self.btnItemEdit , MUIA_Disabled , MUI_TRUE) + set( self.btnItemAdd , MUIA_Disabled , MUI_TRUE) + set(self.strItem, MUIA_String_Contents,'') + + set( self.lvList , MUIA_ShortHelp , getHelpText(BACKUP_LVIEW)) + set( self.btnItemAdd , MUIA_ShortHelp , getHelpText(BACKUP_ADD)) + set( self.btnItemEdit , MUIA_ShortHelp , getHelpText(BACKUP_EDIT)) + set( self.btnItemRemove , MUIA_ShortHelp , getHelpText(BACKUP_DELETE)) + set(self.strItem, MUIA_ShortHelp , getHelpText(BACKUP_TEXT)) + + domethod( self.lList , [ MUIM_List_Clear] ) + + set( self.winMain, MUIA_Window_Title,'Edit Backup Files') + set( self.winMain, MUIA_Window_ID, "FBAK") + + self.addNotifications() + + loop:=TRUE + count:=0 + WHILE (loop) + StringF(temppath,'BACKUP.\d',count+1) + readToolType(acpName,temppath,tempstr) + IF StrLen(tempstr)>0 + domethod( self.lList , [ MUIM_List_InsertSingle , tempstr , MUIV_List_Insert_Bottom ] ) + count++ + ELSE + loop:=FALSE + ENDIF + ENDWHILE + self.oldcount:=count + + set( self.btnItemsSave , MUIA_Disabled , MUI_TRUE) + + self.showModal() + self.removeNotifications() + END saveHook + END closeHook +ENDPROC +/* +//hide edit +set(self.app.grp_arrange,MUIA_Group_Columns,2) +set(self.strItem,MUIA_ShowMe,FALSE) +set(self.app.grp_computers_add,MUIA_Group_Horiz,FALSE) + +//show edit +set(self.app.grp_arrange,MUIA_Group_Columns,1) +set(self.strItem,MUIA_ShowMe,MUI_TRUE) +set(self.app.grp_computers_add,MUIA_Group_Horiz,MUI_TRUE) +*/ \ No newline at end of file diff --git a/axSetupTool/frmMain.e b/axSetupTool/frmMain.e new file mode 100644 index 0000000..426f4b3 --- /dev/null +++ b/axSetupTool/frmMain.e @@ -0,0 +1,530 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi','dos/dos','libraries/asl','dos/var' +MODULE 'utility/tagitem' , 'utility/hooks', 'tools/installhook' +MODULE '*axedit','*frmBase','*frmEditList','*frmNodeEdit','*frmConfEdit','*frmSettingsEdit','*frmAccess','*frmCommands','*frmTools','*tooltypes' + +EXPORT OBJECT frmMain OF frmBase + aboutwin:LONG + missingMandatory:INT + acpConfigName: PTR TO CHAR + btnConfsClickHook: hook + btnNodesClickHook: hook + btnComputersClickHook: hook + btnCheckersClickHook: hook + btnNamesNotAllowedClickHook: hook + btnDrivesClickHook: hook + btnSystemClickHook: hook + btnScreensClickHook: hook + btnServerClickHook: hook + btnSecurityClickHook: hook + btnLanguagesClickHook: hook + btnProtocolsClickHook: hook + btnCommandsClickHook: hook + btnZoomClickHook: hook + btnConnectClickHook: hook + btnBackupClickHook: hook + btnRestrictClickHook: hook + btnExitClickHook: hook + btnAboutClickHook: hook + btnToolsClickHook: hook + mnuAboutMuiClickHook: hook +ENDOBJECT + +PROC aboutMui() OF frmMain + MOVE.L (A1),self + GetA4() + IF (self.aboutwin=0) + self.aboutwin:=AboutmuiObject, + MUIA_Window_RefWindow, self.winMain, + MUIA_Aboutmui_Application, self.app.app, + End + ENDIF + IF (self.aboutwin) THEN set(self.aboutwin,MUIA_Window_Open,TRUE) +ENDPROC + +PROC exitbuttonPressed() OF frmMain + MOVE.L (A1),self + GetA4() + domethod(self.app.app,[MUIM_Application_ReturnID,MUIA_Window_CloseRequest]) +ENDPROC + + +PROC aboutbuttonPressed() OF frmMain + MOVE.L (A1),self + GetA4() + Mui_RequestA(0,self.winMain,0,'About Ami-Express Setup Tool' ,'*Ok','This tool can assist you in configuring\nalmost every aspect of Ami-Express.\n\n(c)2023 Darren Coles.',0) +ENDPROC + +PROC toolsbuttonPressed() OF frmMain + DEF frmTools:PTR TO frmTools + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW frmTools.create(self.app) + frmTools.tools(self.acpConfigName) + END frmTools + self.wake() + +ENDPROC + + +PROC computersbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editComputers(self.acpConfigName) + END listEdit + self.wake() + +ENDPROC + +PROC drivesbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editDrives(self.acpConfigName) + END listEdit + self.wake() + +ENDPROC + +PROC screensbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editScreens(self.acpConfigName) + END listEdit + self.wake() + +ENDPROC + +PROC connectbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editConnectionStrings(self.acpConfigName) + END listEdit + self.wake() + +ENDPROC + +PROC namesnotallowedbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editNamesNotAllowed(self.acpConfigName) + END listEdit + self.wake() + +ENDPROC + +PROC nodesbuttonPressed() OF frmMain + DEF frmNodeEdit:PTR TO frmNodeEdit + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW frmNodeEdit.create(self.app) + frmNodeEdit.editNodes(self.acpConfigName) + END frmNodeEdit + self.wake() + +ENDPROC + +PROC confsbuttonPressed() OF frmMain + DEF frmConfEdit:PTR TO frmConfEdit + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW frmConfEdit.create(self.app) + frmConfEdit.editConfs(self.acpConfigName) + END frmConfEdit + self.wake() + +ENDPROC + +PROC zoombuttonPressed() OF frmMain + DEF frmSettingsEdit:PTR TO frmSettingsEdit + MOVE.L (A1),self + GetA4() + self.sleep() + NEW frmSettingsEdit.create(self.app) + frmSettingsEdit.editZoomSettings(self.acpConfigName) + END frmSettingsEdit + self.wake() +ENDPROC + +PROC serverbuttonPressed() OF frmMain + DEF frmSettingsEdit:PTR TO frmSettingsEdit + MOVE.L (A1),self + GetA4() + self.sleep() + NEW frmSettingsEdit.create(self.app) + frmSettingsEdit.editServerSettings(self.acpConfigName) + END frmSettingsEdit + self.wake() +ENDPROC + +PROC systembuttonPressed() OF frmMain + DEF frmSettingsEdit:PTR TO frmSettingsEdit + MOVE.L (A1),self + GetA4() + self.sleep() + NEW frmSettingsEdit.create(self.app) + frmSettingsEdit.editSystemSettings(self.acpConfigName) + END frmSettingsEdit + self.wake() +ENDPROC + +PROC securitybuttonPressed() OF frmMain + DEF frmAccess:PTR TO frmAccess + MOVE.L (A1),self + GetA4() + self.sleep() + NEW frmAccess.create(self.app) + frmAccess.editAccess(self.acpConfigName) + END frmAccess + self.wake() +ENDPROC + + +PROC backupbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editBackup(self.acpConfigName) + END listEdit + self.wake() +ENDPROC + +PROC restrictbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editRestricted(self.acpConfigName) + END listEdit + self.wake() +ENDPROC + +PROC languagesbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editLanguages(self.acpConfigName) + END listEdit + self.wake() +ENDPROC + +PROC fcheckbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editFileCheckers(self.acpConfigName) + END listEdit + self.wake() + +ENDPROC + +PROC commandsbuttonPressed() OF frmMain + DEF frmCommands:PTR TO frmCommands + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW frmCommands.create(self.app) + frmCommands.editCommands(self.acpConfigName) + END frmCommands + self.wake() + +ENDPROC + +PROC protocolsbuttonPressed() OF frmMain + DEF listEdit:PTR TO frmEditList + MOVE.L (A1),self + GetA4() + + self.sleep() + NEW listEdit.create(self.app) + listEdit.editProtocols(self.acpConfigName) + END listEdit + self.wake() + +ENDPROC + +PROC formShow() OF frmMain + DEF frmSettingsEdit:PTR TO frmSettingsEdit + MOVE.L (A1),self + GetA4() + IF self.missingMandatory + NEW frmSettingsEdit.create(self.app) + frmSettingsEdit.editSystemSettings(self.acpConfigName,TRUE) + END frmSettingsEdit + + ENDIF +ENDPROC + + +PROC create(app:PTR TO app_obj) OF frmMain + SUPER self.create(app) + self.winMain:=app.winMain + + set (app.mnlabel1Donotremovefolder1, MUIA_Menuitem_Exclude, 6) + set (app.mnlabel1Removefolder1, MUIA_Menuitem_Exclude, 5) + set (app.mnlabel1Ask1, MUIA_Menuitem_Exclude, 3) + + + set (app.mnlabel1Donotremovefolder2, MUIA_Menuitem_Exclude, 6) + set (app.mnlabel1Removefolder2, MUIA_Menuitem_Exclude, 5) + set (app.mnlabel1Ask2, MUIA_Menuitem_Exclude, 3) +ENDPROC + +PROC canClose() OF frmMain + DEF tempStr[255]:STRING + DEF configOk=TRUE + + MOVE.L (A1),self + GetA4() + + readToolType(self.acpConfigName,'SYSOP_NAME',tempStr) + IF StrLen(tempStr)=0 THEN configOk:=FALSE + + readToolType(self.acpConfigName,'BBS_LOCATION',tempStr) + IF StrLen(tempStr)=0 THEN configOk:=FALSE + + readToolType(self.acpConfigName,'BBS_NAME',tempStr) + IF StrLen(tempStr)=0 THEN configOk:=FALSE + + readToolType(self.acpConfigName,'BBS_GEOGRAPHIC',tempStr) + IF StrLen(tempStr)=0 THEN configOk:=FALSE + + IF configOk=FALSE + IF Mui_RequestA(0,self.winMain,0,'Warning' ,'*Ok|Cancel','You have not cofigured the minimal settings to allow Ami-Express to start up.. Are you sure you wish to exit?',0)=0 THEN RETURN FALSE + ENDIF + + IF(FindPort('AE.Master')) AND getChangeFlag() + Mui_RequestA(0,self.winMain,0,'Warning','*OK','ACP is running and changes have been made.\nA restart of the bbs is recommended.',0) + ENDIF + +ENDPROC TRUE + +PROC doMain() OF frmMain + DEF fh,fr:PTR TO filerequester + DEF tempStr[200]:STRING + DEF nodeCount + DEF closeHook:PTR TO hook + DEF showHook:PTR TO hook + + DEF v + + NEW closeHook + NEW showHook + + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + installhook( showHook, {formShow}) + self.showHook:=showHook + + GetVar('axSetupEditor_prefs',tempStr,200,0) + SetStr(tempStr) + IF (EstrLen(tempStr)>0) THEN v:=tempStr[0]-48 ELSE v:=0 + SELECT v + CASE 1 + set (self.app.mnlabel1Donotremovefolder1, MUIA_Menuitem_Checked, MUI_TRUE) + CASE 2 + set (self.app.mnlabel1Removefolder1, MUIA_Menuitem_Checked, MUI_TRUE) + CASE 3 + set (self.app.mnlabel1Ask1, MUIA_Menuitem_Checked, MUI_TRUE) + DEFAULT + set (self.app.mnlabel1Donotremovefolder1, MUIA_Menuitem_Checked, MUI_TRUE) + ENDSELECT + + IF (EstrLen(tempStr)>1) THEN v:=tempStr[1]-48 ELSE v:=0 + SELECT v + CASE 1 + set (self.app.mnlabel1Donotremovefolder2, MUIA_Menuitem_Checked, MUI_TRUE) + CASE 2 + set (self.app.mnlabel1Removefolder2, MUIA_Menuitem_Checked, MUI_TRUE) + CASE 3 + set (self.app.mnlabel1Ask2, MUIA_Menuitem_Checked, MUI_TRUE) + DEFAULT + set (self.app.mnlabel1Donotremovefolder2, MUIA_Menuitem_Checked, MUI_TRUE) + ENDSELECT + + self.acpConfigName:=String(200) + + IF EstrLen(tempStr)>2 + StrCopy(self.acpConfigName,tempStr+2) + ENDIF + + StringF(tempStr,'\s.info',self.acpConfigName) + + IF (EstrLen(self.acpConfigName)=0) OR (FileLength(tempStr)<=0) + fr:=Mui_AllocAslRequest(ASL_FILEREQUEST, [ASLFR_TITLETEXT,'Select ACP file',ASLFR_INITIALDRAWER,'sys:wbstartup',ASLFR_INITIALFILE,'ACP',ASLFR_INITIALPATTERN,'ACP',0]) + IF (fr) + IF Mui_AslRequest(fr,0) + StrCopy(self.acpConfigName,fr.drawer) + AddPart(self.acpConfigName,fr.file,StrMax(self.acpConfigName)) + SetStr(self.acpConfigName) + StringF(tempStr,'\s.info',self.acpConfigName) + IF (FileLength(self.acpConfigName)<=0) OR (FileLength(tempStr)<=0) + StrCopy(self.acpConfigName,'') + ENDIF + ELSE + StrCopy(self.acpConfigName,'') + ENDIF + Mui_FreeAslRequest(fr) + ENDIF + ENDIF + IF EstrLen(self.acpConfigName)=0 + Mui_RequestA(0,self.winMain,0,'Error' ,'*Ok','Ami-Express setup tool is unable to proceed\nbecause we cannot find the acp.info file',0) + Throw("ACP","icon") + ENDIF + + self.aboutwin:=0 + + self.setupButtonClick(self.app.btnComputers,self.btnComputersClickHook,{computersbuttonPressed}) + self.setupButtonClick(self.app.btnCheckers,self.btnCheckersClickHook,{fcheckbuttonPressed}) + self.setupButtonClick(self.app.btnNamesNotAllowed,self.btnNamesNotAllowedClickHook,{namesnotallowedbuttonPressed}) + self.setupButtonClick(self.app.btnDrives,self.btnDrivesClickHook,{drivesbuttonPressed}) + self.setupButtonClick(self.app.btnScreenTypes,self.btnScreensClickHook,{screensbuttonPressed}) + self.setupButtonClick(self.app.btnNodes,self.btnNodesClickHook,{nodesbuttonPressed}) + self.setupButtonClick(self.app.btnConfs,self.btnConfsClickHook,{confsbuttonPressed}) + self.setupButtonClick(self.app.btnSystem,self.btnSystemClickHook,{systembuttonPressed}) + self.setupButtonClick(self.app.btnServer,self.btnServerClickHook,{serverbuttonPressed}) + self.setupButtonClick(self.app.btnSecurity,self.btnSecurityClickHook,{securitybuttonPressed}) + self.setupButtonClick(self.app.btnLanguages,self.btnLanguagesClickHook,{languagesbuttonPressed}) + self.setupButtonClick(self.app.btnProtocols,self.btnProtocolsClickHook,{protocolsbuttonPressed}) + self.setupButtonClick(self.app.btnCommands,self.btnCommandsClickHook,{commandsbuttonPressed}) + self.setupButtonClick(self.app.btnZoom,self.btnZoomClickHook,{zoombuttonPressed}) + self.setupButtonClick(self.app.btnConnect,self.btnConnectClickHook,{connectbuttonPressed}) + self.setupButtonClick(self.app.btnExit,self.btnExitClickHook,{exitbuttonPressed}) + self.setupButtonClick(self.app.btnRestrict,self.btnRestrictClickHook,{restrictbuttonPressed}) + self.setupButtonClick(self.app.btnBackup,self.btnBackupClickHook,{backupbuttonPressed}) + self.setupButtonClick(self.app.btnAbout,self.btnAboutClickHook,{aboutbuttonPressed}) + self.setupButtonClick(self.app.btnTools,self.btnToolsClickHook,{toolsbuttonPressed}) + + installhook( self.mnuAboutMuiClickHook, {aboutMui}) + + domethod( self.app.mnlabel1AboutMui, [ + MUIM_Notify , MUIA_Menuitem_Trigger, MUIV_EveryTime, + self.app.mnlabel1AboutMui, + 3, + MUIM_CallHook , self.mnuAboutMuiClickHook, self ] ) + + domethod( self.app.mnlabel1Exit , [ + MUIM_Notify , MUIA_Menuitem_Trigger, MUIV_EveryTime, + self.app.mnlabel1Exit, + 3, + MUIM_CallHook , self.btnExitClickHook, self ] ) + + domethod( self.app.mnlabel1About , [ + MUIM_Notify , MUIA_Menuitem_Trigger, MUIV_EveryTime, + self.app.mnlabel1About, + 3, + MUIM_CallHook , self.btnAboutClickHook, self ] ) + + set( self.app.btnUsers, MUIA_Text_Contents,'Unused') + set( self.app.btnUsers, MUIA_Disabled , MUI_TRUE) + + initialiseCache() + + nodeCount:=readToolTypeInt(self.acpConfigName,'NODES') + IF nodeCount=-1 + Mui_RequestA(0,self.winMain,0,'Error' ,'*Ok','Ami-Express setup tool is unable to proceed\nbecause the number of nodes is not defined in the acp.info file',0) + Throw("ACP","icon") + ENDIF + + self.missingMandatory:=FALSE + readToolType(self.acpConfigName,'BBS_LOCATION',tempStr) + IF EstrLen(tempStr)=0 THEN self.missingMandatory:=TRUE + readToolType(self.acpConfigName,'BBS_NAME',tempStr) + IF EstrLen(tempStr)=0 THEN self.missingMandatory:=TRUE + readToolType(self.acpConfigName,'BBS_GEOGRAPHIC',tempStr) + IF EstrLen(tempStr)=0 THEN self.missingMandatory:=TRUE + readToolType(self.acpConfigName,'SYSOP_NAME',tempStr) + IF EstrLen(tempStr)=0 THEN self.missingMandatory:=TRUE + + IF (nodeCount>10) AND (FileLength('bbs:utils/rexxdoor')=16068) + Mui_RequestA(self.app.app,0,0,'Warning','*OK','The version of rexxdoor you are using\nis not compatible with more than 10 nodes.',0) + ENDIF + + self.showModal() + + get (self.app.mnlabel1Donotremovefolder1, MUIA_Menuitem_Checked,{v}) + IF v + StrCopy(tempStr,'1') + ELSE + get (self.app.mnlabel1Removefolder1, MUIA_Menuitem_Checked, {v}) + IF v + StrCopy(tempStr,'2') + ELSE + get (self.app.mnlabel1Ask1, MUIA_Menuitem_Checked, {v}) + IF v + StrCopy(tempStr,'3') + ELSE + StrCopy(tempStr,'1') + ENDIF + ENDIF + ENDIF + + get (self.app.mnlabel1Donotremovefolder2, MUIA_Menuitem_Checked,{v}) + IF v + StrAdd(tempStr,'1') + ELSE + get (self.app.mnlabel1Removefolder2, MUIA_Menuitem_Checked, {v}) + IF v + StrAdd(tempStr,'2') + ELSE + get (self.app.mnlabel1Ask2, MUIA_Menuitem_Checked, {v}) + IF v + StrAdd(tempStr,'3') + ELSE + StrAdd(tempStr,'1') + ENDIF + ENDIF + ENDIF + StrAdd(tempStr,self.acpConfigName) + + SetVar('axSetupEditor_prefs',tempStr,-1,GVF_SAVE_VAR OR GVF_GLOBAL_ONLY) + IF KickVersion(39)=FALSE THEN Execute('Copy env:axSetupEditor_prefs envarc:',0,0) + + clearDiskObjectCache() + deInitialiseCache() + + DisposeLink(self.acpConfigName) + END closeHook + END showHook +ENDPROC diff --git a/axSetupTool/frmNodeEdit.e b/axSetupTool/frmNodeEdit.e new file mode 100644 index 0000000..cd3a507 --- /dev/null +++ b/axSetupTool/frmNodeEdit.e @@ -0,0 +1,1381 @@ +OPT MODULE +OPT LARGE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui','dos/dos','dos/dostags','dos/dosextens' +MODULE 'tools/boopsi','workbench/workbench','icon','intuition/classusr' +MODULE 'utility/tagitem','utility/hooks','exec/lists','tools/installhook' +MODULE '*axedit','*frmBase','*tooltypes','*controls','*miscfuncs','*helpText' + +OBJECT timeItem + baudStr:PTR TO CHAR + startControl:PTR TO LONG + endControl:PTR TO LONG +ENDOBJECT + +EXPORT OBJECT frmNodeEdit OF frmBase + controlList1a : LONG + controlList1b : LONG + controlList2 : LONG + controlList3 : LONG + controlList4 : LONG + + grpNodePages : PTR TO LONG + + strNodeNumber : PTR TO LONG + btnFirstNode : PTR TO LONG + btnLastNode : PTR TO LONG + btnPrevNode : PTR TO LONG + btnNextNode : PTR TO LONG + btnAddNode : PTR TO LONG + btnCloneNode : PTR TO LONG + btnRemoveNode : PTR TO LONG + btnNodeSave : PTR TO LONG + btnNodeCancel : PTR TO LONG + grpNodeSettings : PTR TO LONG + grpNodeMoreSettings: PTR TO LONG + grpNodeSettings2 : PTR TO LONG + grpNodeSettings3 : PTR TO LONG + grpNodeSettings4 : PTR TO LONG + + intPriority : PTR TO control + strNodeStart : PTR TO control + strSystemPassword : PTR TO control + strSystemPasswordPrompt: PTR TO control + strNewuserPassword : PTR TO control + strNamePrompt : PTR TO control + strNamePrompt2 : PTR TO control + strPasswordPrompt : PTR TO control + paScreens : PTR TO control + intAutoValPreset : PTR TO control + intAutoValDelay : PTR TO control + strAutoValPassword : PTR TO control + strFtpPort : PTR TO control + strFtpDataPort : PTR TO control + strHttpPort : PTR TO control + intKeepUlCredit : PTR TO control + intMaxMsgQueue : PTR TO control + paPlaypen : PTR TO control + intRingCount : PTR TO control + strRemotePassword : PTR TO control + intSysopChatColour : PTR TO control + intUserChatColour : PTR TO control + fnUserDataName : PTR TO control + fnUserMiscName : PTR TO control + fnUserKeysName : PTR TO control + paLocalUlPath : PTR TO control + intOverrideTimeout : PTR TO control + //needs to be a cycle + strForceAnsi : PTR TO control + intBGFilecheckStack: PTR TO control + strConInputDev : PTR TO control + strConOutputDev : PTR TO control + strScreenPens : PTR TO control + strConfDb : PTR TO control + fnFilesNotAllowed : PTR TO control + strFirstCommand : PTR TO control + intSerialCacheSize : PTR TO control + boolCallersLog : PTR TO control + boolCapitalFilenames: PTR TO control + boolDefScreens : PTR TO control + boolDebugLog : PTR TO control + boolDoorLog : PTR TO control + boolStartLog : PTR TO control + boolUDLog : PTR TO control + boolChatOn : PTR TO control + boolDisableQuickLogon: PTR TO control + boolIdleNode : PTR TO control + boolMailscanPrompt : PTR TO control + boolNoTimeout : PTR TO control + boolQuietNode : PTR TO control + boolStealthNode : PTR TO control + boolShowPwFail : PTR TO control + boolSentByFiles : PTR TO control + boolTelnet : PTR TO control + boolFtp : PTR TO control + boolTelnetD : PTR TO control + boolTelserD : PTR TO control + boolUserNumLogin : PTR TO control + boolViewPassword : PTR TO control + boolLogHost : PTR TO control + boolLogInputs : PTR TO control + boolNoCx : PTR TO control + boolCentralAnswers : PTR TO control + boolDisableIemsi : PTR TO control + boolNoMciMsg : PTR TO control + boolNoWildcard : PTR TO control + boolOwnPartFiles : PTR TO control + boolPhoneCheck : PTR TO control + boolRamWork : PTR TO control + boolConsoleDebug : PTR TO control + boolNoEmails : PTR TO control + boolOwnDevunit : PTR TO control + boolShowCacheStats : PTR TO control + boolTrapDoor : PTR TO control + boolTrapSerial : PTR TO control + boolNoRadBoogie : PTR TO control + + //serial device settings + strSerialDevice : PTR TO control + intSerialUnit : PTR TO control + intSerialBaud : PTR TO control + boolA2232Patch : PTR TO control + boolNoPurgeLine : PTR TO control + boolRepurge : PTR TO control + boolLogoffReset : PTR TO control + boolTrueReset : PTR TO control + + //modem settings + strModemInit : PTR TO control + strModemReset : PTR TO control + strModemRing : PTR TO control + strModemAnswer : PTR TO control + strModemOffhook : PTR TO control + + strNRAMS1 : PTR TO control + strNRAMS2 : PTR TO control + strNRAMS3 : PTR TO control + strNRAMS4 : PTR TO control + + + //window settings + intNumColours : PTR TO control + intWinLeftEdge : PTR TO control + intWinTopEdge : PTR TO control + intWinWidth : PTR TO control + intWinHeight : PTR TO control + boolWinPubScreen : PTR TO control + strWinPubScreen : PTR TO control + boolWinIconified : PTR TO control + boolWinInterlace : PTR TO control + boolWinStatusBar : PTR TO control + boolWinToFront : PTR TO control + strDisplayId : PTR TO control + + btnFirstNodeClick: hook + btnLastNodeClick: hook + btnNextNodeClick: hook + btnPrevNodeClick: hook + btnAddNodeClick: hook + btnCloneNodeClick: hook + btnRemoveNodeClick: hook + setChangedHook:hook + + //evo bug here + //timesList:PTR TO PTR TO timeItem + //do this instead + timesList:PTR TO LONG + + acpName:PTR TO CHAR + changed:INT + nodeCount:INT + currNode:INT + newNode:INT +ENDOBJECT + +PROC create(app:PTR TO app_obj) OF frmNodeEdit + DEF group + SUPER self.create(app) + self.winMain:=app.wi_nodeEdit + + self.strNodeNumber:=app.str_Node_Number + self.btnFirstNode:=app.btnFirstNode + self.btnLastNode:=app.btnLastNode + self.btnPrevNode:=app.btnPrevNode + self.btnNextNode:=app.btnNextNode + self.btnAddNode:=app.btnAddNode + self.btnCloneNode:=app.btnNodeClone + self.btnRemoveNode:=app.btnRemoveNode + self.btnNodeSave:=app.btnNodeSave + self.btnNodeCancel:=app.btnNodeCancel + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(75)) + + self.grpNodePages:=app.gr_node_pages + + get(app.gr_node_settings,MUIA_Scrollgroup_Contents,{group}) + self.grpNodeSettings:=group + set(self.grpNodeSettings, MUIA_Group_Columns , 2) + + get(app.gr_node_second_settings,MUIA_Scrollgroup_Contents,{group}) + self.grpNodeMoreSettings:=group + set(self.grpNodeMoreSettings, MUIA_Group_Columns , 2) + + get(app.gr_node_more_settings,MUIA_Scrollgroup_Contents,{group}) + self.grpNodeSettings2:=group + set(self.grpNodeSettings2, MUIA_Group_Columns , 4) + + get(app.gr_node_serial_settings,MUIA_Scrollgroup_Contents,{group}) + self.grpNodeSettings3:=group + set(self.grpNodeSettings3, MUIA_Group_Columns , 4) + + get(app.gr_node_window_settings,MUIA_Scrollgroup_Contents,{group}) + self.grpNodeSettings4:=group + set(self.grpNodeSettings4, MUIA_Group_Columns , 4) + +ENDPROC + +PROC cloneNewNode() OF frmNodeEdit + DEF tempStr[255]:STRING + MOVE.L (A1),self + GetA4() + + IF self.loadNode(self.currNode) + self.changed:=TRUE + self.newNode:=TRUE + self.nodeCount:=self.nodeCount+1 + self.currNode:=self.nodeCount-1 + + self.checkRexxDoor() + + + StringF(tempStr,'\d',self.currNode) + set(self.strNodeNumber, MUIA_String_Contents,tempStr) + + set( self.btnPrevNode, MUIA_Disabled , FALSE) + set( self.btnNextNode, MUIA_Disabled , MUI_TRUE) + set( self.btnRemoveNode, MUIA_Disabled , FALSE) + + set( self.btnNodeSave,MUIA_Disabled,FALSE) + set( self.btnAddNode,MUIA_Disabled,MUI_TRUE) + set( self.btnCloneNode,MUIA_Disabled,MUI_TRUE) + ENDIF +ENDPROC + +PROC checkRexxDoor() OF frmNodeEdit + IF (self.nodeCount>10) AND (FileLength('bbs:utils/rexxdoor')=16068) + Mui_RequestA(self.app.app,0,0,'Warning','*OK','The version of rexxdoor you are using\nis not compatible with more than 10 nodes.',0) + ENDIF +ENDPROC + +PROC createNewNode() OF frmNodeEdit + MOVE.L (A1),self + GetA4() + + IF self.loadNode(self.nodeCount) + self.changed:=TRUE + self.newNode:=TRUE + self.nodeCount:=self.nodeCount+1 + + self.checkRexxDoor() + + set( self.btnNodeSave,MUIA_Disabled,FALSE) + set( self.btnAddNode,MUIA_Disabled,MUI_TRUE) + set( self.btnCloneNode,MUIA_Disabled,MUI_TRUE) + ENDIF +ENDPROC + +PROC deleteNodeFolder(node) OF frmNodeEdit + DEF deleteStr[255]:STRING + DEF bbsPath[255]:STRING + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + + StringF(deleteStr,'DELETE \sNode\d ALL',bbsPath,node) + Execute(deleteStr,0,0) + + StringF(deleteStr,'DELETE \sNode\d.info',bbsPath,node) + Execute(deleteStr,0,0) +ENDPROC + +PROC deleteCurrentNode() OF frmNodeEdit + DEF deleteOption + DEF nodeStr[255]:STRING + MOVE.L (A1),self + GetA4() + + get (self.app.mnlabel1Donotremovefolder2, MUIA_Menuitem_Checked, {deleteOption}) + IF deleteOption + deleteOption:=1 + ELSE + get (self.app.mnlabel1Removefolder2, MUIA_Menuitem_Checked, {deleteOption}) + IF deleteOption + deleteOption:=2 + ELSE + deleteOption:=3 + ENDIF + ENDIF + + IF self.deleteNodeWarning()=FALSE THEN RETURN + + IF self.loadNode(self.nodeCount-2) + self.nodeCount:=self.currNode+1 + + //update node count + StringF(nodeStr,'\d',self.nodeCount) + writeToolType(self.acpName,'NODES',nodeStr) + + StringF(nodeStr,'NODE\d_NAME',self.nodeCount) + deleteToolType(self.acpName,nodeStr) + StringF(nodeStr,'NODE\d_SYSOP',self.nodeCount) + deleteToolType(self.acpName,nodeStr) + StringF(nodeStr,'NODE\d_LOCATION',self.nodeCount) + deleteToolType(self.acpName,nodeStr) + + set( self.btnNextNode, MUIA_Disabled , MUI_TRUE) + set( self.btnRemoveNode, MUIA_Disabled , (self.currNode0 + timeVal:=Val(timeEntry) + IF (Mod(timeVal,100)>59) OR (timeVal>2359) OR (timeVal<0) + StringF(errorText,'You have entered an invalid time for \s baud start time',timeStr) + Mui_RequestA(0,self.winMain,0,'Error','*OK',errorText,0) + RETURN FALSE + ENDIF + ENDIF + + get(endControl, MUIA_String_Contents,{timeEntry}) + + IF StrLen(timeEntry)>0 + timeVal:=Val(timeEntry) + IF (Mod(timeVal,100)>59) OR (timeVal>2359) OR (timeVal<0) + StringF(errorText,'You have entered an invalid time for \s baud end time',timeStr) + Mui_RequestA(0,self.winMain,0,'Error','*OK',errorText,0) + RETURN FALSE + ENDIF + ENDIF + +ENDPROC TRUE + +PROC saveChanges() OF frmNodeEdit + DEF nodeStr[255]:STRING + DEF bbsPath[255]:STRING + DEF folderStr[255]:STRING + DEF tempStr[255]:STRING + DEF toolTypePath[255]:STRING + DEF windowTooltype[255]:STRING + DEF timeTooltype[255]:STRING + DEF timeItem:PTR TO timeItem + DEF val + + MOVE.L (A1),self + GetA4() + + + fullTrim(self.strNodeStart.getValue(),tempStr) + IF EstrLen(tempStr)=0 + Mui_RequestA(0,self.winMain,0,'Error','*OK','Express File is a mandatory field',0) + RETURN + ENDIF + + IF Exists({timeItem},self.timesList,`self.validateTime(timeItem.baudStr,timeItem.startControl,timeItem.endControl)=FALSE) THEN RETURN + + self.sleep() + StringF(nodeStr,'\d',self.nodeCount) + writeToolType(self.acpName,'NODES',nodeStr) + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + StringF(nodeStr,'\sNode\d',bbsPath,self.currNode) + + IF (self.newNode) + //create the folder structure + makeDir(nodeStr) + StringF(folderStr,'\s/work',nodeStr) + makeDir(folderStr) + StringF(folderStr,'\s/playpen',nodeStr) + makeDir(folderStr) + StringF(folderStr,'\s/serial',nodeStr) + makeDir(folderStr) + StringF(folderStr,'\s/modem',nodeStr) + makeDir(folderStr) + StringF(folderStr,'\s/nrams',nodeStr) + makeDir(folderStr) + val:=self.paScreens.getValue() + IF StrLen(val)>0 + makeDir(val) + ENDIF + val:=self.paPlaypen.getValue() + IF StrLen(val)>0 + makeDir(val) + ENDIF + ENDIF + + writeToolType(nodeStr,'PRIORITY',self.intPriority.getValue()) + writeToolType(nodeStr,'NODESTART',self.strNodeStart.getValue()) + writeToolType(nodeStr,'SYSTEM_PASSWORD',self.strSystemPassword.getValue()) + writeToolType(nodeStr,'SYS_PWRD_PROMPT',self.strSystemPasswordPrompt.getValue()) + writeToolType(nodeStr,'NEWUSER_PASSWORD',self.strNewuserPassword.getValue()) + writeToolType(nodeStr,'NAME_PROMPT',self.strNamePrompt.getValue()) + writeToolType(nodeStr,'NAME_PROMPT2',self.strNamePrompt2.getValue()) + writeToolType(nodeStr,'PASSWORD_PROMPT',self.strPasswordPrompt.getValue()) + writeToolType(nodeStr,'SCREENS',self.paScreens.getValue()) + writeToolType(nodeStr,'AUTOVAL_PRESET',self.intAutoValPreset.getValue()) + writeToolType(nodeStr,'AUTOVAL_DELAY',self.intAutoValDelay.getValue()) + writeToolType(nodeStr,'AUTOVAL_PASSWORD',self.strAutoValPassword.getValue()) + writeToolType(nodeStr,'FTPPORT',self.strFtpPort.getValue()) + writeToolType(nodeStr,'FTPDATAPORT',self.strFtpDataPort.getValue()) + writeToolType(nodeStr,'HTTPPORT',self.strHttpPort.getValue()) + + val:=self.intKeepUlCredit.getValueIndex() + StringF(tempStr,'\d',val) + writeToolType(nodeStr,'KEEP_UPLOAD_CREDIT',tempStr) + + writeToolType(nodeStr,'MAX_MSG_QU',self.intMaxMsgQueue.getValue()) + writeToolType(nodeStr,'PLAYPEN',self.paPlaypen.getValue()) + writeToolType(nodeStr,'RINGCOUNT',self.intRingCount.getValue()) + writeToolType(nodeStr,'REMOTE_PASSWORD',self.strRemotePassword.getValue()) + writeToolType(nodeStr,'SYSOP_CHAT_COLOR',self.intSysopChatColour.getValue()) + writeToolType(nodeStr,'USER_CHAT_COLOR',self.intUserChatColour.getValue()) + writeToolType(nodeStr,'USERDATA_NAME',self.fnUserDataName.getValue()) + writeToolType(nodeStr,'USERKEYS_NAME',self.fnUserMiscName.getValue()) + writeToolType(nodeStr,'USERMISC_NAME',self.fnUserKeysName.getValue()) + writeToolType(nodeStr,'LOCAL_UPLOAD_PATH',self.paLocalUlPath.getValue()) + + writeToolType(nodeStr,'OVERRIDE_TIMEOUT',self.intOverrideTimeout.getValue()) + writeToolType(nodeStr,'FORCE_ANSI',self.strForceAnsi.getValue()) + writeToolType(nodeStr,'BGFILECHECKSTACK',self.intBGFilecheckStack.getValue()) + writeToolType(nodeStr,'CONSOLE_INPUT_DEVICE',self.strConInputDev.getValue()) + writeToolType(nodeStr,'CONSOLE_OUTPUT_DEVICE',self.strConOutputDev.getValue()) + writeToolType(nodeStr,'SCREENPENS',self.strScreenPens.getValue()) + writeToolType(nodeStr,'CONF_DB',self.strConfDb.getValue()) + writeToolType(nodeStr,'FILESNOTALLOWED',self.fnFilesNotAllowed.getValue()) + writeToolType(nodeStr,'FIRSTCOMMAND',self.strFirstCommand.getValue()) + writeToolType(nodeStr,'SERIAL_CACHE_SIZE',self.intSerialCacheSize.getValue()) + + IF self.boolCallersLog.getValue() THEN writeToolType(nodeStr,'CALLERS_LOG') ELSE deleteToolType(nodeStr,'CALLERS_LOG') + IF self.boolCapitalFilenames.getValue() THEN writeToolType(nodeStr,'CAPITOL_FILES') ELSE deleteToolType(nodeStr,'CAPITOL_FILES') + IF self.boolDebugLog.getValue() THEN writeToolType(nodeStr,'DEBUG_LOG') ELSE deleteToolType(nodeStr,'DEBUG_LOG') + IF self.boolDefScreens.getValue() THEN writeToolType(nodeStr,'DEF_SCREENS') ELSE deleteToolType(nodeStr,'DEF_SCREENS') + IF self.boolDebugLog.getValue() THEN writeToolType(nodeStr,'DEBUG_LOG') ELSE deleteToolType(nodeStr,'DEBUG_LOG') + IF self.boolDoorLog.getValue() THEN writeToolType(nodeStr,'DOOR_LOG') ELSE deleteToolType(nodeStr,'DOOR_LOG') + IF self.boolStartLog.getValue() THEN writeToolType(nodeStr,'START_LOG') ELSE deleteToolType(nodeStr,'START_LOG') + IF self.boolUDLog.getValue() THEN writeToolType(nodeStr,'UD_LOG') ELSE deleteToolType(nodeStr,'UD_LOG') + IF self.boolChatOn.getValue() THEN writeToolType(nodeStr,'CHAT_ON') ELSE deleteToolType(nodeStr,'CHAT_ON') + IF self.boolDisableQuickLogon.getValue() THEN writeToolType(nodeStr,'DISABLE_QUICK_LOGONS') ELSE deleteToolType(nodeStr,'DISABLE_QUICK_LOGONS') + IF self.boolIdleNode.getValue() THEN writeToolType(nodeStr,'IDLENODE') ELSE deleteToolType(nodeStr,'IDLENODE') + IF self.boolMailscanPrompt.getValue() THEN writeToolType(nodeStr,'MAILSCAN_PROMPT') ELSE deleteToolType(nodeStr,'MAILSCAN_PROMPT') + IF self.boolNoTimeout.getValue() THEN writeToolType(nodeStr,'NO_TIMEOUT') ELSE deleteToolType(nodeStr,'NO_TIMEOUT') + IF self.boolQuietNode.getValue() THEN writeToolType(nodeStr,'QUIETNODE') ELSE deleteToolType(nodeStr,'QUIETNODE') + IF self.boolStealthNode.getValue() THEN writeToolType(nodeStr,'STEALTH_MODE') ELSE deleteToolType(nodeStr,'STEALTH_MODE') + IF self.boolShowPwFail.getValue() THEN writeToolType(nodeStr,'SHOWPWFAIL') ELSE deleteToolType(nodeStr,'SHOWPWFAIL') + IF self.boolSentByFiles.getValue() THEN writeToolType(nodeStr,'SENTBY_FILES') ELSE deleteToolType(nodeStr,'SENTBY_FILES') + IF self.boolTelnet.getValue() THEN writeToolType(nodeStr,'TELNET') ELSE deleteToolType(nodeStr,'TELNET') + IF self.boolFtp.getValue() THEN writeToolType(nodeStr,'FTP') ELSE deleteToolType(nodeStr,'FTP') + IF self.boolTelnetD.getValue() THEN writeToolType(nodeStr,'TELSERD') ELSE deleteToolType(nodeStr,'TELSERD') + IF self.boolTelserD.getValue() THEN writeToolType(nodeStr,'TELNETD') ELSE deleteToolType(nodeStr,'TELNETD') + IF self.boolUserNumLogin.getValue() THEN writeToolType(nodeStr,'USERNUMBER_LOGIN') ELSE deleteToolType(nodeStr,'USERNUMBER_LOGIN') + IF self.boolViewPassword.getValue() THEN writeToolType(nodeStr,'VIEW_PASSWORD') ELSE deleteToolType(nodeStr,'VIEW_PASSWORD') + IF self.boolLogHost.getValue() THEN writeToolType(nodeStr,'LOG_HOST') ELSE deleteToolType(nodeStr,'LOG_HOST') + IF self.boolLogInputs.getValue() THEN writeToolType(nodeStr,'LOG_INPUTS') ELSE deleteToolType(nodeStr,'LOG_INPUTS') + IF self.boolNoCx.getValue() THEN writeToolType(nodeStr,'NO_CX') ELSE deleteToolType(nodeStr,'NO_CX') + IF self.boolCentralAnswers.getValue() THEN writeToolType(nodeStr,'CENTRAL_ANSWERS') ELSE deleteToolType(nodeStr,'CENTRAL_ANSWERS') + IF self.boolDisableIemsi.getValue() THEN writeToolType(nodeStr,'DISABLE_IEMSI') ELSE deleteToolType(nodeStr,'DISABLE_IEMSI') + IF self.boolNoMciMsg.getValue() THEN writeToolType(nodeStr,'NO_MCI_MSG') ELSE deleteToolType(nodeStr,'NO_MCI_MSG') + IF self.boolNoWildcard.getValue() THEN writeToolType(nodeStr,'NO_WILDCARD_EXPANSION') ELSE deleteToolType(nodeStr,'NO_WILDCARD_EXPANSION') + IF self.boolOwnPartFiles.getValue() THEN writeToolType(nodeStr,'OWN_PARTFILES') ELSE deleteToolType(nodeStr,'OWN_PARTFILES') + IF self.boolPhoneCheck.getValue() THEN writeToolType(nodeStr,'PHONECHECK') ELSE deleteToolType(nodeStr,'PHONECHECK') + IF self.boolRamWork.getValue() THEN writeToolType(nodeStr,'RAMWORK') ELSE deleteToolType(nodeStr,'RAMWORK') + IF self.boolConsoleDebug.getValue() THEN writeToolType(nodeStr,'CONSOLE_DEBUG') ELSE deleteToolType(nodeStr,'CONSOLE_DEBUG') + IF self.boolNoEmails.getValue() THEN writeToolType(nodeStr,'NO_EMAILS') ELSE deleteToolType(nodeStr,'NO_EMAILS') + IF self.boolOwnDevunit.getValue() THEN writeToolType(nodeStr,'OWNDEVUNIT') ELSE deleteToolType(nodeStr,'OWNDEVUNIT') + IF self.boolShowCacheStats.getValue() THEN writeToolType(nodeStr,'SHOW_CACHE_STATS') ELSE deleteToolType(nodeStr,'SHOW_CACHE_STATS') + IF self.boolTrapDoor.getValue() THEN writeToolType(nodeStr,'TRAPDOOR') ELSE deleteToolType(nodeStr,'TRAPDOOR') + IF self.boolTrapSerial.getValue() THEN writeToolType(nodeStr,'TRAP_SERIAL') ELSE deleteToolType(nodeStr,'TRAP_SERIAL') + IF self.boolNoRadBoogie.getValue() THEN writeToolType(nodeStr,'NORADBOOGIE') ELSE deleteToolType(nodeStr,'NORADBOOGIE') + + //serial device settings + StringF(toolTypePath,'\sNode\d/Serial',bbsPath,self.currNode) + IF(self.getToolTypeFileName(toolTypePath,tempStr)=FALSE) + StrCopy(tempStr,'serial') + ELSE + SetStr(tempStr) + ENDIF + StringF(toolTypePath,'\sNode\d/Serial/\s',bbsPath,self.currNode,tempStr) + + writeToolType(toolTypePath,'SERIAL.DRIVER',self.strSerialDevice.getValue()) + writeToolType(toolTypePath,'SERIAL.UNIT',self.intSerialUnit.getValue()) + writeToolType(toolTypePath,'SERIAL.BAUD',self.intSerialBaud.getValue()) + + IF self.boolA2232Patch.getValue() THEN writeToolType(nodeStr,'SERIAL.A2232_PATCH') ELSE deleteToolType(nodeStr,'SERIAL.A2232_PATCH') + IF self.boolNoPurgeLine.getValue() THEN writeToolType(nodeStr,'SERIAL.NO_PURGELINE') ELSE deleteToolType(nodeStr,'SERIAL.NO_PURGELINE') + IF self.boolRepurge.getValue() THEN writeToolType(nodeStr,'SERIAL.REPURGE') ELSE deleteToolType(nodeStr,'SERIAL.REPURGE') + IF self.boolLogoffReset.getValue() THEN writeToolType(nodeStr,'SERIAL.LOGOFF_RESET') ELSE deleteToolType(nodeStr,'SERIAL.LOGOFF_RESET') + IF self.boolTrueReset.getValue() THEN writeToolType(nodeStr,'SERIAL.TRUE_RESET') ELSE deleteToolType(nodeStr,'SERIAL.TRUE_RESET') + + StringF(toolTypePath,'\sNode\d/Modem',bbsPath,self.currNode) + IF(self.getToolTypeFileName(toolTypePath,tempStr))=FALSE + StrCopy(tempStr,'modem') + ELSE + SetStr(tempStr) + ENDIF + StringF(toolTypePath,'\sNode\d/Modem/\s',bbsPath,self.currNode,tempStr) + + //modem settings + writeToolType(toolTypePath,'MODEM.INIT',self.strModemInit.getValue()) + writeToolType(toolTypePath,'MODEM.RESET',self.strModemReset.getValue()) + writeToolType(toolTypePath,'MODEM.RING',self.strModemRing.getValue()) + writeToolType(toolTypePath,'MODEM.ANSWER',self.strModemAnswer.getValue()) + writeToolType(toolTypePath,'MODEM.OFFHOOK',self.strModemOffhook.getValue()) + + StringF(toolTypePath,'\sNode\d/NRAMS',bbsPath,self.currNode) + IF(self.getToolTypeFileName(toolTypePath,tempStr))=FALSE + StrCopy(tempStr,'nrams') + ELSE + SetStr(tempStr) + ENDIF + StringF(toolTypePath,'\sNode\d/Modem/\s',bbsPath,self.currNode,tempStr) + + //NRAM settings + writeToolType(toolTypePath,'NRAM.1',self.strNRAMS1.getValue()) + writeToolType(toolTypePath,'NRAM.2',self.strNRAMS2.getValue()) + writeToolType(toolTypePath,'NRAM.3',self.strNRAMS3.getValue()) + writeToolType(toolTypePath,'NRAM.4',self.strNRAMS4.getValue()) + + + StringF(windowTooltype,'\s/WINDOW.DEF',nodeStr) + val:=self.intNumColours.getValueIndex() + SELECT val + CASE 0 + writeToolType(windowTooltype,'WINDOW.NUM_COLORS','2') + CASE 1 + writeToolType(windowTooltype,'WINDOW.NUM_COLORS','4') + CASE 2 + writeToolType(windowTooltype,'WINDOW.NUM_COLORS','8') + CASE 3 + writeToolType(windowTooltype,'WINDOW.NUM_COLORS','16') + DEFAULT + writeToolType(windowTooltype,'WINDOW.NUM_COLORS','8') + ENDSELECT + + writeToolType(windowTooltype,'WINDOW.LEFTEDGE',self.intWinLeftEdge.getValue()) + writeToolType(windowTooltype,'WINDOW.TOPEDGE',self.intWinTopEdge.getValue()) + writeToolType(windowTooltype,'WINDOW.WIDTH',self.intWinWidth.getValue()) + writeToolType(windowTooltype,'WINDOW.HEIGHT',self.intWinHeight.getValue()) + IF self.boolWinPubScreen.getValue() + writeToolType(windowTooltype,'WINDOW.PUBSCREEN') + ELSE + writeToolType(windowTooltype,'WINDOW.PUBSCREEN',self.strWinPubScreen.getValue()) + ENDIF + IF self.boolWinIconified.getValue() THEN writeToolType(windowTooltype,'WINDOW.ICONIFIED') ELSE deleteToolType(windowTooltype,'WINDOW.ICONIFIED') + IF self.boolWinInterlace.getValue() THEN writeToolType(windowTooltype,'WINDOW.INTERLACE') ELSE deleteToolType(windowTooltype,'WINDOW.INTERLACE') + IF self.boolWinStatusBar.getValue() THEN writeToolType(windowTooltype,'WINDOW.STATBAR') ELSE deleteToolType(windowTooltype,'WINDOW.STATBAR') + IF self.boolWinToFront.getValue() THEN writeToolType(windowTooltype,'WINDOW.TO_FRONT') ELSE deleteToolType(windowTooltype,'WINDOW.TO_FRONT') + writeToolType(windowTooltype,'WINDOW.DISPLAYID',self.strDisplayId.getValue()) + + StringF(timeTooltype,'\s/TIMES.DEF',nodeStr) + ForAll({timeItem},self.timesList,`self.saveTimes(timeTooltype,timeItem.baudStr,timeItem.startControl,timeItem.endControl)) + saveCachedChanges() + + + set( self.btnNodeSave,MUIA_Disabled,MUI_TRUE) + set( self.btnAddNode,MUIA_Disabled,FALSE) + set( self.btnCloneNode,MUIA_Disabled,FALSE) + self.changed:=FALSE + self.newNode:=FALSE + self.wake() +ENDPROC + +PROC getToolTypeFileName(path:PTR TO CHAR,buf:PTR TO CHAR) OF frmNodeEdit + DEF returnval=0 + DEF dir_info:PTR TO fileinfoblock + DEF pdir + + IF ((dir_info:=AllocDosObject(DOS_FIB,NIL)) = NIL) + RETURN 0 + ENDIF + + IF ((pdir:=Lock(path,ACCESS_READ)))=FALSE + FreeDosObject(DOS_FIB,dir_info) + RETURN 0 + ENDIF + + IF(Examine(pdir, dir_info))=FALSE + FreeDosObject(DOS_FIB,dir_info) + UnLock(pdir) + RETURN 0 + ENDIF + + IF(ExNext(pdir,dir_info)) + IF(dir_info.direntrytype < 0) + returnval:=1 + AstrCopy(buf,dir_info.filename) + stripInfo(buf) + ENDIF + ENDIF + + UnLock(pdir) + FreeDosObject(DOS_FIB,dir_info) +ENDPROC returnval + +PROC saveTimes(toolType,baudStr,startControl,endControl) OF frmNodeEdit + DEF toolTypeName[255]:STRING + DEF timeVal + get(startControl, MUIA_String_Contents,{timeVal}) + StringF(toolTypeName,'START.\s',baudStr) + writeToolType(toolType,toolTypeName,timeVal) + + get(endControl, MUIA_String_Contents,{timeVal}) + StringF(toolTypeName,'END.\s',baudStr) + writeToolType(toolType,toolTypeName,timeVal) +ENDPROC + +PROC loadTimes(toolType,baudStr,startControl,endControl) OF frmNodeEdit + DEF toolTypeName[255]:STRING + DEF tempStr[255]:STRING + + StringF(toolTypeName,'START.\s',baudStr) + readToolType(toolType,toolTypeName,tempStr) + domethod(startControl,[MUIM_NoNotifySet,MUIA_String_Contents,tempStr]) + + StringF(toolTypeName,'END.\s',baudStr) + readToolType(toolType,toolTypeName,tempStr) + domethod(endControl,[MUIM_NoNotifySet,MUIA_String_Contents,tempStr]) +ENDPROC + + +PROC loadNode(node) OF frmNodeEdit + DEF nodeStr[255]:STRING,val + DEF windowTooltype[255]:STRING + DEF timeTooltype[255]:STRING + DEF bbsPath[255]:STRING + DEF tooltypeValue[255]:STRING + DEF toolTypePath[255]:STRING + DEF tempStr[255]:STRING + DEF timeItem:PTR TO timeItem + + IF self.changed + IF self.unsavedChangesWarning()=FALSE THEN RETURN FALSE + ENDIF + + IF self.newNode THEN self.nodeCount:=self.nodeCount-1 + + StringF(nodeStr,'\d',node) + self.currNode:=node + + set(self.strNodeNumber, MUIA_String_Contents,nodeStr) + set( self.btnPrevNode, MUIA_Disabled , node=0) + set( self.btnNextNode, MUIA_Disabled , node>=(self.nodeCount-1)) + set( self.btnRemoveNode, MUIA_Disabled , (node<(self.nodeCount-1)) OR (node=0)) + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + + StringF(nodeStr,'\snode\d',bbsPath,node) + + val:=readToolTypeInt(nodeStr,'PRIORITY') + self.intPriority.setValue(val) + readToolType(nodeStr,'NODESTART',tooltypeValue) + self.strNodeStart.setValue(tooltypeValue) + readToolType(nodeStr,'SYSTEM_PASSWORD',tooltypeValue) + self.strSystemPassword.setValue(tooltypeValue) + readToolType(nodeStr,'SYS_PWRD_PROMPT',tooltypeValue) + self.strSystemPasswordPrompt.setValue(tooltypeValue) + readToolType(nodeStr,'NEWUSER_PASSWORD',tooltypeValue) + self.strNewuserPassword.setValue(tooltypeValue) + readToolType(nodeStr,'NAME_PROMPT',tooltypeValue) + self.strNamePrompt.setValue(tooltypeValue) + readToolType(nodeStr,'NAME_PROMPT2',tooltypeValue) + self.strNamePrompt2.setValue(tooltypeValue) + readToolType(nodeStr,'PASSWORD_PROMPT',tooltypeValue) + self.strPasswordPrompt.setValue(tooltypeValue) + readToolType(nodeStr,'SCREENS',tooltypeValue) + self.paScreens.setValue(tooltypeValue) + val:=readToolTypeInt(nodeStr,'AUTOVAL_PRESET') + self.intAutoValPreset.setValue(val) + val:=readToolTypeInt(nodeStr,'AUTOVAL_DELAY') + self.intAutoValDelay.setValue(val) + readToolType(nodeStr,'AUTOVAL_PASSWORD',tooltypeValue) + self.strAutoValPassword.setValue(tooltypeValue) + + readToolType(nodeStr,'FTPPORT',tooltypeValue) + self.strFtpPort.setValue(tooltypeValue) + readToolType(nodeStr,'FTPDATAPORT',tooltypeValue) + self.strFtpDataPort.setValue(tooltypeValue) + readToolType(nodeStr,'HTTPPORT',tooltypeValue) + self.strHttpPort.setValue(tooltypeValue) + val:=readToolTypeInt(nodeStr,'KEEP_UPLOAD_CREDIT') + IF val<>1 THEN val:=0 + self.intKeepUlCredit.setValueIndex(val) + val:=readToolTypeInt(nodeStr,'MAX_MSG_QUE') + self.intMaxMsgQueue.setValue(val) + readToolType(nodeStr,'PLAYPEN',tooltypeValue) + self.paPlaypen.setValue(tooltypeValue) + val:=readToolTypeInt(nodeStr,'RINGCOUNT') + self.intRingCount.setValue(val) + readToolType(nodeStr,'REMOTE_PASSWORD',tooltypeValue) + self.strRemotePassword.setValue(tooltypeValue) + val:=readToolTypeInt(nodeStr,'SYSOP_CHAT_COLOR') + self.intSysopChatColour.setValue(val) + val:=readToolTypeInt(nodeStr,'USER_CHAT_COLOR') + self.intUserChatColour.setValue(val) + readToolType(nodeStr,'USERDATA_NAME',tooltypeValue) + self.fnUserDataName.setValue(tooltypeValue) + readToolType(nodeStr,'USERKEYS_NAME',tooltypeValue) + self.fnUserMiscName.setValue(tooltypeValue) + readToolType(nodeStr,'USERMISC_NAME',tooltypeValue) + self.fnUserKeysName.setValue(tooltypeValue) + readToolType(nodeStr,'LOCAL_UPLOAD_PATH',tooltypeValue) + self.paLocalUlPath.setValue(tooltypeValue) + val:=readToolTypeInt(nodeStr,'OVERRIDE_TIMEOUT') + self.intOverrideTimeout.setValue(val) + readToolType(nodeStr,'FORCE_ANSI',tooltypeValue) + self.strForceAnsi.setValue(tooltypeValue) + val:=readToolTypeInt(nodeStr,'BGFILECHECKSTACK') + self.intBGFilecheckStack.setValue(val) + readToolType(nodeStr,'CONSOLE_INPUT_DEVICE',tooltypeValue) + self.strConInputDev.setValue(tooltypeValue) + readToolType(nodeStr,'CONSOLE_OUTPUT_DEVICE',tooltypeValue) + self.strConOutputDev.setValue(tooltypeValue) + readToolType(nodeStr,'SCREENPENS',tooltypeValue) + self.strScreenPens.setValue(tooltypeValue) + readToolType(nodeStr,'CONF_DB',tooltypeValue) + self.strConfDb.setValue(tooltypeValue) + readToolType(nodeStr,'FILESNOTALLOWED',tooltypeValue) + self.fnFilesNotAllowed.setValue(tooltypeValue) + readToolType(nodeStr,'FIRSTCOMMAND',tooltypeValue) + self.strFirstCommand.setValue(tooltypeValue) + val:=readToolTypeInt(nodeStr,'SERIAL_CACHE_SIZE') + self.intSerialCacheSize.setValue(val) + self.boolCallersLog.setValue(IF checkToolTypeExists(nodeStr,'CALLERS_LOG') THEN MUI_TRUE ELSE FALSE) + self.boolCapitalFilenames.setValue(IF checkToolTypeExists(nodeStr,'CAPITOL_FILES') THEN MUI_TRUE ELSE FALSE) + self.boolDebugLog.setValue(IF checkToolTypeExists(nodeStr,'DEBUG_LOG') THEN MUI_TRUE ELSE FALSE) + self.boolDefScreens.setValue(IF checkToolTypeExists(nodeStr,'DEF_SCREENS') THEN MUI_TRUE ELSE FALSE) + self.boolDebugLog.setValue(IF checkToolTypeExists(nodeStr,'DEBUG_LOG') THEN MUI_TRUE ELSE FALSE) + self.boolDoorLog.setValue(IF checkToolTypeExists(nodeStr,'DOOR_LOG') THEN MUI_TRUE ELSE FALSE) + self.boolStartLog.setValue(IF checkToolTypeExists(nodeStr,'START_LOG') THEN MUI_TRUE ELSE FALSE) + self.boolUDLog.setValue(IF checkToolTypeExists(nodeStr,'UD_LOG') THEN MUI_TRUE ELSE FALSE) + self.boolChatOn.setValue(IF checkToolTypeExists(nodeStr,'CHAT_ON') THEN MUI_TRUE ELSE FALSE) + self.boolDisableQuickLogon.setValue(IF checkToolTypeExists(nodeStr,'DISABLE_QUICK_LOGONS') THEN MUI_TRUE ELSE FALSE) + self.boolIdleNode.setValue(IF checkToolTypeExists(nodeStr,'IDLENODE') THEN MUI_TRUE ELSE FALSE) + self.boolMailscanPrompt.setValue(IF checkToolTypeExists(nodeStr,'MAILSCAN_PROMPT') THEN MUI_TRUE ELSE FALSE) + self.boolNoTimeout.setValue(IF checkToolTypeExists(nodeStr,'NO_TIMEOUT') THEN MUI_TRUE ELSE FALSE) + self.boolQuietNode.setValue(IF checkToolTypeExists(nodeStr,'QUIETNODE') THEN MUI_TRUE ELSE FALSE) + self.boolStealthNode.setValue(IF checkToolTypeExists(nodeStr,'STEALTH_MODE') THEN MUI_TRUE ELSE FALSE) + self.boolShowPwFail.setValue(IF checkToolTypeExists(nodeStr,'SHOWPWFAIL') THEN MUI_TRUE ELSE FALSE) + self.boolSentByFiles.setValue(IF checkToolTypeExists(nodeStr,'SENTBY_FILES') THEN MUI_TRUE ELSE FALSE) + self.boolTelnet.setValue(IF checkToolTypeExists(nodeStr,'TELNET') THEN MUI_TRUE ELSE FALSE) + self.boolFtp.setValue(IF checkToolTypeExists(nodeStr,'FTP') THEN MUI_TRUE ELSE FALSE) + self.boolTelnetD.setValue(IF checkToolTypeExists(nodeStr,'TELSERD') THEN MUI_TRUE ELSE FALSE) + self.boolTelserD.setValue(IF checkToolTypeExists(nodeStr,'TELNETD') THEN MUI_TRUE ELSE FALSE) + self.boolUserNumLogin.setValue(IF checkToolTypeExists(nodeStr,'USERNUMBER_LOGIN') THEN MUI_TRUE ELSE FALSE) + self.boolViewPassword.setValue(IF checkToolTypeExists(nodeStr,'VIEW_PASSWORD') THEN MUI_TRUE ELSE FALSE) + self.boolLogHost.setValue(IF checkToolTypeExists(nodeStr,'LOG_HOST') THEN MUI_TRUE ELSE FALSE) + self.boolLogInputs.setValue(IF checkToolTypeExists(nodeStr,'LOG_INPUTS') THEN MUI_TRUE ELSE FALSE) + self.boolNoCx.setValue(IF checkToolTypeExists(nodeStr,'NO_CX') THEN MUI_TRUE ELSE FALSE) + self.boolCentralAnswers.setValue(IF checkToolTypeExists(nodeStr,'CENTRAL_ANSWERS') THEN MUI_TRUE ELSE FALSE) + self.boolDisableIemsi.setValue(IF checkToolTypeExists(nodeStr,'DISABLE_IEMSI') THEN MUI_TRUE ELSE FALSE) + self.boolNoMciMsg.setValue(IF checkToolTypeExists(nodeStr,'NO_MCI_MSG') THEN MUI_TRUE ELSE FALSE) + self.boolNoWildcard.setValue(IF checkToolTypeExists(nodeStr,'NO_WILDCARD_EXPANSION') THEN MUI_TRUE ELSE FALSE) + self.boolOwnPartFiles.setValue(IF checkToolTypeExists(nodeStr,'OWN_PARTFILES') THEN MUI_TRUE ELSE FALSE) + self.boolPhoneCheck.setValue(IF checkToolTypeExists(nodeStr,'PHONECHECK') THEN MUI_TRUE ELSE FALSE) + self.boolRamWork.setValue(IF checkToolTypeExists(nodeStr,'RAMWORK') THEN MUI_TRUE ELSE FALSE) + self.boolConsoleDebug.setValue(IF checkToolTypeExists(nodeStr,'CONSOLE_DEBUG') THEN MUI_TRUE ELSE FALSE) + self.boolNoEmails.setValue(IF checkToolTypeExists(nodeStr,'NO_EMAILS') THEN MUI_TRUE ELSE FALSE) + self.boolOwnDevunit.setValue(IF checkToolTypeExists(nodeStr,'OWNDEVUNIT') THEN MUI_TRUE ELSE FALSE) + self.boolShowCacheStats.setValue(IF checkToolTypeExists(nodeStr,'SHOW_CACHE_STATS') THEN MUI_TRUE ELSE FALSE) + self.boolTrapDoor.setValue(IF checkToolTypeExists(nodeStr,'TRAPDOOR') THEN MUI_TRUE ELSE FALSE) + self.boolTrapSerial.setValue(IF checkToolTypeExists(nodeStr,'TRAP_SERIAL') THEN MUI_TRUE ELSE FALSE) + self.boolNoRadBoogie.setValue(IF checkToolTypeExists(nodeStr,'NORADBOOGIE') THEN MUI_TRUE ELSE FALSE) + + //serial device settings + StringF(toolTypePath,'\sNode\d/Serial',bbsPath,node) + IF(self.getToolTypeFileName(toolTypePath,tempStr)=FALSE) + StrCopy(tempStr,'serial') + ELSE + SetStr(tempStr) + ENDIF + StringF(toolTypePath,'\sNode\d/Serial/\s',bbsPath,node,tempStr) + + readToolType(toolTypePath,'SERIAL.DRIVER',tooltypeValue) + self.strSerialDevice.setValue(tooltypeValue) + + val:=readToolTypeInt(toolTypePath,'SERIAL.UNIT') + self.intSerialUnit.setValue(val) + + val:=readToolTypeInt(toolTypePath,'SERIAL.BAUD') + self.intSerialBaud.setValue(val) + + self.boolA2232Patch.setValue(IF checkToolTypeExists(toolTypePath,'SERIAL.A2232_PATCH') THEN MUI_TRUE ELSE FALSE) + + self.boolNoPurgeLine.setValue(IF checkToolTypeExists(toolTypePath,'SERIAL.NO_PURGELINE') THEN MUI_TRUE ELSE FALSE) + + self.boolRepurge.setValue(IF checkToolTypeExists(toolTypePath,'SERIAL.REPURGE') THEN MUI_TRUE ELSE FALSE) + + self.boolLogoffReset.setValue(IF checkToolTypeExists(toolTypePath,'SERIAL.LOGOFF_RESET') THEN MUI_TRUE ELSE FALSE) + + self.boolTrueReset.setValue(IF checkToolTypeExists(toolTypePath,'SERIAL.TRUE_RESET') THEN MUI_TRUE ELSE FALSE) + + StringF(toolTypePath,'\sNode\d/Modem',bbsPath,node) + IF(self.getToolTypeFileName(toolTypePath,tempStr))=FALSE + StrCopy(tempStr,'modem') + ELSE + SetStr(tempStr) + ENDIF + StringF(toolTypePath,'\sNode\d/Modem/\s',bbsPath,node,tempStr) + + //modem settings + readToolType(toolTypePath,'MODEM.INIT',tooltypeValue) + self.strModemInit.setValue(tooltypeValue) + readToolType(toolTypePath,'MODEM.RESET',tooltypeValue) + self.strModemReset.setValue(tooltypeValue) + readToolType(toolTypePath,'MODEM.RING',tooltypeValue) + self.strModemRing.setValue(tooltypeValue) + readToolType(toolTypePath,'MODEM.ANSWER',tooltypeValue) + self.strModemAnswer.setValue(tooltypeValue) + readToolType(toolTypePath,'MODEM.OFFHOOK',tooltypeValue) + self.strModemOffhook.setValue(tooltypeValue) + + + StringF(windowTooltype,'\s/WINDOW.DEF',nodeStr) + val:=readToolTypeInt(windowTooltype,'WINDOW.NUM_COLORS') + SELECT val + CASE 2 + self.intNumColours.setValueIndex(0) + CASE 4 + self.intNumColours.setValueIndex(1) + CASE 8 + self.intNumColours.setValueIndex(2) + CASE 16 + self.intNumColours.setValueIndex(3) + DEFAULT + self.intNumColours.setValueIndex(8) + ENDSELECT + + val:=readToolTypeInt(windowTooltype,'WINDOW.LEFTEDGE') + self.intWinLeftEdge.setValue(val) + val:=readToolTypeInt(windowTooltype,'WINDOW.TOPEDGE') + self.intWinTopEdge.setValue(val) + val:=readToolTypeInt(windowTooltype,'WINDOW.WIDTH') + self.intWinWidth.setValue(val) + val:=readToolTypeInt(windowTooltype,'WINDOW.HEIGHT') + self.intWinHeight.setValue(val) + IF checkToolTypeExists(windowTooltype,'WINDOW.PUBSCREEN') + readToolType(windowTooltype,'WINDOW.PUBSCREEN',tooltypeValue) + IF StrLen(tooltypeValue)=0 + self.boolWinPubScreen.setValue(-1) + self.strWinPubScreen.setValue('') + ELSE + self.boolWinPubScreen.setValue(0) + self.strWinPubScreen.setValue(tooltypeValue) + ENDIF + ENDIF + self.boolWinIconified.setValue(IF checkToolTypeExists(windowTooltype,'WINDOW.ICONIFIED') THEN MUI_TRUE ELSE FALSE) + self.boolWinInterlace.setValue(IF checkToolTypeExists(windowTooltype,'WINDOW.INTERLACE') THEN MUI_TRUE ELSE FALSE) + self.boolWinStatusBar.setValue(IF checkToolTypeExists(windowTooltype,'WINDOW.STATBAR') THEN MUI_TRUE ELSE FALSE) + self.boolWinToFront.setValue(IF checkToolTypeExists(windowTooltype,'WINDOW.TO_FRONT') THEN MUI_TRUE ELSE FALSE) + readToolType(windowTooltype,'WINDOW.DISPLAYID',tooltypeValue) + self.strDisplayId.setValue(tooltypeValue) + + StringF(timeTooltype,'\s/TIMES.DEF',nodeStr) + ForAll({timeItem},self.timesList,`self.loadTimes(timeTooltype,timeItem.baudStr,timeItem.startControl,timeItem.endControl)) + + self.changed:=FALSE + set( self.btnNodeSave, MUIA_Disabled , MUI_TRUE) + set( self.btnAddNode,MUIA_Disabled,FALSE) + set( self.btnCloneNode,MUIA_Disabled,FALSE) + self.newNode:=FALSE +ENDPROC TRUE + +PROC editNodes(acpName) OF frmNodeEdit + DEF count,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + DEF timeItem:PTR TO timeItem + + NEW saveHook + installhook( saveHook, {saveChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + set( self.btnFirstNode, MUIA_ShortHelp , getHelpText(NODE_FIRST)) + set( self.btnPrevNode, MUIA_ShortHelp , getHelpText(NODE_PREV)) + set( self.btnNextNode, MUIA_ShortHelp , getHelpText(NODE_NEXT)) + set( self.btnLastNode, MUIA_ShortHelp , getHelpText(NODE_LAST)) + set( self.btnAddNode, MUIA_ShortHelp , getHelpText(NODE_ADD)) + set( self.btnCloneNode, MUIA_ShortHelp , getHelpText(NODE_CLONE)) + set( self.btnRemoveNode, MUIA_ShortHelp , getHelpText(NODE_DEL)) + + self.timesList:=[ + ['300',self.app.str300start,self.app.str300end]:timeItem, + ['1200',self.app.str1200start,self.app.str1200end]:timeItem, + ['2400',self.app.str2400start,self.app.str2400end]:timeItem, + ['4800',self.app.str4800start,self.app.str4800end]:timeItem, + ['9600',self.app.str9600start,self.app.str9600end]:timeItem, + ['12000',self.app.str12000start,self.app.str12000end]:timeItem, + ['14400',self.app.str14400start,self.app.str14400end]:timeItem, + ['16800',self.app.str16800start,self.app.str16800end]:timeItem, + ['19200',self.app.str19200start,self.app.str19200end]:timeItem, + ['21600',self.app.str21600start,self.app.str21600end]:timeItem, + ['24000',self.app.str24000start,self.app.str24000end]:timeItem, + ['26400',self.app.str26400start,self.app.str26400end]:timeItem, + ['28800',self.app.str28800start,self.app.str28800end]:timeItem, + ['31200',self.app.str31200start,self.app.str31200end]:timeItem, + ['33600',self.app.str33600start,self.app.str33600end]:timeItem, + ['38400',self.app.str38400start,self.app.str38400end]:timeItem, + ['57600',self.app.str57600start,self.app.str57600end]:timeItem, + ['115200',self.app.str115200start,self.app.str115200end]:timeItem] + + ForAll({timeItem},self.timesList,`set( timeItem.startControl, MUIA_ShortHelp , getHelpText(NODE_TIME_START))) + ForAll({timeItem},self.timesList,`set( timeItem.endControl, MUIA_ShortHelp , getHelpText(NODE_TIME_END))) + ForAll({timeItem},self.timesList,`domethod( timeItem.startControl,[MUIM_Notify,MUIA_String_Contents,MUIV_EveryTime,self.app.app,3,MUIM_CallHook,self.setChangedHook,self])) + ForAll({timeItem},self.timesList,`domethod( timeItem.endControl,[MUIM_Notify,MUIA_String_Contents,MUIV_EveryTime,self.app.app,3,MUIM_CallHook,self.setChangedHook,self])) + + self.acpName:=acpName + + set( self.btnRemoveNode, MUIA_Disabled , MUI_TRUE) + + self.nodeCount:=readToolTypeInt(acpName,'NODES') + + installhook( self.setChangedHook, {setChangedFlag}) + self.addControls() + self.addNotifications() + + set(self.grpNodePages,MUIA_Group_ActivePage,MUIV_Group_ActivePage_First) + + self.changed:=FALSE + self.loadNode(0) + + self.showModal() + self.removeNotifications() + self.removeControls() + + ForAll({timeItem},self.timesList,`domethod( timeItem.startControl,[MUIM_KillNotify,MUIA_String_Contents])) + ForAll({timeItem},self.timesList,`domethod( timeItem.endControl,[MUIM_KillNotify,MUIA_String_Contents])) + + END saveHook + END closeHook +ENDPROC + diff --git a/axSetupTool/frmPresetsEdit.e b/axSetupTool/frmPresetsEdit.e new file mode 100644 index 0000000..dbe1496 --- /dev/null +++ b/axSetupTool/frmPresetsEdit.e @@ -0,0 +1,365 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi','workbench/workbench','icon','intuition/classusr' +MODULE 'utility/tagitem','utility/hooks','tools/installhook','exec/lists','dos/dos' +MODULE '*axedit','*frmBase','*tooltypes','*controls','*miscfuncs','*/stringlist','*helpText' + + +EXPORT OBJECT frmPresetsEdit OF frmBase + acpName : PTR TO CHAR + bbsConfigName : PTR TO CHAR + btnSave : PTR TO LONG + btnCancel : PTR TO LONG + raPreset : PTR TO LONG + grpSettings : PTR TO LONG + changed + + areaNames:PTR TO LONG + setChangedHook : hook + presetListOnChange : hook + currPreset : INT + controlList : LONG + + strAreaName : PTR TO control + intAccessLevel : PTR TO control + intConfrJoin : PTR TO control + intMsgbaserJoin : PTR TO control + intDailyBytes : PTR TO control + intRatioType : PTR TO control + intRatio : PTR TO control + intTimeLimit : PTR TO control +ENDOBJECT + +PROC create(app:PTR TO app_obj) OF frmPresetsEdit + DEF group + SUPER self.create(app) + self.winMain:=app.wi_presets + + self.btnSave:=app.btnPresetSave + self.btnCancel:=app.btnPresetClose + self.raPreset:=app.ra_presets + + self.grpSettings:=app.gr_preset_settings + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(50)) +ENDPROC + +PROC setChangedFlag() OF frmPresetsEdit + MOVE.L (A1),self + GetA4() + IF self.changed=FALSE + self.changed:=TRUE + set( self.btnSave,MUIA_Disabled,FALSE) + ENDIF +ENDPROC + +PROC freeControl(control:PTR TO control) OF frmPresetsEdit + control.removeFromGroup(self.grpSettings) + END control +ENDPROC + +PROC addNotifications() OF frmPresetsEdit + domethod( self.btnCancel , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , MUIA_Window_CloseRequest ] ) + + domethod( self.btnSave , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , ID_SAVE ] ) + + domethod( self.raPreset , [ + MUIM_Notify , MUIA_Radio_Active , MUIV_EveryTime , + self.app.app, + 3 , + MUIM_CallHook , self.presetListOnChange, self] ) + installhook( self.presetListOnChange, {presetChange}) + +ENDPROC + +PROC removeNotifications() OF frmPresetsEdit + domethod(self.btnCancel,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnSave,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.raPreset ,[MUIM_KillNotify,MUIA_Radio_Active]) +ENDPROC + +PROC addPresetControls() OF frmPresetsEdit + DEF control: PTR TO control + + NEW control.createCycle('bArea Name',PRESET_AREA_NAME,['',0],self.app.app,self.setChangedHook,self) + self.strAreaName:=control + + NEW control.createStringInt('bAccess Level',PRESET_ACCESS_LEVEL,self.app.app,self.setChangedHook,self) + self.intAccessLevel:=control + + NEW control.createStringInt('bInitial Conf',PRESET_CONF_RJOIN,self.app.app,self.setChangedHook,self) + self.intConfrJoin:=control + + NEW control.createStringInt('Initial Msgbase',PRESET_MESSAGEBASE_RJOIN,self.app.app,self.setChangedHook,self) + self.intMsgbaserJoin:=control + + NEW control.createStringInt('Daily Byte Limit',PRESET_DAILY_BYTES,self.app.app,self.setChangedHook,self) + self.intDailyBytes:=control + + NEW control.createStringInt('Ratio Type',PRESET_RATIO_TYPE,self.app.app,self.setChangedHook,self) + self.intRatioType:=control + + NEW control.createStringInt('Ratio',PRESET_RATIO,self.app.app,self.setChangedHook,self) + self.intRatio:=control + + NEW control.createStringInt('Time Limit',PRESET_TIME_LIMIT,self.app.app,self.setChangedHook,self) + self.intTimeLimit:=control + + self.controlList:=[self.strAreaName,self.intAccessLevel,self.intConfrJoin,self.intMsgbaserJoin, + self.intDailyBytes,self.intRatioType,self.intRatio,self.intTimeLimit] + + domethod(self.grpSettings,[MUIM_Group_InitChange]) + ForAll({control},self.controlList,`control.addToGroup(self.grpSettings)) + domethod(self.grpSettings,[OM_ADDMEMBER,HVSpace]) + domethod(self.grpSettings,[OM_ADDMEMBER,HVSpace]) + domethod(self.grpSettings,[MUIM_Group_ExitChange]) +ENDPROC + +PROC removePresetControls() OF frmPresetsEdit + DEF list:PTR TO lh,state,obj + DEF control: PTR TO control + + domethod(self.grpSettings,[MUIM_Group_InitChange]) + ForAll({control},self.controlList,`self.freeControl(control)) + + get(self.grpSettings,MUIA_Group_ChildList,{list}) + state:=list.head + WHILE (obj:=NextObject({state})) + domethod(self.grpSettings,[OM_REMMEMBER,obj]) + Mui_DisposeObject(obj) + ENDWHILE + domethod(self.grpSettings,[MUIM_Group_ExitChange]) +ENDPROC + +PROC presetChange() OF frmPresetsEdit + DEF entry + MOVE.L (A1),self + GetA4() + + get(self.raPreset,MUIA_Radio_Active,{entry}) + + IF self.loadPreset(entry+1)=FALSE + //restore old prest + domethod(self.raPreset,[MUIM_NoNotifySet,MUIA_Radio_Active,self.currPreset]) + ENDIF + +ENDPROC + +PROC canClose() OF frmPresetsEdit + MOVE.L (A1),self + GetA4() + IF self.changed + IF self.unsavedChangesWarning()=0 THEN RETURN FALSE + ENDIF +ENDPROC TRUE + +PROC unsavedChangesWarning() OF frmPresetsEdit + IF Mui_RequestA(0,self.winMain,0,'Unsaved changes', + '*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE +ENDPROC TRUE + +PROC savePresetChanges() OF frmPresetsEdit + DEF tempStr[255]:STRING + DEF bbsPath[255]:STRING + DEF presetStr[20]:STRING + + MOVE.L (A1),self + GetA4() + + fullTrim(self.areaNames[self.strAreaName.getValueIndex()],tempStr) + IF EstrLen(tempStr)=0 + Mui_RequestA(0,self.winMain,0,'Error','*OK','Area Name is a mandatory field',0) + RETURN + ENDIF + + fullTrim(self.intAccessLevel.getValue(),tempStr) + IF EstrLen(tempStr)=0 + Mui_RequestA(0,self.winMain,0,'Error','*OK','Acces Level is a mandatory field',0) + RETURN + ENDIF + + fullTrim(self.intConfrJoin.getValue(),tempStr) + IF EstrLen(tempStr)=0 + Mui_RequestA(0,self.winMain,0,'Error','*OK','Initial Conf is a mandatory field',0) + RETURN + ENDIF + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + StringF(presetStr,'\saccess/preset.\d',bbsPath,self.currPreset) + + writeToolType(presetStr,'PRESET.AREA',self.areaNames[self.strAreaName.getValueIndex()]) + writeToolType(presetStr,'PRESET.ACCESS',self.intAccessLevel.getValue()) + writeToolType(presetStr,'PRESET.CONFRJOIN',self.intConfrJoin.getValue()) + writeToolType(presetStr,'PRESET.MSGBASERJOIN',self.intMsgbaserJoin.getValue()) + writeToolType(presetStr,'PRESET.DAILY_BYTE_LIMIT',self.intDailyBytes.getValue()) + writeToolType(presetStr,'PRESET.RATIO_TYPE',self.intRatioType.getValue()) + writeToolType(presetStr,'PRESET.RATIO',self.intRatio.getValue()) + writeToolType(presetStr,'PRESET.TIME_LIMIT',self.intTimeLimit.getValue()) + saveCachedChanges() + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE +ENDPROC + +PROC findAreaIndex(areaName:PTR TO CHAR) OF frmPresetsEdit + DEF res,i + res:=-1 + + FOR i:=0 TO ListLen(self.areaNames)-2 DO IF StriCmp(areaName,self.areaNames[i]) THEN res:=i +ENDPROC res + +PROC loadAreaNames(bbsPath:PTR TO CHAR) OF frmPresetsEdit + DEF accessPath[255]:STRING + DEF dir_info:PTR TO fileinfoblock + DEF pdir,r,entry + + DEF buf[255]:STRING + DEF parseBuf[100]:STRING + + StringF(accessPath,'\saccess/',bbsPath) + + IF ((dir_info:=AllocDosObject(DOS_FIB,NIL)) = NIL) + RETURN 0 + ENDIF + + IF ((pdir:=Lock(accessPath,ACCESS_READ)))=FALSE + FreeDosObject(DOS_FIB,dir_info) + RETURN 0 + ENDIF + + IF(Examine(pdir, dir_info))=FALSE + FreeDosObject(DOS_FIB,dir_info) + UnLock(pdir) + RETURN 0 + ENDIF + + IF ParsePatternNoCase('AREA.#?.info',parseBuf,100) =-1 THEN RETURN + + ForAll({entry},self.areaNames,`DisposeLink(entry)) + SetList(self.areaNames,0) + + + WHILE(ExNext(pdir,dir_info)) + IF(dir_info.direntrytype < 0) + + IF MatchPatternNoCase(parseBuf,dir_info.filename) + buf:=String(255) + StrCopy(buf,dir_info.filename+5) + stripInfo(buf) + ListAddItem(self.areaNames,buf) + ENDIF + ENDIF + ENDWHILE + + ListAddItem(self.areaNames,String(0)) + ListAddItem(self.areaNames,0) + + set(self.strAreaName.muiControl,MUIA_Cycle_Entries,self.areaNames) + + UnLock(pdir) + FreeDosObject(DOS_FIB,dir_info) + + +ENDPROC + +PROC loadPreset(presetNum) OF frmPresetsEdit + DEF bbsPath[255]:STRING + DEF presetStr[20]:STRING + DEF tempStr[255]:STRING + DEF val + + IF self.changed + IF self.unsavedChangesWarning()=FALSE THEN RETURN FALSE + ENDIF + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + + StringF(presetStr,'\saccess/preset.\d',bbsPath,presetNum) + + readToolType(presetStr,'PRESET.AREA',tempStr) + IF EstrLen(tempStr)=0 THEN StrCopy(tempStr,'') + self.strAreaName.setValueIndex(self.findAreaIndex(tempStr)) + + val:=readToolTypeInt(presetStr,'PRESET.ACCESS') + self.intAccessLevel.setValue(val) + + val:=readToolTypeInt(presetStr,'PRESET.CONFRJOIN') + self.intConfrJoin.setValue(val) + + val:=readToolTypeInt(presetStr,'PRESET.MSGBASERJOIN') + self.intMsgbaserJoin.setValue(val) + + val:=readToolTypeInt(presetStr,'PRESET.DAILY_BYTE_LIMIT') + self.intDailyBytes.setValue(val) + + val:=readToolTypeInt(presetStr,'PRESET.RATIO_TYPE') + self.intRatioType.setValue(val) + + val:=readToolTypeInt(presetStr,'PRESET.RATIO') + self.intRatio.setValue(val) + + val:=readToolTypeInt(presetStr,'PRESET.TIME_LIMIT') + self.intTimeLimit.setValue(val) + + self.currPreset:=presetNum + + self.changed:=FALSE + set( self.btnSave, MUIA_Disabled , MUI_TRUE) + +ENDPROC TRUE + +PROC editPresets(acpName:PTR TO CHAR) OF frmPresetsEdit + DEF count,val,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF bbsPath[255]:STRING + + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + + NEW saveHook + installhook( saveHook, {savePresetChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.acpName:=acpName + + self.areaNames:=List(100) + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + + + installhook( self.setChangedHook, {setChangedFlag}) + self.addPresetControls() + self.addNotifications() + + self.loadAreaNames(bbsPath) + + set( self.winMain, MUIA_Window_Title,'Edit Presets') + set(self.raPreset,MUIA_Radio_Active,0) + set(self.raPreset, MUIA_ShortHelp , getHelpText(PRESET_NUMBER)) + + self.changed:=FALSE + self.loadPreset(1) + + self.changed:=FALSE + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + self.showModal() + self.removeNotifications() + self.removePresetControls() + END saveHook + END closeHook + ForAll({entry},self.areaNames,`IF entry THEN DisposeLink(entry) ELSE 0) + DisposeLink(self.areaNames) +ENDPROC diff --git a/axSetupTool/frmSettingsEdit.e b/axSetupTool/frmSettingsEdit.e new file mode 100644 index 0000000..71a365b --- /dev/null +++ b/axSetupTool/frmSettingsEdit.e @@ -0,0 +1,1245 @@ +OPT MODULE,LARGE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui' +MODULE 'tools/boopsi','workbench/workbench','icon','intuition/classusr' +MODULE 'utility/tagitem','utility/hooks','tools/installhook','exec/lists' +MODULE '*axedit','*frmBase','*tooltypes','*controls','*miscfuncs','*/stringlist','*helpText' + + +EXPORT OBJECT frmSettingsEdit OF frmBase + acpName : PTR TO CHAR + bbsConfigName : PTR TO CHAR + zoomDirPath : PTR TO CHAR + btnSave : PTR TO LONG + btnCancel : PTR TO LONG + grpSettings : PTR TO LONG + changed + setChangedHook : hook + controlList : LONG + languages : PTR TO LONG + languagesConfigName:PTR TO CHAR + nodeCount : INT + + //system settings + strBBSName : PTR TO control + strBBSLocation : PTR TO control + strSysopName : PTR TO control + strDefaultMenu : PTR TO control + intMinPasswordLen: PTR TO control + cycMinPasswordStrength: PTR TO control + cycPasswordEncryption: PTR TO control + intMaxPasswordFails: PTR TO control + intPasswordExpiry: PTR TO control + cycStrictPasswordPolicy: PTR TO control + paLocalULPath : PTR TO control + intAutoValPreset : PTR TO control + intAutoValDelay : PTR TO control + strAutoValPassword: PTR TO control + cyLanguage : PTR TO control + boolCreditByKb : PTR TO control + boolLongWho : PTR TO control + cyNewAccounts : PTR TO control + strRegKey : PTR TO control + boolConvertToMb : PTR TO control + boolTimeoutLc : PTR TO control + boolQuietJoin : PTR TO control + boolRelativeConfs: PTR TO control + strSmtpHost : PTR TO control + intSmtpPort : PTR TO control + strSmtpUsername : PTR TO control + strSmtpPassword : PTR TO control + boolSmtpSSL : PTR TO control + strSysopEmail : PTR TO control + strBbsEmail : PTR TO control + boolMailOnPage : PTR TO control + boolMailOnComment: PTR TO control + boolMailOnLogon : PTR TO control + boolMailOnLogoff : PTR TO control + boolMailOnNewUser: PTR TO control + boolMailOnUpload : PTR TO control + boolMailOnPwdFail: PTR TO control + paLanguageBase : PTR TO control + paHistory : PTR TO control + paUserNotes : PTR TO control + intHoldAccess : PTR TO control + strFileDizSysCmd : PTR TO control + strFtpHost : PTR TO control + strFtpPort : PTR TO control + strFtpDataPort : PTR TO control + strHttpPort : PTR TO control + strExecOnNewUser : PTR TO control + strExecAOnNewUser: PTR TO control + strExecOnPage : PTR TO control + strExecAOnPage : PTR TO control + strExecOnConnect : PTR TO control + strExecAOnConnect: PTR TO control + strExecOnLogon : PTR TO control + strExecAOnLogon : PTR TO control + strExecOnLogoff : PTR TO control + strExecAOnLogoff : PTR TO control + strExecOnComment : PTR TO control + strExecAOnComment: PTR TO control + strExecOnUpload : PTR TO control + strExecAOnUpload : PTR TO control + + //server settings + paBBSPath : PTR TO control + intStack : PTR TO control + intPriority : PTR TO control + boolIconified : PTR TO control + intIconifyLeft : PTR TO control + intIconifyTop : PTR TO control + boolDoNotMove : PTR TO control + boolMulticom : PTR TO control + boolAEShell : PTR TO control + boolNoCx : PTR TO control + boolNoSaveState: PTR TO control + intTelnetPort : PTR TO control + intFtpPort : PTR TO control + strAcpFont : PTR TO control + strExecOnStart : PTR TO control + intDosCheckTime: PTR TO control + intDosBanTime : PTR TO control + intDosCheckTrig: PTR TO control + nodeLocs : PTR TO stdlist + nodeNames : PTR TO stdlist + nodeSysops : PTR TO stdlist + buttonNames : PTR TO stdlist + buttonCommands : PTR TO stdlist + nuttonNames : PTR TO stdlist + nuttonCommands : PTR TO stdlist + + //zoom settings + strBbsNumber : PTR TO control + strBbsAddress : PTR TO control + strBbsId : PTR TO control + strQwkZip : PTR TO control + strQwkLha : PTR TO control + strAscZip : PTR TO control + strAscLha : PTR TO control +ENDOBJECT + +PROC create(app:PTR TO app_obj) OF frmSettingsEdit + DEF group + SUPER self.create(app) + self.winMain:=app.wi_systemdata + + self.setChangedHook.data:=self + + self.btnSave:=app.btnSettingsSave + self.btnCancel:=app.btnSettingsCancel + + get(app.gr_settings,MUIA_Scrollgroup_Contents,{group}) + self.grpSettings:=group + + set(self.winMain,MUIA_Window_Width,MUIV_Window_Width_Screen(50)) +ENDPROC + +PROC setChangedFlag() OF frmSettingsEdit + MOVE.L (A1),self + GetA4() + + IF self.changed=FALSE + self.changed:=TRUE + set( self.btnSave,MUIA_Disabled,FALSE) + ENDIF +ENDPROC + +PROC freeControl(control:PTR TO control) OF frmSettingsEdit + control.removeFromGroup(self.grpSettings) + END control +ENDPROC + +PROC addNotifications() OF frmSettingsEdit + domethod( self.btnCancel , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , MUIA_Window_CloseRequest ] ) + + domethod( self.btnSave , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , ID_SAVE ] ) +ENDPROC + +PROC removeNotifications() OF frmSettingsEdit + domethod(self.btnCancel,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnSave,[MUIM_KillNotify,MUIA_Pressed]) +ENDPROC + +PROC addSystemControls() OF frmSettingsEdit + DEF control: PTR TO control + DEF languageList:PTR TO LONG + DEF i + + NEW control.createDirSelect('bBBS Path',SYS_BBS_PATH,self.app.app,self.setChangedHook,self) + self.paBBSPath:=control + + NEW control.createString('bBBS Name',SYS_BBS_NAME,self.app.app,self.setChangedHook,self) + self.strBBSName:=control + + NEW control.createString('bBBS Location',SYS_BBS_LOCATION,self.app.app,self.setChangedHook,self) + self.strBBSLocation:=control + + NEW control.createString('bSysop Name',SYS_SYSOP_NAME,self.app.app,self.setChangedHook,self) + self.strSysopName:=control + + NEW control.createStringInt('Min Password Length',SYS_MIN_PASSWORD_LEN,self.app.app,self.setChangedHook,self) + self.intMinPasswordLen:=control + + NEW control.createCycle('Min Password Strength',SYS_MIN_PASSWORD_STRENGTH,['No restriction','2 character types','3 character types','All 4 character types',0],self.app.app,self.setChangedHook,self) + self.cycMinPasswordStrength:=control + + NEW control.createCycle('Password Encryption',SYS_PASSWORD_ENCRYPTION,['Legacy /X Encryption','PBKDF2 (5 rounds)','PBKDF2 (50 rounds)','PBKDF2 (100 rounds)','PBKDF2 (1000 rounds)','PBKDF2 (10000 rounds)',0],self.app.app,self.setChangedHook,self) + self.cycPasswordEncryption:=control + + NEW control.createStringInt('Max Password Fails',SYS_MAX_PASSWORD_FAILS,self.app.app,self.setChangedHook,self) + self.intMaxPasswordFails:=control + + NEW control.createStringInt('Password Expiry',SYS_PASSWORD_EXPIRY,self.app.app,self.setChangedHook,self) + self.intPasswordExpiry:=control + + NEW control.createCycle('Strict Password Policy',SYS_STRICT_PASSWORD_POLICY,['No','Yes',0],self.app.app,self.setChangedHook,self) + self.cycStrictPasswordPolicy:=control + + NEW control.createString('Default Menu',SYS_DEFAULT_MENU,self.app.app,self.setChangedHook,self) + self.strDefaultMenu:=control + + NEW control.createDirSelect('Local Upload Path',SYS_LOCAL_UPLOAD_PATH,self.app.app,self.setChangedHook,self) + self.paLocalULPath:=control + + NEW control.createStringInt('Auto Validate Preset',SYS_AUTO_VAL_PRESET,self.app.app,self.setChangedHook,self) + self.intAutoValPreset:=control + + NEW control.createStringInt('Auto Validate Delay',SYS_AUTO_VAL_DELAY,self.app.app,self.setChangedHook,self) + self.intAutoValDelay:=control + + NEW control.createString('Auto Validate Password',SYS_AUTO_VAL_PASSWORD,self.app.app,self.setChangedHook,self) + self.strAutoValPassword:=control + + self.cyLanguage:=0 + IF ListLen(self.languages)>1 + NEW control.createCycle('Host Language',SYS_LANGUAGE,self.languages,self.app.app,self.setChangedHook,self) + self.cyLanguage:=control + ENDIF + + NEW control.createCheckBox('Credit by KB',SYS_CREDIT_BY_KB,self.app.app,self.setChangedHook,self) + self.boolCreditByKb:=control + + NEW control.createCheckBox('Long who',SYS_LONG_WHO,self.app.app,self.setChangedHook,self) + self.boolLongWho:=control + + NEW control.createCycle('New Accounts',SYS_NEW_ACCOUNTS,['Append','Overwrite',0],self.app.app,self.setChangedHook,self) + self.cyNewAccounts:=control + + NEW control.createCycle('Timeout Recorded as',SYS_TIMEOUT_LC,['Lost Carrier','Normal Logoff',0],self.app.app,self.setChangedHook,self) + self.boolTimeoutLc:=control + + NEW control.createString('Registered to',SYS_REGKEY,self.app.app,self.setChangedHook,self) + self.strRegKey:=control + + NEW control.createCheckBox('Convert to MB',SYS_CONVERT_TO_MB,self.app.app,self.setChangedHook,self) + self.boolConvertToMb:=control + + NEW control.createCheckBox('Quiet Join',SYS_QUIET_JOIN,self.app.app,self.setChangedHook,self) + self.boolQuietJoin:=control + + NEW control.createCheckBox('Relative Conferences',SYS_RELATIVE_CONFS,self.app.app,self.setChangedHook,self) + self.boolRelativeConfs:=control + + NEW control.createString('SMTP server address',SYS_SMTP_SERVER,self.app.app,self.setChangedHook,self) + self.strSmtpHost:=control + NEW control.createStringInt('SMTP server port',SYS_SMTP_PORT,self.app.app,self.setChangedHook,self) + self.intSmtpPort:=control + NEW control.createString('SMTP server username',SYS_SMTP_USERNAME,self.app.app,self.setChangedHook,self) + self.strSmtpUsername:=control + NEW control.createString('SMTP server password',SYS_SMTP_PASSWORD,self.app.app,self.setChangedHook,self) + self.strSmtpPassword:=control + NEW control.createCheckBox('Use SSL for emails',SYS_SSL_EMAILS,self.app.app,self.setChangedHook,self) + self.boolSmtpSSL:=control + NEW control.createString('Sysops email address',SYS_SYSOP_EMAIL,self.app.app,self.setChangedHook,self) + self.strSysopEmail:=control + NEW control.createString('BBS email address',SYS_BBS_EMAIL,self.app.app,self.setChangedHook,self) + self.strBbsEmail:=control + NEW control.createCheckBox('Email on sysop page',SYS_EMAIL_ON_SYSOP_PAGE,self.app.app,self.setChangedHook,self) + self.boolMailOnPage:=control + NEW control.createCheckBox('Email on comment',SYS_EMAIL_ON_COMMENT,self.app.app,self.setChangedHook,self) + self.boolMailOnComment:=control + NEW control.createCheckBox('Email on logon',SYS_EMAIL_ON_LOGON,self.app.app,self.setChangedHook,self) + self.boolMailOnLogon:=control + NEW control.createCheckBox('Email on logoff',SYS_EMAIL_ON_LOGOFF,self.app.app,self.setChangedHook,self) + self.boolMailOnLogoff:=control + NEW control.createCheckBox('Email on new user',SYS_EMAIL_ON_NEW_USER,self.app.app,self.setChangedHook,self) + self.boolMailOnNewUser:=control + NEW control.createCheckBox('Email on upload',SYS_EMAIL_ON_UPLOAD,self.app.app,self.setChangedHook,self) + self.boolMailOnUpload:=control + NEW control.createCheckBox('Email on password fail',SYS_EMAIL_ON_PW_FAIL,self.app.app,self.setChangedHook,self) + self.boolMailOnPwdFail:=control + NEW control.createDirSelect('Language base folder',SYS_LANG_BASE_PATH,self.app.app,self.setChangedHook,self) + self.paLanguageBase:=control + NEW control.createDirSelect('History folder',SYS_HISTORY_PATH,self.app.app,self.setChangedHook,self) + self.paHistory:=control + NEW control.createDirSelect('User notes folder',SYS_USER_NOTES_PATH,self.app.app,self.setChangedHook,self) + self.paUserNotes:=control + NEW control.createStringInt('Hold access level',SYS_HOLD_ACCESS_LEVEL,self.app.app,self.setChangedHook,self) + self.intHoldAccess:=control + NEW control.createString('File Diz Cmd',SYS_FILEDIZ_CMD,self.app.app,self.setChangedHook,self) + self.strFileDizSysCmd:=control + NEW control.createString('FTP host name',SYS_FTP_HOST,self.app.app,self.setChangedHook,self) + self.strFtpHost:=control + NEW control.createString('FTP port(s)',SYS_FTP_PORT,self.app.app,self.setChangedHook,self) + self.strFtpPort:=control + NEW control.createString('FTP data port(s)',SYS_FTP_DATA_PORT,self.app.app,self.setChangedHook,self) + self.strFtpDataPort:=control + NEW control.createString('HTTP port(s)',SYS_HTTP_PORT,self.app.app,self.setChangedHook,self) + self.strHttpPort:=control + NEW control.createString('Execute on new user',SYS_EXEC_ON_NEW_USER,self.app.app,self.setChangedHook,self) + self.strExecOnNewUser:=control + NEW control.createString('Execute async on new user',SYS_EXECA_ON_NEW_USER,self.app.app,self.setChangedHook,self) + self.strExecAOnNewUser:=control + NEW control.createString('Execute on sysop page',SYS_EXEC_ON_SYSOP_PAGE,self.app.app,self.setChangedHook,self) + self.strExecOnPage:=control + NEW control.createString('Execute async on sysop page',SYS_EXECA_ON_SYSOP_PAGE,self.app.app,self.setChangedHook,self) + self.strExecAOnPage:=control + NEW control.createString('Execute on connect',SYS_EXEC_ON_CONNECT,self.app.app,self.setChangedHook,self) + self.strExecOnConnect:=control + NEW control.createString('Execute async on connect',SYS_EXECA_ON_CONNECT,self.app.app,self.setChangedHook,self) + self.strExecAOnConnect:=control + NEW control.createString('Execute on logon',SYS_EXEC_ON_LOGON,self.app.app,self.setChangedHook,self) + self.strExecOnLogon:=control + NEW control.createString('Execute async on logon',SYS_EXECA_ON_LOGON,self.app.app,self.setChangedHook,self) + self.strExecAOnLogon:=control + NEW control.createString('Execute on logoff',SYS_EXEC_ON_LOGOFF,self.app.app,self.setChangedHook,self) + self.strExecOnLogoff:=control + NEW control.createString('Execute async on logoff',SYS_EXECA_ON_LOGOFF,self.app.app,self.setChangedHook,self) + self.strExecAOnLogoff:=control + NEW control.createString('Execute on comment',SYS_EXEC_ON_COMMENT,self.app.app,self.setChangedHook,self) + self.strExecOnComment:=control + NEW control.createString('Execute async on comment',SYS_EXECA_ON_COMMENT,self.app.app,self.setChangedHook,self) + self.strExecAOnComment:=control + NEW control.createString('Execute on upload',SYS_EXEC_ON_UPLOAD,self.app.app,self.setChangedHook,self) + self.strExecOnUpload:=control + NEW control.createString('Execute async on upload',SYS_EXECA_ON_UPLOAD,self.app.app,self.setChangedHook,self) + self.strExecAOnUpload:=control + + self.controlList:=[self.paBBSPath,self.strBBSName,self.strBBSLocation,self.strSysopName,self.intMinPasswordLen, + self.cycMinPasswordStrength,self.cycPasswordEncryption,self.intMaxPasswordFails,self.intPasswordExpiry, + self.cycStrictPasswordPolicy,self.strRegKey,self.cyNewAccounts,self.strDefaultMenu, + self.paLocalULPath,self.intAutoValPreset,self.intAutoValDelay,self.strAutoValPassword,self.cyLanguage, + self.strSmtpHost,self.intSmtpPort,self.strSmtpUsername,self.strSmtpPassword,self.boolSmtpSSL,self.strSysopEmail, + self.strBbsEmail,self.paLanguageBase,self.paHistory,self.paUserNotes,self.intHoldAccess, + self.strFileDizSysCmd,self.strFtpHost,self.strFtpPort,self.strFtpDataPort,self.strHttpPort,self.strExecOnNewUser, + self.strExecAOnNewUser,self.strExecOnPage,self.strExecAOnPage,self.strExecOnConnect,self.strExecAOnConnect, + self.strExecOnLogon,self.strExecAOnLogon,self.strExecOnLogoff,self.strExecAOnLogoff, + self.strExecOnComment,self.strExecAOnComment,self.strExecOnUpload,self.strExecAOnUpload, + self.boolCreditByKb,self.boolLongWho,self.boolConvertToMb,self.boolQuietJoin,self.boolRelativeConfs, + self.boolMailOnPage,self.boolMailOnComment,self.boolMailOnLogon,self.boolMailOnLogoff,self.boolMailOnNewUser, + self.boolMailOnUpload,self.boolMailOnPwdFail] + + //domethod(self.grpSettings,[MUIM_Group_InitChange]) + ForAll({control},self.controlList,`IF control THEN control.addToGroup(self.grpSettings) ELSE FALSE) + domethod(self.grpSettings,[OM_ADDMEMBER,HVSpace]) + domethod(self.grpSettings,[OM_ADDMEMBER,HVSpace]) + //domethod(self.grpSettings,[MUIM_Group_ExitChange]) +ENDPROC + +PROC removeSystemControls() OF frmSettingsEdit + DEF list:PTR TO lh,state,obj + DEF control: PTR TO control + + //domethod(self.grpSettings,[MUIM_Group_InitChange]) + ForAll({control},self.controlList,`IF control THEN self.freeControl(control) ELSE FALSE) + + get(self.grpSettings,MUIA_Group_ChildList,{list}) + state:=list.head + WHILE (obj:=NextObject({state})) + domethod(self.grpSettings,[OM_REMMEMBER,obj]) + Mui_DisposeObject(obj) + ENDWHILE + //domethod(self.grpSettings,[MUIM_Group_ExitChange]) +ENDPROC + +PROC addServerControls() OF frmSettingsEdit + DEF control: PTR TO control + DEF list:PTR TO stdlist + DEF sublist:PTR TO control + DEF tempStr[255]:STRING + DEF i + + NEW control.createStringInt('Stack size',SYS_STACK,self.app.app,self.setChangedHook,self) + self.intStack:=control + + NEW control.createStringInt('Priority',SYS_PRIORITY,self.app.app,self.setChangedHook,self) + self.intPriority:=control + + NEW control.createCheckBox('Start Iconified',SYS_START_ICONIFIED,self.app.app,self.setChangedHook,self) + self.boolIconified:=control + + NEW control.createStringInt('Iconify Left',SYS_ICONIFY_LEFT,self.app.app,self.setChangedHook,self) + self.intIconifyLeft:=control + + NEW control.createStringInt('Iconify Top',SYS_ICONIFY_TOP,self.app.app,self.setChangedHook,self) + self.intIconifyTop:=control + + NEW control.createCheckBox('Do not move',SYS_DO_NOT_MOVE,self.app.app,self.setChangedHook,self) + self.boolDoNotMove:=control + + NEW control.createCheckBox('Multicom port',SYS_MULTICOM,self.app.app,self.setChangedHook,self) + self.boolMulticom:=control + + NEW control.createCheckBox('AE Shell',SYS_AE_SHELL,self.app.app,self.setChangedHook,self) + self.boolAEShell:=control + + NEW control.createCheckBox('Disable commodity',SYS_NO_COMMODITY,self.app.app,self.setChangedHook,self) + self.boolNoCx:=control + + NEW control.createCheckBox('Don''t save state',SYS_DONT_SAVE_STATE,self.app.app,self.setChangedHook,self) + self.boolNoSaveState:=control + + NEW control.createStringInt('Telnet Port Number',SYS_TELNET_PORT,self.app.app,self.setChangedHook,self) + self.intTelnetPort:=control + + NEW control.createStringInt('FTP Port Number',SYS_FTP_PORT2,self.app.app,self.setChangedHook,self) + self.intFtpPort:=control + + NEW control.createString('ACP Font',SYS_ACP_FONT,self.app.app,self.setChangedHook,self) + self.strAcpFont:=control + + NEW control.createString('Execute on startup',SYS_EXEC_ON_STARTUP,self.app.app,self.setChangedHook,self) + self.strExecOnStart:=control + + NEW control.createStringInt('DOS check time',SYS_DOS_CHECK_TIME,self.app.app,self.setChangedHook,self) + self.intDosCheckTime:=control + + NEW control.createStringInt('DOS ban time',SYS_DOS_BAN_TIME,self.app.app,self.setChangedHook,self) + self.intDosBanTime:=control + + NEW control.createStringInt('DOS check trigger',SYS_DOS_CHECK_TRIGGER,self.app.app,self.setChangedHook,self) + self.intDosCheckTrig:=control + + NEW list.stdlist(self.nodeCount) + self.nodeLocs:=list + + NEW list.stdlist(self.nodeCount) + self.nodeNames:=list + + NEW list.stdlist(self.nodeCount) + self.nodeSysops:=list + + NEW list.stdlist(15) + self.buttonNames:=list + + NEW list.stdlist(15) + self.buttonCommands:=list + + NEW list.stdlist(15) + self.nuttonNames:=list + + NEW list.stdlist(15) + self.nuttonCommands:=list + + FOR i:=0 TO self.nodeCount-1 + StringF(tempStr,'Node \d Location',i) + NEW control.createString(tempStr,SYS_NODE_X_LOC,self.app.app,self.setChangedHook,self) + self.nodeLocs.add(control) + StringF(tempStr,'Node \d Name',i) + NEW control.createString(tempStr,SYS_NODE_X_NAME,self.app.app,self.setChangedHook,self) + self.nodeNames.add(control) + StringF(tempStr,'Node \d Sysop',i) + NEW control.createString(tempStr,SYS_NODE_X_SYSOP,self.app.app,self.setChangedHook,self) + self.nodeSysops.add(control) + ENDFOR + + FOR i:=1 TO 15 + StringF(tempStr,'Button \d Name',i) + NEW control.createString(tempStr,SYS_BUTTON_NAME,self.app.app,self.setChangedHook,self) + self.buttonNames.add(control) + StringF(tempStr,'Button \d Command',i) + NEW control.createString(tempStr,SYS_BUTTON_COMMAND,self.app.app,self.setChangedHook,self) + self.buttonCommands.add(control) + + StringF(tempStr,'Nutton \d Name',i) + NEW control.createString(tempStr,SYS_NUTTON_NAME,self.app.app,self.setChangedHook,self) + self.nuttonNames.add(control) + StringF(tempStr,'Nutton \d Command',i) + NEW control.createString(tempStr,SYS_NUTTON_COMMAND,self.app.app,self.setChangedHook,self) + self.nuttonCommands.add(control) + ENDFOR + + self.controlList:=[self.intStack,self.intPriority,self.intTelnetPort,self.intFtpPort, + self.boolIconified,self.intIconifyLeft,self.intIconifyTop,self.strAcpFont,self.strExecOnStart, + self.intDosCheckTime,self.intDosBanTime,self.intDosCheckTrig,self.boolDoNotMove, + self.boolMulticom,self.boolAEShell,self.boolNoCx,self.boolNoSaveState] + + domethod(self.grpSettings,[MUIM_Group_InitChange]) + + sublist:=[self.intStack,self.intPriority,self.intTelnetPort,self.intFtpPort, + self.strAcpFont,self.strExecOnStart, + self.intDosCheckTime,self.intDosBanTime,self.intDosCheckTrig] + + ForAll({control},sublist,`control.addToGroup(self.grpSettings)) + + FOR i:=0 TO self.nodeCount-1 + control:=self.nodeLocs.item(i) + control.addToGroup(self.grpSettings) + control:=self.nodeNames.item(i) + control.addToGroup(self.grpSettings) + control:=self.nodeSysops.item(i) + control.addToGroup(self.grpSettings) + ENDFOR + + FOR i:=0 TO 14 + control:=self.buttonNames.item(i) + control.addToGroup(self.grpSettings) + control:=self.buttonCommands.item(i) + control.addToGroup(self.grpSettings) + ENDFOR + + FOR i:=0 TO 14 + control:=self.nuttonNames.item(i) + control.addToGroup(self.grpSettings) + control:=self.nuttonCommands.item(i) + control.addToGroup(self.grpSettings) + ENDFOR + + sublist:=[self.intIconifyLeft,self.intIconifyTop,self.boolIconified,self.boolDoNotMove,self.boolMulticom,self.boolAEShell,self.boolNoCx,self.boolNoSaveState] + ForAll({control},sublist,`control.addToGroup(self.grpSettings)) + + + domethod(self.grpSettings,[OM_ADDMEMBER,HVSpace]) + domethod(self.grpSettings,[OM_ADDMEMBER,HVSpace]) + domethod(self.grpSettings,[MUIM_Group_ExitChange]) +ENDPROC + +PROC removeServerControls() OF frmSettingsEdit + DEF list:PTR TO lh,state,obj,i + DEF control: PTR TO control + + domethod(self.grpSettings,[MUIM_Group_InitChange]) + ForAll({control},self.controlList,`self.freeControl(control)) + + FOR i:=0 TO self.nodeCount-1 + control:=self.nodeLocs.item(i) + self.freeControl(control) + control:=self.nodeNames.item(i) + self.freeControl(control) + control:=self.nodeSysops.item(i) + self.freeControl(control) + ENDFOR + + FOR i:=0 TO 14 + control:=self.buttonNames.item(i) + self.freeControl(control) + control:=self.buttonCommands.item(i) + self.freeControl(control) + control:=self.nuttonNames.item(i) + self.freeControl(control) + control:=self.nuttonCommands.item(i) + self.freeControl(control) + ENDFOR + + END self.nodeLocs + END self.nodeNames + END self.nodeSysops + END self.buttonNames + END self.buttonCommands + END self.nuttonNames + END self.nuttonCommands + + get(self.grpSettings,MUIA_Group_ChildList,{list}) + state:=list.head + WHILE (obj:=NextObject({state})) + domethod(self.grpSettings,[OM_REMMEMBER,obj]) + Mui_DisposeObject(obj) + ENDWHILE + domethod(self.grpSettings,[MUIM_Group_ExitChange]) +ENDPROC + +PROC addZoomControls() OF frmSettingsEdit + DEF control: PTR TO control + + NEW control.createString('BBS Number',SYS_QWK_BBS_NUMBER,self.app.app,self.setChangedHook,self) + self.strBbsNumber:=control + NEW control.createString('BBS Address',SYS_QWK_BBS_ADDRESS,self.app.app,self.setChangedHook,self) + self.strBbsAddress:=control + NEW control.createString('BBS ID',SYS_QWK_BBS_ID,self.app.app,self.setChangedHook,self) + self.strBbsId:=control + NEW control.createString('QWK Zip command',SYS_QWK_ZIP_COMMAND,self.app.app,self.setChangedHook,self) + self.strQwkZip:=control + NEW control.createString('QWK LHA command',SYS_QWK_LHA_COMMAND,self.app.app,self.setChangedHook,self) + self.strQwkLha:=control + NEW control.createString('ASCII Zip command',SYS_ASC_ZIP_COMMAND,self.app.app,self.setChangedHook,self) + self.strAscZip:=control + NEW control.createString('ASCII LHA command',SYS_ASC_LHA_COMMAND,self.app.app,self.setChangedHook,self) + self.strAscLha:=control + + self.controlList:=[self.strBbsNumber,self.strBbsAddress,self.strBbsId, self.strQwkZip, self.strQwkLha, self.strAscZip, self.strAscLha] + + domethod(self.grpSettings,[MUIM_Group_InitChange]) + ForAll({control},self.controlList,`control.addToGroup(self.grpSettings)) + domethod(self.grpSettings,[OM_ADDMEMBER,HVSpace]) + domethod(self.grpSettings,[OM_ADDMEMBER,HVSpace]) + domethod(self.grpSettings,[MUIM_Group_ExitChange]) +ENDPROC + +PROC removeZoomControls() OF frmSettingsEdit + DEF list:PTR TO lh,state,obj + DEF control: PTR TO control + + domethod(self.grpSettings,[MUIM_Group_InitChange]) + ForAll({control},self.controlList,`self.freeControl(control)) + + get(self.grpSettings,MUIA_Group_ChildList,{list}) + state:=list.head + WHILE (obj:=NextObject({state})) + domethod(self.grpSettings,[OM_REMMEMBER,obj]) + Mui_DisposeObject(obj) + ENDWHILE + domethod(self.grpSettings,[MUIM_Group_ExitChange]) +ENDPROC + +PROC canClose() OF frmSettingsEdit + MOVE.L (A1),self + GetA4() + IF self.changed + IF self.unsavedChangesWarning()=0 THEN RETURN FALSE + ENDIF +ENDPROC TRUE + +PROC unsavedChangesWarning() OF frmSettingsEdit + IF Mui_RequestA(0,self.winMain,0,'Unsaved changes', + '*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE +ENDPROC TRUE + +PROC saveSystemChanges() OF frmSettingsEdit + DEF tempStr[255]:STRING + + MOVE.L (A1),self + GetA4() + + fullTrim(self.paBBSPath.getValue(),tempStr) + IF EstrLen(tempStr)=0 + Mui_RequestA(0,self.winMain,0,'Error','*OK','BBS Path is a mandatory field',0) + RETURN + ENDIF + + fullTrim(self.strBBSName.getValue(),tempStr) + IF EstrLen(tempStr)=0 + Mui_RequestA(0,self.winMain,0,'Error','*OK','BBS Name is a mandatory field',0) + RETURN + ENDIF + + fullTrim(self.strBBSLocation.getValue(),tempStr) + IF EstrLen(tempStr)=0 + Mui_RequestA(0,self.winMain,0,'Error','*OK','BBS Location is a mandatory field',0) + RETURN + ENDIF + + fullTrim(self.strSysopName.getValue(),tempStr) + IF EstrLen(tempStr)=0 + Mui_RequestA(0,self.winMain,0,'Error','*OK','Sysop Name is a mandatory field',0) + RETURN + ENDIF + + self.sleep() + writeToolType(self.acpName,'BBS_LOCATION',self.paBBSPath.getValue()) + writeToolType(self.acpName,'BBS_NAME',self.strBBSName.getValue()) + writeToolType(self.acpName,'BBS_GEOGRAPHIC',self.strBBSLocation.getValue()) + writeToolType(self.acpName,'SYSOP_NAME',self.strSysopName.getValue()) + + writeToolType(self.bbsConfigName,'MIN_PASSWORD_LENGTH',self.intMinPasswordLen.getValue()) + IF self.cycMinPasswordStrength.getValueIndex()=0 + writeToolType(self.bbsConfigName,'MIN_PASSWORD_STRENGTH','') + ELSE + StringF(tempStr,'\d',self.cycMinPasswordStrength.getValueIndex()+1) + writeToolType(self.bbsConfigName,'MIN_PASSWORD_STRENGTH',tempStr) + ENDIF + SELECT self.cycPasswordEncryption.getValueIndex() + CASE 0 + writeToolType(self.bbsConfigName,'PASSWORD_SECURITY','LEGACY') + CASE 1 + writeToolType(self.bbsConfigName,'PASSWORD_SECURITY','PBKDF2_5') + CASE 2 + writeToolType(self.bbsConfigName,'PASSWORD_SECURITY','PBKDF2_50') + CASE 3 + writeToolType(self.bbsConfigName,'PASSWORD_SECURITY','PBKDF2_100') + CASE 4 + writeToolType(self.bbsConfigName,'PASSWORD_SECURITY','PBKDF2_1000') + CASE 5 + writeToolType(self.bbsConfigName,'PASSWORD_SECURITY','PBKDF2_10000') + ENDSELECT + + writeToolType(self.bbsConfigName,'MAX_PASSWORD_FAILS',self.intMaxPasswordFails.getValue()) + writeToolType(self.bbsConfigName,'PASSWORD_EXPIRY_DAYS',self.intPasswordExpiry.getValue()) + IF self.cycStrictPasswordPolicy.getValueIndex() THEN writeToolType(self.bbsConfigName,'STRICT_PASSWORD_POLICY') ELSE deleteToolType(self.bbsConfigName,'STRICT_PASSWORD_POLICY') + + IF self.cyNewAccounts.getValueIndex()=0 THEN writeToolType(self.acpName,'NEW_ACCOUNTS','APPEND') ELSE deleteToolType(self.acpName,'NEW_ACCOUNTS') + writeToolType(self.bbsConfigName,'REGKEY',self.strRegKey.getValue()) + writeToolType(self.bbsConfigName,'DEFAULT_MENUNAME',self.strDefaultMenu.getValue()) + writeToolType(self.bbsConfigName,'LOCAL_UPLOAD_PATH',self.paLocalULPath.getValue()) + writeToolType(self.bbsConfigName,'AUTOVAL_PRESET',self.intAutoValPreset.getValue()) + writeToolType(self.bbsConfigName,'AUTOVAL_DELAY',self.intAutoValDelay.getValue()) + writeToolType(self.acpName,'AUTOVAL_PASSWORD',self.strAutoValPassword.getValue()) + + IF self.cyLanguage + writeToolType(self.languagesConfigName,'HOSTLANGUAGE',self.languages[self.cyLanguage.getValueIndex()]) + ENDIF + + IF self.boolCreditByKb.getValue() THEN writeToolType(self.acpName,'CREDIT_BY_KBYTES') ELSE deleteToolType(self.acpName,'CREDIT_BY_KBYTES') + IF self.boolLongWho.getValue() THEN writeToolType(self.acpName,'LONG_WHO') ELSE deleteToolType(self.acpName,'LONG_WHO') + IF self.boolConvertToMb.getValue() THEN writeToolType(self.bbsConfigName,'CONVERT_TO_MB') ELSE deleteToolType(self.bbsConfigName,'CONVERT_TO_MB') + IF self.boolTimeoutLc.getValueIndex() THEN deleteToolType(self.bbsConfigName,'TIMEOUT_LC') ELSE writeToolType(self.bbsConfigName,'TIMEOUT_LC') + IF self.boolQuietJoin.getValue() THEN writeToolType(self.bbsConfigName,'QUIET_JOIN') ELSE deleteToolType(self.bbsConfigName,'QUIET_JOIN') + IF self.boolRelativeConfs.getValue() THEN writeToolType(self.bbsConfigName,'RELATIVE_CONFERENCES') ELSE deleteToolType(self.bbsConfigName,'RELATIVE_CONFERENCES') + + writeToolType(self.bbsConfigName,'SMTP_HOST',self.strSmtpHost.getValue()) + writeToolType(self.bbsConfigName,'SMTP_PORT',self.intSmtpPort.getValue()) + writeToolType(self.bbsConfigName,'SMTP_USERNAME',self.strSmtpUsername.getValue()) + writeToolType(self.bbsConfigName,'SMTP_PASSWORD',self.strSmtpPassword.getValue()) + IF self.boolSmtpSSL.getValue() THEN writeToolType(self.bbsConfigName,'SMTP_SSL') ELSE deleteToolType(self.bbsConfigName,'SMTP_SSL') + writeToolType(self.bbsConfigName,'SYSOP_EMAIL',self.strSysopEmail.getValue()) + writeToolType(self.bbsConfigName,'BBS_EMAIL',self.strBbsEmail.getValue()) + IF self.boolMailOnPage.getValue() THEN writeToolType(self.bbsConfigName,'MAIL_ON_SYSOP_PAGE') ELSE deleteToolType(self.bbsConfigName,'MAIL_ON_SYSOP_PAGE') + IF self.boolMailOnComment.getValue() THEN writeToolType(self.bbsConfigName,'MAIL_ON_SYSOP_COMMENT') ELSE deleteToolType(self.bbsConfigName,'MAIL_ON_SYSOP_COMMENT') + IF self.boolMailOnLogon.getValue() THEN writeToolType(self.bbsConfigName,'MAIL_ON_LOGON') ELSE deleteToolType(self.bbsConfigName,'MAIL_ON_LOGON') + IF self.boolMailOnLogoff.getValue() THEN writeToolType(self.bbsConfigName,'MAIL_ON_LOGOFF') ELSE deleteToolType(self.bbsConfigName,'MAIL_ON_LOGOFF') + IF self.boolMailOnNewUser.getValue() THEN writeToolType(self.bbsConfigName,'MAIL_ON_NEW_USER') ELSE deleteToolType(self.bbsConfigName,'MAIL_ON_NEW_USER') + IF self.boolMailOnUpload.getValue() THEN writeToolType(self.bbsConfigName,'MAIL_ON_UPLOAD') ELSE deleteToolType(self.bbsConfigName,'MAIL_ON_UPLOAD') + IF self.boolMailOnPwdFail.getValue() THEN writeToolType(self.bbsConfigName,'MAIL_ON_PWD_FAIL') ELSE deleteToolType(self.bbsConfigName,'MAIL_ON_PWD_FAIL') + + writeToolType(self.bbsConfigName,'LANGUAGE_BASE',self.paLanguageBase.getValue()) + writeToolType(self.bbsConfigName,'HISTORY',self.paHistory.getValue()) + writeToolType(self.bbsConfigName,'USERNOTES',self.paUserNotes.getValue()) + writeToolType(self.bbsConfigName,'HOLD_ACCESS_LEVEL',self.intHoldAccess.getValue()) + writeToolType(self.bbsConfigName,'FILEDIZ_SYSCMD',self.strFileDizSysCmd.getValue()) + writeToolType(self.bbsConfigName,'FTPHOST',self.strFtpHost.getValue()) + writeToolType(self.bbsConfigName,'FTPPORT',self.strFtpPort.getValue()) + writeToolType(self.bbsConfigName,'FTPDATAPORT',self.strFtpDataPort.getValue()) + writeToolType(self.bbsConfigName,'HTTPPORT',self.strHttpPort.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ON_NEW_USER',self.strExecOnNewUser.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_NEW_USER',self.strExecAOnNewUser.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ON_SYSOP_PAGE',self.strExecOnPage.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_SYSOP_PAGE',self.strExecAOnPage.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ON_CONNECT',self.strExecOnConnect.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ON_CONNECT_ASYNC',self.strExecAOnConnect.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ON_LOGON',self.strExecOnLogon.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_LOGON',self.strExecAOnLogon.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ON_LOGOFF',self.strExecOnLogoff.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_LOGOFF',self.strExecAOnLogoff.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ON_SYSOP_COMMENT',self.strExecOnComment.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_SYSOP_COMMENT',self.strExecAOnComment.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ON_UPLOAD',self.strExecOnUpload.getValue()) + writeToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_UPLOAD',self.strExecAOnUpload.getValue()) + saveCachedChanges() + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC saveServerChanges() OF frmSettingsEdit + DEF tempStr[255]:STRING + DEF i + DEF control:PTR TO control + DEF toolName[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + writeToolType(self.acpName,'BBS_STACK',self.intStack.getValue()) + writeToolType(self.acpName,'PRIORITY',self.intPriority.getValue()) + IF self.boolIconified.getValue() THEN writeToolType(self.acpName,'ICONIFIED') ELSE deleteToolType(self.acpName,'ICONIFIED') + writeToolType(self.acpName,'ICONIFY.LEFTEDGE',self.intIconifyLeft.getValue()) + writeToolType(self.acpName,'ICONIFY.TOPEDGE',self.intIconifyTop.getValue()) + IF self.boolDoNotMove.getValue() THEN writeToolType(self.acpName,'SHORT_DONOTMOVE') ELSE deleteToolType(self.acpName,'SHORT_DONOTMOVE') + IF self.boolMulticom.getValue() THEN writeToolType(self.acpName,'MULTICOM_PORT') ELSE deleteToolType(self.acpName,'MULTICOM_PORT') + IF self.boolAEShell.getValue() THEN writeToolType(self.acpName,'AESHELL') ELSE deleteToolType(self.acpName,'AESHELL') + IF self.boolNoCx.getValue() THEN writeToolType(self.acpName,'NO_CX') ELSE deleteToolType(self.acpName,'NO_CX') + IF self.boolNoSaveState.getValue() THEN writeToolType(self.acpName,'NO_SAVESTATE') ELSE deleteToolType(self.acpName,'NO_SAVESTATE') + writeToolType(self.acpName,'TELNETPORT',self.intTelnetPort.getValue()) + writeToolType(self.acpName,'FTPPORT',self.intFtpPort.getValue()) + + writeToolType(self.acpName,'ACPFONT',self.strAcpFont.getValue()) + writeToolType(self.acpName,'EXECUTE_ON_STARTUP_COMPLETE',self.strExecOnStart.getValue()) + writeToolType(self.acpName,'DOSCHECKTIME',self.intDosCheckTime.getValue()) + writeToolType(self.acpName,'DOSBANTIME',self.intDosBanTime.getValue()) + writeToolType(self.acpName,'DOSCHECKTRIGGER',self.intDosCheckTrig.getValue()) + + FOR i:=0 TO self.nodeCount-1 + control:=self.nodeLocs.item(i) + StringF(toolName,'NODE\d_LOCATION',i) + writeToolType(self.acpName,toolName,control.getValue()) + + control:=self.nodeNames.item(i) + StringF(toolName,'NODE\d_NAME',i) + writeToolType(self.acpName,toolName,control.getValue()) + + control:=self.nodeSysops.item(i) + StringF(toolName,'NODE\d_SYSOP',i) + writeToolType(self.acpName,toolName,control.getValue()) + ENDFOR + + FOR i:=0 TO 14 + control:=self.buttonNames.item(i) + StringF(toolName,'BUTTON_NAME.\d',i) + writeToolType(self.acpName,toolName,control.getValue()) + + control:=self.buttonCommands.item(i) + StringF(toolName,'BUTTON_COMMAND.\d',i) + writeToolType(self.acpName,toolName,control.getValue()) + + control:=self.nuttonNames.item(i) + StringF(toolName,'NUTTON_NAME.\d',i) + writeToolType(self.acpName,toolName,control.getValue()) + + control:=self.nuttonCommands.item(i) + StringF(toolName,'NUTTON_COMMAND.\d',i) + writeToolType(self.acpName,toolName,control.getValue()) + ENDFOR + saveCachedChanges() + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC saveZoomChanges() OF frmSettingsEdit + DEF tempStr[255]:STRING + DEF zoomToolType[255]:STRING + + MOVE.L (A1),self + GetA4() + + self.sleep() + + StrCopy(zoomToolType,self.zoomDirPath) + AddPart(zoomToolType,'qwkcfg',255) + writeToolType(zoomToolType,'BBS.NUMBER',self.strBbsNumber.getValue()) + writeToolType(zoomToolType,'BBS.ADDRESS',self.strBbsAddress.getValue()) + writeToolType(zoomToolType,'BBS.ID',self.strBbsId.getValue()) + + StrCopy(zoomToolType,self.zoomDirPath) + AddPart(zoomToolType,'qwkpack',255) + writeToolType(zoomToolType,'ZIP',self.strQwkZip.getValue()) + writeToolType(zoomToolType,'LHA',self.strQwkLha.getValue()) + + StrCopy(zoomToolType,self.zoomDirPath) + AddPart(zoomToolType,'ascpack',255) + writeToolType(zoomToolType,'ZIP',self.strAscZip.getValue()) + writeToolType(zoomToolType,'LHA',self.strAscLha.getValue()) + saveCachedChanges() + + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + self.changed:=FALSE + self.wake() +ENDPROC + +PROC formShow() OF frmSettingsEdit + MOVE.L (A1),self + GetA4() + Mui_RequestA(0,self.winMain,0,'Information','*OK','For the initial setup please fill in the mandatory fields on this page.',0) +ENDPROC + +PROC editSystemSettings(acpName:PTR TO CHAR, initialSetup=FALSE) OF frmSettingsEdit + DEF loop,val,count,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF bbsPath[200]:STRING + DEF languagesTooltype[255]:STRING + DEF languages:PTR TO stringlist + + DEF saveHook:PTR TO hook + DEF formShowHook:PTR TO hook + DEF closeHook:PTR TO hook + + NEW saveHook + installhook( saveHook, {saveSystemChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + IF initialSetup + NEW formShowHook + installhook( formShowHook, {formShow}) + self.showHook:=formShowHook + ENDIF + + + self.acpName:=acpName + self.bbsConfigName:=String(255) + + readToolType(self.acpName,'BBS_LOCATION',bbsPath) + StringF(self.bbsConfigName,'\sBBSCONFIG',bbsPath) + + StringF(languagesTooltype,'\sLanguages',bbsPath) + NEW languages.stringlist(20) + + loop:=TRUE + count:=0 + WHILE (loop) + StringF(temppath,'LANGUAGE.\d',count+1) + readToolType(languagesTooltype,temppath,tempstr) + IF StrLen(tempstr)>0 + languages.add(tempstr) + count++ + ELSE + loop:=FALSE + ENDIF + ENDWHILE + + self.languages:=List(count+1) + FOR count:=0 TO languages.count()-1 DO ListAddItem(self.languages,languages.item(count)) + ListAddItem(self.languages,0) + + self.languagesConfigName:=languagesTooltype + + installhook( self.setChangedHook, {setChangedFlag}) + self.addSystemControls() + self.addNotifications() + + set( self.winMain, MUIA_Window_Title,'Edit System Settings') + set( self.winMain, MUIA_Window_ID, "FSYS") + + readToolType(self.acpName,'BBS_NAME',tempstr) + self.strBBSName.setValue(tempstr) + + readToolType(self.acpName,'BBS_LOCATION',tempstr) + self.paBBSPath.setValue(tempstr) + + readToolType(self.acpName,'BBS_GEOGRAPHIC',tempstr) + self.strBBSLocation.setValue(tempstr) + + readToolType(self.acpName,'SYSOP_NAME',tempstr) + self.strSysopName.setValue(tempstr) + + val:=readToolTypeInt(self.bbsConfigName,'MIN_PASSWORD_LENGTH') + self.intMinPasswordLen.setValue(val) + + val:=readToolTypeInt(self.bbsConfigName,'MIN_PASSWORD_STRENGTH') + IF val<1 THEN val:=1 + self.cycMinPasswordStrength.setValueIndex(val-1) + + readToolType(self.bbsConfigName,'PASSWORD_SECURITY',tempstr) + IF StriCmp(tempstr,'LEGACY') + self.cycPasswordEncryption.setValueIndex(0) + ELSEIF StriCmp(tempstr,'PBKDF2_5') + self.cycPasswordEncryption.setValueIndex(1) + ELSEIF StriCmp(tempstr,'PBKDF2_50') + self.cycPasswordEncryption.setValueIndex(2) + ELSEIF StriCmp(tempstr,'PBKDF2_100') + self.cycPasswordEncryption.setValueIndex(3) + ELSEIF StriCmp(tempstr,'PBKDF2_1000') + self.cycPasswordEncryption.setValueIndex(4) + ELSEIF StriCmp(tempstr,'PBKDF2_10000') + self.cycPasswordEncryption.setValueIndex(5) + ELSE + self.cycPasswordEncryption.setValueIndex(0) + ENDIF + + val:=readToolTypeInt(self.bbsConfigName,'MAX_PASSWORD_FAILS') + self.intMaxPasswordFails.setValue(val) + + val:=readToolTypeInt(self.bbsConfigName,'PASSWORD_EXPIRY_DAYS') + self.intPasswordExpiry.setValue(val) + + self.cycStrictPasswordPolicy.setValueIndex(IF checkToolTypeExists(self.bbsConfigName,'STRICT_PASSWORD_POLICY') THEN 1 ELSE 0) + + readToolType(self.acpName,'NEW_ACCOUNTS',tempstr) + self.cyNewAccounts.setValueIndex(IF StriCmp(tempstr,'APPEND') THEN 0 ELSE 1) + + readToolType(self.bbsConfigName,'REGKEY',tempstr) + self.strRegKey.setValue(tempstr) + + readToolType(self.bbsConfigName,'DEFAULT_MENUNAME',tempstr) + self.strDefaultMenu.setValue(tempstr) + + readToolType(self.bbsConfigName,'LOCAL_UPLOAD_PATH',tempstr) + self.paLocalULPath.setValue(tempstr) + + val:=readToolTypeInt(self.bbsConfigName,'AUTOVAL_PRESET') + self.intAutoValPreset.setValue(val) + + val:=readToolTypeInt(self.bbsConfigName,'AUTOVAL_DELAY') + self.intAutoValDelay.setValue(val) + + readToolType(self.acpName,'AUTOVAL_PASSWORD',tempstr) + self.strAutoValPassword.setValue(tempstr) + + IF languages.count() + readToolType(languagesTooltype,'HOSTLANGUAGE',tempstr) + FOR count:=0 TO languages.count()-1 + IF StriCmp(languages.item(count),tempstr) THEN self.cyLanguage.setValueIndex(count) + ENDFOR + ENDIF + + self.boolCreditByKb.setValue(IF checkToolTypeExists(self.acpName,'CREDIT_BY_KBYTES') THEN MUI_TRUE ELSE FALSE) + self.boolLongWho.setValue(IF checkToolTypeExists(self.acpName,'LONG_WHO') THEN MUI_TRUE ELSE FALSE) + self.boolConvertToMb.setValue(IF checkToolTypeExists(self.bbsConfigName,'CONVERT_TO_MB') THEN MUI_TRUE ELSE FALSE) + self.boolTimeoutLc.setValueIndex(IF checkToolTypeExists(self.bbsConfigName,'TIMEOUT_LC') THEN 0 ELSE 1) + self.boolQuietJoin.setValue(IF checkToolTypeExists(self.bbsConfigName,'QUIET_JOIN') THEN MUI_TRUE ELSE FALSE) + self.boolRelativeConfs.setValue(IF checkToolTypeExists(self.bbsConfigName,'RELATIVE_CONFERENCES') THEN MUI_TRUE ELSE FALSE) + + readToolType(self.bbsConfigName,'SMTP_HOST',tempstr) + self.strSmtpHost.setValue(tempstr) + val:=readToolTypeInt(self.bbsConfigName,'SMTP_PORT') + self.intSmtpPort.setValue(val) + readToolType(self.bbsConfigName,'SMTP_USERNAME',tempstr) + self.strSmtpUsername.setValue(tempstr) + readToolType(self.bbsConfigName,'SMTP_PASSWORD',tempstr) + self.strSmtpPassword.setValue(tempstr) + self.boolSmtpSSL.setValue(IF checkToolTypeExists(self.bbsConfigName,'SMTP_SSL') THEN MUI_TRUE ELSE FALSE) + readToolType(self.bbsConfigName,'SYSOP_EMAIL',tempstr) + self.strSysopEmail.setValue(tempstr) + readToolType(self.bbsConfigName,'BBS_EMAIL',tempstr) + self.strBbsEmail.setValue(tempstr) + self.boolMailOnPage.setValue(IF checkToolTypeExists(self.bbsConfigName,'MAIL_ON_SYSOP_PAGE') THEN MUI_TRUE ELSE FALSE) + self.boolMailOnComment.setValue(IF checkToolTypeExists(self.bbsConfigName,'MAIL_ON_SYSOP_COMMENT') THEN MUI_TRUE ELSE FALSE) + self.boolMailOnLogon.setValue(IF checkToolTypeExists(self.bbsConfigName,'MAIL_ON_LOGON') THEN MUI_TRUE ELSE FALSE) + self.boolMailOnLogoff.setValue(IF checkToolTypeExists(self.bbsConfigName,'MAIL_ON_LOGOFF') THEN MUI_TRUE ELSE FALSE) + self.boolMailOnNewUser.setValue(IF checkToolTypeExists(self.bbsConfigName,'MAIL_ON_NEW_USER') THEN MUI_TRUE ELSE FALSE) + self.boolMailOnUpload.setValue(IF checkToolTypeExists(self.bbsConfigName,'MAIL_ON_UPLOAD') THEN MUI_TRUE ELSE FALSE) + self.boolMailOnPwdFail.setValue(IF checkToolTypeExists(self.bbsConfigName,'MAIL_ON_PWD_FAIL') THEN MUI_TRUE ELSE FALSE) + readToolType(self.bbsConfigName,'LANGUAGE_BASE',tempstr) + self.paLanguageBase.setValue(tempstr) + readToolType(self.bbsConfigName,'HISTORY',tempstr) + self.paHistory.setValue(tempstr) + readToolType(self.bbsConfigName,'USERNOTES',tempstr) + self.paUserNotes.setValue(tempstr) + val:=readToolTypeInt(self.bbsConfigName,'HOLD_ACCESS_LEVEL') + self.intHoldAccess.setValue(val) + readToolType(self.bbsConfigName,'FILEDIZ_SYSCMD',tempstr) + self.strFileDizSysCmd.setValue(tempstr) + readToolType(self.bbsConfigName,'FTPHOST',tempstr) + self.strFtpHost.setValue(tempstr) + readToolType(self.bbsConfigName,'FTPPORT',tempstr) + self.strFtpPort.setValue(tempstr) + readToolType(self.bbsConfigName,'FTPDATAPORT',tempstr) + self.strFtpDataPort.setValue(tempstr) + readToolType(self.bbsConfigName,'HTTPPORT',tempstr) + self.strHttpPort.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ON_NEW_USER',tempstr) + self.strExecOnNewUser.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_NEW_USER',tempstr) + self.strExecAOnNewUser.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ON_SYSOP_PAGE',tempstr) + self.strExecOnPage.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_SYSOP_PAGE',tempstr) + self.strExecAOnPage.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ON_CONNECT',tempstr) + self.strExecOnConnect.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ON_CONNECT_ASYNC',tempstr) + self.strExecAOnConnect.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ON_LOGON',tempstr) + self.strExecOnLogon.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_LOGON',tempstr) + self.strExecAOnLogon.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ON_LOGOFF',tempstr) + self.strExecOnLogoff.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_LOGOFF',tempstr) + self.strExecAOnLogoff.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ON_SYSOP_COMMENT',tempstr) + self.strExecOnComment.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_SYSOP_COMMENT',tempstr) + self.strExecAOnComment.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ON_UPLOAD',tempstr) + self.strExecOnUpload.setValue(tempstr) + readToolType(self.bbsConfigName,'EXECUTE_ASYNC_ON_UPLOAD',tempstr) + self.strExecAOnUpload.setValue(tempstr) + + self.changed:=FALSE + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + self.showModal() + + self.removeNotifications() + self.removeSystemControls() + END saveHook + END closeHook + END languages + IF initialSetup THEN END formShowHook + DisposeLink(self.languages) + DisposeLink(self.bbsConfigName) +ENDPROC + +PROC editServerSettings(acpName:PTR TO CHAR) OF frmSettingsEdit + DEF count,val,i,entry,temppath[255]:STRING,tempstr[255]:STRING + DEF control:PTR TO control + DEF toolName[255]:STRING + + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + + NEW saveHook + installhook( saveHook, {saveServerChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.acpName:=acpName + self.nodeCount:=readToolTypeInt(self.acpName,'NODES') + + installhook( self.setChangedHook, {setChangedFlag}) + self.addServerControls() + self.addNotifications() + + set( self.winMain, MUIA_Window_Title,'Edit Server Settings') + set( self.winMain, MUIA_Window_ID, "FSER") + + val:=readToolTypeInt(self.acpName,'BBS_STACK') + self.intStack.setValue(val) + + val:=readToolTypeInt(self.acpName,'PRIORITY') + self.intPriority.setValue(val) + + self.boolIconified.setValue(IF checkToolTypeExists(self.acpName,'ICONIFIED') THEN MUI_TRUE ELSE FALSE) + + val:=readToolTypeInt(self.acpName,'ICONIFY.LEFTEDGE') + self.intIconifyLeft.setValue(val) + + val:=readToolTypeInt(self.acpName,'ICONIFY.TOPEDGE') + self.intIconifyTop.setValue(val) + + self.boolDoNotMove.setValue(IF checkToolTypeExists(self.acpName,'SHORT_DONOTMOVE') THEN MUI_TRUE ELSE FALSE) + self.boolMulticom.setValue(IF checkToolTypeExists(self.acpName,'MULTICOM_PORT') THEN MUI_TRUE ELSE FALSE) + + self.boolAEShell.setValue(IF checkToolTypeExists(self.acpName,'AESHELL') THEN MUI_TRUE ELSE FALSE) + self.boolNoCx.setValue(IF checkToolTypeExists(self.acpName,'NO_CX') THEN MUI_TRUE ELSE FALSE) + self.boolNoSaveState.setValue(IF checkToolTypeExists(self.acpName,'NO_SAVESTATE') THEN MUI_TRUE ELSE FALSE) + + val:=readToolTypeInt(self.acpName,'TELNETPORT') + self.intTelnetPort.setValue(val) + + val:=readToolTypeInt(self.acpName,'FTPPORT') + self.intFtpPort.setValue(val) + + readToolType(self.acpName,'ACPFONT',tempstr) + self.strAcpFont.setValue(tempstr) + + readToolType(self.acpName,'EXECUTE_ON_STARTUP_COMPLETE',tempstr) + self.strExecOnStart.setValue(tempstr) + + val:=readToolTypeInt(self.acpName,'DOSCHECKTIME') + self.intDosCheckTime.setValue(val) + + val:=readToolTypeInt(self.acpName,'DOSBANTIME') + self.intDosBanTime.setValue(val) + + + val:=readToolTypeInt(self.acpName,'DOSCHECKTRIGGER') + self.intDosCheckTrig.setValue(val) + + FOR i:=0 TO self.nodeCount-1 + control:=self.nodeLocs.item(i) + StringF(toolName,'NODE\d_LOCATION',i) + readToolType(self.acpName,toolName,tempstr) + control.setValue(tempstr) + + control:=self.nodeNames.item(i) + StringF(toolName,'NODE\d_NAME',i) + readToolType(self.acpName,toolName,tempstr) + control.setValue(tempstr) + + control:=self.nodeSysops.item(i) + StringF(toolName,'NODE\d_SYSOP',i) + readToolType(self.acpName,toolName,tempstr) + control.setValue(tempstr) + ENDFOR + + FOR i:=0 TO 14 + control:=self.buttonNames.item(i) + StringF(toolName,'BUTTON_NAME.\d',i) + readToolType(self.acpName,toolName,tempstr) + control.setValue(tempstr) + + control:=self.buttonCommands.item(i) + StringF(toolName,'BUTTON_COMMAND.\d',i) + readToolType(self.acpName,toolName,tempstr) + control.setValue(tempstr) + + control:=self.nuttonNames.item(i) + StringF(toolName,'NUTTON_NAME.\d',i) + readToolType(self.acpName,toolName,tempstr) + control.setValue(tempstr) + + control:=self.nuttonCommands.item(i) + StringF(toolName,'NUTTON_COMMAND.\d',i) + readToolType(self.acpName,toolName,tempstr) + control.setValue(tempstr) + ENDFOR + + self.changed:=FALSE + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + self.showModal() + self.removeNotifications() + self.removeServerControls() + END saveHook + END closeHook +ENDPROC + +PROC editZoomSettings(acpName:PTR TO CHAR) OF frmSettingsEdit + DEF count,val,i,entry,temppath[255]:STRING,tempStr[255]:STRING + DEF zoomToolType[255]:STRING + + DEF saveHook:PTR TO hook + DEF closeHook:PTR TO hook + + NEW saveHook + installhook( saveHook, {saveZoomChanges}) + self.saveHook:=saveHook + NEW closeHook + installhook( closeHook, {canClose}) + self.closeHook:=closeHook + + self.acpName:=acpName + self.zoomDirPath:=String(255) + + installhook( self.setChangedHook, {setChangedFlag}) + self.addZoomControls() + self.addNotifications() + + set( self.winMain, MUIA_Window_Title,'Edit Zoom Settings') + set( self.winMain, MUIA_Window_ID, "FZOM") + + readToolType(self.acpName,'BBS_LOCATION',self.zoomDirPath) + AddPart(self.zoomDirPath,'Zoom',255) + SetStr(self.zoomDirPath) + + StrCopy(zoomToolType,self.zoomDirPath) + AddPart(zoomToolType,'qwkcfg',255) + readToolType(zoomToolType,'BBS.NUMBER',tempStr) + self.strBbsNumber.setValue(tempStr) + + readToolType(zoomToolType,'BBS.ADDRESS',tempStr) + self.strBbsAddress.setValue(tempStr) + readToolType(zoomToolType,'BBS.ID',tempStr) + self.strBbsId.setValue(tempStr) + + StrCopy(zoomToolType,self.zoomDirPath) + AddPart(zoomToolType,'qwkpack',255) + readToolType(zoomToolType,'ZIP',tempStr) + self.strQwkZip.setValue(tempStr) + readToolType(zoomToolType,'LHA',tempStr) + self.strQwkLha.setValue(tempStr) + + StrCopy(zoomToolType,self.zoomDirPath) + AddPart(zoomToolType,'ascpack',255) + readToolType(zoomToolType,'ZIP',tempStr) + self.strAscZip.setValue(tempStr) + readToolType(zoomToolType,'LHA',tempStr) + self.strAscLha.setValue(tempStr) + + self.changed:=FALSE + set( self.btnSave,MUIA_Disabled,MUI_TRUE) + + self.showModal() + self.removeNotifications() + self.removeZoomControls() + END saveHook + END closeHook + DisposeLink(self.zoomDirPath) +ENDPROC diff --git a/axSetupTool/frmTools.e b/axSetupTool/frmTools.e new file mode 100644 index 0000000..778f87b --- /dev/null +++ b/axSetupTool/frmTools.e @@ -0,0 +1,201 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'muimaster' , 'libraries/mui','exec/ports','exec/nodes','amigalib/ports' +MODULE 'tools/boopsi','workbench/workbench','icon','intuition/classusr' +MODULE 'utility/tagitem','utility/hooks','tools/installhook','exec/lists' +MODULE '*axedit','*frmBase','*tooltypes' + +EXPORT OBJECT acpMessage + msg: mn ->length 20 + user[50]:ARRAY OF CHAR + location[50]:ARRAY OF CHAR + action[50]:ARRAY OF CHAR + baud[10]:ARRAY OF CHAR + data:LONG + command:LONG + node:LONG + lineNum:LONG + myCmds:LONG + sopt:LONG +ENDOBJECT ->LENGTH 204 + +CONST SV_ACPSHUTDOWN=202 + +EXPORT OBJECT frmTools OF frmBase + btnShutdown : PTR TO LONG + btnStart : PTR TO LONG + btnRestart : PTR TO LONG + btnClose : PTR TO LONG + + acpConfigName : PTR TO CHAR + configOk : LONG + + btnShutdownClick: hook + btnStartupClick: hook + btnRestartClick: hook +ENDOBJECT + +PROC create(app:PTR TO app_obj) OF frmTools + DEF group + SUPER self.create(app) + self.winMain:=app.winTools + + self.btnShutdown:=app.btnShutdown + self.btnStart:=app.btnStart + self.btnRestart:=app.btnRestart + self.btnClose:=app.btnClose +ENDPROC + +PROC acpShutdown() OF frmTools + DEF port,serverRP,retry + DEF masterMsg:acpMessage + + serverRP:=createPort(0,0) + masterMsg.node:=0 + masterMsg.command:=SV_ACPSHUTDOWN + masterMsg.msg.ln.type:=NT_MESSAGE + masterMsg.msg.length:=SIZEOF acpMessage + masterMsg.msg.replyport:=serverRP + + IF(port:=FindPort('AE.Master')) + PutMsg(port,masterMsg) + WaitPort(serverRP) + GetMsg(serverRP) + ENDIF + + retry:=0 + WHILE (retry<20) AND (FindPort('AE.Master')) + Delay(30) + retry++ + ENDWHILE + IF FindPort('AE.Master') + Mui_RequestA(0,self.winMain,0,'Error' ,'*Ok','ACP did not shutdown in a timely manner.',0) + ELSE + clearChangeFlag() + ENDIF + + self.refreshAcpStatus() +ENDPROC + +PROC acpStartup() OF frmTools + DEF retry + DEF execStr[255]:STRING + + IF FindPort('AE.Master')=0 + StringF(execStr,'run >NIL: \s',self.acpConfigName) + Execute(execStr,0,0) + retry:=0 + WHILE (retry<20) AND (FindPort('AE.Master')=0) + Delay(30) + retry++ + ENDWHILE + IF FindPort('AE.Master')=0 THEN Mui_RequestA(0,self.winMain,0,'Error' ,'*Ok','ACP did not startup in a timely manner.',0) + self.refreshAcpStatus() + ENDIF +ENDPROC + +PROC doAcpStart() OF frmTools + MOVE.L (A1),self + GetA4() + + self.acpStartup() +ENDPROC + +PROC doAcpShutdown() OF frmTools + MOVE.L (A1),self + GetA4() + + self.acpShutdown() +ENDPROC + +PROC doAcpRestart() OF frmTools + MOVE.L (A1),self + GetA4() + self.acpShutdown() + self.acpStartup() +ENDPROC + +PROC refreshAcpStatus() OF frmTools + DEF tempStr[20]:STRING + IF(FindPort('AE.Master')) + StrCopy(tempStr,'Running') + set( self.btnRestart,MUIA_Disabled,FALSE) + set( self.btnStart,MUIA_Disabled,MUI_TRUE) + set( self.btnShutdown,MUIA_Disabled,FALSE) + ELSE + StrCopy(tempStr,'Not Running') + set( self.btnRestart,MUIA_Disabled,MUI_TRUE) + set( self.btnStart,MUIA_Disabled,FALSE) + set( self.btnShutdown,MUIA_Disabled,MUI_TRUE) + ENDIF + IF self.configOk=FALSE + set( self.btnRestart,MUIA_Disabled,MUI_TRUE) + set( self.btnStart,MUIA_Disabled,MUI_TRUE) + set( self.btnShutdown,MUIA_Disabled,MUI_TRUE) + ENDIF + set(self.app.txtAcpStatus, MUIA_Text_Contents,tempStr) +ENDPROC + +PROC addNotifications() OF frmTools + DEF i + self.setupButtonClick(self.btnShutdown,self.btnShutdownClick,{doAcpShutdown}) + self.setupButtonClick(self.btnStart,self.btnStartupClick,{doAcpStart}) + self.setupButtonClick(self.btnRestart,self.btnRestartClick,{doAcpRestart}) + + domethod( self.btnClose , [ + MUIM_Notify , MUIA_Pressed , FALSE , + self.app.app, + 2 , + MUIM_Application_ReturnID , MUIA_Window_CloseRequest ] ) + +ENDPROC + +PROC removeNotifications() OF frmTools + DEF i + domethod(self.btnShutdown,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnStart,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnRestart,[MUIM_KillNotify,MUIA_Pressed]) + domethod(self.btnClose,[MUIM_KillNotify,MUIA_Pressed]) +ENDPROC + +PROC tools(acpConfigName:PTR TO CHAR) OF frmTools + DEF nodeCount,confCount,i + DEF bbsPath[255]:STRING + DEF confConfig[255]:STRING + DEF tempStr[255]:STRING + + self.acpConfigName:=acpConfigName + + nodeCount:=readToolTypeInt(acpConfigName,'NODES') + StringF(tempStr,'\d',nodeCount) + set(self.app.txtNodeCount, MUIA_Text_Contents,tempStr) + + self.configOk:=TRUE + + readToolType(acpConfigName,'BBS_LOCATION',bbsPath) + IF StrLen(bbsPath)=0 THEN self.configOk:=FALSE + + StringF(confConfig,'\sCONFCONFIG',bbsPath) + confCount:=readToolTypeInt(confConfig,'NCONFS') + StringF(tempStr,'\d',confCount) + set(self.app.txtConfCount, MUIA_Text_Contents,tempStr) + + IF (nodeCount<0) OR (confCount<0) THEN self.configOk:=FALSE + + readToolType(acpConfigName,'SYSOP_NAME',tempStr) + IF StrLen(tempStr)=0 THEN self.configOk:=FALSE + + readToolType(acpConfigName,'BBS_NAME',tempStr) + IF StrLen(tempStr)=0 THEN self.configOk:=FALSE + + readToolType(acpConfigName,'BBS_GEOGRAPHIC',tempStr) + IF StrLen(tempStr)=0 THEN self.configOk:=FALSE + self.addNotifications() + + self.refreshAcpStatus() + self.showModal() + + self.removeNotifications() + +ENDPROC diff --git a/axSetupTool/helpText.e b/axSetupTool/helpText.e new file mode 100644 index 0000000..6676a0b --- /dev/null +++ b/axSetupTool/helpText.e @@ -0,0 +1,459 @@ +->help text definitions +OPT MODULE + +EXPORT ENUM ACCESS_NAME_MAX_PAGES,ACCESS_NAME,ACCESS_AREA_NAME,CHECKER_FILE,CHECKER_ERROR,CHECKER_OPTIONS, + CHECKER_PRIORITY,CHECKER_STACK,HYDRA_RX_WINDOW,HYDRA_TX_WINDOW,COMMAND_ACCESS, + COMMAND_PRIORITY,COMMAND_STACK,FTP_DIR_DAYS,NODE_PRIORITY,NODE_AUTO_VAL_PRESET, + NODE_AUTO_VAL_DELAY,NODE_FTP_PORT,NODE_FTP_DATA_PORT,NODE_HTTP_PORT,NODE_MAX_MSG_QUEUE,NODE_RING_COUNT, + NODE_SYSOP_CHAT_COLOUR,NODE_USER_CHAT_COLOUR,NODE_OVERRIDE_TIMEOUT,NODE_BG_FILECHECK_STACK, + NODE_SERIAL_CACHE_SIZE,NODE_SERIAL_DEV_UNIT,NODE_SERIAL_BAUD,NODE_WIN_LEFT,NODE_WIN_TOP,NODE_WIN_WIDTH,NODE_WIN_HEIGHT, + PRESET_ACCESS_LEVEL,PRESET_CONF_RJOIN,PRESET_MESSAGEBASE_RJOIN,PRESET_DAILY_BYTES,PRESET_RATIO_TYPE,PRESET_RATIO, + PRESET_TIME_LIMIT,SYS_AUTO_VAL_PRESET,SYS_AUTO_VAL_DELAY,SYS_SMTP_PORT,SYS_HOLD_ACCESS_LEVEL, + SYS_STACK,SYS_PRIORITY,SYS_ICONIFY_LEFT,SYS_ICONIFY_TOP,SYS_TELNET_PORT,SYS_FTP_PORT, + SYS_DOS_CHECK_TIME,SYS_DOS_BAN_TIME,SYS_DOS_CHECK_TRIGGER,COMMAND_PASS_PARAMS,COMMAND_TYPE, + NODE_KEEP_UL_CREDIT,NODE_WIN_COLOURS,PRESET_AREA_NAME,SYS_LANGUAGE,SYS_NEW_ACCOUNTS, + SYS_TIMEOUT_LC,HTTP_TEMPDIR,MSGBASE_LOCATION,CONF_PATH,CONF_LOCAL_UPLOAD_PATH,NODE_SCREENS_PATH, + NODE_PLAYPEN_PATH,NODE_LOCAL_UPLOAD_PATH,SYS_LOCAL_UPLOAD_PATH,SYS_LANG_BASE_PATH,SYS_HISTORY_PATH, + SYS_USER_NOTES_PATH,SYS_BBS_PATH,NODE_USER_DATA_FILE,NODE_USER_MISC_FILE,NODE_USER_KEYS_FILE, + NODE_NOT_ALLOWED_FILE,NODE_DISPLAY_ID,ACCESS_AREA_NAME,FTP_AUTH,COMMAND_RESIDENT, + COMMAND_QUICK_MODE,COMMAND_TRAP_ON,COMMAND_EXPERT_MODE,COMMAND_SILENT,COMMAND_LOG_INPUTS, + COMMAND_SCRIPT_CHECK,MSGBASE_SEND_EXTERNAL,MSGBASE_USES_USERNAMES,MSGBASE_USES_REALNAMES, + MSGBASE_USES_INETNAMES,CONF_FREE_DL,CONF_FORCE_MSCAN,CONF_USE_USERNAMES,CONF_USE_INETNAMES, + CONF_CUSTOM_MAIL,CONF_NEVER_MSCAN,CONF_DEFAULT_NEW_MSCAN,CONF_DEFAULT_NEW_FSCAN,CONF_DEFAULT_ZOOM, + CONF_USE_REALNAMES,CONF_ALWAYS_NEW_FILES,CONF_NEVER_NEW_FILES,CONF_FTP_UL_DISABLE,CONF_FTP_NO_DIRLIST, + NODE_CALLERSLOG,NODE_CAPS_FILENAMES,NODE_DEF_SCREENS,NODE_DEBUG_LOGS,NODE_DOOR_LOGS,NODE_STARTUP_LOGS, + NODE_UD_LOGS,NO_CHAT_ON,NODE_NO_QUICK_LOGON,NODE_IDLE,NODE_MSCAN_PROMPT,NODE_NO_TIMEOUT,NODE_QUIET, + NODE_STEALTH,NODE_SHOW_PWFAILS,NODE_SENTBY_FILES,NODE_TELNET,NODE_FTP,NODE_TELNETD,NODE_TELSERD, + NODE_USERNUM_LOGON,NODE_VIEW_PWDS,NODE_LOG_IP,NODE_LOG_INPUTS,NODE_DISABLE_COMMODITY,NODE_CENTRAL_ANSWERS, + NODE_DISABLE_IEMSI,NODE_NO_MCI_MSG,NODE_NO_WILDCARDS,NODE_OWN_PARTUPLOADS,NODE_PHONE_CHECK,NODE_RAM_WORK, + NODE_CONSOLE_DEBUG,NODE_NO_EMAILS,NODE_OWNDEVUNIT,NODE_SHOW_CACHE_STATS,NODE_TRAPDOOR,NODE_TRAP_SERIAL, + NODE_NORADBOOGIE,NODE_A2232PATCH,NODE_NO_PURGE_LINE,NODE_REPURGE,NODE_LOGOFF_RESET,NODE_TRUE_RESET, + NODE_WIN_ICONIFIED,NODE_WIN_INTERLACE,NODE_WIN_STATUSBAR,NODE_WIN_TO_FRONT,SYS_CREDIT_BY_KB, + SYS_LONG_WHO,SYS_CONVERT_TO_MB,SYS_QUIET_JOIN,SYS_RELATIVE_CONFS,SYS_SSL_EMAILS,SYS_EMAIL_ON_SYSOP_PAGE, + SYS_EMAIL_ON_COMMENT,SYS_EMAIL_ON_LOGON,SYS_EMAIL_ON_LOGOFF,SYS_EMAIL_ON_NEW_USER,SYS_EMAIL_ON_UPLOAD, + SYS_EMAIL_ON_PW_FAIL,SYS_START_ICONIFIED,SYS_DO_NOT_MOVE,SYS_MULTICOM,SYS_AE_SHELL,SYS_NO_COMMODITY,SYS_DONT_SAVE_STATE, + CHECKER_SCRIPT,PROTOCOL_OPTIONS,HTTP_HOSTNAME,FTP_HOSTNAME,COMMAND_NAME,COMMAND_LOCATION,COMMAND_INTERNAL, + COMMAND_MIMIC_VER,COMMAND_PASSWORD,COMMAND_BANNER,CONF_NAME,CONF_FORWARD_MAIL,CONF_MENU_PROMPT,CONF_UPLOAD_PROMPT, + CONF_FTP_DIR_NAME,NODE_EXPRESS_FILE,NODE_SYSTEM_PASSWORD,NODE_SYSTEM_PASSWORD_PROMPT,NODE_NEW_USER_PASSWORD, + NODE_NAME_PROMPT,NODE_NAME_PROMPT2,NODE_PASSWORD_PROMPT,NODE_AUTO_VAL_PASSWORD,NODE_REMOTE_PASSWORD, + NODE_FORCE_ANSI,NODE_CON_IN_DEVICE,NODE_CON_OUT_DEVICE,NODE_SCREEN_PENS,NODE_CONF_DB_FILE, + NODE_FIRST_COMMAND,NODE_SERIAL_DEVICE,NODE_MODEM_INIT,NODE_MODEM_RESET,NODE_MODEM_RING,NODE_MODEM_ANSWER, + NODE_MODEM_OFFHOOK,NODE_MODEM_NRAMS,NODE_WIN_DEFPUBSCREEN,NODE_WIN_PUBSCREEN,SYS_BBS_NAME,SYS_BBS_LOCATION,SYS_SYSOP_NAME, + SYS_MIN_PASSWORD_LEN,SYS_MIN_PASSWORD_STRENGTH,SYS_PASSWORD_ENCRYPTION,SYS_MAX_PASSWORD_FAILS,SYS_PASSWORD_EXPIRY,SYS_STRICT_PASSWORD_POLICY, + SYS_DEFAULT_MENU,SYS_AUTO_VAL_PASSWORD,SYS_REGKEY,SYS_SMTP_SERVER,SYS_SMTP_USERNAME,SYS_SMTP_PASSWORD, + SYS_SYSOP_EMAIL,SYS_BBS_EMAIL,SYS_FILEDIZ_CMD,SYS_FTP_HOST,SYS_EXEC_ON_NEW_USER,SYS_EXECA_ON_NEW_USER, + SYS_EXEC_ON_SYSOP_PAGE,SYS_EXECA_ON_SYSOP_PAGE,SYS_EXEC_ON_CONNECT,SYS_EXECA_ON_CONNECT, + SYS_EXEC_ON_LOGON,SYS_EXECA_ON_LOGON,SYS_EXEC_ON_LOGOFF,SYS_EXECA_ON_LOGOFF,SYS_EXEC_ON_COMMENT, + SYS_EXECA_ON_COMMENT,SYS_EXEC_ON_UPLOAD,SYS_EXECA_ON_UPLOAD,SYS_ACP_FONT,SYS_EXEC_ON_STARTUP, + SYS_NODE_X_LOC,SYS_NODE_X_NAME,SYS_NODE_X_SYSOP,SYS_BUTTON_NAME,SYS_BUTTON_COMMAND, + SYS_NUTTON_NAME,SYS_NUTTON_COMMAND,SYS_QWK_BBS_NUMBER,SYS_QWK_BBS_ADDRESS,SYS_QWK_BBS_ID, + SYS_QWK_ZIP_COMMAND,SYS_QWK_LHA_COMMAND,SYS_ASC_ZIP_COMMAND,SYS_ASC_LHA_COMMAND, + SYS_FTP_PORT2,SYS_FTP_DATA_PORT,SYS_HTTP_PORT, + BACKUP_LVIEW,BACKUP_ADD,BACKUP_EDIT,BACKUP_DELETE,BACKUP_TEXT, + RESTRICT_LVIEW,RESTRICT_ADD,RESTRICT_EDIT,RESTRICT_DELETE,RESTRICT_TEXT, + DLPATHS_LVIEW,DLPATHS_ADD,DLPATHS_DELETE,DLPATHS_TEXT, + ULPATHS_LVIEW,ULPATHS_ADD,ULPATHS_DELETE,ULPATHS_TEXT, + MBASE_LVIEW,MBASE_ADD,MBASE_EDIT,MBASE_DELETE,MBASE_NAME, + ACS_LVIEW,ACS_ADD,ACS_EDIT,ACS_DELETE,ACS_NAME, + AREAS_LVIEW,AREAS_ADD,AREAS_EDIT,AREAS_DELETE,AREAS_NAME, + PRESET_NUMBER, + CMDS_LVIEW,CMDS_ADD,CMDS_EDIT,CMDS_DELETE,CMDS_NAME, + COMPS_LVIEW,COMPS_ADD,COMPS_EDIT,COMPS_DELETE,COMPS_NAME, + PCOL_LVIEW,PCOL_ADD,PCOL_EDIT,PCOL_DELETE,PCOL_NAME, + NNA_LVIEW,NNA_ADD,NNA_EDIT,NNA_DELETE,NNA_NAME, + SCRN_LVIEW,SCRN_ADD,SCRN_EDIT,SCRN_DELETE,SCRN_NAME,SCRN_EXT, + LANG_LVIEW,LANG_ADD,LANG_EDIT,LANG_DELETE,LANG_NAME, + DRV_LVIEW,DRV_ADD,DRV_EDIT,DRV_DELETE,DRV_NAME, + FCHK_LVIEW,FCHK_ADD,FCHK_EDIT,FCHK_DELETE,FCHK_NAME, + CONN_LVIEW,CONN_ADD,CONN_EDIT,CONN_DELETE,CONN_TEXT,CONN_BAUD, + CONF_FIRST,CONF_PREV,CONF_NEXT,CONF_LAST,CONF_ADD,CONF_DEL,CONF_CLONE, + NODE_FIRST,NODE_PREV,NODE_NEXT,NODE_LAST,NODE_ADD,NODE_DEL,NODE_CLONE, + NODE_TIME_START,NODE_TIME_END, + END_OF_LIST + +EXPORT DEF helpTexts:PTR TO LONG + +PROC addHelp(id,text) + IF id>=END_OF_LIST THEN Throw( "HLP" , "LIST" ) + helpTexts[id]:=text +ENDPROC + +EXPORT PROC getHelpText(id) + IF id0 THEN v:=dest[n-1] + WHILE (n>0) AND (v=" ") + SetStr(dest,n-1) + n:=EstrLen(dest) + IF n>0 THEN v:=dest[n-1] + ENDWHILE +ENDPROC + +EXPORT PROC makeDir(folderStr) + DEF lock + + lock:=Lock(folderStr,ACCESS_READ) + IF lock=0 + lock:=CreateDir(folderStr) + ENDIF + IF lock THEN UnLock(lock) +ENDPROC + +EXPORT PROC stripInfo(y:PTR TO CHAR) + DEF x,brk=FALSE + + x:=StrLen(y)-1 + WHILE(x>-1) + IF(y[x]=".") + y[x]:=0 + brk:=TRUE + ENDIF + EXIT brk + x-- + ENDWHILE +ENDPROC x diff --git a/axSetupTool/tooltypes.e b/axSetupTool/tooltypes.e new file mode 100644 index 0000000..8e0d6a6 --- /dev/null +++ b/axSetupTool/tooltypes.e @@ -0,0 +1,449 @@ +OPT MODULE +OPT PREPROCESS + +MODULE 'workbench/workbench','icon','*/stringlist','dos/dos' + +DEF diskObjectCache:PTR TO stdlist +DEF changesMade + +EXPORT OBJECT diskObjectCacheItem + fileName:PTR TO CHAR + diskObject: LONG + originalToolTypes: LONG + ownsToolTypes: CHAR + changed:CHAR +ENDOBJECT + +EXPORT PROC readToolType(toolType,key,outValue) + DEF do: PTR TO diskobject + DEF tooltypes + DEF s: PTR TO CHAR + + s:=NIL + StrCopy(outValue,'') + do:=getOrCreateCacheItem(toolType) + IF (do) + tooltypes:=do.tooltypes + IF tooltypes + IF (s:=FindToolType(tooltypes,key)) THEN StrCopy(outValue,s) + ENDIF + IF diskObjectCache=NIL THEN FreeDiskObject(do) + ENDIF +ENDPROC s<>NIL + +EXPORT PROC readAllToolTypes(toolType,outList:PTR TO stringlist) + DEF do: PTR TO diskobject + DEF tooltypes:PTR TO LONG + DEF count + + outList.clear() + do:=getOrCreateCacheItem(toolType) + IF (do) + tooltypes:=do.tooltypes + IF tooltypes + count:=0 + WHILE tooltypes[count]<>0 + outList.add(tooltypes[count]) + count++ + ENDWHILE + ENDIF + IF diskObjectCache=NIL THEN FreeDiskObject(do) + ENDIF +ENDPROC + +PROC getKeyName(tooltype,outKey) + DEF i=0 + StrCopy(outKey,'') + WHILE i" " THEN StrAddChar(outKey,tooltype[i]) + i++ + ENDWHILE +ENDPROC + +EXPORT PROC writeToolType(toolType,key,newValue=-1,force=FALSE) + DEF do: PTR TO diskobject + DEF oldtooltypes:PTR TO LONG,newToolTypes,count,i + DEF keyName[255]:STRING + DEF newItem[255]:STRING + DEF needToAdd=TRUE + DEF item + DEF s + DEF cacheObj:PTR TO diskObjectCacheItem + + + IF newValue=-1 + StringF(newItem,'\s',key) + newValue:='' + ELSEIF newValue + IF StrLen(newValue)=0 + deleteToolType(toolType,key) + RETURN + ENDIF + StringF(newItem,'\s=\s',key,newValue) + ELSEIF force=FALSE + deleteToolType(toolType,key) + RETURN + ENDIF + + do,cacheObj:=getOrCreateCacheItem(toolType,TRUE) + IF (do) + oldtooltypes:=do.tooltypes + IF oldtooltypes + IF (s:=FindToolType(oldtooltypes,key)) ANDALSO StrCmp(s,newValue) + //no changes so no need to save + RETURN + ENDIF + ENDIF + ->WriteF('update tooltype \s \s = \s\n',toolType,key,newValue) + changesMade:=TRUE + + count:=0 + IF oldtooltypes + WHILE oldtooltypes[count]<>0 + count++ + ENDWHILE + ENDIF + + IF (cacheObj.originalToolTypes=oldtooltypes) + newToolTypes:=List(count+27) + + FOR i:=0 TO count-1 + ListAddItem(newToolTypes,AstrClone(oldtooltypes[i],255)) + ENDFOR + ListAddItem(newToolTypes,0) + oldtooltypes:=newToolTypes + ENDIF + + IF ListLen(oldtooltypes)=ListMax(oldtooltypes) + newToolTypes:=List(count+27) + FOR i:=0 TO count-1 + ListAddItem(newToolTypes,AstrClone(oldtooltypes[i],255)) + DisposeLink(oldtooltypes[i]) + ENDFOR + ListAdd(newToolTypes,[NIL]) + DisposeLink(oldtooltypes) + oldtooltypes:=newToolTypes + ENDIF + + FOR i:=0 TO count-1 + getKeyName(oldtooltypes[i],keyName) + IF StriCmp(keyName,key) + StrCopy(oldtooltypes[i],newItem) + cacheObj.changed:=TRUE + needToAdd:=FALSE + ENDIF + ENDFOR + IF needToAdd + ->WriteF('added \s\n',newItem) + changesMade:=TRUE + cacheObj.changed:=TRUE + oldtooltypes[count]:=StrClone(newItem) + ListAddItem(oldtooltypes,0) + ENDIF + do.tooltypes:=oldtooltypes + ENDIF +ENDPROC + +EXPORT PROC deleteToolType(toolType,key) + DEF do: PTR TO diskobject + DEF oldtooltypes:PTR TO LONG,newToolTypes + DEF keyName[255]:STRING + DEF count,i,changed=FALSE,n + DEF cacheObj:PTR TO diskObjectCacheItem + + do,cacheObj:=getOrCreateCacheItem(toolType) + IF (do) + oldtooltypes:=do.tooltypes + + IF(FindToolType(oldtooltypes,key))=FALSE THEN RETURN + + count:=0 + IF oldtooltypes + WHILE oldtooltypes[count]<>0 + count++ + ENDWHILE + ENDIF + + IF (cacheObj.originalToolTypes=oldtooltypes) + newToolTypes:=List(count+27) + FOR i:=0 TO count-1 + ListAddItem(newToolTypes,AstrClone(oldtooltypes[i],255)) + ENDFOR + ListAdd(newToolTypes,[NIL]) + oldtooltypes:=newToolTypes + ENDIF + + n:=0 + FOR i:=0 TO count-1 + getKeyName(oldtooltypes[i],keyName) + IF StriCmp(keyName,key)=FALSE + IF i<>n THEN StrCopy(oldtooltypes[n],oldtooltypes[i]) + n++ + ELSE + changed:=TRUE + cacheObj.changed:=TRUE + ENDIF + ENDFOR + FOR i:=n TO count-1 + DisposeLink(oldtooltypes[i]) + oldtooltypes[i]:=NIL + ENDFOR + SetList(oldtooltypes,n+1) + do.tooltypes:=oldtooltypes + + IF changed + ->WriteF('delete tooltype \s \s\n',toolType,key) + changesMade:=TRUE + ENDIF + ENDIF +ENDPROC + + +EXPORT PROC readToolTypeInt(toolType,key) + DEF value[255]:STRING + IF readToolType(toolType,key,value) + RETURN Val(value) + ENDIF +ENDPROC -1 + +EXPORT PROC checkToolTypeExists(toolType,key) + DEF nodeFile[255]:STRING + DEF do: PTR TO diskobject + DEF tooltypes + DEF s: PTR TO CHAR + DEF result=FALSE + + s:=NIL + + do:=getOrCreateCacheItem(toolType) + IF (do) + tooltypes:=do.tooltypes + IF tooltypes + IF(s:=FindToolType(tooltypes,key)) THEN result:=TRUE + ENDIF + IF diskObjectCache=NIL THEN FreeDiskObject(do) + ENDIF +ENDPROC result + +EXPORT PROC initialiseCache() + diskObjectCache:=NEW diskObjectCache.stdlist(100) + changesMade:=FALSE +ENDPROC + +EXPORT PROC deInitialiseCache() + END diskObjectCache +ENDPROC + +PROC freeCacheItem(cacheObj:PTR TO diskObjectCacheItem) + DEF newtooltypes:PTR TO LONG + DEF do:PTR TO diskobject + DEF item:PTR TO LONG + DEF mem,i + + IF cacheObj.changed + ->WriteF('saving file and freeing \s\n',cacheObj.fileName) + PutDiskObject(cacheObj.fileName,cacheObj.diskObject) + ENDIF + + do:=cacheObj.diskObject + IF do + IF do.tooltypes<>cacheObj.originalToolTypes + newtooltypes:=do.tooltypes + FOR i:=0 TO ListLen(newtooltypes)-1 + IF newtooltypes[i] THEN DisposeLink(newtooltypes[i]) + ENDFOR + DisposeLink(newtooltypes) + do.tooltypes:=cacheObj.originalToolTypes + ENDIF + + IF cacheObj.ownsToolTypes + IF do.tooltypes + mem:=do.tooltypes[0] -> release the file buffer (first s.tring pointer points to start of buffer) + Dispose(mem) + DisposeLink(do.tooltypes) ->our tooltypes is a list that needs to be freed + ENDIF + ENDIF + + DisposeLink(cacheObj.fileName) + FreeDiskObject(do) + ENDIF + END cacheObj + +ENDPROC + +PROC getOrCreateCacheItem(fileName:PTR TO CHAR,getDef=FALSE) + DEF i,cnt,found=FALSE + DEF cacheObj: PTR TO diskObjectCacheItem + DEF oldCacheObj: PTR TO diskObjectCacheItem + DEF do=NIL:PTR TO diskobject + DEF fn2[255]:STRING + DEF ownToolTypes + DEF toolTypes:PTR TO LONG + DEF fh,fileBuf,off,lineCount,len,item + DEF newValues:PTR TO stringlist + + IF diskObjectCache<>NIL + cnt:=diskObjectCache.count() + + i:=0 + WHILE (iLRU algorithm, move most recently used to end of list + i++ + WHILE i=0 + StringF(fn2,'\s.cfg',fileName) + IF FileLength(fn2)>=0 + do:=GetDefDiskObject(WBPROJECT) + ENDIF + ELSE + do:=GetDefDiskObject(WBPROJECT) + ENDIF + IF do<>NIL + fileBuf:=New(FileLength(fn2)+1) ->allow an extra char in case file does not end in LF + + fh:=Open(fn2,MODE_OLDFILE) + IF fh<>0 + off:=0 + lineCount:=0 + WHILE(ReadStr(fh,fn2)<>-1) OR (StrLen(fn2)>0) + len:=0 + WHILE (fn2[len]<>0) AND (fn2[len]<>";") + len++ + ENDWHILE + + ->trim trailing space + WHILE (fn2[len-1]<=32) AND (len>0) + len-- + EXIT len=0 ->this is just here to prevent the fn2[len-1] causing a buffer underrun in the absence of short circuit evaluation + ENDWHILE + SetStr(fn2,len) + + AstrCopy(fileBuf+off,fn2,len+1) + lineCount++ + off:=off+len+1 + ENDWHILE + + toolTypes:=List(lineCount+1) + off:=0 + FOR i:=1 TO lineCount + ListAddItem(toolTypes,fileBuf+off) + off:=off+StrLen(fileBuf+off)+1 + ENDFOR + ListAdd(toolTypes,[NIL]) + do.tooltypes:=toolTypes + ownToolTypes:=TRUE + Close(fh) + ELSE + Dispose(fileBuf) + FreeDiskObject(do) + do:=NIL + ENDIF + ENDIF + ENDIF + + IF (do=NIL) + IF (getDef) + do:=GetDefDiskObject(WBPROJECT) + ->WriteF('create new disk obj\n') + ELSE + RETURN 0,0 + ENDIF + ENDIF + + IF diskObjectCache<>NIL + NEW cacheObj + + cacheObj.fileName:=String(StrLen(fileName)) + cacheObj.ownsToolTypes:=ownToolTypes + IF do + cacheObj.originalToolTypes:=do.tooltypes + ELSE + cacheObj.originalToolTypes:=0 + ENDIF + StrCopy(cacheObj.fileName,fileName) + cacheObj.diskObject:=do + + IF diskObjectCache.count()<(diskObjectCache.maxSize()-1) + diskObjectCache.add(cacheObj) + ELSE + freeCacheItem(diskObjectCache.item(0)) + diskObjectCache.remove(0) + diskObjectCache.add(cacheObj) + ENDIF + item:=diskObjectCache.item(diskObjectCache.count()-1) + ENDIF + ENDIF +ENDPROC do,item + +EXPORT PROC clearDiskObjectCache() + DEF cacheObj: PTR TO diskObjectCacheItem + DEF i, do: PTR TO diskobject + DEF mem + + IF diskObjectCache=NIL THEN RETURN + FOR i:=0 TO diskObjectCache.count()-1 + IF (cacheObj:=diskObjectCache.item(i)) + freeCacheItem(cacheObj) + ENDIF + ENDFOR + diskObjectCache.clear() +ENDPROC + +EXPORT PROC deleteFileFromCache(filename:PTR TO CHAR) + DEF cacheObj: PTR TO diskObjectCacheItem + DEF i + + IF diskObjectCache=NIL THEN RETURN + + FOR i:=diskObjectCache.count()-1 TO 0 STEP -1 + cacheObj:=diskObjectCache.item(i) + IF StriCmp(filename,cacheObj.fileName) + freeCacheItem(cacheObj) + diskObjectCache.remove(i) + ENDIF + ENDFOR +ENDPROC + +EXPORT PROC saveCachedChanges() + DEF cacheObj: PTR TO diskObjectCacheItem + DEF i + + IF diskObjectCache=NIL THEN RETURN + FOR i:=0 TO diskObjectCache.count()-1 + cacheObj:=diskObjectCache.item(i) + IF cacheObj.changed + ->WriteF('saving file \s\n',cacheObj.fileName) + PutDiskObject(cacheObj.fileName,cacheObj.diskObject) + cacheObj.changed:=FALSE + ENDIF + ENDFOR +ENDPROC + +EXPORT PROC clearChangeFlag() + changesMade:=FALSE +ENDPROC + +EXPORT PROC getChangeFlag() IS changesMade diff --git a/axcommon.e b/axcommon.e index f157702..4e82fb4 100644 --- a/axcommon.e +++ b/axcommon.e @@ -174,8 +174,15 @@ EXPORT CONST SV_STARTNODE=185 EXPORT CONST SV_INFO=199 EXPORT CONST INCOMING_TELNET=200 EXPORT CONST INCOMING_FTP=201 - - +EXPORT CONST SV_ACPSHUTDOWN=202 +EXPORT CONST SV_CONFMAINT=203 +EXPORT CONST SV_VIEWLOGS=204 +EXPORT CONST SV_TOGGLESTATUS=205 +EXPORT CONST SV_TIMEINCREASE=206 +EXPORT CONST SV_TIMEDECREASE=207 +EXPORT CONST SV_CAPTURE=208 +EXPORT CONST SV_DISPLAYFILE=209 +EXPORT CONST SV_GRANTTEMP=210 EXPORT CONST GETKEY=500 EXPORT CONST RAWARROW=501 EXPORT CONST CHAIN=502 @@ -327,6 +334,10 @@ EXPORT CONST DT_SIZEDOWNLOAD=704 EXPORT CONST CON_CURSOR=705 EXPORT CONST TELNET_CONNECT=706 EXPORT CONST GET_CMD_TOOLTYPE=707 +EXPORT CONST TELNET_USERNAME_PROMPT=708 +EXPORT CONST TELNET_USERNAME=709 +EXPORT CONST TELNET_PASSWORD_PROMPT=710 +EXPORT CONST TELNET_PASSWORD=711 /* end of new /X 5 host commands */ diff --git a/axenums.e b/axenums.e index 1832eb3..68c1bf3 100644 --- a/axenums.e +++ b/axenums.e @@ -22,7 +22,7 @@ EXPORT ENUM LOGON_TYPE_LOGGED_OFF=0, LOGON_TYPE_SYSOP=1, LOGON_TYPE_LOCAL=2, LOG EXPORT ENUM RESULT_FAILURE=-1, RESULT_SUCCESS=0, RESULT_NOT_ALLOWED=1, RESULT_ABORT=-2, RESULT_TIMEOUT=-3, RESULT_NO_CARRIER=-4, RESULT_GOODBYE=-5, RESULT_SLEEP_LOGOFF=-6, RESULT_STANDARD_LOGOFF=-7, RESULT_CONNECT=-8, RESULT_NOT_TESTED=2, RESULT_LCFILES=9,RESULT_PRIVATE=10, RESULT_SIGNALLED=11, RESULT_NOT_FOUND=12 -EXPORT ENUM ERR_MEMORY,ERR_MEMORY2,ERR_MSGBASE,ERR_MEMORY3,ERR_FILELIST,ERR_NOFILES,ERR_FILEEXAMINE,ERR_WORKDIROPEN,ERR_LOCK,ERR_FREESPACE,ERR_SYMBOLS,ERR_FIB_MEMORY,ERR_NO_BULLS,ERR_NO_CONFFLAGS +EXPORT ENUM ERR_MEMORY,ERR_MEMORY2,ERR_MSGBASE,ERR_MEMORY3,ERR_FILELIST,ERR_NOFILES,ERR_FILEEXAMINE,ERR_WORKDIROPEN,ERR_LOCK,ERR_FREESPACE,ERR_SYMBOLS,ERR_FIB_MEMORY,ERR_NO_BULLS,ERR_NO_CONFFLAGS, ERR_NODEPARAM EXPORT ENUM MAIL_READ=1,MAIL_CREATE=2, MAIL_SCAN=3, MAIL_STATS=4, MAIL_SYSOP_COMMENT=6, MAIL_ZOOM=7 @@ -44,3 +44,5 @@ EXPORT ENUM SUBTYPE_ANYCMD=-1, SUBTYPE_CONFCMD=0, SUBTYPE_NODECMD=1, SUBTYPE_CMD -> User Keys Flags /* show new user message */ /* show all users only once */ EXPORT ENUM USER_NEWMSG=1,USER_TOCONF1=2, USER_ONETIME_MSG=4,USER_SCRNCLR=8,USER_DONATED=16,USER_ED_FULLSCREEN=32,USER_ED_PROMPT=64,USER_BGFILECHECK=128 + +EXPORT ENUM PWD_LEGACY=0, PWD_PBKDF2_5=1, PWD_PBKDF2_50=2, PWD_PBKDF2_100=3,PWD_PBKDF2_1000=4,PWD_PBKDF2_10000=5 \ No newline at end of file diff --git a/axobjects.e b/axobjects.e index d04fa97..289577e 100644 --- a/axobjects.e +++ b/axobjects.e @@ -87,10 +87,16 @@ EXPORT OBJECT userMisc uploadBytesBCD[8]:ARRAY OF CHAR eMail[50]:ARRAY OF CHAR lastDlCPS:LONG - unused[142]:ARRAY OF CHAR - ->unknown[28]:ARRAY OF CHAR - ->nodeFlags[32]:ARRAY OF LONG - ->confFlags2[10]:ARRAY OF LONG + pwdHash[32]:ARRAY OF CHAR + salt[8]:ARRAY OF CHAR + pwdType:CHAR + forcePwdReset:CHAR + accountLocked:CHAR + invalidAttempts:CHAR + pwdLastUpdated:LONG + lastIP:LONG + ipMask:LONG + unused[86]:ARRAY OF CHAR ENDOBJECT EXPORT OBJECT tempAccess @@ -120,8 +126,9 @@ EXPORT OBJECT zModem currentOperation: LONG freeDFlag: LONG fileList:PTR TO stdlist - current: LONG - total: LONG + currentUL: LONG + currentDL: LONG + totalDL: LONG shouldUpdateDownloadStats: CHAR needUpdateDownloadStats: CHAR ENDOBJECT @@ -270,7 +277,7 @@ ENDOBJECT EXPORT OBJECT bgCheckData semi: ss checkedCount: LONG - checkedBytes: LONG + checkedBytes[8]:ARRAY OF CHAR ENDOBJECT EXPORT OBJECT diskObjectCacheItem diff --git a/bcd.e b/bcd.e index 72f29cf..9316053 100644 --- a/bcd.e +++ b/bcd.e @@ -91,6 +91,29 @@ EXPORT PROC addBCD(bcdTotal:PTR TO CHAR, valToAdd) addBCD2(bcdTotal,bcdVal) ENDPROC +EXPORT PROC mulBCD(bcdVal:PTR TO CHAR,valToMul) + DEF tmpVal[8]:ARRAY OF CHAR + DEF i + CopyMem(bcdVal,tmpVal,8) + convertToBCD(0,bcdVal) + WHILE(valToMul) + FOR i:=1 TO Mod(valToMul,10) + addBCD2(bcdVal,tmpVal) + ENDFOR + + valToMul:=Div(valToMul,10) + tmpVal[0]:=Shl(tmpVal[0] AND $F,4) OR Shr(tmpVal[1] AND $F0,4) + tmpVal[1]:=Shl(tmpVal[1] AND $F,4) OR Shr(tmpVal[2] AND $F0,4) + tmpVal[2]:=Shl(tmpVal[2] AND $F,4) OR Shr(tmpVal[3] AND $F0,4) + tmpVal[3]:=Shl(tmpVal[3] AND $F,4) OR Shr(tmpVal[4] AND $F0,4) + tmpVal[4]:=Shl(tmpVal[4] AND $F,4) OR Shr(tmpVal[5] AND $F0,4) + tmpVal[5]:=Shl(tmpVal[5] AND $F,4) OR Shr(tmpVal[6] AND $F0,4) + tmpVal[6]:=Shl(tmpVal[6] AND $F,4) OR Shr(tmpVal[7] AND $F0,4) + tmpVal[7]:=Shl(tmpVal[7] AND $F,4) + + ENDWHILE +ENDPROC + EXPORT PROC divBCD1024(bcdVal:PTR TO CHAR) DEF decVal[16]:ARRAY OF CHAR @@ -120,6 +143,36 @@ EXPORT PROC divBCD1024(bcdVal:PTR TO CHAR) ENDFOR ENDPROC +EXPORT PROC divBCD(dividend:PTR TO CHAR, divisor) + DEF decVal[16]:ARRAY OF CHAR + DEF i,n=0,v,r + + FOR i:=0 TO 7 + decVal[n]:=Shr(dividend[i] AND $f0,4) + n++ + decVal[n]:=dividend[i] AND $f + n++ + ENDFOR + + v:=0 + r:=0 + FOR i:=0 TO 15 + IF r + r:=Mul(r,10) + r+=decVal[i]; + ELSE + r:=decVal[i]; + ENDIF + + v:=Mul(v,10) + IF r>=divisor + n:=Div(r,divisor) + v+=n + r:=r-Mul(n,divisor); + ENDIF + ENDFOR + +ENDPROC v EXPORT PROC convertFromBCD(inArray:PTR TO CHAR) DEF tempBCD[8]:ARRAY diff --git a/deployment/File_Id.Diz b/deployment/File_Id.Diz new file mode 100644 index 0000000..662dd14 --- /dev/null +++ b/deployment/File_Id.Diz @@ -0,0 +1,10 @@ + ____ _____ A M I +.:::\ \| /:::. :::::. .:::: .:::: .:::: +::../ /::..' ::..' ::.. ::... ::... +::./ | \: :: `: ::... ...:: ...:: +.--\____|\____\-----------------------. +| /X v5.6.0 Released on 02-Jan-2024 | +| Written By Darren Coles | +| This update introduces a full MUI based | +| setup editor and a standard installer | +`------------------------------------------' diff --git a/deployment/Install Ami-Express b/deployment/Install Ami-Express new file mode 100644 index 0000000..db20546 --- /dev/null +++ b/deployment/Install Ami-Express @@ -0,0 +1,409 @@ +; Ami-Express +; $VER: Ami-Express 1.0 (09.08.2023) + +(set #appver "v5.6.0") +(set #appyear "2018-2023") + +(complete 0) +(set @app-name "Ami-Express") +(if (exists "BBS:" (noreq)) + (set @default-dest "bbs:") + (set @default-dest "sys:bbs") +) +; + +(if (< (getversion) (* 37 65536)) + (abort (cat + "Ami-Express requires operating system " + "version 2.04 or higher to work." + )) +) + +(welcome "Welcome to the Ami-Express installation utility.\nThis will install or upgrade your installation to AmiExpress " #appver) + + (set #muiver (/ (getversion "mui:mui" ) 65536) ) + + (set #owndevunitver (/ (getversion "libs:owndevunit.library" ) 65536) ) + + (set #fifolibver (/ (getversion "libs:fifo.library" ) 65536) ) + + (set #amissllibver (/ (getversion "libs:amisslmaster.library" ) 65536) ) + (set #asynclibver (/ (getversion "libs:async.library" ) 65536) ) + + (if ( <> #muiver 0) + ( set #muimsg "MUI: installed\n" ) + ( set #muimsg "MUI: not installed\n" ) + ) + + (if ( <> #owndevunitver 0) + ( set #owndevunitmsg "OwnDevUnit.library: installed\n" ) + ( set #owndevunitmsg "OwnDevUnit.library: not installed\n" ) + ) + + (if ( <> #fifolibver 0) + ( set #fifolibmsg "fifo library: installed\n" ) + ( set #fifolibmsg "fifo library: not installed\n" ) + ) + + (if ( <> #amissllibver 0) + ( set #amissllibmsg "amissl library: installed\n" ) + ( set #amissllibmsg "amissl library: not installed\n" ) + ) + + (if ( <> #asynclibver 0) + ( set #asynclibmsg "async.library: installed\n" ) + ( set #asynclibmsg "async.library: not installed\n" ) + ) + +; +( if (exists "sys:wbstartup/ACP" (noreq)) + ( set #acpname "sys:wbstartup/ACP") + ( + ( if (exists "bbs:wbstartup/ACP" (noreq)) + ( set #acpname "bbs:wbstartup/ACP") + ( set #acpname "") + ) + ) +) +; +(set expexists + (exists "BBS:Express" (noreq)) +) + +; +(if (= expexists 0) +( + +; +(message "After completion of the installation you will have a bare bones functioning bbs system installed and you will be able to use the included setup tool to customise the setup according to your preferences.\n\n(C)1989-91 Mike Thomas, Synthetic Technologies\n(C)1992-95 Joe Hodge, LightSpeed Technologies Inc.\n(C)" #appyear " Darren Coles\n\nFull documentation and the latest releases are always available at:\nhttps://github.com/dmcoles/AmiExpress\n" +) + +; +(set #default-dest-installergen-temp + (askdir + (prompt "Select where you want Ami-Express installed (create a folder if you need one)") + (help "Select where you want Ami-Express installed.\nNo folder will be created so please ensure that you have created one if needed.") + (default @default-dest) + ) +) +(set @default-dest #default-dest-installergen-temp) + +; +( complete 20) + +(set #acpchoice (askchoice + (choices "WBStartup (for auto startup)" "BBS: (for manual startup)" "Select a different location") + (prompt "Where would you like to install the ACP program?") + (help "") + (default 0) )) + +( if ( = #acpchoice 0) + (set #acppath "sys:wbstartup") +) + +( if ( = #acpchoice 1) + (set #acppath @default-dest) +) + +( if ( = #acpchoice 2) + ( + (set #acppath + (askdir + (prompt "Please select the destination for the ACP file") + (help #destdir-help) + (default @default-dest) ) ) + ) +) + +(copyfiles + (prompt "Copying Express") + (help @copyfiles-help) + (source "AmiExpress/AmiExpress") + (choices "Express") + (dest @default-dest) + (confirm "expert") +) +( complete 30) + +(copyfiles + (source "AmiExpress/AmiExpress") + (dest #acppath) + (prompt "Copying ACP") + (help @copyfiles-help) + (choices "ACP") + (infos) + (confirm "expert") + +) + +( complete 40) + +(copyfiles + (prompt "Copying utils") + (help @copyfiles-help) + (confirm "expert") + (source "AmiExpress/AmiExpress/Utils") + (dest (tackon @default-dest "Utils")) + (all) +) + +( complete 45) + +(copyfiles + (prompt "Copying icons") + (help @copyfiles-help) + (confirm "expert") + (source "AmiExpress/AmiExpress/Storage") + (dest (tackon @default-dest "Storage")) + (all) +) + + +( complete 50) + +(copylib + (prompt "Copying aedoor library") + (help @copylib-help) + (confirm "average") + (source "AmiExpress/libs/aedoor.library") + (dest "libs:") +) + +( complete 55) + +(copyfiles + (prompt "Copying archive tools") + (help @copyfiles-help) + (confirm "average") + (source "AmiExpress/c") + (dest "c:") + (choices "LHA" "LZX" "ZIP" "UNZIP") +) + +( complete 60) + +(copyfiles + (prompt "Copying LZX registration key") + (help @copyfiles-help) + (confirm "average") + (source "AmiExpress/l") + (dest "l:") + (choices "LZX.keyfile") +) + +( complete 65) + +(copyfiles + (prompt "Copying file id tools") + (help @copyfiles-help) + (confirm "expert") + (source "AmiExpress/fileid") + (dest "c:") + (choices "Textract" "DMSDescript" "EXEDescript" "GIFDesc") +) + +( complete 70) + +; +(copyfiles + (prompt "Copying default bbs configuration") + (help @copyfiles-help) + (confirm "expert") + (source "AmiExpress/defaultbbs") + (dest @default-dest) + (all) +) +( complete 90) + +(run (cat "setenv axsetupeditor_prefs 11" (tackon #acppath "acp")) + (prompt "Saving configuration") + (help ) +) + +(run (cat "copy env:axsetupeditor_prefs envarc:") + (prompt "Saving configuration") + (help ) +) + +( complete 95) + +(if (exists "BBS:" (noreq)) + (set #startup "Assign doors: bbs:doors\nPath bbs:utils add\nResident SYS:Rexxc/RX pure") + (set #startup (cat "Assign bbs: " @default-dest "\nAssign doors: bbs:doors\nPath bbs:utils add\nResident SYS:Rexxc/RX pure")) +) + + +(startup "Ami-Express" + (prompt "Add startup items") + (help @startup-help) + (command #startup) +) + +( message "The user password encryption used by Ami-Express prior to this release is extremely weak and easily hackable using brute force.\n\nThis release introduces password encryption using PKBDF2. The number of rounds of PKBDF2 has been set to 100 which is a compromise between security and the processing capability of the Amiga. If you have a powerful CPU you should consider changing the settings to make it more secure.") + +; + +) ; Else +( + +; +(set install-dest bbs:) + +(if (exists "env:axsetupeditor_prefs" (noreq)) + (set #axprefs (getenv "axsetupeditor_prefs") ) + (set #axprefs "") +) + +(set #acppath "") +(if (<> #axprefs "") + ( + (set #axprefs (substr #axprefs 2 (- (strlen #axprefs) 5))) + + ( if (exists (tackon #axprefs "acp") (noreq)) + (set #acppath #axprefs) + ) + ) +) +(if (= #acppath "") + (if (exists "sys:wbstartup/ACP" (noreq)) + (set #acppath "sys:wbstartup") + ) +) +(if (= #acppath "") + (if (exists "bbs:ACP" (noreq)) + (set #acppath "bbs:") + ) +) + +(if (= #acppath "") + (set #acppath + (askdir + (prompt "Please select the location of your ACP file") + (help #destdir-help) + (default @default-dest) ) ) +) + + +( complete 10) + +(set #acpname (tackon #acppath "acp")) + +(if (= #acpname "") + (set #acpver "Unknown\n") + ( + (run (cat "echo >ram:out " #acpname)) + (run (cat "version full >env:tmpver \"" #acpname "\"")) + (set #acpver (getenv "tmpver") ) + (if (= (substr #acpver 0 4) "ACP ") + (set #acpver (substr #acpver 4 (- (strlen #acpver) 4))) + ) + ) +) + +(run (cat "version full >env:tmpver bbs:express")) +(set #expressver (getenv "tmpver") ) +(if (= (substr #expressver 0 11) "AmiExpress ") + (set #expressver (substr #expressver 11 (- (strlen #expressver) 11))) +) + +(message ("An existing installation of Ami-Express was found.\n\nThe currently installed version information is \n\nACP: %sExpress: %s\nPress proceed if you wish to continue upgrading Ami-Express.\n\nThe configuration of your bbs will not be affected and only the updated\napplication files will be overwritten.\n" #acpver #expressver) +) + +( complete 20) + +(copyfiles + (source "AmiExpress/AmiExpress") + (dest "bbs:") + (prompt "Upgrading Express") + (choices "Express") + (help @copyfiles-help) + (confirm "expert") +) + +( complete 40) + +( if (exists (tackon #acppath "ACP" (noreq))) + (copyfiles + (source "AmiExpress/AmiExpress") + (dest #acppath) + (prompt "Upgrading ACP") + (help @copyfiles-help) + (choices "ACP") + (confirm "expert") + ) +) + +( complete 50) + +(if (= (exists "env:axsetupeditor_prefs" (noreq)) 0) + ( + (run (cat "setenv axsetupeditor_prefs 11" (tackon #acppath "acp")) + (prompt "Saving configuration") + (help ) + ) + + (run (cat "copy env:axsetupeditor_prefs envarc:") + (prompt "Saving configuration") + (help ) + ) + ) +) + +( complete 60) + +(copyfiles + (prompt "Upgrading utils") + (help @copyfiles-help) + (confirm "expert") + (source "AmiExpress/AmiExpress/Utils") + (dest "BBS:Utils") + (pattern "~(rexxdoor|qwk.cfg|ftn.cfg)") +) + +( complete 80) + +(set #currsecurity "") +(iconinfo (dest "bbs:bbsconfig") (gettooltype "PASSWORD_SECURITY" "#currsecurity" )) + +( if ( = #currsecurity "") +( + (set #securitychoice (askchoice + (choices "Enable the new encryption" "Keep the legacy encryption" + (prompt "This release of Ami-Express includes a new password encryption system.\nThe old system was extremely weak and easily hacked using brute force.\nIf you have to downgrade Ami-Express for any reason, new users created with the new password security will not be able to log into the BBS.") + (help "") + (default 0) )) + ) + + (if (= (exists "bbs:bbsconfig.info" (noreq)) 0) + ( + (copyfiles + (prompt "Creating bbsconfig.info") + (help @copyfiles-help) + (source "AmiExpress/defaultbbs/bbsconfig.info") + (dest "BBS:") + ) + + (tooltype (dest "bbs:bbsconfig") (settooltype "HISTORY")) + (tooltype (dest "bbs:bbsconfig") (settooltype "CONVERT_TO_MB")) + ) + + ) + + + ( if ( = #securitychoice 0) + (tooltype (dest "bbs:bbsconfig") (settooltype "PASSWORD_SECURITY" "PKBDF2_100")) + (tooltype (dest "bbs:bbsconfig") (settooltype "PASSWORD_SECURITY" "LEGACY")) + ) + ) +) + + +( complete 90) + +; +) +) ; End If + +( message "The MUI system is required by the Ami-Express configuration tool and is recommended to be installed. In addition there are optional extras that can be used by Ami-Express which should be installed manually if required.\n\n" #muimsg #owndevunitmsg #fifolibmsg #amissllibmsg #asynclibmsg "\nThese extras are all freely available for download on the aminet.") + +(exit) \ No newline at end of file diff --git a/deployment/Install Ami-Express.info b/deployment/Install Ami-Express.info new file mode 100644 index 0000000..78d8f52 Binary files /dev/null and b/deployment/Install Ami-Express.info differ diff --git a/deployment/binaries.lha b/deployment/binaries.lha new file mode 100644 index 0000000..ce965f6 Binary files /dev/null and b/deployment/binaries.lha differ diff --git a/deployment/read_me.hdr b/deployment/read_me.hdr new file mode 100644 index 0000000..76d23ec --- /dev/null +++ b/deployment/read_me.hdr @@ -0,0 +1,10 @@ +Short: AmiExpress BBS system redeveloped in E +Author: darren_m_coles@yahoo.co.uk (Darren Coles) +Uploader: darren_m_coles@yahoo.co.uk (Darren Coles) +Type: comm/amiex +Version: 5.6.0 +Replaces: comm/amiex/Amix550.lha +Architecture: m68k-amigaos >= 2.0.4 +Distribution: Aminet +Kurz: AmiExpress BBS entwickelt in E + diff --git a/deployment/read_me.txt b/deployment/read_me.txt new file mode 100644 index 0000000..5e0f246 --- /dev/null +++ b/deployment/read_me.txt @@ -0,0 +1,103 @@ +[sof] ____ + ___________ __\ /________ ________________________________ + \_ _ ¬\ ¬\/ ¬\\/¡ ___/ ¬Y / __ /__ ¬\ ___/ ___/ ___/C +.--/----¡ ¬ \ \/ \ | __/__> ' < ¬__/ ¬ _/_ __/_____ ¬\___ ¬\-----\--. +|// l__¡ \\_¡¡ \\!___ ¬\_. \ ¡ l__¡ ¯¬\__ ¬\ \\ \\ \\| +/ ¬l____/¬'l____/: ¬l___/ l___\ ! ¬l____/¬l___/_____/_____/ \ +| · · | +| Ami-Express was a BBS System that ran on the Commodore Amiga series of | +| computers and was developed by Lightspeed Technologies in the 1990s. | +| | +| Version 5.6.0 | +| | +| This is a rewrite of that system written in Amiga E. It is open source | +| and has new features and bug fixes in addition to aiming for near 100% | +| backwards compatibility with the version 4.x releases. | +| | +| I contacted Joe Hodge/LightSpeed Technologies the owner of /X product | +| in December 2018 and he has given his full approval for me to take over | +| this software and to continue using the Ami-Express name. | +| | +| I have also updated the documentation for Ami-Express as many existing | +| features were not properly documented. Some new features included in this | +| release are: | +| * Full MUI Based Configuration / Setup Editor | +| * Installer Script that allows upgrading and initial BBS setup | +| * Improved password encryption. | +| | +| All source code is publicly available at: | +| https://github.com/dmcoles/AmiExpress along with the documentation. | +| | +| The sample bbs configurations included in previous versions of this tool | +| are no longer included. The new install process will create a default | +| minimal (but functional) BBS for you. You can then use the new setup tool | +| to fully configure the BBS and create a system tailored to your needs. | +| The default bbs also contains some useful doors that are typically used | +| on every Ami-Express bbs eg AquaScan and FileDescription. | +| | +| This version of /X comes with both rexxdoor 1.3 and 2.2 - If you have 10 | +| nodes or more you *MUST* use 2.2 - new installations will be configured | +| to use the newer version but upgrades will leave the the setup unaltered. | +| | +| If you are a pre-existing /X4 user, the ACP and Express files can just | +| replace the old versions and should be as close to fully backwards | +| compatible as possible. Please do contact me or raise issues in github if | +| you encounter any problems. | +| | +| Copyright (c)2024 Darren Coles | +| Permission is hereby granted, free of charge, to any person obtaining a +| copy of this software and associated documentation files (the "Software"),| +| to deal in the Software without restriction, including without limitation | +| the rights to use, copy, modify, merge, publish, distribute, sublicense, | +| and/or sell copies of the Software, and to permit persons to whom the | +| Software is furnished to do so, subject to the following conditions: | +| | +| The above copyright notice and this permission notice shall be included | +| in all copies or substantial portions of the Software. | +| | +| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | +| OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | +| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | +| NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | +| DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | +| OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | +| USE OR OTHER DEALINGS IN THE SOFTWARE. | +| | +| Installer and Installer project icon | +| (c) Copyright 1995-96 Escom AG. All Rights Reserved. | +| Reproduced and distributed under license from Escom AG. | +| | +| INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE; | +| NO WARRANTIES ARE MADE. ALL USE IS AT YOUR OWN RISK. NO LIABILITY | +| OR RESPONSIBILITY IS ASSUMED. | +| | +|---------------------------------------------------------------------------| +| This release is dedicated to my ex-partner Traci who was taken ill | +| unexpectedly at the end of 2018 and passed away after suffering | +| lung damage caused by Influenza. RIP Traci xx. | +|---------------------------------------------------------------------------| +| | +| Version History | +| | +| 5.6.0 02 Jan 2024 | +| * Improved password encryption, Full Setup Editor, Installer | +| 5.5.0 05 Jun 2022 (Feature parity release) | +| * XMODEM and Hydra support, FTP Direct Server, IEMSI auto login | +| 5.4.0 17 May 2021 | +| * YModem and ZModem 8k support, FTP authentication, shortcut mode | +| 5.3.2 01 September 2020 | +| * Minor bugfix release | +| 5.3.1 07 August 2020 | +| * Minor bugfix release | +| 5.3.0 04 July 2020 | +| * Internal Zmodem, HTTP File Transfers, connect to QWK & FTN | +| 5.2.0 02 Jan 2020 | +| * Native Telnet, FTP File Transfers, some bugfixes. | +| 5.1.0 03 June 2019 | +| * New features and bugfixes. | +| 5.0.0 23 December 2018 | +| * First release of this project | +\ / +|\\ //| +`--\---------------------------------------------------------------------/--' + [eof] diff --git a/express.e b/express.e index 0d74eeb..0c0c7e8 100644 --- a/express.e +++ b/express.e @@ -26,7 +26,7 @@ MODULE 'intuition/screens','intuition/intuition','intuition/gadgetclass','exec/p 'libraries/asyncio' MODULE '*axcommon','*axconsts','*axenums','*axobjects','*miscfuncs','*stringlist','*ftpd','*httpd','*errors','*mailssl','*zmodem', - '*xymodem','*hydra','*bcd','*pwdhash','*tooltypes','*expversion' + '*xymodem','*hydra','*bcd','*pwdhash','*sha256','*tooltypes','*expversion' DEF masterMsg:acpMessage DEF resmp: PTR TO mp @@ -40,9 +40,9 @@ DEF serverin DEF singleNode=0: PTR TO singlePort DEF masterNode=0: PTR TO multiPort -DEF debug=FALSE + DEF consoleDebugLevel=LOG_NONE -DEF debugLogLevel=LOG_NONE +DEF debugLogLevel=LOG_ERROR DEF inputLogging=FALSE DEF inac=FALSE @@ -51,6 +51,7 @@ DEF state=-1, stateData, reqState,instantLogon=FALSE DEF windowClose=NIL:PTR TO window DEF windowStat=NIL:PTR TO window DEF windowZmodem=NIL:PTR TO window +DEF expMenu:PTR TO menu DEF consoleReadMP=NIL: PTR TO mp DEF titlebar[255]:STRING DEF ititlebar[255]:STRING @@ -150,9 +151,9 @@ DEF tTCPS=0 ->DEF tTTM=0 DEF ulTTTM=0 DEF dlTTTM=0 -DEF dTBT=0 -DEF uTBT=0 -DEF beenUDd=0 +DEF dTBT[8]:ARRAY OF CHAR +DEF uTBT[8]:ARRAY OF CHAR +DEF beenUDd=FALSE DEF lcFileXfr=0 DEF recFileNames:PTR TO stringlist DEF skipdFiles:PTR TO stringlist @@ -279,7 +280,8 @@ DEF doorSilent=FALSE DEF cancelTransferOffHook=FALSE DEF aeGoodFile=0 -DEF sysopdl,numFiles,fsize,dtfsize +DEF sysopdl,numFiles,fsize +DEF dtfsize[8]:ARRAY OF CHAR DEF zModemInfo: zModem DEF chatSerFlag=0,chatConFlag=0 @@ -356,7 +358,8 @@ DEF includeDeact=FALSE DEF bgChecking=FALSE -DEF ftptime=0 +DEF ftptime1=0 +DEF ftptime2=0 DEF nativeTelnet=FALSE DEF nativeFtp=FALSE @@ -366,7 +369,10 @@ DEF offHookFlag=TRUE DEF lastIAC=FALSE DEF lastIAC2=FALSE +DEF iaccmd=0 DEF nawsMode=0 +DEF willsent=FALSE +DEF dosent=FALSE DEF nodeStart=0 @@ -383,7 +389,7 @@ DEF zmodemRxBuffer=0 DEF zModemRxBufferSize=65536 DEF bufferedBytes=0 DEF bufferReadOffset=0 -->DEF lastCarrierCheck=0 +DEF lastCarrierCheck=0 DEF cmdShortcuts=FALSE DEF shortcuts:PTR TO stringlist @@ -391,6 +397,11 @@ DEF currentMenuName[255]:STRING DEF defaultMenuName[255]:STRING DEF menuPause=TRUE +DEF telnetUsername[100]:STRING +DEF telnetPassword[100]:STRING +DEF telnetUsernamePrompt[100]:STRING +DEF telnetPasswordPrompt[100]:STRING + DEF quietDownload=FALSE DEF unknownValue=0 DEF memConf=0:PTR TO LONG ->shared with tooltypes.e @@ -399,14 +410,6 @@ RAISE ERR_BRKR IF CxBroker()=NIL, ERR_PORT IF CreateMsgPort()=NIL, ERR_ASL IF AllocAslRequest()=NIL -PROC countTags(tags:PTR TO LONG) - DEF n=0 - WHILE tags[n]<>TAG_DONE - n:=n+2 - ENDWHILE - n++ -ENDPROC - PROC calcEfficiency(cps,baud) DEF res IF cps>21474836 @@ -902,6 +905,122 @@ PROC resetSystem() ENDIF ENDPROC +PROC checkPasswordStrength(newPass:PTR TO CHAR) + DEF min,act,lower=0,upper=0,num=0,sym=0,i + min:=readToolTypeInt(TOOLTYPE_BBSCONFIG,0,'MIN_PASSWORD_LENGTH') + IF min>0 + IF StrLen(newPass)0 + act:=0 + IF min>4 THEN min:=4 + FOR i:=0 TO StrLen(newPass)-1 + IF (newPass[i]>=48) AND (newPass[i]<=57) + num:=1 + ELSEIF (newPass[i]>=65) AND (newPass[i]<=90) + upper:=1 + ELSEIF (newPass[i]>=97) AND (newPass[i]<=122) + lower:=1 + ELSE + sym:=1 + ENDIF + ENDFOR + act:=lower+upper+num+sym + IF act=0 + IF userMisc.invalidAttempts>=maxAttempts + userMisc.accountLocked:=TRUE + userMisc.invalidAttempts:=0 + ENDIF + ENDIF + ELSE + userMisc.invalidAttempts:=0 + ENDIF + +ENDPROC res + + PROC acceptIncomingConnection(sock,ftp) DEF ni:PTR TO nodeInfo DEF socket @@ -1054,8 +1173,8 @@ PROC checkDoorMsg(mode) ->calculate the new password hash StrCopy(tempstring,servermsg.string) IF StrLen(tempstring)>0 - UpperStr(tempstring) - loggedOnUser.pwdHash:=calcPasswordHash(tempstring) + setNewPassword(loggedOnUser,loggedOnUserMisc,tempstring) + loggedOnUserMisc.pwdLastUpdated:=getSystemTime() ENDIF ENDIF CASE DT_LOCATION @@ -1275,9 +1394,9 @@ PROC checkDoorMsg(mode) CASE SV_INSTANT servercmd:=SV_INSTANT CASE SV_CHATTOGGLE - sysopAvail:=Not(sysopAvail) - updateTitle(NIL) - statChatFlag() + servercmd:=SV_CHATTOGGLE + CASE SV_TOGGLESTATUS + servercmd:=SV_TOGGLESTATUS CASE SV_ACCOUNTS servercmd:=SV_ACCOUNTS CASE SV_QUIETNODE @@ -1313,6 +1432,16 @@ PROC checkDoorMsg(mode) servercmd:=SV_AESHELL CASE SV_KICKUSER servercmd:=SV_KICKUSER + CASE SV_TIMEINCREASE + servercmd:=SV_TIMEINCREASE + CASE SV_TIMEDECREASE + servercmd:=SV_TIMEDECREASE + CASE SV_CAPTURE + servercmd:=SV_CAPTURE + CASE SV_DISPLAYFILE + servercmd:=SV_DISPLAYFILE + CASE SV_GRANTTEMP + servercmd:=SV_GRANTTEMP CASE SV_RESERVENODE StrCopy(reservedName,servermsg.string) IF(StrLen(reservedName)>0) @@ -1358,6 +1487,10 @@ PROC checkDoorMsg(mode) acceptIncomingConnection(servermsg.data,FALSE) CASE INCOMING_FTP acceptIncomingConnection(servermsg.data,TRUE) + CASE SV_CONFMAINT + servercmd:=SV_CONFMAINT + CASE SV_VIEWLOGS + servercmd:=SV_VIEWLOGS ENDSELECT IF servermsg<>NIL ReplyMsg(servermsg) @@ -1368,11 +1501,12 @@ PROC checkDoorMsg(mode) inac:=FALSE ENDPROC returnval -PROC getPass2(prompt: PTR TO CHAR,password:PTR TO CHAR,pwdhash:LONG, max:LONG,outstr=NIL:PTR TO CHAR) +PROC getPass2(prompt: PTR TO CHAR,password:PTR TO CHAR,userPwd, max:LONG,outstr=NIL:PTR TO CHAR) DEF c,i,j DEF pass[200]:STRING DEF tempstr[255]:STRING + DEF passType i:=1 IF (password<>NIL) @@ -1427,13 +1561,39 @@ PROC getPass2(prompt: PTR TO CHAR,password:PTR TO CHAR,pwdhash:LONG, max:LONG,ou aePuts('\b\n') RETURN RESULT_SUCCESS ENDIF - ELSE - UpperStr(pass) - IF calcPasswordHash(pass)=pwdhash + ELSEIF userPwd + IF checkUserPassword(loggedOnUser,loggedOnUserMisc,pass) + IF checkToolType(TOOLTYPE_BBSCONFIG,0,'PASSWORD_SECURITY','LEGACY') + passType:=PWD_LEGACY + ELSEIF checkToolType(TOOLTYPE_BBSCONFIG,0,'PASSWORD_SECURITY','PBKDF2_5') + passType:=PWD_PBKDF2_5 + ELSEIF checkToolType(TOOLTYPE_BBSCONFIG,0,'PASSWORD_SECURITY','PBKDF2_50') + passType:=PWD_PBKDF2_50 + ELSEIF checkToolType(TOOLTYPE_BBSCONFIG,0,'PASSWORD_SECURITY','PBKDF2_100') + passType:=PWD_PBKDF2_100 + ELSEIF checkToolType(TOOLTYPE_BBSCONFIG,0,'PASSWORD_SECURITY','PBKDF2_1000') + passType:=PWD_PBKDF2_1000 + ELSEIF checkToolType(TOOLTYPE_BBSCONFIG,0,'PASSWORD_SECURITY','PBKDF2_10000') + passType:=PWD_PBKDF2_10000 + ELSE + passType:=PWD_LEGACY + ENDIF + + IF loggedOnUserMisc.pwdType<>passType + setNewPassword(loggedOnUser,loggedOnUserMisc,pass) + ENDIF + + IF checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'STRICT_PASSWORD_POLICY') + IF checkPasswordStrength(pass)<>TRUE THEN loggedOnUserMisc.forcePwdReset:=TRUE + ENDIF purgeLine() aePuts('\b\n') RETURN RESULT_SUCCESS ENDIF + ELSE + purgeLine() + aePuts('\b\n') + RETURN RESULT_SUCCESS ENDIF ENDIF aePuts('\b\n') @@ -1488,7 +1648,7 @@ PROC asl(s: PTR TO CHAR,slines=NIL:PTR TO stringlist) HANDLE ENDIF EXCEPT DO IF fr THEN FreeAslRequest(fr) - IF tags THEN END tags[countTags(tags)] + IF tags THEN FastDisposeList(tags) IF aslbase THEN CloseLibrary(aslbase) SELECT exception CASE ERR_ASL @@ -2224,7 +2384,7 @@ PROC readMayGetChar(msgport, checkTelnet, whereto) temp:=0 IF checkTelnet AND (telnetSocket>=0) - IF Recv(telnetSocket,whereto,1,0)=1 + IF Recv(telnetSocket,whereto,1,0)=1 temp:=whereto[] IF (lastIAC=0) AND (temp=255) lastIAC:=1 @@ -2338,7 +2498,7 @@ PROC loadTranslator(translator:PTR TO translator,fileName) DEF tempstr2[255]:STRING DEF tempstr3[255]:STRING - fsize:=getFileSize(fileName) + fsize:=FileLength(fileName) translator.translationText:=New(fsize+4) ->allocate some memory, two extra bytes for ending colon and space and some in case there is no newline workMem:=New(fsize+2) ->allocate some memory (two extra bytes in case there is no newline at the end of the file) fh:=Open(fileName,MODE_OLDFILE) @@ -2800,42 +2960,57 @@ PROC checkUserOnLine(check) IF(check) loop:=0 error:=1 - REPEAT - IF(loop=node) THEN loop++ IF sopt.toggles[TOGGLES_MULTICOM] - status:=-1 ObtainSemaphore(masterNode) - sp:=(masterNode.myNode[loop].s) - ReleaseSemaphore(masterNode) - - IF sp - ObtainSemaphore(sp) - status:=sp.status - ReleaseSemaphore(sp) - ENDIF - ELSE - status:=0 ENDIF - IF (status>=0) AND (status<>ENV_NOTACTIVE) AND (status<>ENV_SHUTDOWN) - StringF(tempStr,'\snode\d',cmds.bbsLoc,loop) - IF(lock:=Lock(tempStr,ACCESS_READ)) - UnLock(lock) - StringF(tempStr,'\snode\d.user',cmds.bbsLoc,loop) - IF(fh:=Open(tempStr,MODE_OLDFILE))<>0 - IF(Read(fh,tuser,SIZEOF user)) - IF(stringCompare(tuser.name,loggedOnUser.name)=RESULT_SUCCESS) + REPEAT + IF(loop=node) THEN loop++ + + IF sopt.toggles[TOGGLES_MULTICOM] + status:=-1 + sp:=(masterNode.myNode[loop].s) + + IF sp + ObtainSemaphore(sp) + status:=sp.status + ReleaseSemaphore(sp) + lock:=-1 + IF (status>=0) AND (status<>ENV_NOTACTIVE) AND (status<>ENV_SHUTDOWN) + IF(stringCompare(sp.handle,loggedOnUser.name)=RESULT_SUCCESS) + lock:=0 error:=0 - lock:=NIL ENDIF ENDIF + status:=-1 ENDIF - Close(fh) + ELSE + status:=0 ENDIF - ENDIF - loop++ + + IF (status>=0) AND (status<>ENV_NOTACTIVE) AND (status<>ENV_SHUTDOWN) + StringF(tempStr,'\snode\d',cmds.bbsLoc,loop) + IF(lock:=Lock(tempStr,ACCESS_READ)) + UnLock(lock) + StringF(tempStr,'\snode\d.user',cmds.bbsLoc,loop) + IF(fh:=Open(tempStr,MODE_OLDFILE))<>0 + IF(Read(fh,tuser,SIZEOF user)) + IF(stringCompare(tuser.name,loggedOnUser.name)=RESULT_SUCCESS) + error:=0 + lock:=NIL + ENDIF + ENDIF + ENDIF + Close(fh) + ENDIF + ENDIF + loop++ UNTIL (lock=NIL) OR (loop=MAX_NODES) + + IF sopt.toggles[TOGGLES_MULTICOM] + ReleaseSemaphore(masterNode) + ENDIF ELSE error:=1 ENDIF @@ -2888,7 +3063,7 @@ PROC telnetConnect(host:PTR TO CHAR,port) DEF tlastIAC2=FALSE DEF tlastIAC3=FALSE DEF last - DEF c,c2 + DEF c,c2,ch DEF cmd1,cmd2 DEF sigs @@ -2992,29 +3167,32 @@ PROC telnetConnect(host:PTR TO CHAR,port) IF checkInput() c:=0 WHILE (checkInput()) AND (c<100) - ibuf[c]:=readChar(1,0,TRUE) - IF (ibuf[c]=UPARROW) AND (c<97) - ibuf[c]:=27 - ibuf[c+1]:="[" - ibuf[c+2]:="A" - c:=c+2 - ELSEIF (ibuf[c]=DOWNARROW) AND (c<97) - ibuf[c]:=27 - ibuf[c+1]:="[" - ibuf[c+2]:="B" - c:=c+2 - ELSEIF (ibuf[c]=RIGHTARROW) AND (c<97) - ibuf[c]:=27 - ibuf[c+1]:="[" - ibuf[c+2]:="C" - c:=c+2 - ELSEIF (ibuf[c]=LEFTARROW) AND (c<97) - ibuf[c]:=27 - ibuf[c+1]:="[" - ibuf[c+2]:="D" - c:=c+2 + ch:=readChar(1,0,TRUE) + IF ch>=0 + ibuf[c]:=ch + IF (ibuf[c]=UPARROW) AND (c<97) + ibuf[c]:=27 + ibuf[c+1]:="[" + ibuf[c+2]:="A" + c:=c+2 + ELSEIF (ibuf[c]=DOWNARROW) AND (c<97) + ibuf[c]:=27 + ibuf[c+1]:="[" + ibuf[c+2]:="B" + c:=c+2 + ELSEIF (ibuf[c]=RIGHTARROW) AND (c<97) + ibuf[c]:=27 + ibuf[c+1]:="[" + ibuf[c+2]:="C" + c:=c+2 + ELSEIF (ibuf[c]=LEFTARROW) AND (c<97) + ibuf[c]:=27 + ibuf[c+1]:="[" + ibuf[c+2]:="D" + c:=c+2 + ENDIF + c++ ENDIF - c++ ENDWHILE conCursorOn() @@ -3032,6 +3210,9 @@ PROC telnetConnect(host:PTR TO CHAR,port) e:=Errno() IF e<>35 THEN done:=TRUE ELSEIF b>0 + readBuffer[b]:=0 + ->hexdump(readBuffer,b) + c:=0 c2:=0 REPEAT @@ -3087,6 +3268,21 @@ PROC telnetConnect(host:PTR TO CHAR,port) UNTIL c>=b IF c2>0 THEN aePuts2(readBuffer,c2) + IF (StrLen(telnetUsername)>0) AND (StrLen(telnetUsernamePrompt)>0) + IF InStr(readBuffer,telnetUsernamePrompt)>=0 + StringF(tempstr,'\s\b\n',telnetUsername) + Send(s,tempstr,EstrLen(tempstr),0) + StrCopy(telnetUsername,'') + ENDIF + ENDIF + IF (StrLen(telnetPassword)>0) AND (StrLen(telnetPasswordPrompt)>0) + IF InStr(readBuffer,telnetPasswordPrompt)>=0 + StringF(tempstr,'\s\b\n',telnetPassword) + Send(s,tempstr,EstrLen(tempstr),0) + StrCopy(telnetPassword,'') + ENDIF + ENDIF + ENDIF IF((logonType>=LOGON_TYPE_REMOTE) AND (checkCarrier()=FALSE)) THEN done:=TRUE @@ -3125,7 +3321,7 @@ PROC startProcess(exestring, stacksize, priority, async, doorTrap) filetags:=NEW [SYS_INPUT,0,SYS_OUTPUT,doorTrapFH,SYS_ASYNCH,async,NP_STACKSIZE,stacksize,NP_PRIORITY,priority,TAG_DONE] temp:=SystemTagList(exestring,filetags) - END filetags[countTags(filetags)] + FastDisposeList(filetags) IF (byteSignExtend(cmds.taskPri)<=priority) SetTaskPri(task,cmds.taskPri) @@ -3309,8 +3505,8 @@ PROC processXimMsg(msgcmd,msg:PTR TO jhMessage,tooltype,command,privcmd,params,n ->calculate the new password hash StrCopy(tempstring,msg.string) IF StrLen(tempstring)>0 - UpperStr(tempstring) - loggedOnUser.pwdHash:=calcPasswordHash(tempstring) + setNewPassword(loggedOnUser,loggedOnUserMisc,tempstring) + loggedOnUserMisc.pwdLastUpdated:=getSystemTime() ENDIF ENDIF CASE DT_LOCATION @@ -3512,8 +3708,8 @@ PROC processXimMsg(msgcmd,msg:PTR TO jhMessage,tooltype,command,privcmd,params,n CASE BB_LOCAL AstrCopy(msg.string,cmds.bbsLoc,200) CASE ZMODEMSEND - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) ulTTTM:=NIL dlTTTM:=NIL tTEFF:=NIL @@ -3522,8 +3718,8 @@ PROC processXimMsg(msgcmd,msg:PTR TO jhMessage,tooltype,command,privcmd,params,n ch:=downloadFile(tempstring) IF((logonType>=LOGON_TYPE_REMOTE) AND (checkCarrier()=FALSE)) THEN msg.data:=-2 ELSE msg.data:=ch CASE BATCHZMODEMSEND - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) ulTTTM:=NIL dlTTTM:=NIL tTEFF:=NIL @@ -3531,8 +3727,8 @@ PROC processXimMsg(msgcmd,msg:PTR TO jhMessage,tooltype,command,privcmd,params,n ch:=downloadFile(msg.filler1) IF((logonType>=LOGON_TYPE_REMOTE) AND (checkCarrier()=FALSE)) THEN msg.data:=-2 ELSE msg.data:=ch CASE ZMODEMRECEIVE - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) ulTTTM:=NIL dlTTTM:=NIL tTEFF:=NIL @@ -3788,8 +3984,8 @@ PROC processXimMsg(msgcmd,msg:PTR TO jhMessage,tooltype,command,privcmd,params,n ioFlags[IOFLAG_SER_OUT]:=msg.data CASE AXNET_SEND - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) ulTTTM:=0 dlTTTM:=0 tTEFF:=0 @@ -3802,8 +3998,8 @@ PROC processXimMsg(msgcmd,msg:PTR TO jhMessage,tooltype,command,privcmd,params,n ENDIF ENDIF CASE AXNET_RECEIVE - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) ulTTTM:=0 dlTTTM:=0 tTEFF:=0 @@ -3831,8 +4027,12 @@ PROC processXimMsg(msgcmd,msg:PTR TO jhMessage,tooltype,command,privcmd,params,n IF checkConfAccess(msg.data+1) THEN msg.data:=1 ELSE msg.data:=0 ENDIF CASE PASSWORD_HASH - formatUnsignedLong(calcPasswordHash(msg.string),tempstring) - AstrCopy(msg.string,tempstring,20) + IF loggedOnUserMisc.pwdType=PWD_LEGACY + formatUnsignedLong(calcPasswordHash(msg.string),tempstring) + ELSE + StrCopy(tempstring,loggedOnUserMisc.pwdHash,32) + ENDIF + AstrCopy(msg.string,tempstring,40) CASE GET_GNSFLAG msg.data:=IF(nonStopDisplayFlag) THEN 1 ELSE 0 CASE DISPLAY_FILE @@ -3926,6 +4126,14 @@ PROC processXimMsg(msgcmd,msg:PTR TO jhMessage,tooltype,command,privcmd,params,n ENDIF CASE TELNET_CONNECT telnetConnect(msg.string,msg.data) + CASE TELNET_USERNAME_PROMPT + StrCopy(telnetUsernamePrompt,msg.string) + CASE TELNET_USERNAME + StrCopy(telnetUsername,msg.string) + CASE TELNET_PASSWORD_PROMPT + StrCopy(telnetPasswordPrompt,msg.string) + CASE TELNET_PASSWORD + StrCopy(telnetPassword,msg.string) CASE GET_CMD_TOOLTYPE StrCopy(tempstring,'') msg.data:=readToolType(tooltype,command,msg.string,tempstring) @@ -4046,7 +4254,7 @@ PROC runDoor(cmd,type,command,tooltype,params,resident,doorTrap,privcmd,pri=0,st StrCopy(runOnExit,'') StrCopy(runOnExit2,'') - IF (resident=FALSE) AND ((type<>DOORTYPE_MCI) OR (StrLen(cmd)>0)) + IF (resident=FALSE) AND ((type<>DOORTYPE_MCI) AND (StrLen(cmd)>0)) IF (fileExists(cmd)=FALSE) IF privcmd=FALSE aePuts('\b\nError, can''t locate Custom Command\b\n') @@ -4147,7 +4355,6 @@ PROC runDoor(cmd,type,command,tooltype,params,resident,doorTrap,privcmd,pri=0,st WHILE(msg:=GetMsg(mp)) msgcmd:=msg.command - stripAnsi(msg.string,tempstring,0,0,ansi) StringF(tempstring,'msg request: \d',msgcmd) debugLog(LOG_DEBUG,tempstring) @@ -4861,9 +5068,9 @@ PROC joinConf(conf, msgBaseNum,confScan, auto, forceMailScan=FORCE_MAILSCAN_NOFO processSysCommand('S') IF getConfMsgBaseCount(conf)>1 getMsgBaseName(conf,msgBaseNum,tempstr) - StringF(string,'Conference \d: \s [\s] Auto-ReJoined',relConfNum,currentConfName,tempstr) + StringF(string,'Conference \d: \s [\s] Auto-ReJoined',conf,currentConfName,tempstr) ELSE - StringF(string,'Conference \d: \s Auto-ReJoined',relConfNum,currentConfName) + StringF(string,'Conference \d: \s Auto-ReJoined',conf,currentConfName) ENDIF IF quietJoin=FALSE THEN aePuts(string) ELSE @@ -6464,18 +6671,75 @@ PROC runExecuteOn(execOn:PTR TO CHAR) StringF(toolTypeText,'EXECUTE_ON_\s',execOn) IF (readToolType(TOOLTYPE_BBSCONFIG,0,toolTypeText,tempstr1)) - filetags:=NEW [SYS_INPUT,0,SYS_OUTPUT,0,SYS_ASYNCH,FALSE,TAG_DONE]:LONG + filetags:=NEW [SYS_INPUT,0,SYS_OUTPUT,0,SYS_ASYNCH,FALSE,TAG_DONE] processMci(tempstr1,tempstr2) SystemTagList(tempstr2,filetags) - END filetags[countTags(filetags)] + FastDisposeList(filetags) ENDIF StringF(toolTypeText,'EXECUTE_ASYNC_ON_\s',execOn) IF (readToolType(TOOLTYPE_BBSCONFIG,0,toolTypeText,tempstr1)) - filetags:=NEW [SYS_INPUT,0,SYS_OUTPUT,0,SYS_ASYNCH,TRUE,TAG_DONE]:LONG + filetags:=NEW [SYS_INPUT,0,SYS_OUTPUT,0,SYS_ASYNCH,TRUE,TAG_DONE] processMci(tempstr1,tempstr2) SystemTagList(tempstr2,filetags) - END filetags[countTags(filetags)] + FastDisposeList(filetags) + ENDIF +ENDPROC + +PROC doUploadNotify() + DEF str[255]:STRING + DEF string[255]:STRING + runExecuteOn('UPLOAD') + + IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_UPLOAD')) AND (StrLen(mailOptions.sysopEmail)>0) + StringF(str,'\s: Ami-Express upload notification',cmds.bbsName) + StringF(string,'This is a notification that \s from \s has uploaded\n\n',loggedOnUser.name,loggedOnUser.location) + sendMail(str,string,FALSE, NIL,0,mailOptions.sysopEmail) + ENDIF +ENDPROC + +PROC doCommentNotify(fromName:PTR TO CHAR, subject:PTR TO CHAR) + DEF tempStr[255]:STRING + DEF tempStr2[255]:STRING + runExecuteOn('SYSOP_COMMENT') + IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_SYSOP_COMMENT')) AND (StrLen(mailOptions.sysopEmail)>0) + StringF(tempStr,'\s: Ami-Express sysop message notification',cmds.bbsName) + StringF(tempStr2,'This is a notification that \s has sent you a message.\n\nSubject: \s\n\n',fromName,subject) + sendMail(tempStr,tempStr2,TRUE, msgBuf,lines,mailOptions.sysopEmail) + ENDIF +ENDPROC + +PROC doLogonNotify() + DEF tempStr[255]:STRING + DEF tempStr2[255]:STRING + runExecuteOn('LOGON') + IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_LOGON')) AND (StrLen(mailOptions.sysopEmail)>0) + StringF(tempStr,'\s: Ami-Express logon notification',cmds.bbsName) + StringF(tempStr2,'This is a notification that \s from \s has logged on\n\n',loggedOnUser.name,loggedOnUser.location) + sendMail(tempStr,tempStr2,FALSE, NIL,0,mailOptions.sysopEmail) + ENDIF +ENDPROC + +PROC doNewUserNotify() + DEF tempStr[255]:STRING + DEF tempStr2[255]:STRING + runExecuteOn('NEW_USER') + + IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_NEW_USER')) AND (StrLen(mailOptions.sysopEmail)>0) + StringF(tempStr,'\s: Ami-Express new user notification',cmds.bbsName) + StringF(tempStr2,'This is a notification that a new user called \s from \s has registered.',loggedOnUser.name,loggedOnUser.location) + sendMail(tempStr,tempStr2,FALSE,msgBuf,lines,mailOptions.sysopEmail) + ENDIF +ENDPROC + +PROC doLogoffNotify() + DEF tempstr[255]:STRING + DEF tempstr2[255]:STRING + runExecuteOn('LOGOFF') + IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_LOGOFF')) AND (StrLen(mailOptions.sysopEmail)>0) + StringF(tempstr,'\s: Ami-Express logoff notification',cmds.bbsName) + StringF(tempstr2,'This is a notification that \s from \s has logged off\n\n',loggedOnUser.name,loggedOnUser.location) + sendMail(tempstr,tempstr2,FALSE, NIL,0,mailOptions.sysopEmail) ENDIF ENDPROC @@ -6718,12 +6982,25 @@ PROC processCommodityMessage(signals) ENDIF ENDPROC +PROC processWinMessage2(win:PTR TO window) + DEF winmsg:PTR TO intuimessage + DEF msgclass + WHILE winmsg:=GetMsg(win.userport) + msgclass:=winmsg.class + ReplyMsg(winmsg) + SELECT msgclass + CASE IDCMP_CLOSEWINDOW + closeExpressScreen() + CASE IDCMP_MENUPICK + handleMenuPick(winmsg.code) + ENDSELECT + EXIT window=NIL + ENDWHILE +ENDPROC + PROC processWindowMessage(signals) -> If IDCMP messages received, handle them - DEF winmsg:PTR TO intuimessage DEF windowsig - DEF msgclass - DEF win:PTR TO window IF screen AND (scropen=FALSE) IF CloseScreen(screen) THEN screen:=NIL @@ -6731,25 +7008,17 @@ PROC processWindowMessage(signals) IF windowClose<>NIL windowsig:=Shl(1, windowClose.userport.sigbit) - win:=windowClose - ELSEIF window<>NIL + IF signals AND windowsig THEN processWinMessage2(windowClose) + ENDIF + + IF window<>NIL windowsig:=Shl(1, window.userport.sigbit) - win:=window - ELSE - windowsig:=0 + IF signals AND windowsig THEN processWinMessage2(window) ENDIF - IF signals AND windowsig - -> We have to ReplyMsg these when done with them - WHILE winmsg:=GetMsg(win.userport) - msgclass:=winmsg.class - ReplyMsg(winmsg) - SELECT msgclass - CASE IDCMP_CLOSEWINDOW - closeExpressScreen() - ENDSELECT - EXIT window=NIL - ENDWHILE + IF windowStat<>NIL + windowsig:=Shl(1, windowStat.userport.sigbit) + IF signals AND windowsig THEN processWinMessage2(windowStat) ENDIF ENDPROC @@ -6797,7 +7066,10 @@ PROC closeAEStats() statWriteMP:=NIL ENDIF - IF(windowStat<>NIL) THEN CloseWindow(windowStat) + IF(windowStat<>NIL) + ClearMenuStrip(windowStat) + CloseWindow(windowStat) + ENDIF windowStat:=NIL ENDPROC @@ -6865,6 +7137,8 @@ PROC toggleStatusDisplay() WA_HEIGHT,sz, WA_DETAILPEN,dp, WA_BLOCKPEN,bp, + WA_IDCMP,IDCMP_MENUPICK, + WA_NEWLOOKMENUS,1, WA_FLAGS,WFLG_SIMPLE_REFRESH, TAG_DONE] ELSE @@ -6875,9 +7149,12 @@ PROC toggleStatusDisplay() WA_HEIGHT,sz, WA_DETAILPEN,dp, WA_BLOCKPEN,bp, + WA_IDCMP,IDCMP_MENUPICK, + WA_NEWLOOKMENUS,1, WA_FLAGS,WFLG_SIMPLE_REFRESH, TAG_DONE] ENDIF + IF(( windowStat:=OpenWindowTagList(NIL,tags))<>NIL) dStatBar:=1 @@ -6887,15 +7164,18 @@ PROC toggleStatusDisplay() initStatCon() clearStatusPane() SetWindowTitles(window,titlebar,titlebar) + SetMenuStrip(windowStat,expMenu) + IF pub THEN SetWindowTitles(windowStat,titlebar,titlebar) IF (loggedOnUser<>NIL) IF (StrLen(loggedOnUser.name)>0) THEN statPrintUser(loggedOnUser,loggedOnUserKeys,loggedOnUserMisc) ENDIF statChatFlag() ENDIF - END tags[countTags(tags)] + FastDisposeList(tags) IF pubLock THEN UnlockPubScreen(NIL,pubLock) ENDIF + updateMenus() ENDPROC PROC doFax() @@ -7138,10 +7418,15 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) IF windowClose<>NIL windowsig:=Shl(1, windowClose.userport.sigbit) - ELSEIF window<>NIL - windowsig:=Shl(1, window.userport.sigbit) + ENDIF + + IF window<>NIL + windowsig:=windowsig OR Shl(1, window.userport.sigbit) ENDIF + IF windowStat<>NIL + windowsig:=windowsig OR Shl(1, windowStat.userport.sigbit) + ENDIF IF resmp<>NIL THEN doorsig:=Shl(1, resmp.sigbit) IF rexxmp<>NIL THEN rexxsig:=Shl(1, rexxmp.sigbit) @@ -7321,6 +7606,8 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) servercmd:=-1 debugLog(LOG_DEBUG,'SYSOP LOGON') statClearTime() + disableNodeMenus(TRUE) + disableOnlineMenus(FALSE) StrCopy(connectString,'SYSOP_LOCAL') IF (scropen) THEN expressToFront() ELSE openExpressScreen() ioFlags[IOFLAG_SER_IN]:=0 @@ -7338,6 +7625,8 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) servercmd:=-1 debugLog(LOG_DEBUG,'LOCAL LOGON') statClearTime() + disableNodeMenus(TRUE) + disableOnlineMenus(FALSE) StrCopy(connectString,'F2_LOCAL') IF (scropen) THEN expressToFront() ELSE openExpressScreen() ioFlags[IOFLAG_SER_IN]:=0 @@ -7363,6 +7652,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) IF(StrLen(reservedName)>0) StrCopy(reservedName,'') ELSE + disableNodeMenus(TRUE) ioFlags[IOFLAG_SER_IN]:=0 ioFlags[IOFLAG_SER_OUT]:=0 ioFlags[IOFLAG_SCR_OUT]:=-1 @@ -7373,6 +7663,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) conCLS() reserveForUser() resetSystem() + disableNodeMenus(FALSE) ioFlags[IOFLAG_SER_IN]:=-1 ioFlags[IOFLAG_SCR_OUT]:=0 setEnvStat(ENV_RESERVE) @@ -7381,7 +7672,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ENDIF ->F5 - IF ((wasControl=1) AND (ch="4")) + IF (servercmd=SV_CONFMAINT) OR ((wasControl=1) AND (ch="4")) servercmd:=-1 ioFlags[IOFLAG_SER_IN]:=0 ioFlags[IOFLAG_SCR_OUT]:=-1 @@ -7391,6 +7682,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) onlineBaud:=cmds.openingBaud onlineBaudR:=cmds.openingBaud timeLimit:=3600 + disableNodeMenus(TRUE) logonType:=LOGON_TYPE_LOCAL logonTime:=getSystemTime() lastTimeUpdate:=logonTime @@ -7399,6 +7691,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) loggedOnUserMisc:=NEW loggedOnUserMisc loadAccount(1,loggedOnUser,loggedOnUserKeys,loggedOnUserMisc) masterLoadPointers(loggedOnUser) + setEnvStat(ENV_SYSOP) conferenceMaintenance() END loggedOnUser END loggedOnUserKeys @@ -7409,6 +7702,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ioFlags[IOFLAG_SER_IN]:=-1 ioFlags[IOFLAG_SCR_OUT]:=0 IF(ioFlags[IOFLAG_FIL_IN]) THEN ioFlags[IOFLAG_FIL_IN]:=0 + disableNodeMenus(FALSE) IF reqState=REQ_STATE_NONE THEN statePtr.redrawScreen:=TRUE ENDIF @@ -7418,11 +7712,13 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ioFlags[IOFLAG_SER_IN]:=0 ioFlags[IOFLAG_SCR_OUT]:=-1 intDoReset(sopt.offHook) + disableNodeMenus(TRUE) IF (scropen) THEN expressToFront() ELSE openExpressScreen() setEnvStat(ENV_SHELL) sendCLS() remoteShell() resetSystem() + disableNodeMenus(FALSE) ioFlags[IOFLAG_SER_IN]:=-1 ioFlags[IOFLAG_SCR_OUT]:=0 IF(ioFlags[IOFLAG_FIL_IN]) THEN ioFlags[IOFLAG_FIL_IN]:=0 @@ -7435,6 +7731,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ioFlags[IOFLAG_SER_IN]:=0 ioFlags[IOFLAG_SCR_OUT]:=-1 intDoReset(sopt.offHook) + disableNodeMenus(TRUE) IF (scropen) THEN expressToFront() ELSE openExpressScreen() conCursorOn() sendCLS() @@ -7459,6 +7756,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) loggedOnUserMisc:=NIL loggedOnUserKeys:=NIL resetSystem() + disableNodeMenus(FALSE) ioFlags[IOFLAG_SER_IN]:=-1 ioFlags[IOFLAG_SCR_OUT]:=0 IF(ioFlags[IOFLAG_FIL_IN]) THEN ioFlags[IOFLAG_FIL_IN]:=0 @@ -7466,11 +7764,12 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ENDIF ->Shift F6 - IF ((wasControl=2) AND (ch="5")) + IF (servercmd=SV_VIEWLOGS) OR ((wasControl=2) AND (ch="5")) servercmd:=-1 ioFlags[IOFLAG_SER_IN]:=0 ioFlags[IOFLAG_SCR_OUT]:=-1 intDoReset(sopt.offHook) + disableNodeMenus(TRUE) IF (scropen) THEN expressToFront() ELSE openExpressScreen() sendCLS() StringF(temp,'\sNode\d/Callerslog',cmds.bbsLoc,node) @@ -7491,6 +7790,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) loggedOnUserMisc:=NIL loggedOnUserKeys:=NIL resetSystem() + disableNodeMenus(FALSE) ioFlags[IOFLAG_SER_IN]:=-1 ioFlags[IOFLAG_SCR_OUT]:=0 IF(ioFlags[IOFLAG_FIL_IN]) THEN ioFlags[IOFLAG_FIL_IN]:=0 @@ -7498,9 +7798,10 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ENDIF ->F7 - IF ((wasControl=1) AND (ch="6")) + IF (servercmd=SV_CHATTOGGLE) OR ((wasControl=1) AND (ch="6")) servercmd:=-1 sysopAvail:=Not(sysopAvail) + updateMenus() updateTitle(NIL) statChatFlag() ENDIF @@ -7530,7 +7831,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) clearDiskObjectCache() ENDIF - IF ((wasControl=1) AND (ch="?")) + IF (servercmd=SV_TOGGLESTATUS) OR ((wasControl=1) AND (ch="?")) toggleStatusDisplay() ENDIF ENDIF @@ -7561,27 +7862,27 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ENDIF ->F2 - increase time limit - IF ((wasControl=1) AND (ch="1") AND (loggedOnUser<>NIL)) + IF (servercmd=SV_TIMEINCREASE) OR ((wasControl=1) AND (ch="1") AND (loggedOnUser<>NIL)) servercmd:=-1 timeLimit:=timeLimit+600 loggedOnUser.timeTotal:=loggedOnUser.timeTotal+600 ENDIF ->F3 - decrease time limit - IF ((wasControl=1) AND (ch="2") AND (loggedOnUser<>NIL)) + IF (servercmd=SV_TIMEDECREASE) OR ((wasControl=1) AND (ch="2") AND (loggedOnUser<>NIL)) servercmd:=-1 timeLimit:=timeLimit-600 loggedOnUser.timeTotal:=loggedOnUser.timeTotal-600 ENDIF ->F4 - capture - IF ((wasControl=1) AND (ch="3")) + IF (servercmd=SV_CAPTURE) OR ((wasControl=1) AND (ch="3")) servercmd:=-1 startCapture() ENDIF ->Shift F4 - display file to user - IF ((wasControl=2) AND (ch="3")) + IF (servercmd=SV_DISPLAYFILE) OR ((wasControl=2) AND (ch="3")) servercmd:=-1 startASend() RETURN TRUE,RESULT_SUCCESS @@ -7596,7 +7897,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ENDIF ->Shift F6 - grant/remove temporary access - IF ((wasControl=2) AND (ch="5") AND (loggedOnUser<>NIL)) + IF (servercmd=SV_GRANTTEMP) OR ((wasControl=2) AND (ch="5") AND (loggedOnUser<>NIL)) servercmd:=-1 IF(tempAccessGranted) loggedOnUser.secStatus:=tempAccess.accessLevel; @@ -7620,9 +7921,10 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ENDIF ->F7 - IF ((wasControl=1) AND (ch="6")) + IF (servercmd=SV_CHATTOGGLE) OR ((wasControl=1) AND (ch="6")) servercmd:=-1 sysopAvail:=Not(sysopAvail) + updateMenus() updateTitle(NIL) statChatFlag() ENDIF @@ -7658,7 +7960,7 @@ PROC processInputMessage(timeout, extsig = 0,rawMode=FALSE, allowSer=TRUE) ENDIF ->HELP - IF ((wasControl=1) AND (ch="?")) + IF (servercmd=SV_TOGGLESTATUS) OR ((wasControl=1) AND (ch="?")) servercmd:=-1 toggleStatusDisplay() ENDIF @@ -7815,7 +8117,6 @@ ENDPROC PROC processLoggingOff() DEF tempstr[255]:STRING - DEF tempstr2[255]:STRING writeLogoffLog('logging off 1 (start)',TRUE) @@ -7825,6 +8126,7 @@ PROC processLoggingOff() pagedFlag:=FALSE chatFlag:=FALSE blockOLM:=FALSE + beenUDd:=FALSE IF(sopt.toggles[TOGGLES_QUIETSTART]) quietFlag:=TRUE ELSE @@ -7905,14 +8207,8 @@ PROC processLoggingOff() saveAccount(loggedOnUser,loggedOnUserKeys,loggedOnUserMisc,0,0) /* Reseave users account after logoff */ writeLogoffLog('logging off 13',FALSE) - runExecuteOn('LOGOFF') - writeLogoffLog('logging off 14',FALSE) - IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_LOGOFF')) AND (StrLen(mailOptions.sysopEmail)>0) - StringF(tempstr,'\s: Ami-Express logoff notification',cmds.bbsName) - StringF(tempstr2,'This is a notification that \s from \s has logged off\n\n',loggedOnUser.name,loggedOnUser.location) - sendMail(tempstr,tempstr2,FALSE, NIL,0,mailOptions.sysopEmail) - ENDIF + doLogoffNotify() StrCopy(reservedName,'') @@ -7965,6 +8261,13 @@ PROC processLoggingOff() Delay(50) stateData:=0 writeLogoffLog('logging off 22',FALSE) + disableNodeMenus(FALSE) + disableOnlineMenus(TRUE) + + StrCopy(telnetUsername,'') + StrCopy(telnetPassword,'') + StrCopy(telnetUsernamePrompt,'') + StrCopy(telnetPasswordPrompt,'') quickFlag:=FALSE ansiColour:=TRUE @@ -8968,7 +9271,7 @@ PROC remoteShell() HANDLE StringF(temp,'newshell fifo:\s/rwkecs',fifoName) tags:=NEW [SYS_INPUT,0,SYS_OUTPUT,0,SYS_ASYNCH,1,TAG_DONE] SystemTagList(temp,tags) - END tags[countTags(tags)] + FastDisposeList(tags) pmask:=Shl(1,ioSink.sigbit) @@ -9105,7 +9408,7 @@ PROC doorLog(type, str:PTR TO CHAR) formatLongDateTime(getSystemTime(),str1) IF StrLen(str)>0 - StringF(string,'[\s[25]] \s - \d - \s[10]',str1,name,type,str) + StringF(string,'[\s[25]] \s - \d - \s',str1,name,type,str) ELSE StringF(string,'[\s[25]] \s - \d - Exiting',str1,name,type) ENDIF @@ -9416,8 +9719,8 @@ PROC checkAttachedFile(msgnumb,flag) StrCopy(tempStr,'') - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) ulTTTM:=NIL ulTTTM:=0 tTEFF:=NIL @@ -10400,12 +10703,7 @@ PROC saveNewMSG(gfh,mh:PTR TO mailHeader) UnLock(msgbaselock) IF (tempUser.slotNumber=1) - runExecuteOn('SYSOP_COMMENT') - IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_SYSOP_COMMENT')) AND (StrLen(mailOptions.sysopEmail)>0) - StringF(tempStr,'\s: Ami-Express sysop message notification',cmds.bbsName) - StringF(tempStr2,'This is a notification that \s has sent you a message.\n\nSubject: \s\n\n',mh.fromName,mh.subject) - sendMail(tempStr,tempStr2,TRUE, msgBuf,lines,mailOptions.sysopEmail) - ENDIF + doCommentNotify(mh.fromName,mh.subject) ENDIF IF(rzmsg) @@ -11013,13 +11311,13 @@ PROC chooseComputer() ENDFOR aePuts('\b\n') -jLoop5: +jLoop6: aePuts('Choose computer type: ') stat:=lineInput('','',3,INPUT_TIMEOUT,tempStr) IF(stat<0) THEN RETURN stat IF(StrLen(tempStr)=0) THEN RETURN RESULT_SUCCESS stat:=Val(tempStr) - IF((stat <= 0) OR (stat > computerTypes.count())) THEN JUMP jLoop5 + IF((stat <= 0) OR (stat > computerTypes.count())) THEN JUMP jLoop6 loggedOnUser.secBulletin:=stat-1 @@ -12151,7 +12449,7 @@ PROC flagFrom(s: PTR TO CHAR) StringF(tempStr,'\sdir\d',currentConfDir,maxDirs) IF(fp:=Open(tempStr,MODE_OLDFILE))<>0 WHILE(((ReadStr(fp,tempStr)<>-1) OR (StrLen(tempStr)>0)) AND (stat<>1)) - IF(StrLen(tempStr)>0) AND (tempStr[0]<>" ") + IF(dirLineNewFile(tempStr)) i:=0 WHILE((i" ")) tempStr2[i]:=tempStr[i] @@ -12354,25 +12652,25 @@ PROC checkFIBForFileSize(fullPath:PTR TO CHAR, checkConfNum, fBlock:PTR TO filei IF(dp=NIL) IF tfsizeList<>NIL THEN tfsizeList.setItem(checkConfNum-1,tfsizeList.item(checkConfNum-1)+fsize) - dtfsize:=dtfsize+fsize + addBCD(dtfsize,fsize) ENDIF ENDPROC dp -PROC checkForFileSize(checkFilename:PTR TO CHAR, checkConfNum, tfsizeList:PTR TO stdlist, freeDFlagList:PTR TO stdlist, cfn:PTR TO stdlist, z) +PROC checkForFileSize(checkFilename:PTR TO CHAR, subDirs:PTR TO CHAR, checkConfNum, tfsizeList:PTR TO stdlist, freeDFlagList:PTR TO stdlist, cfn:PTR TO stdlist, z) DEF stat,pstat=1,i DEF fflag=0,wflag=0,doflag=0 DEF path[255]:STRING,str[255]:STRING,tempstr[100]:STRING,tempstr2[100]:STRING DEF fname1[255]:STRING,fname2[255]:STRING DEF final[255]:STRING - DEF ft,dp + DEF ft=0,dp DEF fBlock: PTR TO fileinfoblock - DEF fLock=0 + DEF fLock=0,fLock2,res DEF drivenum DEF ramDir[255]:STRING DEF patternBuf,patBufLen - DEF debugcount + DEF debugcount,xit IF checkConfNum=-1 THEN checkConfNum:=currentConf @@ -12388,7 +12686,7 @@ PROC checkForFileSize(checkFilename:PTR TO CHAR, checkConfNum, tfsizeList:PTR TO IF StriCmp(fname1,fname2) StringF(tempstr,' File (\s) not found.\b\n',fname1) IF (ftpConn=FALSE) THEN aePuts(tempstr) - RETURN RESULT_FAILURE + RETURN RESULT_NOT_FOUND ENDIF ENDIF @@ -12397,7 +12695,7 @@ PROC checkForFileSize(checkFilename:PTR TO CHAR, checkConfNum, tfsizeList:PTR TO IF StriCmp(fname1,fname2) StringF(tempstr,' File (\s) not found.\b\n',fname1) IF ftpConn=FALSE THEN aePuts(tempstr) - RETURN RESULT_FAILURE + RETURN RESULT_NOT_FOUND ENDIF ENDIF @@ -12447,13 +12745,15 @@ jumpIn: IF(wflag=0) IF(sysopdl=0) StrCopy(final,path) + StrAdd(final,subDirs) + checkPathSlash(final) StrAdd(final,checkFilename) ELSE StrCopy(final,checkFilename) IF(findAssign(final)) THEN JUMP outst ENDIF StringF(ramDir,'RAM:DirCaches/Conf\dDir\d',checkConfNum,drivenum-1) - IF fileExists(ramDir) + IF (StrLen(subDirs)=0) AND (fileExists(ramDir)) ft:=Open(ramDir,MODE_OLDFILE) IF ft<>0 fLock:=NIL @@ -12462,6 +12762,7 @@ jumpIn: IF MatchPatternNoCase(patternBuf,ramDir) THEN fLock:=Lock(final,ACCESS_READ) ENDWHILE Close(ft) + ft:=0 ELSE fLock:=Lock(final,ACCESS_READ) ENDIF @@ -12480,6 +12781,10 @@ jumpIn: IF(doflag) IF fLock=NIL + StringF(ramDir,'RAM:DirCaches/Conf\dDir\d',checkConfNum,drivenum-1) + IF (StrLen(subDirs)=0) AND (fileExists(ramDir)) + ft:=Open(ramDir,MODE_OLDFILE) + ENDIF IF((fLock:=Lock(final,ACCESS_READ))=0) FreeDosObject(DOS_FIB,fBlock) StringF(str,'Error, Path \s missing, adjust paths file..',path) @@ -12500,32 +12805,64 @@ jumpIn: IF(wflag=0) THEN JUMP gotit debugcount:=0 - WHILE (ExNext(fLock,fBlock)) /* my change.. prior to this we had a blank file name */ - debugcount++ - IF(fBlock.direntrytype<0) + WHILE TRUE + IF(ft=0) + xit:=ExNext(fLock,fBlock)=0 + ELSE + xit:=(Fgets(ft,tempstr,255)=0) + IF (StrLen(tempstr)>18) AND (tempstr[8]=" ") AND (tempstr[17]=" ") THEN StrCopy(tempstr,tempstr+18) + ENDIF + EXIT xit + + debugcount++ + IF ft ORELSE (fBlock.direntrytype<0) gotit: - StrCopy(tempstr,fBlock.filename) + IF ft + IF tempstr[StrLen(tempstr)-1]=10 THEN SetStr(tempstr,StrLen(tempstr)-1) + ELSE + StrCopy(tempstr,fBlock.filename) + ENDIF UpperStr(tempstr) stat:=MatchPatternNoCase(patternBuf,tempstr) + res:=TRUE IF((stat<>0) OR sysopdl) fflag:=1 IF(sysopdl) StrCopy(final,checkFilename) ELSE + StrCopy(final,path) - StrAdd(final,fBlock.filename) + StrAdd(final,subDirs) + checkPathSlash(final) + + IF ft<>0 + StrAdd(final,tempstr) + fLock2:=Lock(final,ACCESS_READ) + IF fLock2 + Examine(fLock2,fBlock) + UnLock(fLock2) + ELSE + res:=FALSE + ENDIF + ELSE + StrAdd(final,fBlock.filename) + ENDIF ENDIF - IF (dp:=checkFIBForFileSize(final, checkConfNum, fBlock,tfsizeList,freeDFlagList,cfn, z))=-1 - FreeDosObject(DOS_FIB,fBlock) - UnLock(fLock) - RETURN 11 + IF res + IF (dp:=checkFIBForFileSize(final, checkConfNum, fBlock,tfsizeList,freeDFlagList,cfn, z))=-1 + FreeDosObject(DOS_FIB,fBlock) + UnLock(fLock) + IF ft<>0 THEN Close(ft) + RETURN 11 + ENDIF ENDIF IF(wflag=0) FreeDosObject(DOS_FIB,fBlock) UnLock(fLock) + IF ft<>0 THEN Close(ft) IF(dp<>NIL) THEN RETURN RESULT_FAILURE ELSE RETURN RESULT_SUCCESS ENDIF ENDIF @@ -12537,6 +12874,7 @@ gotit: IF(stat<0) FreeDosObject(DOS_FIB,fBlock) UnLock(fLock) + IF ft<>0 THEN Close(ft) RETURN RESULT_NO_CARRIER ENDIF SELECT stat @@ -12545,18 +12883,22 @@ gotit: IF(stat<0) FreeDosObject(DOS_FIB,fBlock) UnLock(fLock) + IF ft<>0 THEN Close(ft) RETURN RESULT_NO_CARRIER ENDIF CASE 3 /* ^C */ aePuts('**Break\b\n') FreeDosObject(DOS_FIB,fBlock) UnLock(fLock) + IF ft<>0 THEN Close(ft) RETURN 10 ENDSELECT ENDIF ENDIF ENDWHILE UnLock(fLock) + IF ft<>0 THEN Close(ft) + ft:=0 fLock:=0 IF(z=1) THEN JUMP outst ENDIF @@ -12575,7 +12917,7 @@ outst: StringF(str,' File (\s) not found.\b\n',checkFilename) aePuts(str) ENDIF - RETURN RESULT_FAILURE + RETURN RESULT_NOT_FOUND ENDIF IF(dp<>NIL) THEN RETURN RESULT_FAILURE @@ -12599,7 +12941,8 @@ PROC statPrint(s: PTR TO CHAR) IF(dStatBar AND (statWriteIO<>NIL)) IF(bitPlanes<3) - stripAnsi(s,str,0,0,ansi) + StrCopy(str,s) + stripAnsi2(str) statWriteIO.data:=str statWriteIO.length:=-1 statWriteIO.command:=CMD_WRITE @@ -12640,43 +12983,6 @@ ENDPROC regServer() PROC regServer() DEF port:PTR TO mp - DEF tempstr[255]:STRING - - IF debug - cmds:=NEW cmds - AstrCopy(cmds.bbsLoc,'BBS:',41) - - loadAccount(1,tempUser,tempUserKeys,tempUserMisc) - - AstrCopy(cmds.bbsName,'somebbs',41) - - AstrCopy(cmds.sysopName,tempUser.name,31) - - StringF(mybbsLoc,'\s','someplace') - - sopt:=NEW sopt - - sopt.leftEdge:=0 - sopt.topEdge:=0 - sopt.width:=640 - sopt.height:=256 - sopt.bitPlanes:=3 - - readToolType(TOOLTYPE_NODE,node,'SCREENS',tempstr) - AstrCopy(sopt.nodeScreens,tempstr) - - sopt.statBar:=0 - - sopt.toggles[TOGGLES_RED1]:=FALSE - sopt.toggles[TOGGLES_MULTICOM]:=FALSE - sopt.iconify:=FALSE - - cmds.numConf:=4 - - cmds.openingBaud:=115200 - cmds.taskPri:=240 - RETURN - ENDIF masterMsg.command:=SV_START WHILE((port:=FindPort('AE.Master'))=NIL) AND (SetSignal(0,SIGBREAKF_CTRL_C)=0) @@ -13349,10 +13655,16 @@ ENDPROC RESULT_GOODBYE /*PROC hexdump(buf,size) DEF i,j FOR i:=0 TO size-1 - WriteF('\h[2] ',buf[i]) - IF Mod(i,16)=15 - j:=i-15 - IF j<0 THEN j:=0 + WriteF('\r\z\h[2] ',buf[i]) + IF (Mod(i,16)=15) OR (i=(size-1)) + IF (i=size-1) + j:=i + WHILE (Mod(j,16)<15) + WriteF(' ') + j++ + ENDWHILE + ENDIF + j:=i & $fffffff0 REPEAT IF (buf[j]<32) OR (buf[j]>127) WriteF('.') @@ -13382,7 +13694,7 @@ PROC xprfopen() MOVE.L A0,fn MOVE.L A1,am - loadA4() + loadA4({tasksA4}) IF StriCmp(am,'r') filemode:=MODE_OLDFILE @@ -13476,7 +13788,7 @@ PROC xprfclose() -> A0 MOVE.L A0,fp - loadA4() + loadA4({tasksA4}) StringF(tempstr,'xprfclose \d',fp) debugLog(LOG_DEBUG,tempstr) @@ -13491,7 +13803,7 @@ PROC xprfclose() ENDIF ENDIF IF zModemInfo.needUpdateDownloadStats - zmdownloadcompleted(zModemInfo.filesize) + zmdownloadcompleted(zModemInfo.filesize,zModemInfo.filesize-zModemInfo.resumePos) zModemInfo.needUpdateDownloadStats:=FALSE ENDIF @@ -13507,7 +13819,7 @@ PROC xprchkabort() DEF winmsg:PTR TO intuimessage,res ->DEF tempstr[255]:STRING - loadA4() + loadA4({tasksA4}) res:=0 IF windowZmodem<>NIL @@ -13542,7 +13854,7 @@ PROC xprfread() MOVE.L D1,bcount MOVE.L A1,fp - loadA4() + loadA4({tasksA4}) ->StringF(tempstr,'xprfread: \d bytes',bsize*bcount) ->debugLog(LOG_DEBUG,tempstr) @@ -13576,7 +13888,7 @@ PROC xprfwrite() MOVE.L D1,bcount MOVE.L A1,fp - loadA4() + loadA4({tasksA4}) ->StringF(tempstr,'xprfwrite: \d bytes',Mul(bsize,bcount)) ->debugLog(LOG_DEBUG,tempstr) @@ -13610,7 +13922,7 @@ PROC xprsread() MOVE.L D0,bsize MOVE.L D1,timeout - loadA4() + loadA4({tasksA4}) StringF(tempstr,'xprsread: \d bytes \d timeout',bsize,timeout) debugLog(LOG_DEBUG,tempstr) @@ -13881,7 +14193,7 @@ PROC xprswrite() MOVE.L A0,buf MOVE.L D0,bsize - loadA4() + loadA4({tasksA4}) StringF(tempstr,'xprswrite: \d bytes',bsize) debugLog(LOG_DEBUG,tempstr) @@ -13908,7 +14220,7 @@ PROC xprfseek() MOVE.L D0,offset MOVE.L D1,origin - loadA4() + loadA4({tasksA4}) StringF(tempstr,'xprfseek: \d offset',offset) debugLog(LOG_DEBUG,tempstr) @@ -13940,7 +14252,7 @@ PROC xprsflushAsm() ENDPROC D0 PROC xprsflush() - loadA4() + loadA4({tasksA4}) debugLog(LOG_DEBUG,'xprsflush') ENDPROC FALSE @@ -13959,7 +14271,7 @@ PROC xprupdate() MOVE.L A0,xpru - loadA4() + loadA4({tasksA4}) IF(xpru.xpru_updatemask AND XPRU_ERRORMSG)<>0 AstrCopy(zModemInfo.zStat,xpru.xpru_errormsg,60) @@ -14057,7 +14369,7 @@ PROC xprsetserial() MOVE.L D0,newstatus - loadA4() + loadA4({tasksA4}) StringF(tempstr,'xprsetserial \d',newstatus) debugLog(LOG_DEBUG,tempstr) @@ -14081,7 +14393,7 @@ PROC xprfinfo() MOVE.L A0,fn MOVE.L D0,fitype - loadA4() + loadA4({tasksA4}) StringF(tempstr,'xprsfinfo - fitype \d \s',fitype,fn) debugLog(LOG_DEBUG,tempstr) @@ -14126,7 +14438,7 @@ ENDPROC D0 PROC xprunlink() DEF fn MOVE.L A0,fn - loadA4() + loadA4({tasksA4}) ENDPROC xprunlink2(fn) PROC xprunlink2(fn) @@ -14162,7 +14474,7 @@ PROC xprffirst() DEF buffer:PTR TO CHAR MOVE.L A0,buffer - loadA4() + loadA4({tasksA4}) ENDPROC xprffirst2(buffer) PROC xprffirst2(buffer) @@ -14186,7 +14498,7 @@ PROC xprfnext() MOVE.L A0,buffer - loadA4() + loadA4({tasksA4}) ENDPROC xprfnext2(buffer) @@ -14409,7 +14721,7 @@ PROC updateZDisplay() ENDIF ELSE IF zModemInfo.currentOperation=ZMODEM_DOWNLOAD - StringF(tempstr,'[Node \d] Send Window (\d/\d)',node,zModemInfo.currentDL,zModemInfo.total) + StringF(tempstr,'[Node \d] Send Window (\d/\d)',node,zModemInfo.currentDL,zModemInfo.totalDL) AstrCopy(zModemInfo.titleBar,tempstr) ELSE StringF(tempstr,'[Node \d] Receive Window (\d/??)',node,zModemInfo.currentUL) @@ -14445,7 +14757,7 @@ PROC updateZDisplay() DrawBevelBoxA(windowZmodem.rport,9,129,316,10,tags2) FreeVisualInfo(vi) - END tags2[countTags(tags2)] + FastDisposeList(tags2) CloseLibrary(gadtoolsbase) ENDIF @@ -14551,7 +14863,7 @@ PROC downloadFile(str: PTR TO CHAR,forceZmodem=FALSE) ENDFOR ENDIF - res:=downloadFiles(templist,0,FALSE,forceZmodem) + res:=downloadFiles(templist,NIL,FALSE,forceZmodem) clearFlagItems(templist) END templist @@ -14633,17 +14945,20 @@ PROC ftpUploadFileStart(fileName:PTR TO CHAR,resumefrom) zModemInfo.filesize:=0 zModemInfo.resumePos:=resumefrom zModemInfo.transPos:=0 - ftptime:=getSystemTime() + ftptime1,ftptime2:=getSystemTime() updateZDisplay() ENDPROC PROC ftpUploadFileEnd(fileName:PTR TO CHAR,success) DEF i DEF str[255]:STRING + DEF t1,t2 IF ftpConn THEN ulTTTM:=0 - ulTTTM:=ulTTTM+getSystemTime()-ftptime + t1,t2:=getSystemTime() + + ulTTTM:=ulTTTM+Mul(t1-ftptime1,50)+t2-ftptime2 setEnvStat(ENV_UPLOADING) IF ftpConn @@ -14651,12 +14966,19 @@ PROC ftpUploadFileEnd(fileName:PTR TO CHAR,success) StringF(str,'\tUploading \s \d bytes',fileName,zModemInfo.transPos) callersLog(str) - StringF(str,'\t 1 file(s), \dk bytes, \d minute(s). \d second(s), \d cps, N/A % efficiency.',Shr(zModemInfo.transPos,10),Div(ulTTTM,60),Mod(ulTTTM,60),tTCPS) + ulTTTM:=Div(ulTTTM,50) + StringF(str,'\t 1 file(s), \dk bytes, \d minute(s). \d second(s), \d cps, N/A % efficiency.',Shr(zModemInfo.transPos-zModemInfo.resumePos,10),Div(ulTTTM,60),Mod(ulTTTM,60),tTCPS) callersLog(str) ELSE callersLog('\tUpload Failed..') ENDIF - + + IF (tTCPS > loggedOnUserKeys.upCPS2) + loggedOnUserKeys.upCPS2:=tTCPS + IF tTCPS>65535 THEN tTCPS:=65535 + loggedOnUserKeys.oldUpCPS:=tTCPS + ENDIF + FOR i:=0 TO skipdFiles.count()-1 StringF(str,'\tSkipped \s',skipdFiles.item(i)) callersLog(str) @@ -14665,14 +14987,13 @@ PROC ftpUploadFileEnd(fileName:PTR TO CHAR,success) ENDIF ENDPROC -PROC ftpDownloadFileStart(fileName:PTR TO CHAR,filelen) +PROC ftpDownloadFileStart(fileName:PTR TO CHAR,filelen,resume) DEF fileItem:PTR TO flagFileItem DEF item:PTR TO flagFileItem DEF fn:PTR TO CHAR DEF i - ftptime:=getSystemTime() - + ftptime1,ftptime2:=getSystemTime() fileItem:=NIL fn:=FilePart(fileName) @@ -14690,9 +15011,9 @@ PROC ftpDownloadFileStart(fileName:PTR TO CHAR,filelen) zModemInfo.freeDFlag:=FALSE AstrCopy(zModemInfo.fileName,fn,255) ENDIF - + zModemInfo.filesize:=filelen - zModemInfo.resumePos:=0 + zModemInfo.resumePos:=resume zModemInfo.transPos:=0 tTEFF:=0 tTCPS:=0 @@ -14708,10 +15029,13 @@ PROC ftpDownloadFileEnd(fileName:PTR TO CHAR, result) DEF fn:PTR TO CHAR DEF tempStr[255]:STRING DEF i + DEF t1,t2 IF ftpConn THEN dlTTTM:=0 - dlTTTM:=dlTTTM+getSystemTime()-ftptime + t1,t2:=getSystemTime() + + dlTTTM:=dlTTTM+Mul(t1-ftptime1,50)+t2-ftptime2 fileItem:=NIL fn:=FilePart(fileName) @@ -14724,11 +15048,12 @@ PROC ftpDownloadFileEnd(fileName:PTR TO CHAR, result) IF fileItem=NIL THEN RETURN - IF (result) THEN updateDownloadStats(fileItem,zModemInfo.filesize) + IF (result) THEN updateDownloadStats(fileItem,zModemInfo.filesize,zModemInfo.filesize-zModemInfo.resumePos) IF ftpConn + dlTTTM:=Div(dlTTTM,50) IF result - StringF(tempStr,'\t 1 file(s), \dk bytes, \d minutes \d seconds \d cps, N/A % efficiency.',Shr(zModemInfo.filesize,10) AND $003fffff,Div(dlTTTM,60),Mod(dlTTTM,60),tTCPS) + StringF(tempStr,'\t 1 files, \dk bytes, \d minutes \d seconds \d cps, N/A % efficiency.',Shr(zModemInfo.filesize-zModemInfo.resumePos,10) AND $003fffff,Div(dlTTTM,60),Mod(dlTTTM,60),tTCPS) callersLog(tempStr) udLog(tempStr) ELSE @@ -14737,6 +15062,13 @@ PROC ftpDownloadFileEnd(fileName:PTR TO CHAR, result) ENDIF ENDIF + /* is this baud higher then max cps down ? */ + IF(tTCPS > loggedOnUserKeys.dnCPS2) + loggedOnUserKeys.dnCPS2:=tTCPS + IF tTCPS>65535 THEN tTCPS:=65535 + loggedOnUserKeys.oldDnCPS:=tTCPS + ENDIF + IF (result) removeFlagFromList(FilePart(fileItem.fileName),fileItem.confNum) ENDIF @@ -14959,16 +15291,14 @@ ENDPROC res<>0 PROC ftpAuth(userName:PTR TO CHAR,password:PTR TO CHAR) IF StriCmp(userName,loggedOnUser.name,31)=FALSE THEN RETURN FALSE - UpperStr(password) - IF calcPasswordHash(password)<>loggedOnUser.pwdHash THEN RETURN FALSE -ENDPROC TRUE +ENDPROC checkUserPassword(loggedOnUser,loggedOnUserMisc,password) -PROC ftpFindFile(filename:PTR TO CHAR,outFullFilename:PTR TO CHAR) +PROC ftpFindFile(filename:PTR TO CHAR,subdirs:PTR TO CHAR, outFullFilename:PTR TO CHAR) DEF fileList:PTR TO stdlist DEF fileItem:PTR TO flagFileItem fileList:=NEW fileList.stdlist(1) - checkForFileSize(filename,-1,NIL,NIL,fileList,0) + checkForFileSize(filename,subdirs,-1,NIL,NIL,fileList,0) IF fileList.count()>0 fileItem:=fileList.item(0) StrCopy(outFullFilename,fileItem.fileName) @@ -14977,41 +15307,43 @@ PROC ftpFindFile(filename:PTR TO CHAR,outFullFilename:PTR TO CHAR) END fileList ENDPROC -PROC updateDownloadStats(fileItem:PTR TO flagFileItem,fsize) +PROC updateDownloadStats(fileItem:PTR TO flagFileItem,fsize,sentsize) DEF cb:PTR TO confBase dlFileCount++ - dTBT:=addWO(dTBT,fsize) + addBCD(dTBT,sentsize) IF sopt.toggles[TOGGLES_CREDITBYKB] fsize:=Shr(fsize,10) AND $003fffff ENDIF - IF(checkSecurity(ACS_CONFERENCE_ACCOUNTING)) - saveMsgPointers(currentConf,currentMsgBase) + IF sentsize + IF(checkSecurity(ACS_CONFERENCE_ACCOUNTING)) + saveMsgPointers(currentConf,currentMsgBase) - IF(freeDownloads=FALSE) - IF creditAccountTrackDownloads(loggedOnUser) - cb:=confBases.item(getConfIndex(fileItem.confNum,1)) + IF(freeDownloads=FALSE) + IF creditAccountTrackDownloads(loggedOnUser) + cb:=confBases.item(getConfIndex(fileItem.confNum,1)) - addBCD(cb.downloadBytesBCD,fsize) - cb.bytesDownload:=convertFromBCD(cb.downloadBytesBCD) - cb.downloads:=cb.downloads+1 + addBCD(cb.downloadBytesBCD,fsize) + cb.bytesDownload:=convertFromBCD(cb.downloadBytesBCD) + cb.downloads:=cb.downloads+1 + ENDIF ENDIF - ENDIF - loadMsgPointers(currentConf,currentMsgBase) - ELSE - IF(freeDownloads=FALSE) - IF creditAccountTrackDownloads(loggedOnUser) + loadMsgPointers(currentConf,currentMsgBase) + ELSE + IF(freeDownloads=FALSE) + IF creditAccountTrackDownloads(loggedOnUser) - addBCD(loggedOnUserMisc.downloadBytesBCD,fsize) - loggedOnUser.bytesDownload:=convertFromBCD(loggedOnUserMisc.downloadBytesBCD) - loggedOnUser.downloads:=loggedOnUser.downloads+1 + addBCD(loggedOnUserMisc.downloadBytesBCD,fsize) + loggedOnUser.bytesDownload:=convertFromBCD(loggedOnUserMisc.downloadBytesBCD) + loggedOnUser.downloads:=loggedOnUser.downloads+1 + ENDIF ENDIF ENDIF + loggedOnUser.dailyBytesDld:=loggedOnUser.dailyBytesDld+fsize + IF bytesADL<>$7fffffff THEN bytesADL:=bytesADL-fsize ENDIF - loggedOnUser.dailyBytesDld:=loggedOnUser.dailyBytesDld+fsize - IF bytesADL<>$7fffffff THEN bytesADL:=bytesADL-fsize ENDPROC PROC ftpUpload(uploadFolder:PTR TO CHAR,ftpPorts,ftpDataPorts) @@ -15117,13 +15449,13 @@ PROC ftpDownload(fileList: PTR TO stdlist, updateDownloadStats,ftpPorts,ftpDataP ENDPROC ->this returns 0 = fail, 1 = success unlike most of the routines -PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize, updateDownloadStats, forceZmodem=FALSE) +PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize:PTR TO CHAR, updateDownloadStats, forceZmodem=FALSE) DEF tempstr[255]:STRING DEF tempstr2[255]:STRING DEF debugstr[255]:STRING DEF xprio: PTR TO xprIO DEF result - DEF time1,time2 + DEF time1,time2,ticks1,ticks2 DEF oldshared DEF ftpPorts:PTR TO LONG,ftpDataPorts:PTR TO LONG,httpPorts:PTR TO LONG DEF zm=NIL: PTR TO zmodem_t @@ -15139,6 +15471,7 @@ PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize, updateDownloadStats, DEF internalName[10]:STRING DEF path[255]:STRING DEF txwindow,rxwindow + DEF tmpBCD[8]:ARRAY OF CHAR DEF protocol[255]:STRING @@ -15210,7 +15543,7 @@ PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize, updateDownloadStats, zModemInfo.shouldUpdateDownloadStats:=updateDownloadStats zModemInfo.needUpdateDownloadStats:=FALSE - zModemInfo.currentDL:=0;zModemInfo.total:=fileList.count();zModemInfo.transPos:=0;zModemInfo.filesize:=0;zModemInfo.errorCount:=0;zModemInfo.errorPos:=0; zModemInfo.resumePos:=0 + zModemInfo.currentDL:=0;zModemInfo.totalDL:=fileList.count();zModemInfo.transPos:=0;zModemInfo.filesize:=0;zModemInfo.errorCount:=0;zModemInfo.errorPos:=0; zModemInfo.resumePos:=0 AstrCopy(zModemInfo.zStat,'') AstrCopy(zModemInfo.fileName,'') AstrCopy(zModemInfo.lastTime,'') @@ -15372,7 +15705,7 @@ PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize, updateDownloadStats, hyd.hyd_flush:={zmflush} hyd.hyd_isconnected:={zmisconnected} hyd.hyd_iscancelled:=NIL - hyd.hyd_logmessage:={zmlputs} + hyd.hyd_logmessage:={debugLog} hyd.hyd_getkey:={hydgetkey} hyd.hyd_sysidle:={hydsysidle} hyd.hyd_chatwrite:={hydchatwrite} @@ -15380,10 +15713,10 @@ PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize, updateDownloadStats, ELSEIF xmodemFlag OR ymodemFlag xym:=NEW xym - xym.log_level:=ZM_LOG_DEBUG + binaryRaw:=(telnetSocket>=0) xymodem_init(xym, 0, - {zmlputs}, + {debugLog}, {zmprogress}, IF telnetSocket>=0 THEN {zmrecvbyteTelnet} ELSE {zmrecvbyteSerial}, {zmisconnected}, @@ -15404,13 +15737,12 @@ PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize, updateDownloadStats, {zmnextfile}, 2048,0,binaryRaw,65536) xym.total_files:=fileList.count() - xym.total_bytes:=estimatedSize + IF estimatedSize THEN CopyMem(estimatedSize,xym.total_bytes,8) ELSE convertToBCD(0,xym.total_bytes) ELSE zm:=NEW zm - zm.log_level:=ZM_LOG_DEBUG binaryRaw:=(telnetSocket>=0) zmodem_init(zm, 0, - {zmlputs}, + {debugLog}, {zmprogress}, IF telnetSocket>=0 THEN {zmrecvbyteTelnet} ELSE {zmrecvbyteSerial}, {zmisconnected}, @@ -15431,12 +15763,19 @@ PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize, updateDownloadStats, {zmnextfile}, maxBlkSize,0,binaryRaw,65536) zm.total_files:=fileList.count() - zm.total_bytes:=estimatedSize + IF estimatedSize THEN CopyMem(estimatedSize,zm.total_bytes,8) ELSE convertToBCD(0,zm.total_bytes) ENDIF ENDIF asynciobase:=OpenLibrary('asyncio.library',0) + IF telnetSocket>=0 + willsent:=0 + dosent:=0 + iac(telnetSocket,253,0) ->do binary + iac(telnetSocket,251,0) ->will binary + ENDIF + IF ext StringF(debugstr,'xpr setup options = \s',tempstr) debugLog(LOG_DEBUG,debugstr) @@ -15465,10 +15804,10 @@ PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize, updateDownloadStats, IF ext xprio.xpr_filename:=NIL - time1:=getSystemTime() + time1,ticks1:=getSystemTime() result:=XprotocolSend(xprio) - time2:=getSystemTime() - dlTTTM:=time2-time1; + time2,ticks2:=getSystemTime() + dlTTTM:=Mul(time2-time1,50)+ticks2-ticks1; IF zModemInfo.transPos<>zModemInfo.filesize THEN result:=FALSE ELSE IF hydraFlag @@ -15484,14 +15823,20 @@ PROC downloadFiles(fileList: PTR TO stdlist, estimatedSize, updateDownloadStats, result:=zmodem_send_files(zm, NIL,{dlTimeTaken}) ENDIF dlTTTM:=dlTimeTaken + ENDIF - IF dlTTTM - tTCPS:=Mul(Div(dTBT,dlTTTM),50) - ELSE - tTCPS:=Mul(dTBT,50) - ENDIF - dlTTTM:=Div(dlTTTM,50) - tTEFF:=calcEfficiency(tTCPS,onlineBaud) + IF dlTTTM + CopyMem(dTBT,tmpBCD,8) + mulBCD(tmpBCD,50) + tTCPS:=divBCD(tmpBCD,dlTTTM) + ELSE + tTCPS:=convertFromBCD(dTBT) + ENDIF + tTEFF:=calcEfficiency(tTCPS,onlineBaud) + + IF telnetSocket>=0 + iac(telnetSocket,254,0) ->dont binary + iac(telnetSocket,252,0) ->wont binary ENDIF IF ext @@ -15550,8 +15895,8 @@ PROC checklist(lfnames: PTR TO stdlist, sizeList:PTR TO stdlist, freeDFlagList:P FOR i:=0 TO lfnames.count()-1 item:=lfnames.item(i) IF(StrLen(item.fileName)>0) - status:=checkForFileSize(item.fileName,item.confNum,sizeList,freeDFlagList,clrfinal,0) - IF((status=11) OR (status=10)) THEN RETURN RESULT_SUCCESS + status:=checkForFileSize(item.fileName,'',item.confNum,sizeList,freeDFlagList,clrfinal,0) + IF((status=RESULT_SIGNALLED) OR (status=RESULT_PRIVATE)) THEN RETURN RESULT_SUCCESS ENDIF ENDFOR ENDPROC RESULT_SUCCESS @@ -15580,6 +15925,7 @@ PROC displayUserToCallersLog(udonly) IF(udonly=FALSE) loggedOnUser.timesCalled:=loggedOnUser.timesCalled+1 callersLog(tempStr) + saveIPAddr() IF(logonType>=LOGON_TYPE_REMOTE) AND (checkToolTypeExists(TOOLTYPE_NODE,node,'LOG_HOST')) StringF(tempStr,'\tTelnet login address: \s (\s)',hostName,hostIP) callersLog(tempStr) @@ -15590,8 +15936,30 @@ PROC displayUserToCallersLog(udonly) ENDPROC -PROC isascii(n) -ENDPROC n<=127 +PROC saveIPAddr() + DEF v[5]:STRING + DEF i,v2, ip,p, p2 + p:=0 + ip:=0 + FOR i:=0 TO 3 + IF p>=0 + p2:=InStr(hostIP,'.',p) + v2:=0 + IF p2>=0 + StrCopy(v,hostIP+p,p2-p) + p:=p2+1 + ELSE + StrCopy(v,hostIP+p) + p:=StrLen(hostIP) + ENDIF + v2:=Val(v) + ip:=Shl(ip,8) OR v2 + ENDIF + ENDFOR + loggedOnUserMisc.lastIP:=ip +ENDPROC + +PROC isascii(n) IS n<=127 ->gets the actual name of a file (eg. you pass it a filename and it finds the correct case for it, so you can preserve the case) PROC getFileName(s: PTR TO CHAR) @@ -15657,7 +16025,7 @@ PROC fileCopy(from,to) DEF tempstr[255]:STRING ->if(Rename(from,to)) return(2); - buf,bufsize:=dynAllocate(getFileSize(from)+8192) + buf,bufsize:=dynAllocate(FileLength(from)+8192) IF(buf<>NIL) /* got a buffer full of mem */ IF(fhs:=Open(to,MODE_OLDFILE)) @@ -15788,7 +16156,7 @@ PROC hydsysidle() tv.secs:=1 tv.micro:=0 setSingleFDS(fds,telnetSocket) - WaitSelect(telnetSocket+1,fds,fds,0,tv,consig) + WaitSelect(telnetSocket+1,fds,fds,0,tv,{consig}) ELSE /*openTimer() setTimer(1,0) @@ -15972,26 +16340,11 @@ PROC hydstatus(hyd:PTR TO hydra_t,xmit) DrawBevelBoxA(rport,9,129,276,10,tags2) FreeVisualInfo(vi) - END tags2[countTags(tags2)] + FastDisposeList(tags2) CloseLibrary(gadtoolsbase) ENDIF ENDPROC/*hydra_status()*/ -PROC zmlputs(level, str:PTR TO CHAR) - SELECT level - CASE ZM_LOG_DEBUG - debugLog(LOG_DEBUG,str) - CASE ZM_LOG_INFO - debugLog(LOG_DEBUG,str) - CASE ZM_LOG_NOTICE - debugLog(LOG_DEBUG,str) - CASE ZM_LOG_WARNING - debugLog(LOG_WARN,str) - CASE ZM_LOG_ERR - debugLog(LOG_ERROR,str) - ENDSELECT -ENDPROC - PROC zmprogress(pos,cnt,filesize,s1,s2,errors,startpos,filename:PTR TO CHAR,newfile,blocksize) DEF t1,t2,t,td,n DEF h,m,s @@ -16066,7 +16419,7 @@ PROC zmrecvbyteTelnet(timeout) DEF r DEF tv:timeval ->DEF sysTime - + MOVE.L bufferReadOffset,A0 MOVE.L bufferedBytes,A1 MOVE.L zmodemRxBuffer,A2 @@ -16098,22 +16451,41 @@ testiac: BRA recret test1: - CMP.B #250,D0 - BCC.S test2 - - MOVEQ.L #2,D2 - MOVE.L D2,lastIAC - BRA repbuff - -test2: MOVEQ.L #2,D2 MOVE.L D2,lastIAC + MOVE.L D0,iaccmd BRA repbuff testiac2: CMP.B #2,D2 - BNE.S testiac3 + BNE testiac3 + + TST.B D0 + BNE notbin + CMP.L #251,iaccmd + BNE.S notwill + + TST.L dosent + BNE.S notwill + MOVEM.L D0-D7/A0-A6,-(A7) + iac(telnetSocket,253,0) ->if will binary then do binary + dosent:=1 + MOVEM.L (A7)+,D0-D7/A0-A6 + +notwill: + CMP.L #253,iaccmd + BNE.S notdo + + TST.L willsent + BNE.S notdo + MOVEM.L D0-D7/A0-A6,-(A7) + iac(telnetSocket,251,0) ->if do binary then will binary + willsent:=1 + MOVEM.L (A7)+,D0-D7/A0-A6 + +notdo: +notbin: CLR.L D2 MOVE.L D2,lastIAC BRA repbuff @@ -16128,8 +16500,8 @@ testiac3: buffempty: res:=1 - bufferReadOffset:=0 - bufferedBytes:=0 + bufferReadOffset:=0 + bufferedBytes:=0 IF timeout tv.secs:=timeout @@ -16144,8 +16516,8 @@ buffempty: IF (r:=Recv(telnetSocket,zmodemRxBuffer,zModemRxBufferSize,0))<>-1 bufferedBytes:=bufferedBytes+r ENDIF - ENDIF - + ENDIF + IF r<=0 IF (checkCarrier()=FALSE) THEN RETURN -1 ENDIF @@ -16171,11 +16543,27 @@ redo1: RETURN res ELSEIF (res>=250) AND (res<255) lastIAC:=2 + iac1:=res ELSE WriteF('unknown IAC \d\b\n',res) lastIAC:=2 ENDIF ELSEIF lastIAC=2 + IF res=0 + IF iac1=251 + //will + iacr[0]:=255 + iacr[1]:=253 + iacr[2]:=0 + serPuts(iacr,3,TRUE,TRUE) + ELSEIF iac1=253 + //do + iacr[0]:=255 + iacr[1]:=251 + iacr[2]:=0 + serPuts(iacr,3,TRUE,TRUE) + ENDIF + ENDIF lastIAC:=0 ELSEIF res=255 lastIAC:=1 @@ -16199,6 +16587,8 @@ redo1: n:=(zModemRxBufferSize-bufferedBytes) UNTIL (r=-1) OR (n=0) + sysTime:=getSystemTime() + IF ((lastCarrierCheck+5)NIL - uTBT:=addWO(uTBT,filesize) + addBCD(uTBT,filesize) recFileNames.add(FilePart(fname)) ulFileCount++ doBgCheck() @@ -16366,11 +16756,11 @@ PROC zmfclose(fh) ENDIF ENDPROC -PROC zmdownloadcompleted(fsize) +PROC zmdownloadcompleted(fsize,sentsize) DEF fileItem:PTR TO flagFileItem fileItem:=zModemInfo.fileList.item(zModemInfo.currentDL) removeFlagFromList(FilePart(fileItem.fileName),fileItem.confNum) - updateDownloadStats(fileItem,fsize) + updateDownloadStats(fileItem,fsize,sentsize) ENDPROC PROC zmfseek(fh,offset,origin) @@ -16419,12 +16809,12 @@ PROC createBackgroundFileCheckThread() bgStack:=readToolTypeInt(TOOLTYPE_NODE,node,'BGFILECHECKSTACK') IF bgStack<=0 THEN bgStack:=20000 - tags:=NEW [NP_ENTRY,{backgroundFileCheckThread},NP_STACKSIZE,bgStack,TAG_DONE]:LONG + tags:=NEW [NP_ENTRY,{backgroundFileCheckThread},NP_STACKSIZE,bgStack,TAG_DONE] Forbid() proc:=CreateNewProc(tags) - END tags[countTags(tags)] + FastDisposeList(tags) IF proc<>NIL - saveA4thread(proc.task) + saveA4(proc.task,{threadtasksA4}) ELSE transfering:=FALSE bgChecking:=FALSE @@ -16446,8 +16836,9 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE DEF tempstr[255]:STRING,tempstr2[255]:STRING,debugstr[255]:STRING DEF result DEF xprio=NIL: PTR TO xprIO - DEF time1,time2 + DEF time1,time2,ticks1,ticks2 DEF oldshared,bgport + DEF internalName[10]:STRING DEF msg:PTR TO jhMessage,tags=NIL:PTR TO LONG DEF ftpPorts:PTR TO LONG,ftpDataPorts:PTR TO LONG,httpPorts:PTR TO LONG DEF protocol[255]:STRING @@ -16462,12 +16853,14 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE DEF ulTimeTaken DEF ext=TRUE DEF txwindow,rxwindow + DEF tmpBCD[8]:ARRAY OF CHAR statWinType:=0 ObtainSemaphore(bgData) bgData.checkedCount:=0 - bgData.checkedBytes:=0 + convertToBCD(0,bgData.checkedBytes) + ReleaseSemaphore(bgData) IF (forceZmodem) OR (loggedOnUser=NIL) @@ -16476,34 +16869,42 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE StrCopy(protocol,(xprLib.item(loggedOnUser.xferProtocol))) ENDIF + IF(StriCmp(protocol,'INTERNAL')) + StrCopy(internalName,'ZModem') + ext:=FALSE + ENDIF + IF(StriCmp(protocol,'HYDRA')) StrCopy(protocol,'INTERNAL') hydraFlag:=TRUE statWinType:=1 + StrCopy(internalName,'Hydra') ext:=FALSE ENDIF IF(StriCmp(protocol,'INTERNALXM')) StrCopy(protocol,'INTERNAL') xmodemFlag:=TRUE + StrCopy(internalName,'XModem') ext:=FALSE ENDIF IF(StriCmp(protocol,'INTERNALYM')) StrCopy(protocol,'INTERNAL') ymodemFlag:=TRUE + StrCopy(internalName,'YModem') ext:=FALSE ENDIF IF(StriCmp(protocol,'INTERNAL8K')) StrCopy(protocol,'INTERNAL') maxBlkSize:=8192 + StrCopy(internalName,'ZModem') ext:=FALSE ENDIF - IF(StriCmp(protocol,'INTERNAL')) THEN ext:=FALSE - IF (StriCmp(protocol,'XPRZM')) + StrCopy(internalName,'ZModem') StrCopy(protocol,'INTERNAL') ext:=TRUE ENDIF @@ -16549,8 +16950,8 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE wantzwin:=FALSE checkOffhookFlag() receivePlayPen(TRUE) - IF (uTBT>0) AND (ulTTTM>0) - tTEFF:=calcEfficiency(Div(uTBT,ulTTTM),onlineBaud) + IF (ulTTTM>0) + tTEFF:=calcEfficiency(divBCD(uTBT,ulTTTM),onlineBaud) ELSE tTEFF:=0 ENDIF @@ -16578,8 +16979,8 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE wantzwin:=FALSE checkOffhookFlag() receivePlayPen(TRUE) - IF (uTBT>0) AND (ulTTTM>0) - tTEFF:=calcEfficiency(Div(uTBT,ulTTTM),onlineBaud) + IF (ulTTTM>0) + tTEFF:=calcEfficiency(divBCD(uTBT,ulTTTM),onlineBaud) ELSE tTEFF:=0 ENDIF @@ -16659,7 +17060,7 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE hyd.hyd_flush:={zmflush} hyd.hyd_isconnected:={zmisconnected} hyd.hyd_iscancelled:=NIL - hyd.hyd_logmessage:={zmlputs} + hyd.hyd_logmessage:={debugLog} hyd.hyd_getkey:={hydgetkey} hyd.hyd_sysidle:={hydsysidle} hyd.hyd_chatwrite:={hydchatwrite} @@ -16667,10 +17068,9 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE ELSEIF xmodemFlag OR ymodemFlag xym:=NEW xym - xym.log_level:=ZM_LOG_DEBUG binaryRaw:=(telnetSocket>=0) xymodem_init(xym, 0, - {zmlputs}, + {debugLog}, {zmprogress}, IF telnetSocket>=0 THEN {zmrecvbyteTelnet} ELSE {zmrecvbyteSerial}, {zmisconnected}, @@ -16692,10 +17092,9 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE 2048,0,binaryRaw,0) ELSE zm:=NEW zm - zm.log_level:=ZM_LOG_DEBUG binaryRaw:=(telnetSocket>=0) zmodem_init(zm, 0, - {zmlputs}, + {debugLog}, {zmprogress}, IF telnetSocket>=0 THEN {zmrecvbyteTelnet} ELSE {zmrecvbyteSerial}, {zmisconnected}, @@ -16720,6 +17119,13 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE asynciobase:=OpenLibrary('asyncio.library',0) + IF telnetSocket>=0 + willsent:=0 + dosent:=0 + iac(telnetSocket,253,0) ->do binary + iac(telnetSocket,251,0) ->will binary + ENDIF + IF ext StrCopy(tempstr,'') IF(StriCmp(protocol,'INTERNAL')) @@ -16758,10 +17164,10 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE ENDIF IF ext - time1:=getSystemTime() + time1,ticks1:=getSystemTime() result:=XprotocolReceive(xprio) - time2:=getSystemTime() - ulTTTM:=Mul(time2-time1,50) + time2,ticks2:=getSystemTime() + ulTTTM:=Mul(time2-time1,50)+ticks2-ticks1; ELSE IF hydraFlag result:=hydra_do_transfer(hyd,file,NIL,NIL,NIL,{ulTimeTaken}) @@ -16773,13 +17179,19 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE ulTTTM:=ulTimeTaken ENDIF IF ulTTTM - tTCPS:=Mul(Div(uTBT,ulTTTM),50) + CopyMem(uTBT,tmpBCD,8) + mulBCD(tmpBCD,50) + tTCPS:=divBCD(tmpBCD,ulTTTM) ELSE - tTCPS:=Mul(uTBT,50) + tTCPS:=convertFromBCD(uTBT) ENDIF tTEFF:=calcEfficiency(tTCPS,onlineBaud) - ulTTTM:=Div(ulTTTM,50) + IF telnetSocket>=0 + iac(telnetSocket,254,0) ->dont binary + iac(telnetSocket,252,0) ->wont binary + ENDIF + IF ext XprotocolCleanup(xprio) ELSE @@ -16799,7 +17211,7 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE IF msg msg.command:=BG_EXIT msg.msg.length:=SIZEOF jhMessage - + msg.msg.ln.type:=NT_FREEMSG ->signal background checking to finish PutMsg(bgport,msg) @@ -16823,7 +17235,11 @@ PROC fileUpload(file,forceZmodem=FALSE) HANDLE Delay(50) - aePuts(protocol) + IF(StriCmp(protocol,'INTERNAL')) + aePuts(internalName) + ELSE + aePuts(xprTitle.item(loggedOnUser.xferProtocol)) + ENDIF IF(result) THEN aePuts(' upload successful\b\n') ELSE aePuts(' upload unsuccessful\b\n') IF tags<>NIL THEN END tags @@ -16953,7 +17369,7 @@ PROC scanHoldDesc() lcFileXfr:=TRUE aePuts('Preparing Lost Carrier File(s) for File Description(s)\b\n\b\n') WHILE((ReadStr(fi,string)<>-1) OR (StrLen(string)>0)) - IF(string[0]<>" ") + IF(dirLineNewFile(string)) IF ((p:=InStr(string,' '))>=0) THEN SetStr(string,p) StringF(text,'\sLCFILES/\s',currentConfDir,string) @@ -17414,7 +17830,7 @@ PROC batchasl(where: PTR TO CHAR) HANDLE ENDIF EXCEPT DO IF fr THEN FreeAslRequest(fr) - IF tags THEN END tags[countTags(tags)] + IF tags THEN FastDisposeList(tags) IF aslbase THEN CloseLibrary(aslbase) SELECT exception CASE ERR_ASL @@ -17493,7 +17909,7 @@ PROC receivePlayPen(log) ObtainSemaphore(bgData) ulFileCount:=bgData.checkedCount - uTBT:=bgData.checkedBytes + CopyMem(bgData.checkedBytes,uTBT,8) ReleaseSemaphore(bgData) recFileNames.clear() @@ -17541,7 +17957,7 @@ PROC receivePlayPen(log) s++ ENDWHILE ulFileCount++ - uTBT:=addWO(uTBT,fib.size) + addBCD(uTBT,fib.size) IF log StringF(tempstr,'\tUploading \s[12] \d bytes',fib.filename, fib.size) udLog(tempstr) @@ -17872,7 +18288,7 @@ ENDPROC RESULT_SUCCESS PROC checkForFile(fn: PTR TO CHAR) DEF path[255]:STRING,final[255]:STRING - DEF x + DEF x IF((InStr(fn,'%')>=0) OR ((InStr(fn,'#'))>=0) OR ((InStr(fn,'?'))>=0) OR ((InStr(fn,' '))>=0) OR ((InStr(fn,'/'))>=0) OR ((InStr(fn,'('))>=0) OR ((InStr(fn,')'))>=0) OR ((InStr(fn,':'))>=0) OR ((InStr(fn,'*'))>=0)) THEN RETURN RESULT_FAILURE @@ -17947,6 +18363,7 @@ PROC doBgCheck() IF msg msg.command:=BG_CHECKFILE AstrCopy(msg.string,FilePart(zModemInfo.fileName),200) + msg.msg.ln.type:=NT_FREEMSG msg.msg.length:=SIZEOF jhMessage ->signal background checking to check the file @@ -17962,7 +18379,7 @@ PROC backgroundFileCheckThread() DEF exit=FALSE DEF msgcmd,type - loadA4thread() + loadA4({threadtasksA4}) bgCheckPort:=createPort(bgCheckPortName,0) IF bgCheckPort @@ -18015,6 +18432,8 @@ PROC checkFileExternal(temp: PTR TO CHAR, checkFile: PTR TO CHAR) stat:=RESULT_SUCCESS +debugLog(LOG_ERROR,'debug10d1') + IF readToolType(TOOLTYPE_FCHECK,temp,'CHECKER',s) StrCopy(options,s) ELSE @@ -18038,32 +18457,41 @@ PROC checkFileExternal(temp: PTR TO CHAR, checkFile: PTR TO CHAR) pri:=0 ENDIF ->(RTS) +debugLog(LOG_ERROR,'debug10d2') StrAdd(options,' ') StrAdd(options,checkFile) StringF(fileName,'\sOutPut_Of_Test',nodeWorkDir) IF((fi:=Open(fileName,MODE_NEWFILE)))<>0 - filetags:=NEW [SYS_INPUT,0,SYS_OUTPUT,fi,NP_STACKSIZE,stack,NP_PRIORITY,pri,TAG_DONE]:LONG + filetags:=NEW [SYS_INPUT,0,SYS_OUTPUT,fi,NP_STACKSIZE,stack,NP_PRIORITY,pri,TAG_DONE] +debugLog(LOG_ERROR,'debug10d3') SystemTagList(options,filetags) - END filetags[countTags(filetags)] +debugLog(LOG_ERROR,'debug10d4') + FastDisposeList(filetags) Close(fi) +debugLog(LOG_ERROR,'debug10d5') IF bgChecking=FALSE THEN displayOutPutofTest() +debugLog(LOG_ERROR,'debug10d6') IF(readToolType(TOOLTYPE_FCHECK,temp,'SCRIPT',s)) StrAdd(s,' ') IF(fi:=Open('NIL:',MODE_NEWFILE))<>0 - filetags:=NEW [SYS_INPUT,0,SYS_OUTPUT,fi,NP_STACKSIZE,stack,NP_PRIORITY,pri,TAG_DONE]:LONG + filetags:=NEW [SYS_INPUT,0,SYS_OUTPUT,fi,NP_STACKSIZE,stack,NP_PRIORITY,pri,TAG_DONE] +debugLog(LOG_ERROR,'debug10d7') StringF(options,'\s \s \s \d',s,checkFile,FilePart(checkFile),node) SystemTagList(options,filetags) - END filetags[countTags(filetags)] +debugLog(LOG_ERROR,'debug10d8') + FastDisposeList(filetags) Close(fi) ENDIF ENDIF +debugLog(LOG_ERROR,'debug10d9') StringF(options,'\sOutPut_Of_Test',nodeWorkDir) i:=1 StringF(fileName,'ERROR.\d',i) i++ +debugLog(LOG_ERROR,'debug10d10') WHILE(readToolType(TOOLTYPE_FCHECK,temp,fileName,s)) fi1:=Open(options,MODE_OLDFILE) WHILE((ReadStr(fi1,image)<>-1)) OR (StrLen(image)>0) @@ -18078,11 +18506,15 @@ PROC checkFileExternal(temp: PTR TO CHAR, checkFile: PTR TO CHAR) StringF(fileName,'ERROR.\d',i) i++ ENDWHILE +debugLog(LOG_ERROR,'debug10d11') SetProtection(options,FIBF_OTR_DELETE) DeleteFile(options) +debugLog(LOG_ERROR,'debug10d12') ELSE +debugLog(LOG_ERROR,'debug10d13') RETURN 0,stat ENDIF +debugLog(LOG_ERROR,'debug10d14') ENDPROC 1,stat PROC testFile(str: PTR TO CHAR, path: PTR TO CHAR) @@ -18118,7 +18550,9 @@ PROC testFile(str: PTR TO CHAR, path: PTR TO CHAR) aePuts('\b\n') StrAdd(temp4,temp) +debugLog(LOG_ERROR,'debug10d') r,stat:=checkFileExternal(temp2,temp4) +debugLog(LOG_ERROR,'debug10e') RETURN stat ENDIF ENDIF @@ -18238,6 +18672,7 @@ PROC sysopUpload() DEF tempstr2[255]:STRING DEF destpath[255]:STRING DEF string[255]:STRING + DEF tmpBCD[8]:ARRAY OF CHAR DEF str[255]:STRING DEF stat,cnt DEF spacehi,spacelo,space2hi,space2lo @@ -18280,8 +18715,8 @@ PROC sysopUpload() ulFileCount:=0 skipdFiles.clear() - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) dlTTTM:=0 ulTTTM:=0 tTEFF:=0 @@ -18295,7 +18730,12 @@ PROC sysopUpload() sysopUploading:=FALSE aePuts('\b\n\b\nFile Uploading Complete...\b\n') - StringF(string,' \d file(s), \dk bytes, \d minute(s). \d second(s), \d cps, \d% efficiency.',ulFileCount,Shr(uTBT,10) AND $003fffff,Div(ulTTTM,60),Mod(ulTTTM,60),tTCPS,tTEFF) + CopyMem(uTBT,tmpBCD,8) + divBCD1024(tmpBCD) + formatBCD(tmpBCD,tempstr) + + ulTTTM:=Div(ulTTTM,50) + StringF(string,' \d file(s), \sk bytes, \d minute(s). \d second(s), \d cps, \d% efficiency.',ulFileCount,tempstr,Div(ulTTTM,60),Mod(ulTTTM,60),tTCPS,tTEFF) aePuts(string) aePuts('\b\n\b\n') @@ -18393,12 +18833,13 @@ PROC uploadaFile(uLFType,cmd,attach,alreadyUploaded=FALSE) -> JOE DEF odate[20]:STRING,fcomment[256]:STRING DEF ray[256]:STRING,ray2[256]:STRING,string[256]:STRING DEF buff[255]:STRING + DEF tmpBCD[8]:ARRAY OF CHAR DEF tempstr[255]:STRING,tempstr2[255]:STRING,tempstr3[255]:STRING DEF uaf,f DEF foundDupe=0 DEF mstat /* check for carrier. trying to stop upload guru from parcial upload */ DEF fsstr[11]:STRING - DEF tempsize,bgCnt,bgBytes + DEF tempsize,bgCnt DEF dizSysCmd[255]:STRING DEF exitLoop @@ -18476,16 +18917,16 @@ PROC uploadaFile(uLFType,cmd,attach,alreadyUploaded=FALSE) -> JOE /* uploading to another device?? */ IF(StrLen(sopt.ramPen)>0) THEN StrCopy(path,sopt.ramPen) ELSE StringF(path,'\sNode\d/Playpen/',cmds.bbsLoc,node) - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) ulTTTM:=0 dlTTTM:=0 tTEFF:=0 tTCPS:=0 - IF(beenUDd=0) + IF(beenUDd=FALSE) displayUserToCallersLog(1) - beenUDd:=1 + beenUDd:=TRUE ENDIF fileReceive(path,uLFType) /* path of upload */ @@ -18497,15 +18938,19 @@ PROC uploadaFile(uLFType,cmd,attach,alreadyUploaded=FALSE) -> JOE pcps:=NIL ObtainSemaphore(bgData) bgCnt:=bgData.checkedCount - bgBytes:=bgData.checkedBytes ReleaseSemaphore(bgData) - IF(ulFileCount<>0) OR (bgBytes<>0) + IF(ulFileCount<>0) OR (bgCnt<>0) peff:=tTEFF pcps:=tTCPS ENDIF - StringF(string,' \d file(s), \dk bytes, \d minute(s). \d second(s), \d cps, \d% efficiency.',ulFileCount,Shr(uTBT,10) AND $003fffff,Div(ulTTTM,60),Mod(ulTTTM,60),pcps,peff) + CopyMem(uTBT,tmpBCD,8) + divBCD1024(tmpBCD) + formatBCD(tmpBCD,tempstr) + + ulTTTM:=Div(ulTTTM,50) + StringF(string,' \d file(s), \sk bytes, \d minute(s). \d second(s), \d cps, \d% efficiency.',ulFileCount,tempstr,Div(ulTTTM,60),Mod(ulTTTM,60),pcps,peff) aePuts(string) IF (pcps > loggedOnUserKeys.upCPS2) @@ -18531,13 +18976,7 @@ PROC uploadaFile(uLFType,cmd,attach,alreadyUploaded=FALSE) -> JOE callersLog(str) udLog(str) - runExecuteOn('UPLOAD') - - IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_UPLOAD')) AND (StrLen(mailOptions.sysopEmail)>0) - StringF(str,'\s: Ami-Express logoff notification',cmds.bbsName) - StringF(string,'This is a notification that \s from \s has logged off\n\n',loggedOnUser.name,loggedOnUser.location) - sendMail(str,string,FALSE, NIL,0,mailOptions.sysopEmail) - ENDIF + doUploadNotify() ELSE callersLog('\tUpload Failed..') udLog('\tUpload Failed..') @@ -18589,6 +19028,7 @@ PROC uploadaFile(uLFType,cmd,attach,alreadyUploaded=FALSE) -> JOE /* loop thru uploaded (ing) list of files & move to where they belong*/ /* this gets the list of files uploaded */ + FOR x:=0 TO recFileNames.count()-1 StrCopy(str,recFileNames.item(x)) IF(cmds.acLvl[LVL_CAPITOLS_in_FILE]=1) THEN UpperStr(str) @@ -18793,6 +19233,7 @@ cNext: status2:=testFile(str,path) IF((status2=RESULT_NOT_ALLOWED) OR (status2=RESULT_SUCCESS)) THEN aePuts('\b\nTested Ok...') ENDIF + status:=checkForFile(str) IF(moveToLCFILES) @@ -18894,6 +19335,7 @@ move_It: /* gets here if lostcarrier, and file is complete but not when file StringF(fmtstr,'\l\s[13] \s \s \s\n',str,fsstr,odate,fcomment) ENDIF + IF(StrLen(str) < 13) /* for big file name on lost carrier */ IF(checksym) fmtstr[13]:=checksym @@ -18961,7 +19403,7 @@ eit: cleanItUp() /* we get here after lcfile but gugued*/ - tempsize:=uTBT + tempsize:=convertFromBCD(uTBT) IF sopt.toggles[TOGGLES_CREDITBYKB] tempsize:=Shr(tempsize,10) AND $003fffff ENDIF @@ -19042,7 +19484,7 @@ PROC doBackgroundCheck(fname:PTR TO CHAR) Close(fh) ENDIF - fsize:=getFileSize(fileName) + fsize:=FileLength(fileName) status2:=RESULT_NOT_ALLOWED @@ -19108,7 +19550,7 @@ PROC doBackgroundCheck(fname:PTR TO CHAR) ObtainSemaphore(bgData) bgData.checkedCount:=bgData.checkedCount+1 - bgData.checkedBytes:=bgData.checkedBytes+fsize + addBCD(bgData.checkedBytes,fsize) ReleaseSemaphore(bgData) sysopULStats(hold) @@ -19382,7 +19824,7 @@ PROC downloadAFile(cmdcode: PTR TO CHAR, params) HANDLE DEF tsec,min,secs,i,x,status,mystat,proto DEF peff,pcps ->DEF tempsize,tbad - DEF badBCD[8]:ARRAY OF CHAR + DEF tmpBCD[8]:ARRAY OF CHAR DEF bcdStr[20]:STRING DEF tempStr[255]:STRING DEF tempStr2[255]:STRING @@ -19415,7 +19857,7 @@ PROC downloadAFile(cmdcode: PTR TO CHAR, params) HANDLE estDlCPS:=Div(onlineBaud,10) ENDIF - dtfsize:=0 + convertToBCD(0,dtfsize) displayULStats(loggedOnUser,loggedOnUserMisc) /* Show User stats.. Num Dnloads, uploads */ @@ -19431,18 +19873,18 @@ PROC downloadAFile(cmdcode: PTR TO CHAR, params) HANDLE ENDIF IF(loggedOnUser.secBoard<2) - convertToBCD(0,badBCD) + convertToBCD(0,tmpBCD) FOR i:=1 TO loggedOnUser.secLibrary - addBCD2(badBCD,loggedOnUserMisc.uploadBytesBCD) + addBCD2(tmpBCD,loggedOnUserMisc.uploadBytesBCD) ENDFOR - subBCD2(badBCD,loggedOnUserMisc.downloadBytesBCD) - IF badBCD[0]>=$50 + subBCD2(tmpBCD,loggedOnUserMisc.downloadBytesBCD) + IF tmpBCD[0]>=$50 ->result was negative StrCopy(bcdStr,'0') cnt:=0 ELSE - formatBCD(badBCD,bcdStr) - cnt:=convertFromBCD(badBCD) + formatBCD(tmpBCD,bcdStr) + cnt:=convertFromBCD(tmpBCD) ->bad needs to be used in a signed comparison, so don't allow values >7fffffff IF cnt<0 THEN cnt:=$7fffffff @@ -19603,8 +20045,8 @@ arestart: ENDFOR ENDIF - status:=checkForFileSize(tempStr,currentConf,tfsizes,freeDFlags,finalList,0) - IF((status=RESULT_FAILURE) OR (status=11) OR (status=10)) + status:=checkForFileSize(tempStr,'',currentConf,tfsizes,freeDFlags,finalList,0) + IF((status=RESULT_FAILURE) OR (status=RESULT_SIGNALLED) OR (status=RESULT_PRIVATE)) Throw(ERR_EXCEPT,RESULT_SUCCESS) ENDIF ENDLOOP @@ -19633,10 +20075,12 @@ astart: ENDIF aePuts(tempStr) - tsec:=Div(dtfsize,estDlCPS) - min:=tsec/60 - secs:=tsec-(min*60) - StringF(tempStr,' \d files, \dk bytes, \d mins \d secs\b\n',numFiles,Shr(dtfsize,10) AND $003fffff,min,secs) + tsec:=divBCD(dtfsize,estDlCPS) + min:=Div(tsec,60) + secs:=tsec-(Mul(min,60)) + CopyMem(dtfsize,tmpBCD,8) + divBCD1024(tmpBCD) + StringF(tempStr,' \d files, \dk bytes, \d mins \d secs\b\n',numFiles,convertFromBCD(tmpBCD),min,secs) aePuts(tempStr) IF(min>(Div(timeLimit,60))) AND (checkSecurity(ACS_OVERRIDE_TIMELIMIT)=FALSE) @@ -19667,8 +20111,8 @@ breakd: IF (mystat<>13) THEN aePuts('Goodbye!\b\n\b\n') ELSE aePuts('\b\n\b\n') - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) ulTTTM:=0 dlTTTM:=0 tTEFF:=0 @@ -19692,16 +20136,19 @@ breakd: ->peff:=Div(tTEFF,onlineNFiles) ->pcps:=Div(tTCPS,onlineNFiles) peff:=tTEFF - pcps:=tTCPS + pcps:=tTCPS + loggedOnUserMisc.lastDlCPS:=pcps ENDIF ->// (RTS) added dnload cps rate Fri Mar 27 13:13:29 1992 - StringF(string,' \d files, \dk bytes, \d minutes \d seconds \d cps, \d% efficiency at \d',dlFileCount,Shr(dTBT,10) AND $003fffff,Div(dlTTTM,60),Mod(dlTTTM,60),pcps,peff,onlineBaud) + CopyMem(dTBT,tmpBCD,8) + divBCD1024(tmpBCD) + formatBCD(tmpBCD,tempStr) + dlTTTM:=Div(dlTTTM,50) + StringF(string,' \d files, \sk bytes, \d minutes \d seconds \d cps, \d% efficiency at \d',dlFileCount,tempStr,Div(dlTTTM,60),Mod(dlTTTM,60),pcps,peff,onlineBaud) aePuts(string) aePuts('\b\n\b\n') - loggedOnUserMisc.lastDlCPS:=pcps - - /* is this baud higher then max cps up ? */ + /* is this baud higher then max cps down ? */ IF(pcps > loggedOnUserKeys.dnCPS2) loggedOnUserKeys.dnCPS2:=pcps IF pcps>65535 THEN pcps:=65535 @@ -19722,17 +20169,19 @@ breakd: udLog('\tDownload Failed..') ENDIF - IF (uTBT>0) + IF (ulFileCount>0) ->hydra uploads ObtainSemaphore(bgData) bgData.checkedCount:=0 - bgData.checkedBytes:=0 + convertToBCD(0,bgData.checkedBytes) ReleaseSemaphore(bgData) IF ulTTTM - tTCPS:=Div(uTBT,ulTTTM) + CopyMem(uTBT,tmpBCD,8) + mulBCD(tmpBCD,50) + tTCPS:=divBCD(tmpBCD,ulTTTM) ELSE - tTCPS:=uTBT + tTCPS:=convertFromBCD(uTBT) ENDIF tTEFF:=calcEfficiency(tTCPS,onlineBaud) @@ -20629,6 +21078,17 @@ PROC findUserAnswers(which,answersFilename:PTR TO CHAR) IF (i>MAXNODES) OR (lock=0) THEN StrCopy(answersFilename,'') ENDPROC StrLen(answersFilename)>0 +PROC checkChanges(changes) + DEF ch + IF changes=FALSE THEN RETURN TRUE + aePuts('You have unsaved changes. Do you wish to lose them (Y/N)? ') + ch:=readChar(INPUT_TIMEOUT) + IF(ch<0) THEN RETURN TRUE + aePuts('') + + IF((ch="Y") OR (ch="y")) THEN RETURN TRUE +ENDPROC FALSE + PROC editInfo(which:LONG, hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: PTR TO userMisc,f6) DEF flag, command @@ -20637,6 +21097,7 @@ PROC editInfo(which:LONG, hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: DEF checkLock DEF page=0 DEF value1,value2 + DEF changes=FALSE nofkeys:=1 displayAccount(which,page,hoozer,hoozer2,hoozer3,f6) @@ -20668,32 +21129,65 @@ PROC editInfo(which:LONG, hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: SELECT command CASE "\t" - flag:=2 + IF f6 ORELSE checkChanges(changes) + flag:=2 + ENDIF CASE "X" /* NO-SAVE */ - aePuts('No-Save\b\n') - flag:=1 + IF f6 ORELSE checkChanges(changes) + aePuts('No-Save\b\n') + flag:=1 + ENDIF CASE " " - ->page:=Eor(page,1) - ->sendCLS() - ->displayAccount(which,page,hoozer,hoozer2,hoozer3,f6) + page:=Eor(page,1) + sendCLS() + displayAccount(which,page,hoozer,hoozer2,hoozer3,f6) CASE "+" IF(onlineEdit=FALSE) - which:=which+1 - IF(loadAccount(which,hoozer,hoozer2,hoozer3)<>RESULT_FAILURE) - displayAccountInfo(which,page,hoozer,hoozer2,hoozer3,f6) - ELSE - which:=1 - loadAccount(which,hoozer,hoozer2,hoozer3) - displayAccountInfo(which,page,hoozer,hoozer2,hoozer3,f6) + IF checkChanges(changes) + which:=which+1 + changes:=FALSE + IF(loadAccount(which,hoozer,hoozer2,hoozer3)<>RESULT_FAILURE) + displayAccountInfo(which,page,hoozer,hoozer2,hoozer3,f6) + ELSE + which:=1 + loadAccount(which,hoozer,hoozer2,hoozer3) + displayAccountInfo(which,page,hoozer,hoozer2,hoozer3,f6) + ENDIF ENDIF ENDIF CASE "-" IF(onlineEdit=FALSE) - which:=which-1 - IF(which<1) THEN which:=findLastAccount() - loadAccount(which,hoozer,hoozer2,hoozer3) - displayAccountInfo(which,page,hoozer,hoozer2,hoozer3,f6) + IF checkChanges(changes) + which:=which-1 + changes:=FALSE + IF(which<1) THEN which:=findLastAccount() + loadAccount(which,hoozer,hoozer2,hoozer3) + displayAccountInfo(which,page,hoozer,hoozer2,hoozer3,f6) + ENDIF ENDIF + CASE "~" /* SAVE */ + aePuts('Save\b\n') + hoozer.newUser:=0 + displayAccountInfo(which,page,hoozer,hoozer2,hoozer3,f6) + IF(hoozer.slotNumber=0) + hoozer2.number:=0 + stat:=saveAccount(hoozer,hoozer2,hoozer3,which,1) /* 1 = FORCE SAVE */ + + IF(stat<>RESULT_SUCCESS) THEN aePuts('Can''t Save account\b\n') + ELSE + hoozer2.number:=hoozer.slotNumber + /* save using Slot_number */ + stat:=saveAccount(hoozer,hoozer2,hoozer3,0,0) /* Not forced */ + IF(stat<>RESULT_SUCCESS) THEN aePuts('Can''t Save account\b\n') + ENDIF + + IF logonType>=LOGON_TYPE_REMOTE + StringF(tempStr,'\tREMOTE Account Maintenance on Account \d',hoozer.slotNumber) + ELSE + StringF(tempStr,'\tLOCAL Account Maintenance on Account \d',hoozer.slotNumber) + ENDIF + callersLog(tempStr) + changes:=FALSE CASE "!" /* Credit Maintenance */ creditMaintenance(which,hoozer,hoozer2,hoozer3,f6) displayAccount(which,page,hoozer,hoozer2,hoozer3,f6) @@ -20722,6 +21216,7 @@ PROC editInfo(which:LONG, hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: StringF(tempStr,'Preset \d. ',preset) aePuts(tempStr) + changes:=TRUE hoozer.newUser:=0 applyPreset(hoozer,TOOLTYPE_PRESET,preset) @@ -20750,65 +21245,65 @@ PROC editInfo(which:LONG, hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: stat:=which hoozer.slotNumber:=0 hoozer2.number:=0 + changes:=TRUE stat:=saveAccount(hoozer,hoozer2,hoozer3,stat,1) IF(stat<>RESULT_SUCCESS) THEN aePuts('Can''t Save account\b\n') deleteConfAccess(stat) displayAccountInfo(which,page,hoozer,hoozer2,hoozer3,f6) flag:=0 - CASE "~" /* SAVE */ - aePuts('Save\b\n') - hoozer.newUser:=0 - displayAccountInfo(which,page,hoozer,hoozer2,hoozer3,f6) - IF(hoozer.slotNumber=0) - hoozer2.number:=0 - stat:=saveAccount(hoozer,hoozer2,hoozer3,which,1) /* 1 = FORCE SAVE */ - - IF(stat<>RESULT_SUCCESS) THEN aePuts('Can''t Save account\b\n') - ELSE - hoozer2.number:=hoozer.slotNumber - /* save using Slot_number */ - stat:=saveAccount(hoozer,hoozer2,hoozer3,0,0) /* Not forced */ - IF(stat<>RESULT_SUCCESS) THEN aePuts('Can''t Save account\b\n') - ENDIF - - IF logonType>=LOGON_TYPE_REMOTE - StringF(tempStr,'\tREMOTE Account Maintenance on Account \d',hoozer.slotNumber) - ELSE - StringF(tempStr,'\tLOCAL Account Maintenance on Account \d',hoozer.slotNumber) - ENDIF - callersLog(tempStr) - CASE "9" /* RE-ACTIVATE */ aePuts('Re-Activate\b\n') + changes:=TRUE hoozer.slotNumber:=which flag:=0 - CASE "A" /* NAME */ - aePuts('') - StrCopy(tempStr,hoozer.name) - lineInput('',tempStr,30,INPUT_TIMEOUT,tempStr) - AstrCopy(hoozer.name,tempStr,31) - UpperStr(tempStr) - AstrCopy(hoozer2.userName,tempStr,31) - flag:=0 - CASE "B" /* Real Name */ - aePuts('') - StrCopy(tempStr,hoozer3.realName) - lineInput('',tempStr,25,INPUT_TIMEOUT,tempStr) - AstrCopy(hoozer3.realName,tempStr,26) - flag:=0 - CASE "C" /* Location */ - aePuts('') - StrCopy(tempStr,hoozer.location) - lineInput('',tempStr,29,INPUT_TIMEOUT,tempStr) - AstrCopy(hoozer.location,tempStr,30) - flag:=0 - CASE "D" /* PASS */ - IF((logonType>=LOGON_TYPE_REMOTE) AND (f6=FALSE)) - IF(loggedOnUser.slotNumber=1) - aePuts('') + ENDSELECT - StrCopy(tempStr,'') + IF (page=0) + SELECT command + CASE "A" /* NAME */ + aePuts('') + StrCopy(tempStr,hoozer.name) + lineInput('',tempStr,30,INPUT_TIMEOUT,tempStr) + AstrCopy(hoozer.name,tempStr,31) + UpperStr(tempStr) + AstrCopy(hoozer2.userName,tempStr,31) + changes:=TRUE + flag:=0 + CASE "B" /* Real Name */ + aePuts('') + StrCopy(tempStr,hoozer3.realName) + lineInput('',tempStr,25,INPUT_TIMEOUT,tempStr) + AstrCopy(hoozer3.realName,tempStr,26) + changes:=TRUE + flag:=0 + CASE "C" /* Location */ + aePuts('') + StrCopy(tempStr,hoozer.location) + lineInput('',tempStr,29,INPUT_TIMEOUT,tempStr) + AstrCopy(hoozer.location,tempStr,30) + changes:=TRUE + flag:=0 + CASE "D" /* PASS */ + IF((logonType>=LOGON_TYPE_REMOTE) AND (f6=FALSE)) + IF(loggedOnUser.slotNumber=1) + aePuts('') + + StrCopy(tempStr,'') + StrAdd(tempStr,' ') + FOR i:=1 TO 9 + StrAddChar(tempStr,8) + ENDFOR + aePuts(tempStr) + lineInput('','',50,INPUT_TIMEOUT,tempStr) + IF StrLen(tempStr)>0 + setNewPassword(hoozer,hoozer3,tempStr) + hoozer3.pwdLastUpdated:=getSystemTime() + changes:=TRUE + ENDIF + ENDIF + ELSE + StrCopy(tempStr,'') StrAdd(tempStr,' ') FOR i:=1 TO 9 StrAddChar(tempStr,8) @@ -20816,176 +21311,217 @@ PROC editInfo(which:LONG, hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: aePuts(tempStr) lineInput('','',50,INPUT_TIMEOUT,tempStr) IF StrLen(tempStr)>0 - UpperStr(tempStr) - hoozer.pwdHash:=calcPasswordHash(tempStr) + setNewPassword(hoozer,hoozer3,tempStr) + hoozer3.pwdLastUpdated:=getSystemTime() + changes:=TRUE ENDIF ENDIF - ELSE - StrCopy(tempStr,'') - StrAdd(tempStr,' ') - FOR i:=1 TO 9 - StrAddChar(tempStr,8) - ENDFOR - aePuts(tempStr) - lineInput('','',50,INPUT_TIMEOUT,tempStr) - IF StrLen(tempStr)>0 - UpperStr(tempStr) - hoozer.pwdHash:=calcPasswordHash(tempStr) - ENDIF - ENDIF - flag:=0 - CASE "E" /* Phone number */ - aePuts('') - StrCopy(tempStr,hoozer.phoneNumber) - lineInput('',tempStr,12,INPUT_TIMEOUT,tempStr) - AstrCopy(hoozer.phoneNumber,tempStr,13) - flag:=0 - CASE "F" /* conference access */ - aePuts('') - StrCopy(tempStr,hoozer.conferenceAccess) - lineInput('',tempStr,9,INPUT_TIMEOUT,tempStr) - AstrCopy(hoozer.conferenceAccess,tempStr,10) - flag:=0 - CASE "G" /* RATIO */ - aePuts('') - hoozer.secLibrary:=numberInput(hoozer.secLibrary) - flag:=0 - CASE "H" /* SEC_Level */ - IF((logonType>=LOGON_TYPE_REMOTE) AND (f6=FALSE)) - IF(loggedOnUser.slotNumber=1) + flag:=0 + CASE "E" /* Phone number */ + aePuts('') + StrCopy(tempStr,hoozer.phoneNumber) + lineInput('',tempStr,12,INPUT_TIMEOUT,tempStr) + AstrCopy(hoozer.phoneNumber,tempStr,13) + changes:=TRUE + flag:=0 + CASE "F" /* conference access */ + aePuts('') + StrCopy(tempStr,hoozer.conferenceAccess) + lineInput('',tempStr,9,INPUT_TIMEOUT,tempStr) + AstrCopy(hoozer.conferenceAccess,tempStr,10) + changes:=TRUE + flag:=0 + CASE "G" /* RATIO */ + aePuts('') + hoozer.secLibrary:=numberInput(hoozer.secLibrary) + changes:=TRUE + flag:=0 + CASE "H" /* SEC_Level */ + IF((logonType>=LOGON_TYPE_REMOTE) AND (f6=FALSE)) + IF(loggedOnUser.slotNumber=1) + aePuts('') + hoozer.secStatus:=numberInput(hoozer.secStatus) + ENDIF + ELSE aePuts('') hoozer.secStatus:=numberInput(hoozer.secStatus) ENDIF - ELSE - aePuts('') - hoozer.secStatus:=numberInput(hoozer.secStatus) - ENDIF - flag:=0 - CASE "I" /* Ratio Type */ - aePuts('') - hoozer.secBoard:=numberInput(hoozer.secBoard) - IF((hoozer.secBoard<0) OR (hoozer.secBoard > 2)) - sendBELL() - hoozer.secBoard:=0 - ENDIF - StringF(tempStr,'I> Ratio Type ....: \l\d[5]',hoozer.secBoard) - aePuts(tempStr) - IF(hoozer.secBoard=0) THEN aePuts(' <-Byte)') - IF(hoozer.secBoard=1) THEN aePuts(' <-B/F) ') - IF(hoozer.secBoard=2) THEN aePuts(' <-File)') - flag:=0 - CASE "J" /* conference ReJoin */ - aePuts('') - value1,value2:=rJoinInput(hoozer.confRJoin, hoozer.msgBaseRJoin) - hoozer.confRJoin:=value1 - hoozer.msgBaseRJoin:=value2 - flag:=0 - CASE "K" /* UPLOADS */ - aePuts('') - hoozer.uploads:=numberInput(hoozer.uploads) - flag:=0 - CASE "L" /* MESSAGES_POSTED */ - aePuts('') - hoozer.messagesPosted:=numberInput(hoozer.messagesPosted) - flag:=0 - CASE "M" /* DOWNLOADS */ - aePuts('') - hoozer.downloads:=numberInput(hoozer.downloads) - flag:=0 - CASE "N" /* New user ?? */ - aePuts(' ') - command:=yesNo(0) - IF(command) THEN hoozer.newUser:=1 ELSE hoozer.newUser:=0 - flag:=0 - CASE "#" - aePuts('') - hoozer.timesCalled:=numberInput(hoozer.timesCalled) - flag:=0 - CASE "%" - aePuts('') - hoozer2.timesOnToday:=numberInput(getTodaysCalls(hoozer,hoozer2)) - flag:=0 - CASE "O" /* Bytes Uploaded */ - aePuts('') - - bcdNumberInput(hoozer3.uploadBytesBCD) - hoozer.bytesUpload:=convertFromBCD(hoozer3.uploadBytesBCD) - - flag:=0 - CASE "P" /* Bytes Downloaded */ - aePuts('') - bcdNumberInput(hoozer3.downloadBytesBCD) - hoozer.bytesDownload:=convertFromBCD(hoozer3.downloadBytesBCD) - flag:=0 - CASE "Q" /* Daily Bytes Limit */ - aePuts(' ') - IF hoozer.todaysBytesLimit<>0 - temp:=hoozer.todaysBytesLimit-hoozer.dailyBytesLimit - ELSE - temp:=0 - ENDIF - hoozer.dailyBytesLimit:=longNumberInput(hoozer.dailyBytesLimit) - hoozer.todaysBytesLimit:=hoozer.dailyBytesLimit - IF hoozer.todaysBytesLimit<>0 THEN hoozer.todaysBytesLimit:=hoozer.todaysBytesLimit+temp - flag:=0 - CASE "R" /* Time_Total */ - aePuts('') - hoozer.timeTotal:=Mul(numberInput(Div(hoozer.timeTotal,60)),60) - IF(hoozer.timeTotal 2)) + sendBELL() + hoozer.secBoard:=0 + ENDIF + StringF(tempStr,'I> Ratio Type ....: \l\d[5]',hoozer.secBoard) + aePuts(tempStr) + IF(hoozer.secBoard=0) THEN aePuts(' <-Byte)') + IF(hoozer.secBoard=1) THEN aePuts(' <-B/F) ') + IF(hoozer.secBoard=2) THEN aePuts(' <-File)') + changes:=TRUE + flag:=0 + CASE "J" /* conference ReJoin */ + aePuts('') + value1,value2:=rJoinInput(hoozer.confRJoin, hoozer.msgBaseRJoin) + hoozer.confRJoin:=value1 + hoozer.msgBaseRJoin:=value2 + changes:=TRUE + flag:=0 + CASE "K" /* UPLOADS */ + aePuts('') + hoozer.uploads:=numberInput(hoozer.uploads) + changes:=TRUE + flag:=0 + CASE "L" /* MESSAGES_POSTED */ + aePuts('') + hoozer.messagesPosted:=numberInput(hoozer.messagesPosted) + changes:=TRUE + flag:=0 + CASE "M" /* DOWNLOADS */ + aePuts('') + hoozer.downloads:=numberInput(hoozer.downloads) + changes:=TRUE + flag:=0 + CASE "N" /* New user ?? */ + aePuts(' ') + command:=yesNo(0) + IF(command) THEN hoozer.newUser:=1 ELSE hoozer.newUser:=0 + changes:=TRUE + flag:=0 + CASE "#" + aePuts('') + hoozer.timesCalled:=numberInput(hoozer.timesCalled) + changes:=TRUE + flag:=0 + CASE "%" + aePuts('') + hoozer2.timesOnToday:=numberInput(getTodaysCalls(hoozer,hoozer2)) + changes:=TRUE + flag:=0 + CASE "O" /* Bytes Uploaded */ + aePuts('') + + bcdNumberInput(hoozer3.uploadBytesBCD) + hoozer.bytesUpload:=convertFromBCD(hoozer3.uploadBytesBCD) + changes:=TRUE + flag:=0 + CASE "P" /* Bytes Downloaded */ + aePuts('') + bcdNumberInput(hoozer3.downloadBytesBCD) + hoozer.bytesDownload:=convertFromBCD(hoozer3.downloadBytesBCD) + changes:=TRUE + flag:=0 + CASE "Q" /* Daily Bytes Limit */ + aePuts(' ') + IF hoozer.todaysBytesLimit<>0 + temp:=hoozer.todaysBytesLimit-hoozer.dailyBytesLimit + ELSE + temp:=0 + ENDIF + hoozer.dailyBytesLimit:=longNumberInput(hoozer.dailyBytesLimit) + hoozer.todaysBytesLimit:=hoozer.dailyBytesLimit + IF hoozer.todaysBytesLimit<>0 THEN hoozer.todaysBytesLimit:=hoozer.todaysBytesLimit+temp + changes:=TRUE + flag:=0 + CASE "R" /* Time_Total */ + aePuts('') + hoozer.timeTotal:=Mul(numberInput(Div(hoozer.timeTotal,60)),60) + IF(hoozer.timeTotal65535 THEN hoozer2.oldUpCPS:=65535 ELSE hoozer2.oldUpCPS:=hoozer2.upCPS2 - flag:=0; - CASE "T" /* zero dncps rate */ - aePuts('') - hoozer2.dnCPS2:=longNumberInput(hoozer2.dnCPS2) - IF hoozer2.dnCPS2>65535 THEN hoozer2.oldDnCPS:=65535 ELSE hoozer2.oldDnCPS:=hoozer2.dnCPS2 - flag:=0 - CASE "U" /* Time_Limit */ - aePuts('') - hoozer.timeLimit:=Mul(numberInput(Div(hoozer.timeLimit,60)),60) - IF(hoozer.timeTotal65535 THEN hoozer2.oldUpCPS:=65535 ELSE hoozer2.oldUpCPS:=hoozer2.upCPS2 + changes:=TRUE + flag:=0; + CASE "T" /* zero dncps rate */ + aePuts('') + hoozer2.dnCPS2:=longNumberInput(hoozer2.dnCPS2) + IF hoozer2.dnCPS2>65535 THEN hoozer2.oldDnCPS:=65535 ELSE hoozer2.oldDnCPS:=hoozer2.dnCPS2 + changes:=TRUE + flag:=0 + CASE "U" /* Time_Limit */ + aePuts('') + hoozer.timeLimit:=Mul(numberInput(Div(hoozer.timeLimit,60)),60) + IF(hoozer.timeTotal0) AND (hoozer.creditStartDate=0) THEN hoozer.creditStartDate:=getSystemDate() aePuts('Saving Account...') + changes:=FALSE formatLongDate(getSystemDate(),currdatestr) formatLongTime(getSystemDate(),currtimestr) @@ -21383,6 +21929,7 @@ PROC conferenceAccounting(hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: DEF i,m,flag=0,conf,msgbase,ch,oldval DEF checkLock DEF oldBCD[8]:ARRAY OF CHAR + DEF changes=FALSE IF loggedOnUser<>NIL THEN masterSavePointers(loggedOnUser) @@ -21554,7 +22101,9 @@ PROC conferenceAccounting(hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: ENDIF CASE "\t" - flag:=1 + IF checkChanges(changes) + flag:=1 + ENDIF ENDSELECT IF checkLock @@ -21562,6 +22111,7 @@ PROC conferenceAccounting(hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: CASE "G" aePuts('') cb.ratio:=numberInput(cb.ratio) + changes:=TRUE CASE "I" aePuts('') cb.ratioType:=numberInput(cb.ratioType) @@ -21569,16 +22119,19 @@ PROC conferenceAccounting(hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: sendBELL() cb.ratioType:=0 ENDIF + changes:=TRUE CASE "K" aePuts('') oldval:=cb.upload cb.upload:=numberInput(cb.upload) IF(checkSecurity(ACS_CONFERENCE_ACCOUNTING)) THEN hoozer.uploads:=hoozer.uploads-oldval+cb.upload + changes:=TRUE CASE "M" aePuts('') oldval:=cb.downloads cb.downloads:=numberInput(cb.downloads) IF(checkSecurity(ACS_CONFERENCE_ACCOUNTING)) THEN hoozer.downloads:=hoozer.downloads-oldval+cb.downloads + changes:=TRUE CASE "O" aePuts('') @@ -21592,6 +22145,7 @@ PROC conferenceAccounting(hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: addBCD2(hoozer3.uploadBytesBCD,cb.uploadBytesBCD) hoozer.bytesUpload:=convertFromBCD(hoozer3.uploadBytesBCD) ENDIF + changes:=TRUE CASE "P" aePuts('') FOR i:=0 TO 7 @@ -21604,15 +22158,18 @@ PROC conferenceAccounting(hoozer:PTR TO user, hoozer2:PTR TO userKeys, hoozer3: addBCD2(hoozer3.downloadBytesBCD,cb.downloadBytesBCD) hoozer.bytesDownload:=convertFromBCD(hoozer3.downloadBytesBCD) ENDIF + changes:=TRUE CASE "L" aePuts('') oldval:=cb.messagesPosted cb.messagesPosted:=numberInput(cb.messagesPosted) hoozer.messagesPosted:=hoozer.messagesPosted-oldval+cb.messagesPosted + changes:=TRUE CASE "~" aePuts('Save\b\n') masterSavePointers(hoozer) + changes:=FALSE IF (logonType>=LOGON_TYPE_REMOTE) StringF(tempstr,'\tREMOTE Conference Maintenance on Account \d, Conference \s',hoozer.slotNumber,conf) @@ -21953,6 +22510,60 @@ PROC resizeConfDB(confnum,msgBaseNum,newSize) END cb2 ENDPROC +PROC makeFtpDirCache(confLoc:PTR TO CHAR, confnum, dirnum, dlpath:PTR TO CHAR, subdir:PTR TO CHAR) + DEF dirCache[255]:STRING + DEF fh + DEF lock + DEF f_info: PTR TO fileinfoblock + DEF tempstr[255]:STRING + DEF tempstr2[255]:STRING + DEF s,t + + f_info:=AllocDosObject(DOS_FIB,NIL) + IF(f_info)=NIL + RETURN + ENDIF + + lock:=Lock(dlpath,ACCESS_READ) + IF(lock)=0 + FreeDosObject(DOS_FIB,f_info) + RETURN + ENDIF + + IF(Examine(lock,f_info))=0 + UnLock(lock) + FreeDosObject(DOS_FIB,f_info) + RETURN + ENDIF + + StringF(dirCache,'\sDirCaches/Conf\dDir\d\s\s',confLoc,confnum,dirnum,IF StrLen(subdir)>0 THEN '_' ELSE '',subdir) + fh:=Open(dirCache,MODE_NEWFILE) + IF fh<>0 + IF(f_info.direntrytype>0) + WHILE(((ExNext(lock,f_info))<>0)) + IF (StrCmp('.dircache',f_info.filename)=FALSE) + t:=dateStampToDateTime(f_info.datestamp) + s:=f_info.size + IF (f_info.direntrytype>0) + StringF(tempstr,'\s\s/',dlpath,f_info.filename) + StringF(tempstr2,'\s\s\s',subdir,IF StrLen(subdir)>0 THEN '_' ELSE '',f_info.filename) + makeFtpDirCache(confLoc,confnum,dirnum,tempstr,tempstr2) + s:=-1 + ENDIF + StringF(tempstr,'\z\h[8] \z\h[8] \s\n',t,s,f_info.filename) + WriteF(tempstr) + Write(fh,tempstr,StrLen(tempstr)) + ENDIF + ENDWHILE + ENDIF + Close(fh) + ENDIF + + UnLock(lock) + FreeDosObject(DOS_FIB,f_info) + +ENDPROC + PROC conferenceMaintenance() DEF conf,flag=0,ch,size,n,f,m DEF tempstr[255]:STRING @@ -21973,7 +22584,7 @@ PROC conferenceMaintenance() getConfLocation(conf,confLoc) getMailStatFile(conf,msgBase) getConfDbFileName(conf,msgBase,tempstr) - size:=Div(getFileSize(tempstr),SIZEOF confBase) + size:=Div(FileLength(tempstr),SIZEOF confBase) REPEAT conCursorOff() @@ -22119,7 +22730,7 @@ PROC conferenceMaintenance() aePuts('Resizing, Please Standby') resizeConfDB(conf,msgBase,n) getConfDbFileName(conf,msgBase,tempstr) - size:=Div(getFileSize(tempstr),SIZEOF confBase) + size:=Div(FileLength(tempstr),SIZEOF confBase) ENDIF CASE "E" IF dirCacheEnabled @@ -22163,9 +22774,15 @@ PROC conferenceMaintenance() ENDWHILE IF match=FALSE - StringF(tempstr,'LIST FILES LFORMAT %N "\s" >"\sDirCaches/Conf\dDir\d"',path,confLoc,conf,num-1) - Execute(tempstr,0,0) - StringF(tempstr,'COPY "\sDirCaches/Conf\dDir\d" ram:DirCaches/',confLoc,conf,num-1) + + IF checkToolTypeExists(TOOLTYPE_CONF,conf,'FTP_NO_DIRLIST') + makeFtpDirCache(confLoc,conf,num-1,path,'') + ELSE + StringF(tempstr,'LIST FILES LFORMAT %N "\s" >"\sDirCaches/Conf\dDir\d"',path,confLoc,conf,num-1) + Execute(tempstr,0,0) + ENDIF + + StringF(tempstr,'COPY "\sDirCaches/Conf\dDir\d#?" ram:DirCaches/',confLoc,conf,num-1) Execute(tempstr,0,0) ENDIF StringF(path,'DLPATH.\d',num++) @@ -22184,7 +22801,7 @@ PROC conferenceMaintenance() getMailStatFile(conf,msgBase) getConfLocation(conf,confLoc) getConfDbFileName(conf,msgBase,tempstr) - size:=Div(getFileSize(tempstr),SIZEOF confBase) + size:=Div(FileLength(tempstr),SIZEOF confBase) CASE "+" msgBase:=msgBase+1 IF msgBase>getConfMsgBaseCount(conf) @@ -22196,7 +22813,7 @@ PROC conferenceMaintenance() getMailStatFile(conf,msgBase) getConfLocation(conf,confLoc) getConfDbFileName(conf,msgBase,tempstr) - size:=Div(getFileSize(tempstr),SIZEOF confBase) + size:=Div(FileLength(tempstr),SIZEOF confBase) ENDSELECT aePuts(' ') @@ -22392,6 +23009,48 @@ PROC displayAccount(who:LONG, page, hoozer:PTR TO user, hoozer2: PTR TO userKeys aePuts('\b\n') ENDIF + + IF page=1 + + IF hoozer3.forcePwdReset THEN StrCopy(tempStr2,'Yes') ELSE StrCopy(tempStr2,'No') + StringF(tempStr,'B> Force Pwd Reset: \l\s[3]',tempStr2) + aePuts(tempStr) + + IF hoozer3.accountLocked THEN StrCopy(tempStr2,'Yes') ELSE StrCopy(tempStr2,'No') + StringF(tempStr,'C> Account Locked : \l\s',tempStr2) + aePuts(tempStr) + + StringF(tempStr,'D> Invalid Pwd Att: \l\d[3]',hoozer3.invalidAttempts) + aePuts(tempStr) + + formatLongDateTime(hoozer3.pwdLastUpdated,tempStr2) + StringF(tempStr,'Last Pwd Reset : \l\s',tempStr2) + aePuts(tempStr) + + SELECT hoozer3.pwdType + CASE PWD_LEGACY + StrCopy(tempStr2,'LEGACY ') + CASE PWD_PBKDF2_5 + StrCopy(tempStr2,'PBKDF2(5) ') + CASE PWD_PBKDF2_50 + StrCopy(tempStr2,'PBKDF2(50) ') + CASE PWD_PBKDF2_100 + StrCopy(tempStr2,'PBKDF2(100) ') + CASE PWD_PBKDF2_1000 + StrCopy(tempStr2,'PBKDF2(1000) ') + CASE PWD_PBKDF2_10000 + StrCopy(tempStr2,'PBKDF2(10000)') + ENDSELECT + + StringF(tempStr,'Pwd Type ......: \s',tempStr2) + aePuts(tempStr) + + formatIP(hoozer3.lastIP,tempStr2) + StringF(tempStr,'Last IP Addr ..: \s',tempStr2) + aePuts(tempStr) + + ENDIF + displayAccountActions(who) ENDPROC @@ -22576,12 +23235,52 @@ PROC displayAccountInfo(who:LONG, page,hoozer:PTR TO user, hoozer2:PTR TO userKe StringF(tempStr,'\l\d[6]',Div((hoozer.chatLimit-hoozer.chatRemain),60)) aePuts(tempStr) ENDIF + + IF page=1 + IF hoozer3.forcePwdReset THEN StrCopy(tempStr2,'Yes') ELSE StrCopy(tempStr2,'No') + StringF(tempStr,'\l\s[3]',tempStr2) + aePuts(tempStr) + + IF hoozer3.accountLocked THEN StrCopy(tempStr2,'Yes') ELSE StrCopy(tempStr2,'No') + StringF(tempStr,'\l\s[3]',tempStr2) + aePuts(tempStr) + + StringF(tempStr,'\l\d[3]',hoozer3.invalidAttempts) + aePuts(tempStr) + + formatLongDateTime(hoozer3.pwdLastUpdated,tempStr2) + StringF(tempStr,'\l\s',tempStr2) + aePuts(tempStr) + + SELECT hoozer3.pwdType + CASE PWD_LEGACY + StrCopy(tempStr2,'LEGACY ') + CASE PWD_PBKDF2_5 + StrCopy(tempStr2,'PBKDF2(5) ') + CASE PWD_PBKDF2_50 + StrCopy(tempStr2,'PBKDF2(50) ') + CASE PWD_PBKDF2_100 + StrCopy(tempStr2,'PBKDF2(100) ') + CASE PWD_PBKDF2_1000 + StrCopy(tempStr2,'PBKDF2(1000) ') + CASE PWD_PBKDF2_10000 + StrCopy(tempStr2,'PBKDF2(10000)') + ENDSELECT + + StringF(tempStr,'\s',tempStr2) + aePuts(tempStr) + + formatIP(hoozer3.lastIP,tempStr2) + StringF(tempStr,'\l\s',tempStr2) + aePuts(tempStr) + + ENDIF displayAccountActions(who) ENDPROC PROC bulkAccountEditor() DEF flag,command - DEF settings[16]:ARRAY OF LONG + DEF settings[18]:ARRAY OF LONG DEF areaName[255]:STRING DEF secLevel[3]:STRING DEF i,v,v2,r,p @@ -22592,7 +23291,7 @@ PROC bulkAccountEditor() displayBulkScreen() - FOR i:=0 TO 15 + FOR i:=0 TO 17 settings[i]:=String(15) ENDFOR StrCopy(areaName,'') @@ -22706,11 +23405,27 @@ PROC bulkAccountEditor() ELSE StrCopy(settings[15],'') ENDIF + CASE "!" + IF StrLen(settings[16])=0 + StrCopy(settings[16],'1') + ELSEIF StrCmp(settings[16],'1') + StrCopy(settings[16],'0') + ELSE + StrCopy(settings[16],'') + ENDIF + CASE "&" + IF StrLen(settings[17])=0 + StrCopy(settings[17],'1') + ELSEIF StrCmp(settings[17],'1') + StrCopy(settings[17],'0') + ELSE + StrCopy(settings[17],'') + ENDIF CASE "1" /* select area Name */ - aePuts(' ') + aePuts(' ') lineInput('',areaName,10,INPUT_TIMEOUT,areaName) CASE "2" /* select access Level */ - aePuts(' ') + aePuts(' ') lineInput('',secLevel,3,INPUT_TIMEOUT,secLevel) v,r:=Val(secLevel) IF r=0 THEN StrCopy(secLevel,'') @@ -22772,10 +23487,13 @@ PROC displayBulkScreen() aePuts('Y> Chat Limit ....:') aePuts('#> Times Called ..:') - aePuts('Filter Settings:') + aePuts('!> Force Pwd Reset:') + aePuts('&> Accnt Locked ..:') - aePuts('1> Select Area Name :') - aePuts('2> Select Sec Level :') + aePuts('Filter Settings:') + + aePuts('1> Select Area Name :') + aePuts('2> Select Sec Level :') aePuts('3> Include deactivated :') aePuts('~=Apply Changes @=Presets =Exit\b\n') ENDPROC @@ -22826,15 +23544,20 @@ PROC displayBulkSettings(settings:PTR TO LONG, areaName:PTR TO CHAR, secLevel:PT StringF(tempStr,' \s',IF StrLen(settings[15])=0 THEN 'Leave Unchanged' ELSE IF Val(settings[15])=0 THEN 'Deactivate ' ELSE 'Activate ') aePuts(tempStr) + StringF(tempStr,' \s',IF StrLen(settings[16])=0 THEN 'Leave Unchanged' ELSE IF Val(settings[16])=1 THEN 'Yes ' ELSE 'No ') + aePuts(tempStr) + StringF(tempStr,' \s',IF StrLen(settings[17])=0 THEN 'Leave Unchanged' ELSE IF Val(settings[17])=1 THEN 'Yes ' ELSE 'No ') + aePuts(tempStr) + i,tot:=calcAffected(areaName,secLevel) - StringF(tempStr,'[\d/\d] Users will be updated. ',i,tot) + StringF(tempStr,'[\d/\d] Users will be updated. ',i,tot) aePuts(tempStr) - StringF(tempStr,'\s',IF StrLen(areaName)=0 THEN 'N/A' ELSE areaName) + StringF(tempStr,'\s',IF StrLen(areaName)=0 THEN 'N/A' ELSE areaName) aePuts(tempStr) - StringF(tempStr,'\s',IF StrLen(secLevel)=0 THEN 'N/A' ELSE secLevel) + StringF(tempStr,'\s',IF StrLen(secLevel)=0 THEN 'N/A' ELSE secLevel) aePuts(tempStr) StringF(tempStr,'\s',IF includeDeact THEN 'Yes' ELSE 'No ') @@ -22953,6 +23676,13 @@ PROC applyBulkChanges(settings:PTR TO LONG,areaName:PTR TO CHAR,secLevel:PTR TO IF Val(settings[15])=0 THEN tempUser.slotNumber:=0 ELSE tempUser.slotNumber:=sn tempUserKeys.number:=tempUser.slotNumber ENDIF + IF StrLen(settings[16])>0 + IF Val(settings[16])=0 THEN tempUserMisc.forcePwdReset:=FALSE ELSE tempUserMisc.forcePwdReset:=TRUE + ENDIF + + IF StrLen(settings[17])>0 + IF Val(settings[17])=0 THEN tempUserMisc.accountLocked:=FALSE ELSE tempUserMisc.accountLocked:=TRUE + ENDIF Seek(fh,-SIZEOF user,OFFSET_CURRENT) Write(fh,tempUser,SIZEOF user) @@ -24838,7 +25568,7 @@ ENDPROC RESULT_SUCCESS PROC internalCommandVER() DEF tempStr[255]:STRING - StringF(tempStr,'\b\nAmiExpress \s (\s) Copyright ©2018-2022 Darren Coles\b\n\b\n',expressVer,expressDate) + StringF(tempStr,'\b\nAmiExpress \s (\s) Copyright ©2018-2023 Darren Coles\b\n\b\n',expressVer,expressDate) aePuts(tempStr) aePuts('Original Version:\b\n') aePuts(' (C)1989-91 Mike Thomas, Synthetic Technologies\b\n') @@ -24862,8 +25592,8 @@ ENDPROC RESULT_SUCCESS PROC internalCommandW() DEF stat,option - DEF str[100]:STRING - DEF str2[100]:STRING + DEF str[255]:STRING + DEF str2[255]:STRING DEF temp IF checkSecurity(ACS_EDIT_USER_INFO)=FALSE THEN RETURN RESULT_NOT_ALLOWED @@ -25151,15 +25881,35 @@ PROC internalCommandW() CASE 6 ->EDIT PASSWORD IF (checkSecurity(ACS_EDIT_PASSWORD)=FALSE) THEN JUMP cant - aePuts('Password: ') - stat:=lineInput('','',50,INPUT_TIMEOUT,str) + + stat:=getPass2('Enter New Password: ',0,0,50,str) IF(stat<0) THEN RETURN stat IF(StrLen(str)=0) THEN JUMP cant - UpperStr(str) - stat:=calcPasswordHash(str) - StringF(str,'new hash: \h',stat) - debugLog(LOG_DEBUG,str) - loggedOnUser.pwdHash:=stat + + stat:=getPass2('Reenter New Password: ',0,0,50,str2) + IF(stat<0) THEN RETURN stat + IF(StrLen(str2)=0) THEN JUMP cant + + IF StrCmp(str,str2) + stat:=checkPasswordStrength(str) + IF stat=1 + stat:=readToolTypeInt(TOOLTYPE_BBSCONFIG,0,'MIN_PASSWORD_LENGTH') + StringF(str,'\b\nPassword length must be at least \d chars, changes not saved',stat) + aePuts(str) + Delay(60) + ELSEIF stat=2 + stat:=readToolTypeInt(TOOLTYPE_BBSCONFIG,0,'MIN_PASSWORD_STRENGTH') + StringF(str,'\b\nPassword must have at least \d of these:\b\n upper case,lower case, numeric and symbols - changes not saved',stat) + aePuts(str) + Delay(60) + ELSE + setNewPassword(loggedOnUser,loggedOnUserMisc,str) + loggedOnUserMisc.pwdLastUpdated:=getSystemTime() + ENDIF + ELSE + aePuts('\b\nPasswords do not match, changes not saved') + Delay(60) + ENDIF CASE 7 ->EDIT NUMBER OF SCREEN LINES REPEAT @@ -25454,8 +26204,8 @@ PROC internalCommandZOOM() aePuts('Not supported locally...\b\n') RETURN RESULT_SUCCESS ENDIF - dTBT:=0 - uTBT:=0 + convertToBCD(0,dTBT) + convertToBCD(0,uTBT) dlTTTM:=0 ulTTTM:=0 tTEFF:=NIL @@ -26081,7 +26831,7 @@ PROC maintenanceFileDelete(dirname:PTR TO CHAR, srchold, fname:PTR TO CHAR,match found:=0 currpos:=Seek(fh2,0,OFFSET_CURRENT) WHILE(Fgets(fh2,dirline,255)<>NIL) - IF(dirline[0]<>" ") + IF(dirLineNewFile(dirline)) StrCopy(compareFname,dirline,12) UpperStr(compareFname) IF(StrCmp(compareFname,padfname)) AND (currpos=matchposition) @@ -26280,7 +27030,7 @@ PROC maintenanceFileMove(dirname:PTR TO CHAR, srchold, fname:PTR TO CHAR,datestr found:=0 currpos:=Seek(fh2,0,OFFSET_CURRENT) WHILE(Fgets(fh2,dirline,255)<>NIL) - IF(dirline[0]<>" ") + IF(dirLineNewFile(dirline)) StrCopy(compareFname,dirline,12) UpperStr(compareFname) IF(StrCmp(compareFname,padfname)) AND (currpos=matchposition) @@ -26289,7 +27039,7 @@ PROC maintenanceFileMove(dirname:PTR TO CHAR, srchold, fname:PTR TO CHAR,datestr brk:=FALSE ->we've found our file in the source dir, scan the dest dir for the correct position to put it WHILE(Fgets(fh4,dirline2,255)<>NIL) - IF(dirline2[0]<>" ") + IF(dirLineNewFile(dirline2)) StrCopy(tempstr,dirline2) tempstr[13]:=" " parseParams(tempstr) @@ -26531,7 +27281,7 @@ PROC maintenanceFileSearch(holddir,fname:PTR TO CHAR,searchList: PTR TO stringli RETURN RESULT_FAILURE,0,0 ENDIF ENDIF - IF(StrLen(image)>0) AND (image[0]<>" ") + IF(dirLineNewFile(image)) StrCopy(dirfname,image,12) StrCopy(tempStr,image,12) i:=0 @@ -26577,7 +27327,7 @@ PROC maintenanceFileSearch(holddir,fname:PTR TO CHAR,searchList: PTR TO stringli aePuts(image) aePuts('\b\n') prev:=Seek(fi,0,OFFSET_CURRENT) - WHILE(Fgets(fi,image,252)<>NIL) AND (image[0]=" ") AND (countNIL) AND (dirLineNewFile(image)=FALSE) AND (count0) AND (image[0]<>" ") + IF (dirLineNewFile(image)) IF (x<100) current:=myzip+Shl(x,8)+1 ->ln(1,x) current[0]:=0 @@ -27040,7 +27790,7 @@ PROC myNewFiles(params) WHILE(Fgets(fp1,c,250)<>NIL) c[250]:=0 SetStr(c,StrLen(c)) - IF((c[0]=" ") OR (c[0]=0) OR(c[0]="\n")) THEN JUMP fgetnext + IF(dirLineNewFile(c)=FALSE) THEN JUMP fgetnext parseParams(c) IF(parsedParams.count()>0) THEN StrCopy(fn,parsedParams.item(0)) @@ -27619,7 +28369,7 @@ PROC processLoggedOnUser() timeLimit:=loggedOnUser.timeTotal-loggedOnUser.timeUsed IF (loggedOnUser.todaysBytesLimit<>0) - bytesADL:=loggedOnUser.todaysBytesLimit + bytesADL:=loggedOnUser.todaysBytesLimit-loggedOnUser.dailyBytesDld ELSE bytesADL:=$7fffffff ENDIF @@ -27802,6 +28552,7 @@ PROC processFtpLogon() StrCopy(sendStr,'430 That account has problems\b\n') telnetSend(sendStr,EstrLen(sendStr)) state:=STATE_LOGGING_OFF + RETURN ENDIF IF ftpAuth(userName,password)=FALSE @@ -27859,6 +28610,8 @@ PROC processFtpLogon() loggedOnUserKeys.baud:=19200 masterLoadPointers(loggedOnUser) + doLogonNotify() + statPrintUser(loggedOnUser,loggedOnUserKeys,loggedOnUserMisc) IF (StrLen(mybbsLoc)>0) @@ -27868,7 +28621,7 @@ PROC processFtpLogon() ENDIF telnetSend(sendStr,EstrLen(sendStr)) - StringF(sendStr,'230-\b\n230-Running AmiExpress \s Copyright ©2018-2022 Darren Coles\b\n',expressVer) + StringF(sendStr,'230-\b\n230-Running AmiExpress \s Copyright ©2018-2023 Darren Coles\b\n',expressVer) telnetSend(sendStr,EstrLen(sendStr)) StringF(sendStr,'230-Registration \s. You are connected to Node \d\b\n',regKey,node) telnetSend(sendStr,EstrLen(sendStr)) @@ -27959,6 +28712,7 @@ PROC processFtpLoggedOnUser() DEF cnums:PTR TO stdlist DEF confULBlock:PTR TO stringlist DEF ftpData:PTR TO ftpData + DEF res setEnvStat(ENV_IDLE) @@ -27998,7 +28752,13 @@ PROC processFtpLoggedOnUser() loggedOnUser.chatRemain:=loggedOnUser.chatLimit loggedOnUser.dailyBytesDld:=0 loggedOnUser.timeTotal:=loggedOnUser.timeLimit + loggedOnUser.todaysBytesLimit:=loggedOnUser.dailyBytesLimit ELSE + IF loggedOnUser.dailyBytesLimit=0 + loggedOnUser.todaysBytesLimit:=0 + ELSE + IF loggedOnUser.todaysBytesLimit0) - bytesADL:=loggedOnUser.todaysBytesLimit + bytesADL:=loggedOnUser.todaysBytesLimit-loggedOnUser.dailyBytesDld ELSE bytesADL:=$7fffffff ENDIF @@ -28044,7 +28804,14 @@ PROC processFtpLoggedOnUser() ENDIF ENDFOR - IF readToolType(TOOLTYPE_XFERLIB,'FTP','FTPHOST',tempstr)=FALSE + res:=FALSE + FOR i:=0 TO xprLib.count()-1 + IF(StriCmp(xprLib.item(i),'FTP')) + IF readToolType(TOOLTYPE_XFERLIB,i,'FTPHOST',tempstr) THEN res:=TRUE + ENDIF + ENDFOR + + IF res=FALSE IF readToolType(TOOLTYPE_BBSCONFIG,'','FTPHOST',tempstr)=FALSE StrCopy(tempstr,'127.0.0.1') ENDIF @@ -28257,8 +29024,8 @@ PROC checkPassword() stat:=lineInput('','',50,INPUT_TIMEOUT,tempStr) IF(stat<0) THEN RETURN RESULT_NO_CARRIER IF(StrLen(tempStr)>0) - UpperStr(tempStr) - loggedOnUser.pwdHash:=calcPasswordHash(tempStr) + setNewPassword(loggedOnUser,loggedOnUserMisc,tempStr) + loggedOnUserMisc.pwdLastUpdated:=getSystemTime() ENDIF ENDIF ENDIF @@ -28269,7 +29036,7 @@ PROC checkPassword() ENDIF ENDIF IF StrLen(resetCode)=0 - stat:=getPass2(passwordPrompt,0,loggedOnUser.pwdHash,50,tempStr) + stat:=getPass2(passwordPrompt,0,TRUE,50,tempStr) IF(stat<0) IF stat=RESULT_NO_CARRIER THEN RETURN RESULT_NO_CARRIER ELSE RETURN RESULT_SLEEP_LOGOFF ENDIF @@ -28322,7 +29089,7 @@ PROC checkPassword() purgeLineEnd() IF(lfh:=Open('NIL:',MODE_OLDFILE))<>0 StringF(tempStr,'\sUtils/uucico -D \s -U \d -Getty -xx',cmds.bbsLoc,cmds.serDev,cmds.serDevUnit) - Execute(tempStr,IF debug THEN 0 ELSE lfh,IF debug THEN 0 ELSE lfh) + Execute(tempStr,lfh,lfh) Close(lfh) ENDIF purgeLineStart() @@ -28536,7 +29303,7 @@ PROC processLogon() DEF newUser DEF userNum DEF stat,ch - DEF hrs,calcHrs,autovalPreset + DEF hrs,calcHrs,autovalPreset,pwdExpiryDays ripMode:=FALSE confNameType:=NAME_TYPE_USERNAME @@ -28584,7 +29351,7 @@ PROC processLogon() ENDIF aePuts(tempStr) - StringF(tempStr,'\b\n\b\nRunning AmiExpress \s Copyright ©2018-2022 Darren Coles\b\n',expressVer) + StringF(tempStr,'\b\n\b\nRunning AmiExpress \s Copyright ©2018-2023 Darren Coles\b\n',expressVer) aePuts(tempStr) StringF(tempStr,'Registration \s. You are connected to Node \d at \d baud',regKey,node,onlineBaud) aePuts(tempStr) @@ -28811,6 +29578,7 @@ logonLoop: logoffLog('N') ENDIF + saveAccount(loggedOnUser,loggedOnUserKeys,loggedOnUserMisc,0,0) END loggedOnUser loggedOnUser:=NIL END loggedOnUserKeys @@ -28844,14 +29612,81 @@ logonLoop: RETURN ENDIF - IF logonType>=LOGON_TYPE_REMOTE - runExecuteOn('LOGON') - IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_LOGON')) AND (StrLen(mailOptions.sysopEmail)>0) - StringF(tempStr,'\s: Ami-Express logon notification',cmds.bbsName) - StringF(tempStr2,'This is a notification that \s from \s has logged on\n\n',loggedOnUser.name,loggedOnUser.location) - sendMail(tempStr,tempStr2,FALSE, NIL,0,mailOptions.sysopEmail) + IF loggedOnUserMisc.accountLocked + aePuts('\b\nYour account is locked out (possibly due to repeated password failures)\b\n\b\n') + aePuts('Leave a comment for the sysop...\b\n\b\n') + processCommand('C') + + aePuts('\b\nThanks you will now be disconnected...\b\n\b\n') + state:=STATE_LOGGING_OFF + RETURN + ENDIF + + pwdExpiryDays:=readToolTypeInt(TOOLTYPE_BBSCONFIG,0,'PASSWORD_EXPIRY_DAYS') + IF pwdExpiryDays>=0 + IF (loggedOnUserMisc.pwdLastUpdated+Mul(pwdExpiryDays,86400))TRUE + IF stat=1 + stat:=readToolTypeInt(TOOLTYPE_BBSCONFIG,0,'MIN_PASSWORD_LENGTH') + StringF(tempStr,'\b\nPassword length must be at least \d chars, try again..\b\n\b\n',stat) + aePuts(tempStr) + ELSEIF stat=2 + stat:=readToolTypeInt(TOOLTYPE_BBSCONFIG,0,'MIN_PASSWORD_STRENGTH') + StringF(tempStr,'\b\nPassword must have at least \d of these:\b\n upper case,lower case, numeric and symbols, try again..\b\n\b\n',stat) + aePuts(tempStr) + ENDIF + ELSE + setNewPassword(loggedOnUser,loggedOnUserMisc,tempStr) + loggedOnUserMisc.pwdLastUpdated:=getSystemTime() + loggedOnUserMisc.forcePwdReset:=FALSE + ENDIF + ENDIF + ELSE + aePuts('\b\nPasswords do not match, please try again.\b\n\b\n') + ENDIF + ENDIF + ENDIF + retryCount++ + UNTIL (retryCount>3) OR (loggedOnUserMisc.forcePwdReset=FALSE) + + IF (loggedOnUserMisc.forcePwdReset) + aePuts('\b\nYou have not updated your password so you will now be disconnected...\b\n\b\n') + state:=STATE_LOGGING_OFF + RETURN + ENDIF + ENDIF + + IF logonType>=LOGON_TYPE_REMOTE + doLogonNotify() + ENDIF statPrintUser(loggedOnUser,loggedOnUserKeys,loggedOnUserMisc) @@ -28916,7 +29751,7 @@ PROC processAwait() send017() sendCLS() - StringF(tempstr,'\b\n ©2018-2022 AmiExpress by Darren Coles\b\n\b\n') + StringF(tempstr,'\b\n ©2018-2023 AmiExpress by Darren Coles\b\n\b\n') aePuts(tempstr) StringF(tempstr,'  Original Version:\b\n\b\n') @@ -28973,7 +29808,9 @@ PROC processAwait() ENDIF IF (checkSer()) OR (sopt.trapDoor) OR (instantLogon) OR (checkTelnetConnection()) AND (reqState=REQ_STATE_NONE) - + disableNodeMenus(TRUE) + disableOnlineMenus(FALSE) + IF checkIncomingCall()=RESULT_CONNECT debugLog(LOG_DEBUG,'REMOTE LOGON') ioFlags[IOFLAG_SCR_OUT]:=-1 @@ -29124,14 +29961,7 @@ PROC newUserAccount(userName: PTR TO CHAR) clearMsgPointers() masterSavePointers(loggedOnUser) - runExecuteOn('NEW_USER') - - IF (checkToolTypeExists(TOOLTYPE_BBSCONFIG,0,'MAIL_ON_NEW_USER')) AND (StrLen(mailOptions.sysopEmail)>0) - StringF(tempStr,'\s: Ami-Express new user notification',cmds.bbsName) - StringF(tempStr2,'This is a notification that a new user called \s from \s has registered.',loggedOnUser.name,loggedOnUser.location) - sendMail(tempStr,tempStr2,FALSE,msgBuf,lines,mailOptions.sysopEmail) - ENDIF - + doNewUserNotify() IF displayScreen(SCREEN_JOINED) THEN doPause() ENDPROC stat @@ -29232,16 +30062,41 @@ jLoop4: JUMP jLoop3 ENDIF - aePuts('Enter a PassWord: ') - stat:=lineInput('','',50,INPUT_TIMEOUT,string) +jLoop5: + + stat:=getPass2('Enter a PassWord: ',0,0,50,string) IF(stat<0) THEN RETURN stat IF(StrLen(string)=0) aePuts('\b\n') JUMP jLoop4 ENDIF - UpperStr(string) - loggedOnUser.pwdHash:=calcPasswordHash(string) + stat:=getPass2('Reenter the PassWord: ',0,0,50,str2) + IF(stat<0) THEN RETURN stat + + IF(StrCmp(string,str2)=0) + aePuts('\b\nPasswords do not match, try again..\b\n') + JUMP jLoop5 + ENDIF + stat:=checkPasswordStrength(string) + IF stat<>TRUE + + IF stat=1 + stat:=readToolTypeInt(TOOLTYPE_BBSCONFIG,0,'MIN_PASSWORD_LENGTH') + StringF(string,'\b\nPassword length must be at least \d chars, try again..\b\n',stat) + aePuts(string) + ELSEIF stat=2 + stat:=readToolTypeInt(TOOLTYPE_BBSCONFIG,0,'MIN_PASSWORD_STRENGTH') + StringF(string,'\b\nPassword must have at least \d of these:\b\n upper case,lower case, numeric and symbols, try again..\b\n',stat) + aePuts(string) + ENDIF + JUMP jLoop5 + ENDIF + + setNewPassword(loggedOnUser,loggedOnUserMisc,string) + loggedOnUserMisc.pwdLastUpdated:=getSystemTime() + + aePuts('\b\n') stat:=numberOfLinesTest() IF(stat<0) THEN RETURN stat @@ -29308,9 +30163,10 @@ ENDPROC PROC doNewUserQuestions() DEF filename[200]:STRING, afilename[200]:STRING DEF ch,stat,lock - DEF c[200]:STRING,string[200]:STRING,datestr[20]:STRING + DEF c[200]:STRING,string[200]:STRING,datestr[20]:STRING,timestr[20]:STRING DEF fp2,fp1 DEF temp1[255]:STRING + DEF calldate StringF(filename,'\sNode\d/Script\d',cmds.bbsLoc,node,onlineBaud) IF checkToolTypeExists(TOOLTYPE_NODE,node,'CENTRAL_ANSWERS') @@ -29327,13 +30183,15 @@ qAgain: StringF(string,'\sNode\d/TempAns',cmds.bbsLoc,node) - IF((fp1:=Open(string,MODE_READWRITE))=0) THEN RETURN RESULT_GOODBYE - Seek(fp1,0,OFFSET_END) + IF((fp1:=Open(string,MODE_NEWFILE))=0) THEN RETURN RESULT_GOODBYE + + calldate:=getSystemTime() + formatLongDate(calldate,datestr) + formatLongTime(calldate,timestr) - formatLongDateTime(getSystemTime(),datestr) fileWriteLn(fp1,'**************************************************************') - StringF(temp1,'\s [\d] \s (\s) \s',datestr,loggedOnUser.slotNumber,loggedOnUser.name,connectString,loggedOnUser.location) + StringF(temp1,'\s (\s) [\d] \s (\s) \s',datestr,timestr,loggedOnUser.slotNumber,loggedOnUser.name,connectString,loggedOnUser.location) fileWriteLn(fp1,temp1) Close(fp1) @@ -29650,7 +30508,7 @@ PROC openHydraStat() ENDIF hydraWindow1:=OpenWindowTagList(NIL,tags) - END tags[countTags(tags)] + FastDisposeList(tags) IF (hydraWindow1) AND (fontHandle<>NIL) THEN SetFont(hydraWindow1.rport,fontHandle) @@ -29690,7 +30548,7 @@ PROC openHydraStat() hydraWindow2:=OpenWindowTagList(NIL,tags) IF (hydraWindow2) AND (fontHandle<>NIL) THEN SetFont(hydraWindow2.rport,fontHandle) - END tags[countTags(tags)] + FastDisposeList(tags) IF pub tags:=NEW [WA_CLOSEGADGET,1, @@ -29728,7 +30586,7 @@ PROC openHydraStat() hydraWindow3:=OpenWindowTagList(NIL,tags) IF (hydraWindow3) AND (fontHandle<>NIL) THEN SetFont(hydraWindow3.rport,fontHandle) - END tags[countTags(tags)] + FastDisposeList(tags) initHydraStatCon() @@ -29851,12 +30709,144 @@ PROC openZmodemStat() DrawBevelBoxA(windowZmodem.rport,9,129,316,10,tags2) FreeVisualInfo(vi) - END tags2[countTags(tags2)] + FastDisposeList(tags2) CloseLibrary(gadtoolsbase) ENDIF ENDIF - END tags[countTags(tags)] + FastDisposeList(tags) + +ENDPROC + +PROC disableNodeMenus(flag) + DEF item:PTR TO menuitem + IF windowStat THEN ClearMenuStrip(windowStat) + IF window THEN ClearMenuStrip(window) + item:=expMenu.firstitem + WHILE item + IF (item.flags AND CHECKIT)=0 + IF flag THEN item.flags:=item.flags AND $FFEF ELSE item.flags:=item.flags OR $10 + ENDIF + item:=item.nextitem + ENDWHILE + + IF windowStat THEN ResetMenuStrip(windowStat,expMenu) + IF window THEN ResetMenuStrip(window,expMenu) + +ENDPROC + +PROC disableOnlineMenus(flag) + DEF item:PTR TO menuitem + IF windowStat THEN ClearMenuStrip(windowStat) + IF window THEN ClearMenuStrip(window) + + item:=expMenu.nextmenu.firstitem + WHILE item + IF flag THEN item.flags:=item.flags AND $FFEF ELSE item.flags:=item.flags OR $10 + item:=item.nextitem + ENDWHILE + + IF windowStat THEN ResetMenuStrip(windowStat,expMenu) + IF window THEN ResetMenuStrip(window,expMenu) +ENDPROC + +PROC updateMenus() + DEF item:PTR TO menuitem + IF windowStat THEN ClearMenuStrip(windowStat) + IF window THEN ClearMenuStrip(window) + item:=expMenu.firstitem + WHILE item + IF GTMENUITEM_USERDATA(item)=-1 + IF sysopAvail THEN item.flags:=item.flags OR $100 ELSE item.flags:=item.flags AND $FEFF + ENDIF + IF GTMENUITEM_USERDATA(item)=-2 + IF dStatBar THEN item.flags:=item.flags OR $100 ELSE item.flags:=item.flags AND $FEFF + ENDIF + item:=item.nextitem + ENDWHILE + + IF windowStat THEN ResetMenuStrip(windowStat,expMenu) + IF window THEN ResetMenuStrip(window,expMenu) + +ENDPROC + +PROC createMenus() + DEF eWinMenu:PTR TO newmenu + DEF n=0 + + eWinMenu:=NEW eWinMenu[28] + eWinMenu[n].type:=NM_TITLE + eWinMenu[n++].label:='Node' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Sysop logon F1' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Local logon F2' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Instant logon F3' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Reserve node F4' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Conference maintenance F5' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Shell Sh-F5' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Account editor F6' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='View callerslog Sh-F6' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n].flags:=CHECKIT + eWinMenu[n].mutualexclude:=0 + eWinMenu[n].userdata:=-1 + eWinMenu[n++].label:='Sysop available F7' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n].flags:=CHECKIT + eWinMenu[n].mutualexclude:=0 + eWinMenu[n].userdata:=-2 + eWinMenu[n++].label:='Toggle status Help' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Init modem F8' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Exit node F9' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Exit node (offhook) F10' + eWinMenu[n].type:=NM_TITLE + eWinMenu[n++].label:='Online' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Chat F1' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Time limit' + eWinMenu[n].type:=NM_SUB + eWinMenu[n++].label:='Increase F2' + eWinMenu[n].type:=NM_SUB + eWinMenu[n++].label:='Decrease F3' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Capture F4' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Show file F5' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Account edit F6' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Grant temporary access F7' + eWinMenu[n].type:=NM_ITEM + eWinMenu[n++].label:='Disconnect F10' + eWinMenu[n].type:=NM_END + + IF (gadtoolsbase:=OpenLibrary('gadtools.library',0))<>NIL + expMenu:=CreateMenusA(eWinMenu,[TAG_END]) + disableNodeMenus(FALSE) + disableOnlineMenus(TRUE) + CloseLibrary(gadtoolsbase) + ENDIF + END eWinMenu[28] + +ENDPROC +PROC freeMenus() + IF expMenu + IF (gadtoolsbase:=OpenLibrary('gadtools.library',0))<>NIL + FreeMenus(expMenu) + CloseLibrary(gadtoolsbase) + ENDIF + ENDIF ENDPROC PROC openExpressScreen() @@ -29867,6 +30857,7 @@ PROC openExpressScreen() DEF pub=FALSE DEF pubLock=NIL DEF opentags:PTR TO LONG,temp + DEF vi DEF pens: PTR TO INT, cols:PTR TO INT DEF pensize,colsize DEF statePtr:PTR TO awaitState @@ -29993,7 +30984,7 @@ PROC openExpressScreen() SA_COLORS,cols, TAG_DONE] screen:=OpenScreenTagList(NIL,opentags) - END opentags[countTags(opentags)] + FastDisposeList(opentags) END pens[pensize] END cols[colsize] @@ -30007,6 +30998,8 @@ PROC openExpressScreen() IF screen=NIL THEN RETURN ERR_SCREEN + vi:=GetVisualInfoA(screen, [NIL]) + IF windowClose=NIL opentags:=NEW [WA_CLOSEGADGET,1,WA_CUSTOMSCREEN,screen, WA_TOP,0, @@ -30018,7 +31011,7 @@ PROC openExpressScreen() WA_IDCMP,IDCMP_CLOSEWINDOW, TAG_DONE] windowClose:=OpenWindowTagList(NIL,opentags) - END opentags[countTags(opentags)] + FastDisposeList(opentags) ENDIF IF windowClose=NIL THEN RETURN ERR_WINDOW @@ -30041,11 +31034,12 @@ PROC openExpressScreen() WA_MAXHEIGHT,-1, ->WA_DETAILPEN,0, ->WA_BLOCKPEN,blockpen, - WA_IDCMP,IDCMP_CLOSEWINDOW, + WA_NEWLOOKMENUS,1, + WA_IDCMP,IDCMP_CLOSEWINDOW OR IDCMP_MENUPICK, WA_FLAGS,WFLG_ACTIVATE, TAG_DONE] window:=OpenWindowTagList(NIL,opentags) - END opentags[countTags(opentags)] + FastDisposeList(opentags) IF (window) AND (fontHandle<>NIL) THEN SetFont(window.rport,fontHandle) ELSE opentags:=NEW [WA_BORDERLESS,1,WA_CUSTOMSCREEN,screen, @@ -30055,16 +31049,24 @@ PROC openExpressScreen() WA_HEIGHT,height-(screen.wbortop+screen.font.ysize+1), ->WA_DETAILPEN,0, ->WA_BLOCKPEN,blockpen, + WA_NEWLOOKMENUS,1, + WA_IDCMP,IDCMP_MENUPICK, WA_FLAGS,WFLG_ACTIVATE, TAG_DONE] window:=OpenWindowTagList(NIL,opentags) - END opentags[countTags(opentags)] + FastDisposeList(opentags) ENDIF ENDIF + IF pubLock THEN UnlockPubScreen(NIL,pubLock) IF window=NIL THEN RETURN ERR_WINDOW + updateMenus() + LayoutMenusA(expMenu,vi,[GTMN_NEWLOOKMENUS,1,TAG_DONE]) + FreeVisualInfo(vi) + SetMenuStrip(window,expMenu) + IF state=STATE_AWAIT statePtr:=stateData statePtr.redrawScreen:=TRUE @@ -30120,6 +31122,66 @@ PROC openExpressScreen() IF((sopt.statBar<>FALSE) AND (pub=FALSE)) THEN toggleStatusDisplay() ENDPROC ERR_NONE +PROC handleMenuPick(menucode) + DEF menu,item,subitem + menu:=menucode AND $1F + item:=(Shr((menucode),5) AND $3F) + subitem:=(Shr((menucode),11) AND $1F) + + SELECT menu + CASE 0 + SELECT item + CASE 0 + servercmd:=SV_SYSOPLOG + CASE 1 + servercmd:=SV_LOCALLOG + CASE 2 + servercmd:=SV_INSTANT + CASE 3 + servercmd:=SV_RESERVE + CASE 4 + servercmd:=SV_CONFMAINT + CASE 5 + servercmd:=SV_AESHELL + CASE 6 + servercmd:=SV_ACCOUNTS + CASE 7 + servercmd:=SV_VIEWLOGS + CASE 8 + servercmd:=SV_CHATTOGGLE + CASE 9 + servercmd:=SV_TOGGLESTATUS + CASE 10 + servercmd:=SV_INITMODEM + CASE 11 + servercmd:=SV_EXITNODE + CASE 12 + servercmd:=SV_NODEOFFHOOK + ENDSELECT + CASE 1 + SELECT item + CASE 0 + servercmd:=SV_CHAT + CASE 1 + IF subitem=0 + servercmd:=SV_TIMEINCREASE + ELSE + servercmd:=SV_TIMEDECREASE + ENDIF + CASE 2 + servercmd:=SV_CAPTURE + CASE 3 + servercmd:=SV_DISPLAYFILE + CASE 4 + servercmd:=SV_ACCOUNTS + CASE 5 + servercmd:=SV_GRANTTEMP + CASE 6 + servercmd:=SV_KICKUSER + ENDSELECT + ENDSELECT +ENDPROC + PROC closeExpressScreen() closeAEStats() @@ -30160,6 +31222,7 @@ PROC closeExpressScreen() ENDIF IF window + ClearMenuStrip(window) CloseWindow(window) window:=NIL ENDIF @@ -30297,7 +31360,7 @@ PROC main() HANDLE IF StrLen(arg1)>0 node:=Val(arg1) ELSE - debug:=TRUE + Raise(ERR_NODEPARAM) ENDIF stripAnsi(0,0,1,0,ansi) @@ -30379,7 +31442,7 @@ PROC main() HANDLE netTrans:=0 ENDIF - saveA4() + saveA4(FindTask(0),{tasksA4}) StringF(bgCheckPortName,'bgCheckPort\d',node) @@ -30776,7 +31839,8 @@ PROC main() HANDLE SetTaskPri(FindTask(0),cmds.taskPri) ENDIF - IF (debug) OR (sopt.iconify=FALSE) THEN openExpressScreen() + createMenus() + IF (sopt.iconify=FALSE) THEN openExpressScreen() formatLongDateTime(getSystemTime(),tempstr) StringF(tempstr2,'####### BBS Node \d started on \s #######\n',node,tempstr) @@ -30900,6 +31964,8 @@ PROC main() HANDLE socketbase:=NIL closeExpressScreen() + freeMenus() + IF iconbase THEN CloseLibrary(iconbase) IF diskfontbase THEN CloseLibrary(diskfontbase) @@ -30953,9 +32019,12 @@ PROC main() HANDLE debugLog(LOG_ERROR,tempstr) CASE ERR_FDSRANGE debugLog(LOG_ERROR,'FDS Range error') + CASE ERR_NODEPARAM + WriteF('Express should not be launched manually\n.') CASE "NIL" StringF(tempstr,'NIL pointer error at line \d',exceptioninfo) debugLog(LOG_ERROR,tempstr) + WriteF('Error: NIL pointer exception') DEFAULT IF exception<>0 StringF(tempstr,'Unknown exception \d',exception) @@ -30964,29 +32033,12 @@ PROC main() HANDLE ENDSELECT ENDPROC -PROC saveA4() - MOVEM.L D0-D7/A0-A6,-(A7) - MOVE.L 4,A6 - SUB.L A1,A1 - JSR -$126(A6) ->findtask - MOVE.L D0,D7 - - LEA regA4(PC),A0 - LEA tasksA4(PC),A1 - MOVE.L node,D0 - ADD.W D0,D0 - ADD.W D0,D0 - MOVE.L A4,0(A0,D0.W) - MOVE.L D7,0(A1,D0.W) - MOVEM.L (A7)+,D0-D7/A0-A6 -ENDPROC - -PROC saveA4thread(taskID) +PROC saveA4(taskID,tasktable) MOVEM.L D0-D7/A0-A6,-(A7) MOVE.L taskID,D7 LEA regA4(PC),A0 - LEA threadtasksA4(PC),A1 + MOVE.L tasktable,A1 MOVE.L node,D0 ADD.W D0,D0 ADD.W D0,D0 @@ -30995,7 +32047,7 @@ PROC saveA4thread(taskID) MOVEM.L (A7)+,D0-D7/A0-A6 ENDPROC -PROC loadA4() +PROC loadA4(tasktable) MOVEM.L D0-D7/A0-A3/A5-A6,-(A7) MOVE.L 4,A6 @@ -31004,7 +32056,7 @@ PROC loadA4() MOVE.L D0,D1 LEA regA4(PC),A0 - LEA tasksA4(PC),A1 + MOVE.L tasktable,A1 CLR.L D0 findA4task: MOVE.L 0(A1,D0.W),D2 @@ -31023,34 +32075,6 @@ taskfound: MOVEM.L (A7)+,D0-D7/A0-A3/A5-A6 ENDPROC -PROC loadA4thread() - MOVEM.L D0-D7/A0-A3/A5-A6,-(A7) - MOVE.L 4,A6 - SUB.L A1,A1 - JSR -$126(A6) ->findtask - MOVE.L D0,D1 - - LEA regA4(PC),A0 - LEA threadtasksA4(PC),A1 - CLR.L D0 -findA4threadtask: - MOVE.L 0(A1,D0.W),D2 - CMP.L D1,D2 - BEQ threadtaskfound - - ADD.L #4,D0 - CMP.L #128,D0 - BNE findA4threadtask - - MOVE.L #AG_BADPARM,D7 - JSR -$6c(A6) ->Alert(AG_BADPARM) - -threadtaskfound: - MOVE.L 0(A0,D0),A4 - MOVEM.L (A7)+,D0-D7/A0-A3/A5-A6 - -ENDPROC - tasksA4: LONG NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL LONG NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL diff --git a/ftpd.e b/ftpd.e index 168e849..7ab5bce 100644 --- a/ftpd.e +++ b/ftpd.e @@ -33,7 +33,8 @@ MODULE 'socket', '*axobjects', '*axenums', '*tooltypes', - '*miscfuncs' + '*miscfuncs', + '*bcd' EXPORT OBJECT ftpData @@ -258,23 +259,24 @@ PROC uploadFileStart(ftpData:PTR TO ftpData,fn,resumepos) ADD.L #8,A7 ENDPROC -PROC checkDownloadRatio(ftpData:PTR TO ftpData,fn,pos,res:PTR TO CHAR) +PROC checkDownloadRatio(ftpData:PTR TO ftpData,fn,flen,res:PTR TO CHAR) DEF cdr cdr:=ftpData.checkDownloadRatio MOVE.L fn,-(A7) - MOVE.L pos,-(A7) + MOVE.L flen,-(A7) MOVE.L res,-(A7) cdr() ADD.L #12,A7 ENDPROC D0 -PROC downloadFileStart(ftpData:PTR TO ftpData,fn,pos) +PROC downloadFileStart(ftpData:PTR TO ftpData,fn,flen,pos) DEF fs fs:=ftpData.downloadFileStart MOVE.L fn,-(A7) + MOVE.L flen,-(A7) MOVE.L pos,-(A7) fs() - ADD.L #8,A7 + ADD.L #12,A7 ENDPROC PROC uploadFileEnd(ftpData:PTR TO ftpData,fn,result) @@ -335,11 +337,11 @@ PROC getPath(ftpData:PTR TO ftpData,confNum,subDir:PTR TO CHAR,outpath) gp(confNum,subDir,outpath) ENDPROC -PROC findFile(ftpData:PTR TO ftpData,fileName,outpath) +PROC findFile(ftpData:PTR TO ftpData,fileName,subDirs,outpath) DEF ff ff:=ftpData.findFile - ff(fileName,outpath) + ff(fileName,subDirs,outpath) ENDPROC PROC aePuts(ftpData:PTR TO ftpData, s:PTR TO CHAR) @@ -446,17 +448,13 @@ ENDPROC PROC calcCPS(pd,t,t2) DEF cps,td + DEF bcdVal[8]:ARRAY OF CHAR cps:=0 - IF t$10000000) - pd:=Shr(pd,1) AND $7fffffff - td:=Div(td,50) - IF td<1 THEN td:=1 - cps:=Shl(Div(pd,td),1) - ELSE - cps:=Div(Mul(pd,50),td) - ENDIF + td:=t2-t + IF td + convertToBCD(pd,bcdVal) + mulBCD(bcdVal,50) + cps:=divBCD(bcdVal,td) ELSE cps:=pd ENDIF @@ -499,12 +497,8 @@ PROC getFileName(ftpData:PTR TO ftpData, filename:PTR TO CHAR,outFilename:PTR TO item:=fileList.item(i) IF StriCmp(FilePart(item.fileName),filename) THEN StrCopy(outFilename,item.fileName) ENDFOR - ELSEIF StrLen(ftpData.subDirPath)>0 - StrCopy(outFilename,ftpData.subDirPath) - checkPathSlash(outFilename) - StrAdd(outFilename,filename) ELSEIF ftpData.findFile<>NIL - findFile(ftpData,filename,outFilename) + findFile(ftpData,filename,ftpData.subDirPath,outFilename) ENDIF ENDPROC @@ -842,13 +836,10 @@ PROC downloadDir(sb,data_c, ftpData:PTR TO ftpData,cmdType) ENDPROC TRUE PROC fullDir(sb,data_c, ftpData:PTR TO ftpData,cmdType) - DEF fileNames:PTR TO stringlist - DEF fileSizes:PTR TO stdlist - DEF fileDates:PTR TO stdlist - DEF filedate:datestamp + DEF i DEF tempstr[255]:STRING DEF dirline[255]:STRING - DEF i + DEF filedate:datestamp IF (ftpData.currentConf=0) dateTimeToDateStamp(getSystemTime(),filedate) @@ -872,103 +863,193 @@ PROC fullDir(sb,data_c, ftpData:PTR TO ftpData,cmdType) callersLog(ftpData,'\tDirectory Scan via ftp') ENDIF - fileNames,fileSizes,fileDates:=makeConfFileList(ftpData) - - FOR i:=0 TO fileNames.count()-1 - - dateTimeToDateStamp(fileDates.item(i),filedate) - - IF fileSizes.item(i)=-1 - IF cmdType=CMDTYPE_MLSD - formatFileDate2(filedate,tempstr) - StringF(dirline,'Type=dir;Modify=\s;Perm=r; \s\b\n',tempstr,FilePart(fileNames.item(i))) - ELSEIF cmdType=CMDTYPE_NLST - StrCopy(dirline,fileNames.item(i)) - ELSE /*cmdType=CMDTYPE_LIST as default*/ - formatFileDate(filedate,tempstr) - StringF(dirline,'dr--r--r-- 1 root root \r\d[10] \s \s\b\n',0,tempstr,FilePart(fileNames.item(i))) - ENDIF - ELSE - IF cmdType=CMDTYPE_MLSD - formatFileDate2(filedate,tempstr) - StringF(dirline,'Type=file;Size=\d;Modify=\s;Perm=r; \s\b\n',fileSizes.item(i),tempstr,FilePart(fileNames.item(i))) - ELSEIF cmdType=CMDTYPE_NLST - StrCopy(dirline,fileNames.item(i)) - ELSE /*cmdType=CMDTYPE_LIST as default*/ - formatFileDate(filedate,tempstr) - StringF(dirline,'-r--r--r-- 1 root root \r\d[10] \s \s\b\n',fileSizes.item(i),tempstr,FilePart(fileNames.item(i))) - ENDIF + makeConfFileList(ftpData,cmdType,sb,data_c) + +ENDPROC + +PROC sendFileDetails(filename:PTR TO CHAR, fileSize, fileDate, cmdType, sb, data_c, output) + DEF filedatets:datestamp + DEF tempstr[255]:STRING + DEF dirline[255]:STRING + + dateTimeToDateStamp(fileDate,filedatets) + + IF fileSize=-1 + IF cmdType=CMDTYPE_MLSD + formatFileDate2(filedatets,tempstr) + StringF(dirline,'Type=dir;Modify=\s;Perm=r; \s\b\n',tempstr,FilePart(filename)) + ELSEIF cmdType=CMDTYPE_NLST + StrCopy(dirline,filename) + ELSE /*cmdType=CMDTYPE_LIST as default*/ + formatFileDate(filedatets,tempstr) + StringF(dirline,'dr--r--r-- 1 root root \r\d[10] \s \s\b\n',0,tempstr,FilePart(filename)) ENDIF + ELSE + IF cmdType=CMDTYPE_MLSD + formatFileDate2(filedatets,tempstr) + StringF(dirline,'Type=file;Size=\d;Modify=\s;Perm=r; \s\b\n',fileSize,tempstr,FilePart(filename)) + ELSEIF cmdType=CMDTYPE_NLST + StrCopy(dirline,filename) + ELSE /*cmdType=CMDTYPE_LIST as default*/ + formatFileDate(filedatets,tempstr) + StringF(dirline,'-r--r--r-- 1 root root \r\d[10] \s \s\b\n',fileSize,tempstr,FilePart(filename)) + ENDIF + ENDIF + IF output + IF ((EstrLen(output)+EstrLen(dirline))>StrMax(output)) + writeLineEx(sb,data_c, output) + StrCopy(output,'') + ENDIF + StrAdd(output,dirline) + ELSE writeLineEx(sb,data_c, dirline) - ENDFOR - - END fileNames - END fileSizes - END fileDates + ENDIF ENDPROC -PROC makeList(path:PTR TO CHAR, fib:PTR TO fileinfoblock, fileNames:PTR TO stringlist, fileSizes:PTR TO stdlist,fileDates:PTR TO stdlist, startDate) +PROC makeList(path:PTR TO CHAR,dirCache:PTR TO CHAR,fib:PTR TO fileinfoblock, startDate, cmdType, sb, data_c) DEF fLock - DEF d + DEF d,fh + DEF dirLine[40]:STRING + DEF tmp[10]:STRING + DEF c=FALSE + DEF mem,fs,p,cnt + DEF output + + output:=String(10000) + + fs:=FileLength(dirCache) + IF fs>0 + /*IF (mem:=New(fs+1)) + fh:=Open(dirCache,MODE_OLDFILE) + Read(fh,mem,fs) + p:=0 + WHILE (p=0 + StrCopy(dirLine,mem+p,cnt) + p:=p+cnt+1 + ELSE + StrCopy(dirLine,mem+p) + p:=fs + ENDIF + IF StrLen(dirLine)>18 + c:=TRUE + StrCopy(tmp,'$') + StrAdd(tmp,dirLine,8) + d:=Val(tmp) + IF d>=startDate + StrCopy(tmp,'$') + StrAdd(tmp,dirLine+9,8) + sendFileDetails(dirLine+18,Val(tmp),d,cmdType, sb, data_c, output) + ENDIF + ENDIF + ENDWHILE + Close(fh) + Dispose(mem) + ELSE*/ + fh:=Open(dirCache,MODE_OLDFILE) + IF fh<>0 + WHILE(Fgets(fh,dirLine,40)<>NIL) + IF StrLen(dirLine)>18 + c:=TRUE + StrCopy(tmp,'$') + StrAdd(tmp,dirLine,8) + d:=Val(tmp) + IF d>=startDate + StrCopy(tmp,'$') + StrAdd(tmp,dirLine+9,8) + sendFileDetails(dirLine+18,Val(tmp),d,cmdType, sb, data_c, output) + ENDIF + ENDIF + ENDWHILE + Close(fh) + ENDIF + //ENDIF + IF (output ANDALSO (EstrLen(output)>0)) + writeLineEx(sb,data_c, output) + ENDIF + IF c + DisposeLink(output) + RETURN + ENDIF + + ENDIF + IF((fLock:=Lock(path,ACCESS_READ))) IF((Examine(fLock,fib))) IF(fib.direntrytype > 0) WHILE(ExNext(fLock,fib)) - d:=dateStampToDateTime(fib.datestamp) - IF d>=startDate - fileNames.add(fib.filename) - IF fib.direntrytype>0 THEN fileSizes.add(-1) ELSE fileSizes.add(fib.size) - fileDates.add(d) + IF StrCmp(fib.filename,'.dircache')=FALSE + d:=dateStampToDateTime(fib.datestamp) + IF d>=startDate + sendFileDetails(fib.filename,IF fib.direntrytype>0 THEN -1 ELSE fib.size,d,cmdType, sb, data_c, output) + ENDIF ENDIF ENDWHILE ENDIF ENDIF UnLock(fLock) ENDIF + IF (output ANDALSO (EstrLen(output)>0)) THEN writeLineEx(sb,data_c, output) + DisposeLink(output) ENDPROC -PROC makeFtpListFromSubDir(ftpData:PTR TO ftpData, fileNames:PTR TO stringlist, fileSizes:PTR TO stdlist,fileDates:PTR TO stdlist, startDate) - DEF path[255]:STRING - DEF fib:PTR TO fileinfoblock - - StrCopy(path,ftpData.subDirPath) - - IF((fib:=AllocDosObject(DOS_FIB,NIL)))=NIL - RETURN FALSE - ENDIF - - checkPathSlash(path) - - makeList(path,fib, fileNames,fileSizes,fileDates,startDate) - - FreeDosObject(DOS_FIB,fib) -ENDPROC - -PROC makeFtpListFromDlDirs(ftpData:PTR TO ftpData, fileNames:PTR TO stringlist, fileSizes:PTR TO stdlist,fileDates:PTR TO stdlist, startDate) +PROC makeFtpListFromDlDirs(ftpData:PTR TO ftpData, startDate, cmdType, sb, data_c) DEF path[255]:STRING + DEF dirCache[255]:STRING DEF fib:PTR TO fileinfoblock - DEF dirNum + DEF dirNum,i,j,add + DEF dlDirList:PTR TO stringlist IF((fib:=AllocDosObject(DOS_FIB,NIL)))=NIL RETURN FALSE ENDIF + NEW dlDirList.stringlist(20) + dirNum:=1 StringF(path,'DLPATH.\d',dirNum++) WHILE(readToolType(TOOLTYPE_CONF,ftpData.confNums.item(ftpData.currentConf-1),path,path)) checkPathSlash(path) - - makeList(path,fib, fileNames,fileSizes,fileDates,startDate) + dlDirList.add(path) StringF(path,'DLPATH.\d',dirNum++) ENDWHILE + FOR i:=0 TO dlDirList.count()-1 + add:=TRUE + FOR j:=0 TO dlDirList.count()-1 + IF (i<>j) + IF EstrLen(dlDirList.item(i))>=EstrLen(dlDirList.item(j)) + IF StriCmp(dlDirList.item(i),dlDirList.item(j),EstrLen(dlDirList.item(j))) THEN add:=FALSE + ENDIF + ENDIF + ENDFOR + IF add=FALSE THEN dlDirList.setItem(i,'') + ENDFOR + + FOR j:=0 TO dlDirList.count()-1 + IF EstrLen(dlDirList.item(j))>0 + StrCopy(path,dlDirList.item(j)) + IF StrLen(ftpData.subDirPath) + StrAdd(path,ftpData.subDirPath) + checkPathSlash(path) + ENDIF + + StringF(dirCache,'RAM:DirCaches/Conf\dDir\d\s\s',ftpData.currentConf,j,IF StrLen(ftpData.subDirPath)>0 THEN '_' ELSE '', ftpData.subDirPath) + FOR i:=14 TO StrLen(dirCache)-1 DO IF dirCache[i]="/" THEN dirCache[i]:="_" + + makeList(path,dirCache,fib,startDate,cmdType,sb,data_c) + ENDIF + ENDFOR + END dlDirList + FreeDosObject(DOS_FIB,fib) ENDPROC -PROC makeFtpListFromDirList(ftpData:PTR TO ftpData, fileNames:PTR TO stringlist, fileSizes:PTR TO stdlist,fileDates:PTR TO stdlist, startDate) +PROC makeFtpListFromDirList(ftpData:PTR TO ftpData, startDate, cmdType, sb, data_c) DEF dtStr[20]:STRING DEF sizeStr[20]:STRING DEF dtcomp1,dtcomp2 @@ -976,9 +1057,12 @@ PROC makeFtpListFromDirList(ftpData:PTR TO ftpData, fileNames:PTR TO stringlist, DEF dirFile[255]:STRING DEF tempstr[255]:STRING DEF fh,t,sz,m,d,y + DEF output DEF maxDirs + output:=String(10000) + maxDirs:=readToolTypeInt(TOOLTYPE_CONF,ftpData.confNums.item(ftpData.currentConf-1),'NDIRS') formatLongDate(startDate,dtStr) @@ -993,8 +1077,8 @@ PROC makeFtpListFromDirList(ftpData:PTR TO ftpData, fileNames:PTR TO stringlist, IF(Fgets(fh,tempstr,255)<>NIL) AND (StrLen(tempstr)>0) tempstr[255]:=0 - SetStr(tempstr,StrLen(tempstr)) - IF (tempstr[0]<>32) AND (tempstr[0]<>0) AND (tempstr[0]<>"\n") + SetStr(tempstr,StrLen(tempstr)) + IF (dirLineNewFile(tempstr)) t:=TrimStr(tempstr+14) spPos:=InStr(t,' ') StrCopy(dtStr,TrimStr(t+spPos)) @@ -1015,7 +1099,7 @@ PROC makeFtpListFromDirList(ftpData:PTR TO ftpData, fileNames:PTR TO stringlist, found:=FALSE REPEAT IF StrLen(tempstr)>0 - IF (tempstr[0]<>32) AND (tempstr[0]<>0) AND (tempstr[0]<>"\n") + IF dirLineNewFile(tempstr) IF found=FALSE t:=TrimStr(tempstr+14) @@ -1042,11 +1126,8 @@ PROC makeFtpListFromDirList(ftpData:PTR TO ftpData, fileNames:PTR TO stringlist, IF (InStr(sizeStr,'M')>=0) THEN sz:=Mul(sz,1048576) spPos:=InStr(tempstr,' ') - SetStr(tempstr,spPos) - - fileNames.add(tempstr) - fileSizes.add(sz) - fileDates.add(encodeDate(m,d,y)) + SetStr(tempstr,spPos) + sendFileDetails(tempstr,sz,encodeDate(m,d,y),cmdType, sb, data_c, output) ENDIF ENDIF ENDIF @@ -1058,12 +1139,11 @@ PROC makeFtpListFromDirList(ftpData:PTR TO ftpData, fileNames:PTR TO stringlist, fh:=Open(dirFile,MODE_OLDFILE) ENDIF ENDWHILE + IF (output ANDALSO (EstrLen(output)>0)) THEN writeLineEx(sb,data_c, output) + DisposeLink(output) ENDPROC -PROC makeConfFileList(ftpData:PTR TO ftpData) - DEF fileNames:PTR TO stringlist - DEF fileSizes:PTR TO stdlist - DEF fileDates:PTR TO stdlist +PROC makeConfFileList(ftpData:PTR TO ftpData, cmdType, sb, data_c) DEF startDate,dayOffset dayOffset:=readToolTypeInt(TOOLTYPE_CONF,ftpData.confNums.item(ftpData.currentConf-1),'FTP_DIR_DAYS') @@ -1072,20 +1152,17 @@ PROC makeConfFileList(ftpData:PTR TO ftpData) startDate:=getSystemDate()-dayOffset - fileNames:=NEW fileNames.stringlist(256) - fileSizes:=NEW fileSizes.stdlist(256) - fileDates:=NEW fileDates.stdlist(256) IF ftpData.currentConf>0 IF (StrLen(ftpData.subDirPath)>0) - makeFtpListFromSubDir(ftpData,fileNames,fileSizes,fileDates,startDate) + makeFtpListFromDlDirs(ftpData,startDate,cmdType, sb, data_c) ELSEIF checkToolTypeExists(TOOLTYPE_CONF,ftpData.confNums.item(ftpData.currentConf-1),'FTP_NO_DIRLIST') - makeFtpListFromDlDirs(ftpData,fileNames,fileSizes,fileDates,startDate) + makeFtpListFromDlDirs(ftpData,startDate,cmdType, sb, data_c) ELSE - makeFtpListFromDirList(ftpData,fileNames,fileSizes,fileDates,startDate) + makeFtpListFromDirList(ftpData,startDate,cmdType, sb, data_c) ENDIF ENDIF -ENDPROC fileNames,fileSizes,fileDates +ENDPROC PROC cmdUser(sb,ftp_c,params:PTR TO CHAR,ftpData:PTR TO ftpData) ->WriteF('user=\s\b\n',params) @@ -1110,10 +1187,11 @@ PROC cmdPwd(sb,ftp_c,ftpData:PTR TO ftpData) StrCopy(sendStr, '257 "/" is current directory.\b\n') writeLineEx(sb,ftp_c,sendStr) ELSE + StringF(dirName,'/\r\z\d[3]-\s',ftpData.currentConf,ftpData.confNames.item(ftpData.currentConf-1)) IF StrLen(ftpData.subDirPath)>0 StrAdd(dirName,'/') - StrAdd(dirName,FilePart(ftpData.subDirPath)) + StrAdd(dirName,ftpData.subDirPath) ENDIF StringF(sendStr, '257 "\s" is current directory.\b\n',dirName) writeLineEx(sb,ftp_c,sendStr) @@ -1144,7 +1222,7 @@ PROC cmdCwd(sb,ftp_c,ftpData:PTR TO ftpData,path:PTR TO CHAR) DEF sendStr[255]:STRING DEF temp[255]:STRING DEF outFileName[255]:STRING - DEF stat,i + DEF stat,i,p IF ftpData.mode=MODE_FULLSERVER IF StrCmp(path,'/') @@ -1158,7 +1236,13 @@ PROC cmdCwd(sb,ftp_c,ftpData:PTR TO ftpData,path:PTR TO CHAR) writeLineEx(sb,ftp_c,sendStr) IF StrLen(ftpData.subDirPath)>0 - StrCopy(ftpData.subDirPath,'') + IF InStr(ftpData.subDirPath,'/')>=0 + p:=StrLen(ftpData.subDirPath)-1 + WHILE ftpData.subDirPath[p]<>"/" DO p-- + SetStr(ftpData.subDirPath,p) + ELSE + StrCopy(ftpData.subDirPath,'') + ENDIF ELSE ftpData.currentConf:=0 ENDIF @@ -1193,33 +1277,39 @@ PROC cmdCwd(sb,ftp_c,ftpData:PTR TO ftpData,path:PTR TO CHAR) FOR i:=0 TO ftpData.confNames.count()-1 StringF(temp,'/\r\z\d[3]-\s/',i+1,ftpData.confNames.item(i)) - IF StrCmp(temp,path,StrLen(temp)) THEN stat:=i + IF StrCmp(temp,path,StrLen(temp)) + stat:=i + StrCopy(path,path+StrLen(temp)) + ENDIF ENDFOR IF stat=-1 IF ftpData.currentConf=0 FOR i:=0 TO ftpData.confNames.count()-1 StringF(temp,'\r\z\d[3]-\s/',i+1,ftpData.confNames.item(i)) - IF StrCmp(temp,path,StrLen(temp)) THEN stat:=i + IF StrCmp(temp,path,StrLen(temp)) + stat:=i + StrCopy(path,path+StrLen(temp)) + ENDIF ENDFOR ENDIF ENDIF IF stat>=0 ftpData.currentConf:=stat+1 - - getPath(ftpData,ftpData.confNums.item(ftpData.currentConf-1),FilePart(path),outFileName) + getPath(ftpData,ftpData.confNums.item(ftpData.currentConf-1),path,outFileName) IF StrLen(outFileName)>0 - StrCopy(ftpData.subDirPath,outFileName) + StrCopy(ftpData.subDirPath,path) ELSE stat:=-1 ENDIF ELSE IF ftpData.currentConf<>0 + IF StrLen(ftpData.subDirPath)>0 THEN StringF(path,'\s/\s',ftpData.subDirPath,path) getPath(ftpData,ftpData.confNums.item(ftpData.currentConf-1),path,outFileName) IF StrLen(outFileName)>0 + StrCopy(ftpData.subDirPath,path) stat:=1 - StrCopy(ftpData.subDirPath,outFileName) ENDIF ENDIF ENDIF @@ -1619,7 +1709,7 @@ PROC cmdRetr(sb,ftp_c,data_s,data_c,filename:PTR TO CHAR,ftpData:PTR TO ftpData) DEF buff DEF asynclib DEF fn[255]:STRING - DEF r,l,pos,cps,lastpos + DEF r,l,pos,cps,lastpos,flen DEF fh DEF t,t2,startTime DEF candl=TRUE @@ -1656,7 +1746,9 @@ PROC cmdRetr(sb,ftp_c,data_s,data_c,filename:PTR TO CHAR,ftpData:PTR TO ftpData) getFileName(ftpData,filename,fn) fh:=0 + flen:=0 IF StrLen(fn) + flen:=FileLength(fn) IF asynclib<>NIL writeLineEx(sb,ftp_c, '150 Opening BINARY connection with ASYNC\b\n') fh:=OpenAsync(fn,MODE_READ,32768) @@ -1678,18 +1770,15 @@ PROC cmdRetr(sb,ftp_c,data_s,data_c,filename:PTR TO CHAR,ftpData:PTR TO ftpData) pos:=ftpData.restPos IF asynclib<>NIL SeekAsync(fh,pos,MODE_START) - pos:=SeekAsync(fh,0,MODE_CURRENT) ELSE Seek(fh,pos,OFFSET_BEGINNING) - pos:=Seek(fh,0,OFFSET_CURRENT) ENDIF - IF (ftpData.checkDownloadRatio<>NIL) ANDALSO (checkDownloadRatio(ftpData,fn,pos,res)=FALSE) + IF (ftpData.checkDownloadRatio<>NIL) ANDALSO (checkDownloadRatio(ftpData,fn,flen,res)=FALSE) StringF(temp,'550 \s\b\n',res) writeLineEx(sb,ftp_c,temp) candl:=FALSE - ELSE - IF (ftpData.downloadFileStart<>NIL) THEN downloadFileStart(ftpData,fn,pos) ENDIF + IF (ftpData.downloadFileStart<>NIL) THEN downloadFileStart(ftpData,fn,flen,pos) ENDIF IF candl buff:=New(32768) @@ -2049,7 +2138,7 @@ PROC createThread(num,node,sockid,ftpData:PTR TO ftpData) DEF name[255]:STRING StringF(name,'ftpThread\d-\d',node,num) - tags:=NEW [NP_ENTRY,{ftpThread},NP_NAME,name,NP_STACKSIZE,10000,0]:LONG + tags:=NEW [NP_ENTRY,{ftpThread},NP_NAME,name,NP_STACKSIZE,10000,0] ftpData.sockId:=sockid @@ -2057,7 +2146,7 @@ PROC createThread(num,node,sockid,ftpData:PTR TO ftpData) proc:=CreateNewProc(tags) saveA4(proc,ftpData,node) Permit() - END tags[7] + FastDisposeList(tags) ENDPROC EXPORT PROC ftpServerMode(ftpData:PTR TO ftpData, ftp_c,ftpHost:PTR TO CHAR,uploadPath:PTR TO CHAR,ftpDataPorts:PTR TO LONG,filenameCAPS) @@ -2074,7 +2163,7 @@ EXPORT PROC ftpServerMode(ftpData:PTR TO ftpData, ftp_c,ftpHost:PTR TO CHAR,uplo ftpData.workingPath:=String(255) ftpData.uploadPath:=String(255) ftpData.hostName:=String(255) - ftpData.subDirPath:=String(255) + ftpData.subDirPath:=String(1000) ftpData.dataPorts:=ftpDataPorts ftpData.ftpDir:={fullDir} ftpData.currentConf:=0 diff --git a/hydra.e b/hydra.e index 5905c4b..f5f0451 100644 --- a/hydra.e +++ b/hydra.e @@ -2571,7 +2571,7 @@ PROC hydra(hyd:PTR TO hydra_t,txpathname:PTR TO CHAR,txalias:PTR TO CHAR) proc:=hyd.hyd_close proc(hyd.txfd) proc:=hyd.hyd_downloadcompleted - IF proc THEN proc(hyd.txfsize) + IF proc THEN proc(hyd.txfsize,hyd.txfsize-hyd.txoffset) hydra_pct(hyd,TRUE) t1,t2:=time() t:=Mul((t1-hyd.txstart1),50)+t2-hyd.txstart2 diff --git a/icon2cfg.e b/icon2cfg.e index bb471dc..942dd8a 100644 --- a/icon2cfg.e +++ b/icon2cfg.e @@ -95,7 +95,7 @@ PROC main() HANDLE ENDIF ENDIF - fileBuf:=New(getFileSize(fn2)+1) ->allow an extra char in case file does not end in LF + fileBuf:=New(FileLength(fn2)+1) ->allow an extra char in case file does not end in LF IF fileBuf<>NIL fh:=Open(sourceFile,MODE_OLDFILE) IF fh<>0 diff --git a/mailssl.e b/mailssl.e index 9c66c29..21db3cc 100644 --- a/mailssl.e +++ b/mailssl.e @@ -454,11 +454,11 @@ EXPORT PROC initssl(createctx) HANDLE tags:=NEW [AMISSL_ERRNOPTR,{sslerrno},AMISSL_SOCKETBASE,socketbase,0] IF (InitAmiSSLA(tags) <> 0) - END tags[5] + FastDisposeList(tags) WriteF('Couldn''t initialize AmiSSL!\n'); Raise(ERR_SSL) ENDIF - END tags[5] + FastDisposeList(tags) /* Basic intialization. Next few steps (up to SSL_new()) need * to be done only once per AmiSSL opener. diff --git a/makefile b/makefile index 9c630f4..746667a 100644 --- a/makefile +++ b/makefile @@ -1,107 +1,147 @@ -# Compile ACP and EXPRESS and any dependencies - -options=DEBUG IGNORECACHE NILCHECK OPTI SYM SHOWFNAME -compiler=EVO -expprogramname=AmiExpress -acpprogramname=ACP -version=5.5.0 - -all: acp express5 jsonimport icon2cfg qwk ftn - -release: options = IGNORECACHE OPTI SHOWFNAME -release: acp express5 jsonimport icon2cfg qwk ftn - -acp: acp.e acpversion.m axcommon.m jsonparser.m jsoncreate.m stringlist.m - $(compiler) acp $(options) - -express5: express.e expversion.m axcommon.m axconsts.m miscfuncs.m axobjects.m axenums.m stringlist.m errors.m mailssl.m ftpd.m httpd.m xymodem.m zmodem.m hydra.m tooltypes.m pwdhash.m bcd.m - $(compiler) express $(options) - copy express express5 - delete express - -verinfogen: verinfogen.e - $(compiler) verinfogen $(options) - -ftn: ftn.e stringlist.m - $(compiler) ftn $(options) - -qwk: qwk.e stringlist.m - $(compiler) qwk $(options) - -icon2cfg: icon2cfg.e miscfuncs.m - $(compiler) icon2cfg $(options) - -jsonimport: jsonimport.e jsonparser.m jsoncreate.m - $(compiler) jsonimport $(options) - -jsonparser.m: jsonparser.e miscfuncs.m - $(compiler) jsonparser $(options) - -jsoncreate.m: jsoncreate.e miscfuncs.m jsonparser.m - $(compiler) jsoncreate $(options) - -zmodem.m: zmodem.e - $(compiler) zmodem $(options) - -xymodem.m: xymodem.e - $(compiler) xymodem $(options) - -hydra.m: hydra.e - $(compiler) hydra $(options) - -stringlist.m: stringlist.e - $(compiler) stringlist $(options) - -miscfuncs.m: miscfuncs.e axconsts.m axenums.m axobjects.m errors.m - $(compiler) miscfuncs $(options) - -errors.m: errors.e - $(compiler) errors $(options) - -mailssl.m: mailssl.e - $(compiler) mailssl $(options) - -tooltypes.m: tooltypes.e - $(compiler) tooltypes $(options) - -pwdhash.m: pwdhash.e - $(compiler) pwdhash $(options) - -axcommon.m: axcommon.e stringlist.m - $(compiler) axcommon $(options) - -axconsts.m: axconsts.e - $(compiler) axconsts $(options) - -axobjects.m: axobjects.e axconsts.m - $(compiler) axobjects $(options) - -axenums.m: axenums.e - $(compiler) axenums $(options) - -expversion.m: expversion.e - $(compiler) expversion $(options) - -expversion.e: verinfogen - verinfogen expversion.e $(expprogramname) $(version) usedate - -acpversion.m: acpversion.e - $(compiler) acpversion $(options) - -acpversion.e: verinfogen - verinfogen acpversion.e $(acpprogramname) $(version) usedate - -bcd.m: bcd.e - $(compiler) bcd $(options) - -ftpd.m: ftpd.e tooltypes.m stringlist.m axobjects.m axenums.m miscfuncs.m - $(compiler) ftpd $(options) - -httpd.m: httpd.e axcommon.m stringlist.m - $(compiler) httpd $(options) - -clean: - delete expversion.e acpversion.e delete express verinfogen express5 acp qwk ftn jsonimport icon2cfg miscfuncs.m stringlist.m errors.m mailssl.m jsoncreate.m jsonparser.m axcommon.m ftpd.m httpd.m axconsts.m axobjects.m axenums.m zmodem.m xymodem.m hydra.m bcd.m expversion.m acpversion.m pwdhash.m tooltypes.m - -.PHONY: expversion.e - \ No newline at end of file +# Compile ACP and EXPRESS and any dependencies + +debugoptions=DEBUG IGNORECACHE NILCHECK OPTI SYM SHOWFNAME +releaseoptions=IGNORECACHE OPTI SHOWFNAME +compiler=EVO +expprogramname=AmiExpress +acpprogramname=ACP +version=5.6.0 + +ifeq ($(build),release) +options=$(releaseoptions) +else +options=$(debugoptions) +endif + +all: ACP express5 jsonImport icon2cfg qwk ftn + +release: options=$(releaseoptions) +release: ACP express5 jsonImport icon2cfg qwk ftn + +axSetupTool: + $(MAKE) MAKEFLAGS=-B -C axSetupTool build=$(build) + +ACP: ACP.e acpversion.m axcommon.m jsonParser.m jsonCreate.m stringlist.m + $(compiler) ACP $(options) + +express5: express.e expversion.m axcommon.m axconsts.m MiscFuncs.m axobjects.m axenums.m stringlist.m errors.m mailssl.m ftpd.m httpd.m xymodem.m zmodem.m hydra.m tooltypes.m pwdhash.m bcd.m sha256.m + $(compiler) express $(options) + copy express express5 + delete express + +VerInfoGen: VerInfoGen.e + $(compiler) VerInfoGen $(options) + +ftn: ftn.e stringlist.m axobjects.m + $(compiler) ftn $(options) + +qwk: qwk.e stringlist.m axobjects.m + $(compiler) qwk $(options) + +icon2cfg: icon2cfg.e MiscFuncs.m + $(compiler) icon2cfg $(options) + +jsonImport: jsonImport.e jsonParser.m jsonCreate.m + $(compiler) jsonImport $(options) + +jsonParser.m: jsonParser.e MiscFuncs.m + $(compiler) jsonParser $(options) + +jsonCreate.m: jsonCreate.e MiscFuncs.m jsonParser.m + $(compiler) jsonCreate $(options) + +zmodem.m: zmodem.e bcd.m + $(compiler) zmodem $(options) + +xymodem.m: xymodem.e bcd.m + $(compiler) xymodem $(options) + +hydra.m: hydra.e + $(compiler) hydra $(options) + +stringlist.m: stringlist.e + $(compiler) stringlist $(options) + +MiscFuncs.m: MiscFuncs.e axconsts.m axenums.m axobjects.m errors.m + $(compiler) MiscFuncs $(options) + +errors.m: errors.e + $(compiler) errors $(options) + +mailssl.m: mailssl.e + $(compiler) mailssl $(options) + +tooltypes.m: tooltypes.e + $(compiler) tooltypes $(options) + +pwdhash.m: pwdhash.e + $(compiler) pwdhash $(options) + +axcommon.m: axcommon.e stringlist.m + $(compiler) axcommon $(options) + +axconsts.m: axconsts.e + $(compiler) axconsts $(options) + +axobjects.m: axobjects.e axconsts.m stringlist.m + $(compiler) axobjects $(options) + +axenums.m: axenums.e + $(compiler) axenums $(options) + +expversion.m: expversion.e + $(compiler) expversion $(options) + +expversion.e: VerInfoGen + VerInfoGen expversion.e $(expprogramname) $(version) usedate + +acpversion.m: acpversion.e + $(compiler) acpversion $(options) + +acpversion.e: VerInfoGen + VerInfoGen acpversion.e $(acpprogramname) $(version) usedate + +bcd.m: bcd.e axobjects.m + $(compiler) bcd $(options) + +sha256.m: sha256.e + $(compiler) sha256 $(options) + +ftpd.m: ftpd.e tooltypes.m stringlist.m axobjects.m axenums.m MiscFuncs.m bcd.m + $(compiler) ftpd $(options) + +httpd.m: httpd.e axcommon.m stringlist.m + $(compiler) httpd $(options) + +clean: + delete expversion.e acpversion.e delete express VerInfoGen express5 acp qwk ftn jsonImport icon2cfg MiscFuncs.m stringlist.m errors.m mailssl.m jsonCreate.m jsonParser.m axcommon.m ftpd.m httpd.m axconsts.m axobjects.m axenums.m zmodem.m xymodem.m hydra.m bcd.m expversion.m acpversion.m pwdhash.m tooltypes.m sha256.m + +dist: options=$(releaseoptions) +dist: build=release +dist: ACP express5 jsonImport icon2cfg qwk ftn axSetupTool + -delete Rel ALL FORCE + makedir Rel + makedir Rel/AmiExpress + makedir Rel/AmiExpress/AmiExpress + makedir Rel/AmiExpress/AmiExpress/Utils + lha x deployment/binaries.lha Rel/AmiExpress/ + Copy Rel/AmiExpress/Installer Rel/ + -delete Rel/AmiExpress/Installer + Copy acp Rel/AmiExpress/AmiExpress/ + Copy express5 Rel/AmiExpress/AmiExpress/express + Copy jsonImport Rel/AmiExpress/AmiExpress/Utils/ + Copy icon2cfg Rel/AmiExpress/AmiExpress/Utils/ + Copy icon2cfg Rel/AmiExpress/AmiExpress/Utils/ + Copy axSetupTool/axSetupTool Rel/AmiExpress/AmiExpress/Utils/ + Copy qwk Rel/AmiExpress/AmiExpress/Utils/ + Copy ftn Rel/AmiExpress/AmiExpress/Utils/ + Copy deployment/Install\ Ami-Express Rel/ + Copy deployment/Install\ Ami-Express.info Rel/ + Copy deployment/File_Id.Diz Rel/ + Copy deployment/read_me.txt Rel/ + Lha -r a t:Amix560.lha Rel/ + Copy t:Amix560.lha Rel/ + -delete t:Amix560.lha + join deployment/read_me.hdr deployment/read_me.txt TO Rel/Amix560.readme + +.PHONY: expversion.e acpversion.e axSetupTool diff --git a/sha256.e b/sha256.e new file mode 100644 index 0000000..e19a2d9 --- /dev/null +++ b/sha256.e @@ -0,0 +1,587 @@ +OPT MODULE + +CONST SHA1_DIGEST_SIZE=20 +CONST SIZE_OF_SHA_1_CHUNK=64 + +CONST SIZE_OF_SHA_256_HASH=32 +CONST SIZE_OF_SHA_256_CHUNK=64 +CONST TOTAL_LEN_LEN=8 + +OBJECT sha_256 + hash:PTR TO CHAR + chunk[SIZE_OF_SHA_256_CHUNK]: ARRAY OF CHAR + chunk_pos:PTR TO CHAR + space_left:LONG + total_len:LONG + h[8]:ARRAY OF LONG +ENDOBJECT + +OBJECT sha1_ctx + state[5]:ARRAY OF LONG + count[2]:ARRAY OF LONG + buffer[SIZE_OF_SHA_1_CHUNK]:ARRAY OF CHAR +ENDOBJECT + +/* + * Comments from pseudo-code at https://en.wikipedia.org/wiki/SHA-2 are reproduced here. + * When useful for clarification, portions of the pseudo-code are reproduced here too. + */ + +/* + * @brief Rotate a 32-bit value by a number of bits to the right. + * @param value The value to be rotated. + * @param count The number of bits to rotate by. + * @return The rotated value. + */ +PROC right_rot(value, count) + MOVE.L value,D0 + MOVE.L count,D1 + ROR.L D1,D0 +ENDPROC D0 + +PROC left_rot(value, count) + MOVE.L value,D0 + MOVE.L count,D1 + ROL.L D1,D0 +ENDPROC D0 +/* + * @brief Update a hash value under calculation with a new chunk of data. + * @param h Pointer to the first hash item, of a total of eight. + * @param p Pointer to the chunk data, which has a standard length. + * + * @note This is the SHA-256 work horse. + */ +PROC consume_chunk(h:PTR TO LONG, p:PTR TO CHAR) + DEF i,j + DEF ah[8]:ARRAY OF LONG + DEF w[16]:ARRAY OF LONG + DEF s0,s1,ch + DEF k:PTR TO LONG + DEF temp1,temp2,maj + + /* Initialize working variables to current hash value: */ + FOR i:=0 TO 7 DO ah[i]:=h[i] + + /* + * The w-array is really w[64], but since we only need 16 of them at a time, we save stack by + * calculating 16 at a time. + * + * This optimization was not there initially and the rest of the comments about w[64] are kept in their + * initial state. + */ + + /* + * create a 64-entry message schedule array w[0..63] of 32-bit words (The initial values in w[0..63] + * don't matter, so many implementations zero them here) copy chunk into first 16 words w[0..15] of the + * message schedule array + */ + + /* Compression function main loop: */ + FOR i:=0 TO 3 + FOR j:=0 TO 15 + IF (i = 0) + w[j]:=Lsl(p[0],24) OR Lsl(p[1],16) OR Lsl(p[2],8) OR p[3] + p+=4 + ELSE + /* Extend the first 16 words into the remaining 48 words w[16..63] of the + * message schedule array: */ + s0:=Eor( + Eor( + right_rot(w[(j + 1) AND $f], 7), + right_rot(w[(j + 1) AND $f], 18)), + Lsr(w[(j + 1) AND $f],3)) + s1:=Eor + (Eor( + right_rot(w[(j + 14) AND $f], 17), + right_rot(w[(j + 14) AND $f], 19)), + Lsr(w[(j + 14) AND $f],10)) + w[j]:=w[j] + s0 + w[(j + 9) AND $f] + s1 + ENDIF + s1:=Eor(Eor(right_rot(ah[4], 6),right_rot(ah[4], 11)),right_rot(ah[4], 25)) + ch:=Eor((ah[4] AND ah[5]),(Not(ah[4]) AND ah[6])) + + /* + * Initialize array of round constants: + * (first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311): + */ + k:={kdata} + + temp1:=ah[7] + s1 + ch + k[Lsl(i,4) OR j] + w[j] + s0:= Eor(Eor(right_rot(ah[0], 2),right_rot(ah[0], 13)),right_rot(ah[0], 22)) + maj:= Eor(Eor(ah[0] AND ah[1],ah[0] AND ah[2]),ah[1] AND ah[2]) + temp2:=s0+maj + + ah[7]:=ah[6] + ah[6]:=ah[5] + ah[5]:=ah[4] + ah[4]:=ah[3]+temp1 + ah[3]:=ah[2] + ah[2]:=ah[1] + ah[1]:=ah[0] + ah[0]:=temp1+temp2 + ENDFOR + ENDFOR + + /* Add the compressed chunk to the current hash value: */ + FOR i:=0 TO 7 DO h[i]:=h[i]+ah[i] +ENDPROC + +/* blk0() and blk() perform the initial expand. */ +/* I got the idea of expanding during the round function from SSLeay */ +#define blk0(i) block[i] +#define blk(i) (block[i AND 15]:= left_rot(Eor(Eor(Eor(block[(i+13) AND 15],block[(i+8) AND 15]),block[(i+2) AND 15]),block[i AND 15]),1)) + +/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ + +#define r0(v, w, x, y, z, i) z:=z+Eor(w AND Eor(x,y),y)+blk0(i)+$5a827999+left_rot(v,5) +#define r1(v, w, x, y, z, i) z:=z+Eor(w AND Eor(x,y),y)+blk(i)+$5a827999+left_rot(v,5) +#define r2(v, w, x, y, z, i) z:=z+Eor(Eor(w,x),y)+blk(i)+$6ed9eba1+left_rot(v,5) +#define r3(v, w, x, y, z, i) z:=z+(((w OR x) AND y) OR (w AND x))+blk(i)+$8f1bbcdc+left_rot(v,5) +#define r4(v, w, x, y, z, i) z:=z+Eor(Eor(w,x),y)+blk(i)+$ca62c1d6+left_rot(v,5) + +PROC sha1_transform(state:PTR TO LONG,buffer:PTR TO CHAR) + DEF a,b,c,d,e + DEF block[16]:ARRAY OF LONG + + CopyMem(buffer,block,64) + + /* Copy context->state[] to working vars */ + a:=state[0] + b:=state[1] + c:=state[2] + d:=state[3] + e:=state[4] + + /* 4 rounds of 20 operations each. Loop unrolled. */ + r0(a, b, c, d, e, 0);b:=left_rot(b,30) + r0(e, a, b, c, d, 1);a:=left_rot(a,30) + r0(d, e, a, b, c, 2);e:=left_rot(e,30) + r0(c, d, e, a, b, 3);d:=left_rot(d,30) + r0(b, c, d, e, a, 4);c:=left_rot(c,30) + r0(a, b, c, d, e, 5);b:=left_rot(b,30) + r0(e, a, b, c, d, 6);a:=left_rot(a,30) + r0(d, e, a, b, c, 7);e:=left_rot(e,30) + r0(c, d, e, a, b, 8);d:=left_rot(d,30) + r0(b, c, d, e, a, 9);c:=left_rot(c,30) + r0(a, b, c, d, e, 10);b:=left_rot(b,30) + r0(e, a, b, c, d, 11);a:=left_rot(a,30) + r0(d, e, a, b, c, 12);e:=left_rot(e,30) + r0(c, d, e, a, b, 13);d:=left_rot(d,30) + r0(b, c, d, e, a, 14);c:=left_rot(c,30) + r0(a, b, c, d, e, 15);b:=left_rot(b,30) + r1(e, a, b, c, d, 16);a:=left_rot(a,30) + r1(d, e, a, b, c, 17);e:=left_rot(e,30) + r1(c, d, e, a, b, 18);d:=left_rot(d,30) + r1(b, c, d, e, a, 19);c:=left_rot(c,30) + r2(a, b, c, d, e, 20);b:=left_rot(b,30) + r2(e, a, b, c, d, 21);a:=left_rot(a,30) + r2(d, e, a, b, c, 22);e:=left_rot(e,30) + r2(c, d, e, a, b, 23);d:=left_rot(d,30) + r2(b, c, d, e, a, 24);c:=left_rot(c,30) + r2(a, b, c, d, e, 25);b:=left_rot(b,30) + r2(e, a, b, c, d, 26);a:=left_rot(a,30) + r2(d, e, a, b, c, 27);e:=left_rot(e,30) + r2(c, d, e, a, b, 28);d:=left_rot(d,30) + r2(b, c, d, e, a, 29);c:=left_rot(c,30) + r2(a, b, c, d, e, 30);b:=left_rot(b,30) + r2(e, a, b, c, d, 31);a:=left_rot(a,30) + r2(d, e, a, b, c, 32);e:=left_rot(e,30) + r2(c, d, e, a, b, 33);d:=left_rot(d,30) + r2(b, c, d, e, a, 34);c:=left_rot(c,30) + r2(a, b, c, d, e, 35);b:=left_rot(b,30) + r2(e, a, b, c, d, 36);a:=left_rot(a,30) + r2(d, e, a, b, c, 37);e:=left_rot(e,30) + r2(c, d, e, a, b, 38);d:=left_rot(d,30) + r2(b, c, d, e, a, 39);c:=left_rot(c,30) + r3(a, b, c, d, e, 40);b:=left_rot(b,30) + r3(e, a, b, c, d, 41);a:=left_rot(a,30) + r3(d, e, a, b, c, 42);e:=left_rot(e,30) + r3(c, d, e, a, b, 43);d:=left_rot(d,30) + r3(b, c, d, e, a, 44);c:=left_rot(c,30) + r3(a, b, c, d, e, 45);b:=left_rot(b,30) + r3(e, a, b, c, d, 46);a:=left_rot(a,30) + r3(d, e, a, b, c, 47);e:=left_rot(e,30) + r3(c, d, e, a, b, 48);d:=left_rot(d,30) + r3(b, c, d, e, a, 49);c:=left_rot(c,30) + r3(a, b, c, d, e, 50);b:=left_rot(b,30) + r3(e, a, b, c, d, 51);a:=left_rot(a,30) + r3(d, e, a, b, c, 52);e:=left_rot(e,30) + r3(c, d, e, a, b, 53);d:=left_rot(d,30) + r3(b, c, d, e, a, 54);c:=left_rot(c,30) + r3(a, b, c, d, e, 55);b:=left_rot(b,30) + r3(e, a, b, c, d, 56);a:=left_rot(a,30) + r3(d, e, a, b, c, 57);e:=left_rot(e,30) + r3(c, d, e, a, b, 58);d:=left_rot(d,30) + r3(b, c, d, e, a, 59);c:=left_rot(c,30) + r4(a, b, c, d, e, 60);b:=left_rot(b,30) + r4(e, a, b, c, d, 61);a:=left_rot(a,30) + r4(d, e, a, b, c, 62);e:=left_rot(e,30) + r4(c, d, e, a, b, 63);d:=left_rot(d,30) + r4(b, c, d, e, a, 64);c:=left_rot(c,30) + r4(a, b, c, d, e, 65);b:=left_rot(b,30) + r4(e, a, b, c, d, 66);a:=left_rot(a,30) + r4(d, e, a, b, c, 67);e:=left_rot(e,30) + r4(c, d, e, a, b, 68);d:=left_rot(d,30) + r4(b, c, d, e, a, 69);c:=left_rot(c,30) + r4(a, b, c, d, e, 70);b:=left_rot(b,30) + r4(e, a, b, c, d, 71);a:=left_rot(a,30) + r4(d, e, a, b, c, 72);e:=left_rot(e,30) + r4(c, d, e, a, b, 73);d:=left_rot(d,30) + r4(b, c, d, e, a, 74);c:=left_rot(c,30) + r4(a, b, c, d, e, 75);b:=left_rot(b,30) + r4(e, a, b, c, d, 76);a:=left_rot(a,30) + r4(d, e, a, b, c, 77);e:=left_rot(e,30) + r4(c, d, e, a, b, 78);d:=left_rot(d,30) + r4(b, c, d, e, a, 79);c:=left_rot(c,30) + + /* Add the working vars back into context.state[] */ + state[0]:=state[0]+a + state[1]:=state[1]+b + state[2]:=state[2]+c + state[3]:=state[3]+d + state[4]:=state[4]+e + + /* Wipe variables */ + a:=0 + b:=0 + c:=0 + d:=0 + e:=0 + +ENDPROC + +PROC sha1_init(context:PTR TO sha1_ctx) + /* SHA1 initialization constants */ + context.state[0]:=$67452301 + context.state[1]:=$efcdab89 + context.state[2]:=$98badcfe + context.state[3]:=$10325476 + context.state[4]:=$c3d2e1f0 + context.count[0]:=0 + context.count[1]:=0 +ENDPROC + +PROC sha1_update(context:PTR TO sha1_ctx, p,len) + DEF data:PTR TO CHAR + DEF i,j + data:=p + + j:=(Shr(context.count[0],3)) AND 63 + context.count[0]:=context.count[0] + Shl(len,3) + IF (context.count[0] < Shl(len,3)) + context.count[1]:=context.count[1]+1 + ENDIF + context.count[1]:=context.count[1] + Lsr(len,29) + IF ((j + len) > 63) + i:=64 - j + CopyMem(data, context.buffer+j, i) + sha1_transform(context.state, context.buffer) + WHILE ((i+63)= 4 THEN 0 ELSE 1)],((3 - (i AND 3)) * 8))) AND 255) + ENDFOR + sha1_update(context, [128]:CHAR, 1) + WHILE ((context.count[0] AND 504) <> 448) + sha1_update(context, [0]:CHAR, 1) + ENDWHILE + sha1_update(context, finalcount, 8) /* Should cause SHA1_Transform */ + FOR i:=0 TO SHA1_DIGEST_SIZE-1 + digest[i]:=((Shr(context.state[Shr(i,2)],((3 - (i AND 3)) * 8))) AND 255) + ENDFOR + + /* Wipe variables */ + i:=0 + MemFill(context.buffer,64,0) + MemFill(context.state,20,0) + MemFill(context.count,8,0) + MemFill(finalcount,8,0) /* SWR */ + + sha1_transform(context.state, context.buffer); +ENDPROC + +PROC sha_256_init(sha_256:PTR TO sha_256, hash:PTR TO CHAR) + sha_256.hash:=hash + sha_256.chunk_pos:=sha_256.chunk + sha_256.space_left:=SIZE_OF_SHA_256_CHUNK + sha_256.total_len:=0 + + /* + * Initialize hash values (first 32 bits of the fractional parts of the square roots of the first 8 primes + * 2..19): + */ + sha_256.h[0]:=$6a09e667 + sha_256.h[1]:=$bb67ae85 + sha_256.h[2]:=$3c6ef372 + sha_256.h[3]:=$a54ff53a + sha_256.h[4]:=$510e527f + sha_256.h[5]:=$9b05688c + sha_256.h[6]:=$1f83d9ab + sha_256.h[7]:=$5be0cd19 +ENDPROC + +PROC sha_256_write(sha_256:PTR TO sha_256, data,len) + DEF p + DEF consumed_len + p:=data + sha_256.total_len:=sha_256.total_len+len + + WHILE (len > 0) + /* + * If the input chunks have sizes that are multiples of the calculation chunk size, no copies are + * necessary. We operate directly on the input data instead. + */ + IF ((sha_256.space_left = SIZE_OF_SHA_256_CHUNK) AND (len >= SIZE_OF_SHA_256_CHUNK)) + consume_chunk(sha_256.h, p) + len -= SIZE_OF_SHA_256_CHUNK + p += SIZE_OF_SHA_256_CHUNK + CONT TRUE + ENDIF + /* General case, no particular optimization. */ + consumed_len:=IF (len < sha_256.space_left) THEN len ELSE sha_256.space_left + CopyMem(p, sha_256.chunk_pos, consumed_len) + sha_256.space_left -= consumed_len + len -= consumed_len + p += consumed_len + IF (sha_256.space_left = 0) + consume_chunk(sha_256.h, sha_256.chunk) + sha_256.chunk_pos:=sha_256.chunk + sha_256.space_left:=SIZE_OF_SHA_256_CHUNK + ELSE + sha_256.chunk_pos:=sha_256.chunk_pos+consumed_len + ENDIF + ENDWHILE +ENDPROC + +PROC sha_256_close(sha_256:PTR TO sha_256) + + DEF pos:PTR TO CHAR + DEF space_left + DEF h:PTR TO LONG + DEF left,len,i,hash:PTR TO LONG + pos:=sha_256.chunk_pos + space_left:=sha_256.space_left + h:=sha_256.h + /* + * The current chunk cannot be full. Otherwise, it would already have be consumed. I.e. there is space left for + * at least one byte. The next step in the calculation is to add a single one-bit to the data. + */ + pos[]++:=$80 + space_left-- + + /* + * Now, the last step is to add the total data length at the end of the last chunk, and zero padding before + * that. But we do not necessarily have enough space left. If not, we pad the current chunk with zeroes, and add + * an extra chunk at the end. + */ + IF (space_left < TOTAL_LEN_LEN) + MemFill(pos,space_left,0) + consume_chunk(h, sha_256.chunk) + pos:=sha_256.chunk + space_left:=SIZE_OF_SHA_256_CHUNK + ENDIF + left:=space_left - TOTAL_LEN_LEN + MemFill(pos,left,0) + pos+= left + len:=sha_256.total_len + pos[7]:=Lsl(len,3) + len:=Lsr(len,5) + FOR i:=6 TO 0 STEP -1 + pos[i]:=len + len:=Lsr(len,8) + ENDFOR + consume_chunk(h, sha_256.chunk) + /* Produce the final hash value (big-endian): */ + hash:=sha_256.hash + FOR i:=0 TO 7 + hash[i]:=h[i] + ENDFOR + +ENDPROC sha_256.hash + +EXPORT PROC calc_sha_1(hash:PTR TO CHAR, input, len) + DEF context:PTR TO sha1_ctx + + NEW context + sha1_init(context) + sha1_update(context, input, len) + sha1_final(hash,context) + END context +ENDPROC + +EXPORT PROC calc_sha_256(hash:PTR TO CHAR, input, len) + DEF sha_256:PTR TO sha_256 + + NEW sha_256 + sha_256_init(sha_256, hash) + sha_256_write(sha_256, input, len) + sha_256_close(sha_256) + END sha_256 +ENDPROC + +kdata: LONG $428a2f98, $71374491, $b5c0fbcf, $e9b5dba5, $3956c25b, $59f111f1, $923f82a4, + $ab1c5ed5, $d807aa98, $12835b01, $243185be, $550c7dc3, $72be5d74, $80deb1fe, + $9bdc06a7, $c19bf174, $e49b69c1, $efbe4786, $0fc19dc6, $240ca1cc, $2de92c6f, + $4a7484aa, $5cb0a9dc, $76f988da, $983e5152, $a831c66d, $b00327c8, $bf597fc7, + $c6e00bf3, $d5a79147, $06ca6351, $14292967, $27b70a85, $2e1b2138, $4d2c6dfc, + $53380d13, $650a7354, $766a0abb, $81c2c92e, $92722c85, $a2bfe8a1, $a81a664b, + $c24b8b70, $c76c51a3, $d192e819, $d6990624, $f40e3585, $106aa070, $19a4c116, + $1e376c08, $2748774c, $34b0bcb5, $391c0cb3, $4ed8aa4a, $5b9cca4f, $682e6ff3, + $748f82ee, $78a5636f, $84c87814, $8cc70208, $90befffa, $a4506ceb, $bef9a3f7, + $c67178f2 + +/* $OpenBSD: pkcs5_pbkdf2.c,v 1.11 2019/11/21 16:07:24 tedu Exp $ */ + +/*- + * Copyright (c) 2008 Damien Bergamini + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +EXPORT PROC hmac_sha1(text:PTR TO CHAR, text_len, key:PTR TO CHAR, key_len, digest:PTR TO CHAR) + DEF k_pad:PTR TO CHAR + DEF tk[SHA1_DIGEST_SIZE]:ARRAY OF CHAR + DEF i + + k_pad:=New(SIZE_OF_SHA_1_CHUNK+text_len) + + IF (key_len > SIZE_OF_SHA_1_CHUNK) + calc_sha_1(tk,key, key_len) + key:=tk + key_len:=SHA1_DIGEST_SIZE + ENDIF + + CopyMem(key,k_pad, key_len) + CopyMem(text,k_pad+SIZE_OF_SHA_1_CHUNK, text_len) + FOR i:=0 TO SIZE_OF_SHA_1_CHUNK-1 DO k_pad[i]:=Eor(k_pad[i],$36) + + calc_sha_1(digest,k_pad, SIZE_OF_SHA_1_CHUNK+text_len) + Dispose(k_pad) + + k_pad:=New(SIZE_OF_SHA_1_CHUNK+SHA1_DIGEST_SIZE) + CopyMem(key,k_pad,key_len) + CopyMem(digest, k_pad+SIZE_OF_SHA_1_CHUNK, SHA1_DIGEST_SIZE) + + FOR i:=0 TO SIZE_OF_SHA_1_CHUNK-1 DO k_pad[i]:=Eor(k_pad[i],$5c) + + calc_sha_1(digest,k_pad, SIZE_OF_SHA_1_CHUNK+SHA1_DIGEST_SIZE) + Dispose(k_pad) +ENDPROC + +EXPORT PROC hmac_sha256(text:PTR TO CHAR, text_len, key:PTR TO CHAR, key_len, digest:PTR TO CHAR) + DEF k_pad:PTR TO CHAR + DEF tk[SIZE_OF_SHA_256_HASH]:ARRAY OF CHAR + DEF i + + k_pad:=New(SIZE_OF_SHA_256_CHUNK+text_len) + + IF (key_len > SIZE_OF_SHA_256_CHUNK) + calc_sha_256(tk,key, key_len) + key:=tk + key_len:=SIZE_OF_SHA_256_HASH + ENDIF + + CopyMem(key,k_pad, key_len) + CopyMem(text,k_pad+SIZE_OF_SHA_256_CHUNK, text_len) + FOR i:=0 TO SIZE_OF_SHA_256_CHUNK-1 DO k_pad[i]:=Eor(k_pad[i],$36) + + calc_sha_256(digest,k_pad, SIZE_OF_SHA_256_CHUNK+text_len) + Dispose(k_pad) + + k_pad:=New(SIZE_OF_SHA_256_CHUNK+SIZE_OF_SHA_256_HASH) + CopyMem(key,k_pad,key_len) + CopyMem(digest, k_pad+SIZE_OF_SHA_256_CHUNK, SIZE_OF_SHA_256_HASH) + + FOR i:=0 TO SIZE_OF_SHA_256_CHUNK-1 DO k_pad[i]:=Eor(k_pad[i],$5c) + + calc_sha_256(digest,k_pad, SIZE_OF_SHA_256_CHUNK+SIZE_OF_SHA_256_HASH) + Dispose(k_pad) +ENDPROC + +/* + * Password-Based Key Derivation Function 2 (PKCS #5 v2.0). + * Code based on IEEE Std 802.11-2007, Annex H.4.2. + */ +EXPORT PROC pkcs5_pbkdf2(pass:PTR TO CHAR, pass_len, salt:PTR TO CHAR, salt_len, key:PTR TO CHAR, key_len, rounds) + DEF asalt:PTR TO CHAR + DEF obuf[SIZE_OF_SHA_256_HASH]:ARRAY OF CHAR + DEF d1[SIZE_OF_SHA_256_HASH]: ARRAY OF CHAR + DEF d2[SIZE_OF_SHA_256_HASH]:ARRAY OF CHAR + DEF i,j,count,r + + IF ((rounds < 1) OR (key_len = 0)) THEN JUMP bad + + IF ((salt_len = 0) OR (salt_len > ($7fffffff - 4))) THEN JUMP bad + + IF ((asalt:=New(salt_len + 4))=0) THEN JUMP bad + + CopyMem(salt, asalt, salt_len) + + count:=0 + WHILE(key_len>0) + count++ + asalt[salt_len]:=Shr(count,24) + asalt[salt_len+1]:=Shr(count,16) + asalt[salt_len+2]:=Shr(count,8) + asalt[salt_len+3]:=count AND 255 + + hmac_sha256(asalt, salt_len + 4, pass, pass_len, d1) + CopyMem(d1,obuf,SIZE_OF_SHA_256_HASH) + + FOR i:=1 TO rounds-1 + hmac_sha256(d1, SIZE_OF_SHA_256_HASH, pass, pass_len, d2) + CopyMem(d2,d1,SIZE_OF_SHA_256_HASH) + FOR j:=0 TO SIZE_OF_SHA_256_HASH-1 + obuf[j]:=Eor(obuf[j],d1[j]) + ENDFOR + ENDFOR + + IF key_len < SIZE_OF_SHA_256_HASH THEN r:=key_len ELSE r:=SIZE_OF_SHA_256_HASH + CopyMem(obuf,key,r) + key+=r + key_len-=r + ENDWHILE + + MemFill(asalt,salt_len + 4,0) + Dispose(asalt) + + MemFill(d1,SIZE_OF_SHA_256_HASH,0) + MemFill(d2,SIZE_OF_SHA_256_HASH,0) + MemFill(obuf,SIZE_OF_SHA_256_HASH,0) + + RETURN 0 + +bad: + /* overwrite with 0 in case caller doesn't check return code */ + MemFill(key,key_len,0) +ENDPROC -1 + +EXPORT PROC calcPasswordSalt(s:PTR TO CHAR) + DEF i + FOR i:=0 TO 7 + s[i]:=Rnd(95)+32 + ENDFOR +ENDPROC diff --git a/stringlist.e b/stringlist.e index 1dcafb1..e2005f9 100644 --- a/stringlist.e +++ b/stringlist.e @@ -11,7 +11,7 @@ EXPORT OBJECT stringlist PRIVATE initialMax:LONG ENDOBJECT -EXPORT PROC end() OF stringlist -> destructor +EXPORT PROC end() OF stringlist -> destructor self.clear() DisposeLink(self.items) ENDPROC @@ -66,6 +66,12 @@ EXPORT PROC insert(pos,stringVal:PTR TO CHAR) OF stringlist self.items[pos]:=s ENDPROC +EXPORT PROC contains(stringVal:PTR TO CHAR) OF stringlist + DEF i + FOR i:=0 TO ListLen(self.items)-1 + IF StriCmp(self.items[i],stringVal) THEN RETURN TRUE + ENDFOR +ENDPROC FALSE EXPORT PROC add(stringVal:PTR TO CHAR) OF stringlist DEF s,c @@ -110,6 +116,37 @@ EXPORT PROC count() OF stringlist IS ListLen(self.items) EXPORT PROC maxSize() OF stringlist IS ListMax(self.items) +PROC partition(first, last) OF stringlist + DEF splitv, up, down, i + splitv:=self.items[first] + up:=first + down:=last + REPEAT + WHILE (StrCompare(self.items[up],splitv)<=0) AND (up0) AND (down>first) DO down-- + IF up=down + i:=self.items[first] + self.items[first]:=self.items[down] + self.items[down]:=i +ENDPROC down + +PROC quicksort(first, last) OF stringlist + DEF index + IF first destructor +EXPORT PROC end() OF stdlist -> destructor DisposeLink(self.items) ENDPROC diff --git a/tooltypes.e b/tooltypes.e index 814c43f..7de6f6f 100644 --- a/tooltypes.e +++ b/tooltypes.e @@ -223,6 +223,7 @@ ENDPROC result EXPORT PROC getOrCreateCacheItem(fileName:PTR TO CHAR) DEF i,cnt,found=FALSE DEF cacheObj: PTR TO diskObjectCacheItem + DEF oldCacheObj: PTR TO diskObjectCacheItem DEF do=NIL:PTR TO diskobject DEF fn2[255]:STRING DEF ownToolTypes @@ -268,7 +269,7 @@ EXPORT PROC getOrCreateCacheItem(fileName:PTR TO CHAR) do:=GetDefDiskObject(WBPROJECT) ENDIF IF do<>NIL - fileBuf:=New(getFileSize(fn2)+1) ->allow an extra char in case file does not end in LF + fileBuf:=New(FileLength(fn2)+1) ->allow an extra char in case file does not end in LF fh:=Open(fn2,MODE_OLDFILE) IF fh<>0 @@ -319,9 +320,9 @@ EXPORT PROC getOrCreateCacheItem(fileName:PTR TO CHAR) IF diskObjectCache.count()<(diskObjectCache.maxSize()-1) diskObjectCache.add(cacheObj) ELSE - cacheObj:=diskObjectCache.item(0) - DisposeLink(cacheObj.fileName) - FreeDiskObject(cacheObj.diskObject) + oldCacheObj:=diskObjectCache.item(0) + DisposeLink(oldCacheObj.fileName) + FreeDiskObject(oldCacheObj.diskObject) diskObjectCache.remove(0) diskObjectCache.add(cacheObj) ENDIF diff --git a/xymodem.e b/xymodem.e index f3f5b6a..bf7de5e 100644 --- a/xymodem.e +++ b/xymodem.e @@ -1,12 +1,6 @@ OPT LARGE,MODULE - MODULE 'dos/dos' - -EXPORT CONST LOG_DEBUG=4 -EXPORT CONST LOG_INFO=3 -EXPORT CONST LOG_NOTICE=2 -EXPORT CONST LOG_WARNING=1 -EXPORT CONST LOG_ERR=0 + MODULE 'dos/dos','*axenums','*bcd' CONST MAX_PATH=512 @@ -90,9 +84,9 @@ EXPORT OBJECT xymodem_t current_file_pos current_file_size total_files - total_bytes + total_bytes[8]:ARRAY OF CHAR files_remaining - bytes_remaining + bytes_remaining[8]:ARRAY OF CHAR errors fallback_to_xmodem @@ -154,6 +148,14 @@ PROC is_cancelled(xym: PTR TO xymodem_t) ENDIF ENDPROC xym.cancelled +PROC download_completed(xym:PTR TO xymodem_t,fname,fsize,sentsize) + DEF p + p:=xym.zm_download_completed + IF p<>NIL + RETURN p(fsize,sentsize) + ENDIF +ENDPROC + PROC upload_completed(xym:PTR TO xymodem_t,fname:PTR TO CHAR,filebytes) DEF p p:=xym.zm_upload_completed @@ -275,25 +277,25 @@ PROC xmodem_put_nak(xym:PTR TO xymodem_t, block_num) IF(dump_count) StringF(tempstr,'Block \d: Dumped \d bytes',block_num, dump_count) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) ENDIF IF(block_num<=1) IF((xym.mode AND (B2K OR GMODE))=(B2K OR GMODE)) -> A for X/Ymodem-G with 2-K block StringF(tempstr,'Block \d: Requesting mode: Streaming, 16-bit CRC, 2K Block', block_num) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) putcom(xym,"A") ELSEIF((xym.mode) AND GMODE) -> G for X/Ymodem-G StringF(tempstr,'Block \d: Requesting mode: Streaming, 16-bit CRC', block_num) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) putcom(xym,"G") ELSEIF ((xym.mode) AND CRC) -> C for CRC StringF(tempstr,'Block \d: Requesting mode: 16-bit CRC', block_num) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) putcom(xym,"C") ELSE -> NAK for checksum StringF(tempstr,'Block \d: Requesting mode: 8-bit Checksum', block_num) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) putcom(xym,NAK) ENDIF ELSE @@ -354,14 +356,14 @@ PROC xmodem_get_block(xym:PTR TO xymodem_t, block:PTR TO CHAR, expected_block_nu CASE ETX -> 2048-byte blocks IF(xym.max_block_size < XMODEM_2K_BLOCK_SIZE) StringF(tempstr,'Block \d: 2048-byte blocks not supported',expected_block_num) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) RETURN FAILURE ENDIF xym.block_size:=XMODEM_2K_BLOCK_SIZE CASE STX -> 1024-byte blocks IF(xym.max_block_size < XMODEM_MAX_BLOCK_SIZE) StringF(tempstr,'Block \d: 1024-byte blocks not supported',expected_block_num) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) RETURN FAILURE ENDIF xym.block_size:=XMODEM_MAX_BLOCK_SIZE @@ -369,7 +371,7 @@ PROC xmodem_get_block(xym:PTR TO xymodem_t, block:PTR TO CHAR, expected_block_nu StringF(tempstr,'Block \d: EOT received', expected_block_num) lprintf(xym,LOG_DEBUG,tempstr) IF(eot=FALSE) - lprintf(xym,LOG_INFO,'NAKing first EOT') + lprintf(xym,LOG_DEBUG,'NAKing first EOT') eot:=1 xmodem_put_nak(xym,expected_block_num) -> chuck's double EOT trick JUMP lp @@ -379,11 +381,11 @@ PROC xmodem_get_block(xym:PTR TO xymodem_t, block:PTR TO CHAR, expected_block_nu IF(can=FALSE) -> must get two CANs in a row can:=1 StringF(tempstr,'Block \d: Received CAN Expected SOH, STX, or EOT',expected_block_num) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) JUMP lp ENDIF StringF(tempstr,'Block \d: Canceled remotely', expected_block_num) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) RETURN CAN CASE NOINP -> Nothing came in IF(eot) THEN RETURN EOT @@ -391,7 +393,7 @@ PROC xmodem_get_block(xym:PTR TO xymodem_t, block:PTR TO CHAR, expected_block_nu DEFAULT chr(i,tempstr2) StringF(tempstr,'Block \d: Received \s Expected SOH, STX, or EOT',expected_block_num,tempstr2) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) IF (eot) THEN RETURN EOT RETURN NOINP ENDSELECT @@ -426,7 +428,7 @@ PROC xmodem_get_block(xym:PTR TO xymodem_t, block:PTR TO CHAR, expected_block_nu IF(block_num<>(Eor(block_inv,255))) StringF(tempstr,'Block \d: Block number bit error (0x\h[2] vs 0x\h[2])',expected_block_num, block_num,Eor(block_inv,255)) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) RETURN FAILURE ENDIF @@ -436,14 +438,14 @@ PROC xmodem_get_block(xym:PTR TO xymodem_t, block:PTR TO CHAR, expected_block_nu crc:=crc OR getcom(xym,xym.byte_timeout) IF(crc<>calc_crc) StringF(tempstr,'Block \d: CRC ERROR', block_num) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) RETURN FAILURE ENDIF ELSE -> CHKSUM chksum:=getcom(xym,xym.byte_timeout) IF(chksum<>calc_chksum) StringF(tempstr,'Block \d: CHECKSUM ERROR', block_num) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) RETURN FAILURE ENDIF ENDIF @@ -451,7 +453,7 @@ PROC xmodem_get_block(xym:PTR TO xymodem_t, block:PTR TO CHAR, expected_block_nu IF(block_num<>(expected_block_num AND 255)) StringF(tempstr,'Block number error (\d received, expected \d)',block_num,expected_block_num AND 255) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) IF (((xym.mode) AND XMODEM) AND (expected_block_num=1) AND (block_num=0)) THEN RETURN NOT_XMODEM @@ -539,7 +541,7 @@ PROC xmodem_get_ack(xym:PTR TO xymodem_t, tries, block_num) IF xym.g_delay>0 THEN Delay(xym.g_delay) IF(getcom(xym,0)=CAN) StringF(tempstr,'Block \d: !Canceled remotely', block_num) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) xmodem_cancel(xym) RETURN CAN ENDIF @@ -554,7 +556,7 @@ PROC xmodem_get_ack(xym:PTR TO xymodem_t, tries, block_num) IF(i=CAN) IF(can) -> 2 CANs in a row StringF(tempstr,'Block \d: !Canceled remotely', block_num) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) xmodem_cancel(xym) RETURN CAN ENDIF @@ -564,7 +566,7 @@ PROC xmodem_get_ack(xym:PTR TO xymodem_t, tries, block_num) IF(i<>NOINP) chr(i,tempstr2) StringF(tempstr,'Block \d: !Received \s Expected ACK',block_num, tempstr2) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) IF (i<>CAN) THEN RETURN i ENDIF @@ -581,7 +583,7 @@ PROC xmodem_get_mode(xym:PTR TO xymodem_t) DEF tempstr[255]:STRING DEF tempstr2[255]:STRING - lprintf(xym,LOG_INFO,'Waiting for transfer mode request...') + lprintf(xym,LOG_DEBUG,'Waiting for transfer mode request...') xym.mode:=xym.mode AND Eor(GMODE OR CRC,255) errors:=0 @@ -593,12 +595,12 @@ lp2: SELECT i CASE NAK -> checksum - lprintf(xym,LOG_INFO,'Receiver requested mode: 8-bit Checksum') + lprintf(xym,LOG_DEBUG,'Receiver requested mode: 8-bit Checksum') xym.max_block_size:=XMODEM_MAX_BLOCK_SIZE xym.block_size:=XMODEM_MAX_BLOCK_SIZE RETURN TRUE CASE "C" - lprintf(xym,LOG_INFO,'Receiver requested mode: 16-bit CRC') + lprintf(xym,LOG_DEBUG,'Receiver requested mode: 16-bit CRC') IF(xym.crc_mode_supported=FALSE) THEN JUMP lp2 xym.max_block_size:=XMODEM_MAX_BLOCK_SIZE xym.block_size:=XMODEM_MAX_BLOCK_SIZE @@ -606,7 +608,7 @@ lp2: xym.mode:=xym.mode OR CRC RETURN TRUE CASE "A" - lprintf(xym,LOG_INFO,'Receiver requested mode: Streaming, 2k-block, 16-bit CRC') + lprintf(xym,LOG_DEBUG,'Receiver requested mode: Streaming, 2k-block, 16-bit CRC') IF ((xym.crc_mode_supported=FALSE) OR (xym.g_mode_supported=FALSE)) THEN JUMP lp2 xym.mode:=xym.mode OR (GMODE OR CRC OR B2K) @@ -614,7 +616,7 @@ lp2: xym.block_size:=XMODEM_2K_BLOCK_SIZE RETURN TRUE CASE "G" - lprintf(xym,LOG_INFO,'Receiver requested mode: Streaming, 16-bit CRC') + lprintf(xym,LOG_DEBUG,'Receiver requested mode: Streaming, 16-bit CRC') IF ((xym.crc_mode_supported=FALSE) OR (xym.g_mode_supported=FALSE)) THEN JUMP lp2 xym.max_block_size:=XMODEM_MAX_BLOCK_SIZE xym.block_size:=XMODEM_MAX_BLOCK_SIZE @@ -623,7 +625,7 @@ lp2: RETURN TRUE CASE CAN IF(can) - lprintf(xym,LOG_WARNING,'Canceled remotely') + lprintf(xym,LOG_WARN,'Canceled remotely') RETURN FALSE ENDIF can:=1 @@ -632,12 +634,12 @@ lp2: DEFAULT chr(i,tempstr2) StringF(tempstr,'Received \s Expected NAK, C, or G',tempstr2) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) ENDSELECT errors++ ENDWHILE - lprintf(xym,LOG_ERR,'Failed to get transfer mode request from receiver') + lprintf(xym,LOG_ERROR,'Failed to get transfer mode request from receiver') ENDPROC FALSE PROC xmodem_put_eot(xym:PTR TO xymodem_t) @@ -651,12 +653,12 @@ PROC xmodem_put_eot(xym:PTR TO xymodem_t) WHILE((errors<=xym.max_errors) AND (is_connected(xym))) StringF(tempstr,'Sending End-of-Text (EOT) indicator (\d)',errors+1) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) WHILE(((ch:=getcom(xym,0))<>NOINP) AND (is_connected(xym))) chr(ch,tempstr2) lprintf(tempstr,'Throwing out received: \s',tempstr2) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) ENDWHILE putcom(xym,EOT) @@ -666,7 +668,7 @@ PROC xmodem_put_eot(xym:PTR TO xymodem_t) chr(ch,tempstr2) StringF(tempstr,'Received \s',tempstr2) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) IF(ch=ACK) THEN RETURN TRUE IF ((ch=CAN) AND (cans>0)) THEN RETURN FALSE @@ -675,7 +677,7 @@ PROC xmodem_put_eot(xym:PTR TO xymodem_t) JUMP lp3 -> chuck's double EOT trick so don't complain ENDIF - lprintf(xym,LOG_WARNING,'Expected ACK') + lprintf(xym,LOG_WARN,'Expected ACK') lp3: errors++ @@ -702,7 +704,7 @@ PROC xmodem_send_file(xym:PTR TO xymodem_t, fname:PTR TO CHAR, sent:PTR TO LONG, StringF(tempstr,'Sending file \s',fname) - lprintf(xym,LOG_ERR,tempstr) + lprintf(xym,LOG_ERROR,tempstr) xym.success:=FALSE fname2:=FilePart(fname) @@ -711,7 +713,7 @@ PROC xmodem_send_file(xym:PTR TO xymodem_t, fname:PTR TO CHAR, sent:PTR TO LONG, fp:=doOpen(xym,fname,MODE_OLDFILE) IF fp=NIL StringF(tempstr,'Error opening file \s',fname) - lprintf(xym,LOG_ERR,tempstr) + lprintf(xym,LOG_ERROR,tempstr) RETURN FALSE ENDIF fsize:=getFileSize(xym,fp) @@ -719,12 +721,13 @@ PROC xmodem_send_file(xym:PTR TO xymodem_t, fname:PTR TO CHAR, sent:PTR TO LONG, fp:=0 fsize:=0 ENDIF + xym.current_file_size:=fsize IF(xym.total_files=0) THEN xym.total_files:=1 - IF(xym.total_bytes=0) THEN xym.total_bytes:=fsize + IF(convertFromBCD(xym.total_bytes)=0) THEN convertToBCD(fsize,xym.total_bytes) IF(xym.files_remaining=0) THEN xym.files_remaining:=1 - IF(xym.bytes_remaining=0) THEN xym.bytes_remaining:=fsize + IF(convertFromBCD(xym.bytes_remaining)=0) THEN convertToBCD(fsize,xym.bytes_remaining) -> try IF((xym.mode) AND YMODEM) @@ -735,17 +738,18 @@ PROC xmodem_send_file(xym:PTR TO xymodem_t, fname:PTR TO CHAR, sent:PTR TO LONG, AstrCopy(block,fname2,XMODEM_MAX_BLOCK_SIZE) - StringF(tempstr,'\d \d 0 0 \d \d' + formatBCD(xym.bytes_remaining,tempstr2) + StringF(tempstr,'\d \d 0 0 \d \s' ,fsize ,0 ->(uintmax_t)st.st_mtime ,xym.files_remaining ->-xym.sent_files - ,xym.bytes_remaining ->-xym.sent_bytes + ,tempstr2 ->-xym.sent_bytes ) AstrCopy(block+StrLen(block)+1,tempstr) block_len:=StrLen(block)+1+StrLen(tempstr) StringF(tempstr,'Sending YMODEM header block: ''\s''',block+StrLen(block)+1) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) xym.errors:=0 WHILE((xym.errors<=xym.max_errors) AND (is_cancelled(xym)=FALSE) AND (is_connected(xym))) @@ -753,7 +757,7 @@ PROC xmodem_send_file(xym:PTR TO xymodem_t, fname:PTR TO CHAR, sent:PTR TO LONG, WHILE(((ch:=getcom(xym,0))<>NOINP) AND (is_connected(xym))) chr(ch,tempstr2) StringF(tempstr,'Throwing out received: \s',tempstr2) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) ENDWHILE xmodem_put_block(xym, block, IF block_len <=XMODEM_MIN_BLOCK_SIZE THEN XMODEM_MIN_BLOCK_SIZE ELSE xym.block_size, 0) xmodem_flush(xym) @@ -765,7 +769,7 @@ PROC xmodem_send_file(xym:PTR TO xymodem_t, fname:PTR TO CHAR, sent:PTR TO LONG, IF(((i=NAK) OR (i="C") OR (i="G")) AND (xym.fallback_to_xmodem) AND ((xym.errors+1) = xym.fallback_to_xmodem)) StringF(tempstr,'Falling back to XMODEM mode after \d attempts',xym.fallback_to_xmodem) - lprintf(xym,LOG_NOTICE,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) xym.mode:=xym.mode AND Not(YMODEM) JUMP sbr2 ENDIF @@ -773,7 +777,7 @@ PROC xmodem_send_file(xym:PTR TO xymodem_t, fname:PTR TO CHAR, sent:PTR TO LONG, ENDWHILE sbr2: IF((xym.errors>xym.max_errors) OR (is_cancelled(xym))) - lprintf(xym,LOG_ERR,'Failed to send header block') + lprintf(xym,LOG_ERROR,'Failed to send header block') JUMP sbr3 ENDIF ENDIF @@ -797,7 +801,7 @@ sbr2: IF(xym.block_size>XMODEM_MIN_BLOCK_SIZE) IF((sent_bytes+xym.block_size) > fsize) IF((sent_bytes+xym.block_size-XMODEM_MIN_BLOCK_SIZE) >= fsize) - lprintf(xym,LOG_INFO,'Falling back to 128-byte blocks for end of file') + lprintf(xym,LOG_DEBUG,'Falling back to 128-byte blocks for end of file') xym.block_size:=XMODEM_MIN_BLOCK_SIZE ENDIF ENDIF @@ -808,7 +812,7 @@ sbr2: IF(((rd:=doRead(xym,fp,block,xym.block_size))<>xym.block_size) AND ((sent_bytes + rd) <> fsize)) StringF(tempstr,'ERROR reading \d bytes at file offset \d',xym.block_size,sent_bytes) - lprintf(xym,LOG_ERR,tempstr) + lprintf(xym,LOG_ERROR,tempstr) xym.errors:=xym.errors+1 JUMP lp4 ENDIF @@ -818,10 +822,10 @@ sbr2: IF((r:=xmodem_get_ack(xym, 5,block_num)) <> ACK) xym.errors:=xym.errors+1 StringF(tempstr,'Block \d: Error #\d at offset \d',block_num, xym.errors,sent_bytes) - lprintf(xym,LOG_WARNING,tempstr) + lprintf(xym,LOG_WARN,tempstr) IF (((r="C") OR (xym.errors=3)) AND (block_num=1) AND (xym.block_size>XMODEM_MIN_BLOCK_SIZE)) StringF(tempstr,'Block \d: Falling back to 128-byte blocks', block_num) - lprintf(xym,LOG_NOTICE,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) xym.block_size:=XMODEM_MIN_BLOCK_SIZE ENDIF ELSE @@ -839,7 +843,7 @@ lp4: ->#if 0 /* !SINGLE_THREADED */ -> lprintf(LOG_DEBUG,"Waiting for output buffer to empty... ") -> if(WaitForEvent(outbuf_empty,5000)<>WAIT_OBJECT_0) - -> lprintf(xym,LOG_WARNING,"FAILURE") + -> lprintf(xym,LOG_WARN,"FAILURE") ->#endif IF (xmodem_put_eot(xym)) -> end-of-text, wait for ACK success:=TRUE @@ -875,12 +879,12 @@ EXPORT PROC xymodem_send_files(ymodem,xym: PTR TO xymodem_t,sentptr: PTR TO LONG xym.mode:=(IF ymodem THEN YMODEM ELSE XMODEM) OR SEND xym.files_remaining:=xym.total_files - xym.bytes_remaining:=xym.total_bytes + CopyMem(xym.total_bytes,xym.bytes_remaining,8) WHILE(((ch:=getcom(xym,0))<>NOINP) AND (is_connected(xym))) chr(ch,tempstr2) lprintf(tempstr,'Throwing out received: \s',tempstr2) - lprintf(xym,LOG_INFO,tempstr) + lprintf(xym,LOG_DEBUG,tempstr) ENDWHILE @@ -894,7 +898,7 @@ EXPORT PROC xymodem_send_files(ymodem,xym: PTR TO xymodem_t,sentptr: PTR TO LONG IF res=FALSE THEN RETURN res IF (xym.success) - doDownloadCompleted(xym,fname,sent) + download_completed(xym,fname,xym.current_file_size,sent) ENDIF init:=FALSE @@ -903,9 +907,9 @@ EXPORT PROC xymodem_send_files(ymodem,xym: PTR TO xymodem_t,sentptr: PTR TO LONG res:=FALSE IF p<>NIL THEN res:=p(fname) xym.files_remaining:=xym.files_remaining-1 - xym.bytes_remaining:=xym.bytes_remaining-sent + subBCD(xym.bytes_remaining,sent) IF xym.files_remaining<0 THEN xym.files_remaining:=0 - IF xym.bytes_remaining<0 THEN xym.bytes_remaining:=0 + IF xym.bytes_remaining[0]=$99 THEN convertToBCD(0,xym.bytes_remaining) IF sentptr<>NIL THEN sentptr[]:=sentptr[]+sent ENDIF UNTIL res=FALSE @@ -962,7 +966,7 @@ EXPORT PROC xymodem_recv_files(ymodem,xym: PTR TO xymodem_t, download_dir:PTR TO file_bytes:=$7fffffff file_bytes_left:=file_bytes ELSE - lprintf(xym,LOG_INFO,'Fetching YMODEM header block') + lprintf(xym,LOG_DEBUG,'Fetching YMODEM header block') xym.errors:=0 WHILE((xym.errors<=xym.max_errors) AND (xym.cancelled=FALSE)) xmodem_put_nak(xym,0) @@ -977,17 +981,17 @@ EXPORT PROC xymodem_recv_files(ymodem,xym: PTR TO xymodem_t, download_dir:PTR TO IF(((xym.errors+1)>(xym.max_errors/3)) AND (i=NOINP) AND ((xym.mode AND (B2K OR GMODE))=(B2K OR GMODE))) /* Timeout */ xym.mode:=xym.mode AND Not(B2K) StringF(logtmp,'Falling back to Streaming \s',IF (xym.mode AND CRC) THEN 'CRC-16' ELSE 'Checksum') - lprintf(xym,LOG_WARNING,logtmp) + lprintf(xym,LOG_WARN,logtmp) xym.errors:=-1 ELSEIF(((xym.errors+1)>(xym.max_errors/3)) AND (i=NOINP) AND (xym.mode AND GMODE)) /* Timeout */ xym.mode:=xym.mode AND Not(GMODE) StringF(logtmp,'Falling back to \s',IF (xym.mode AND CRC) THEN 'CRC-16' ELSE 'Checksum') - lprintf(xym,LOG_WARNING,logtmp) + lprintf(xym,LOG_WARN,logtmp) xym.errors:=-1 ENDIF IF(i=NOT_YMODEM) StringF(logtmp,'Falling back to XMODEM\s',IF (xym.mode AND GMODE) THEN '-g' ELSE '') - lprintf(xym,LOG_WARNING,logtmp) + lprintf(xym,LOG_WARN,logtmp) xym.mode:=xym.mode AND Not(YMODEM) xym.mode:=xym.mode OR XMODEM OR CRC hold_update:=0 @@ -998,14 +1002,14 @@ EXPORT PROC xymodem_recv_files(ymodem,xym: PTR TO xymodem_t, download_dir:PTR TO hold_update:=old_hold StringF(logtmp,'Falling back to XMODEM\s',IF (xym.mode AND GMODE) THEN '-g' ELSE '') - lprintf(xym,LOG_WARNING,logtmp) + lprintf(xym,LOG_WARN,logtmp) StrCopy(str,fname) file_bytes:=$7fffffff file_bytes_left:=file_bytes JUMP rbr1 ENDIF IF(((xym.errors+1)>(xym.max_errors/3)) AND (xym.mode AND CRC) AND ((xym.mode AND GMODE)=FALSE)) - lprintf(xym,LOG_NOTICE,'Falling back to 8-bit Checksum mode') + lprintf(xym,LOG_DEBUG,'Falling back to 8-bit Checksum mode') xym.mode:=xym.mode AND Not(CRC) ENDIF xym.errors:=xym.errors+1 @@ -1017,7 +1021,7 @@ rbr1: ENDIF IF(i<>NOT_YMODEM) IF(block[0]=FALSE) - lprintf(xym,LOG_INFO,'Received YMODEM termination block') + lprintf(xym,LOG_DEBUG,'Received YMODEM termination block') JUMP end ENDIF file_bytes:=0 @@ -1062,10 +1066,10 @@ rbr1: StringF(str,'\s\s',download_dir,FilePart(fname)) StringF(logtmp,'File size: \d bytes', file_bytes) - lprintf(xym,LOG_INFO,logtmp) + lprintf(xym,LOG_DEBUG,logtmp) IF(total_files>1) StringF(logtmp,'Remaining: \d bytes in \d files', total_bytes, total_files) - lprintf(xym,LOG_INFO,logtmp) + lprintf(xym,LOG_DEBUG,logtmp) ENDIF ENDIF ENDIF @@ -1077,14 +1081,14 @@ rbr1: fnum++ IF dupe_check(xym,str) - lprintf(xym,LOG_WARNING,'dupe check triggered') + lprintf(xym,LOG_WARN,'dupe check triggered') xmodem_cancel(xym) JUMP end ENDIF WHILE(fexist(str) AND ((xym.mode AND OVERWRITE)=FALSE)) StringF(logtmp,'\s already exists',str) - lprintf(xym,LOG_WARNING,logtmp) + lprintf(xym,LOG_WARN,logtmp) IF(xmodem_duplicate(xym, str)=FALSE) xmodem_cancel(xym) JUMP end @@ -1094,7 +1098,7 @@ rbr1: fp:=doOpen(xym,str,MODE_NEWFILE) IF(fp=NIL) StringF(logtmp,'Error \d creating \s',IoErr(),str) - lprintf(xym,LOG_ERR,logtmp) + lprintf(xym,LOG_ERROR,logtmp) xmodem_cancel(xym) JUMP end ENDIF @@ -1105,14 +1109,14 @@ rbr1: ,IF xym.mode AND GMODE THEN 'XMODEM-g' ELSE 'XMODEM' ,IF xym.mode AND CRC THEN 'CRC-16' ELSE 'Checksum') - lprintf(xym,LOG_INFO,logtmp) + lprintf(xym,LOG_DEBUG,logtmp) ELSE StringF(logtmp,'Receiving \s (\d KB) via \s \s' ,str ,Shr(file_bytes,10) AND $3ffffff ,IF xym.mode AND GMODE THEN 'YMODEM-g' ELSE 'YMODEM' ,IF xym.mode AND CRC THEN 'CRC-16' ELSE 'Checksum') - lprintf(xym,LOG_INFO,logtmp) + lprintf(xym,LOG_DEBUG,logtmp) ENDIF t1,t2:=getXYmSystemTime() @@ -1135,7 +1139,7 @@ c1: xym.new_file:=FALSE IF(is_cancelled(xym)) - lprintf(xym,LOG_WARNING,'Cancelled locally') + lprintf(xym,LOG_WARN,'Cancelled locally') xmodem_cancel(xym) JUMP end ENDIF @@ -1160,20 +1164,20 @@ c1: xym.errors:=xym.errors+1 IF(xym.mode AND GMODE) StringF(logtmp,'Too many errors (\d)',xym.errors) - lprintf(xym,LOG_ERR,logtmp) + lprintf(xym,LOG_ERROR,logtmp) JUMP end ENDIF IF(xym.errors>xym.max_errors) StringF(logtmp,'Too many errors (\d)',xym.errors) - lprintf(xym,LOG_ERR,logtmp) + lprintf(xym,LOG_ERROR,logtmp) xmodem_cancel(xym) JUMP rbr2 ENDIF IF((i<>NOT_XMODEM) AND (block_num=1) AND (xym.errors>(Div(xym.max_errors,3))) AND (xym.mode AND CRC) AND ((xym.mode AND GMODE)=FALSE)) StringF(logtmp,'Falling back to 8-bit Checksum mode (error=\d)', i) - lprintf(xym,LOG_NOTICE,logtmp) + lprintf(xym,LOG_DEBUG,logtmp) xym.mode:=xym.mode AND Not(CRC) ENDIF xmodem_put_nak(xym, block_num) @@ -1186,7 +1190,7 @@ c1: ENDIF IF(file_bytes_left<=0) /* No more bytes to receive */ - lprintf(xym,LOG_WARNING,'Sender attempted to send more bytes than were specified in header') + lprintf(xym,LOG_WARN,'Sender attempted to send more bytes than were specified in header') JUMP rbr2 ENDIF @@ -1195,7 +1199,7 @@ c1: IF(doWrite(xym,fp,block,wr)<>wr) StringF(logtmp,'Error writing \d bytes to file at offset \d',wr,pos) - lprintf(xym,LOG_ERR,logtmp) + lprintf(xym,LOG_ERROR,logtmp) xmodem_cancel(xym) JUMP end ENDIF @@ -1218,7 +1222,7 @@ rbr2: IF(file_bytes < getFileSize(xym,fp)) StringF(logtmp,'Truncating file to \d bytes', file_bytes) - lprintf(xym,LOG_INFO,logtmp) + lprintf(xym,LOG_DEBUG,logtmp) ->chsize(fileno(fp),(ulong)file_bytes); /* 4GB limit! */ ELSE file_bytes:=getFileSize(xym,fp) @@ -1245,12 +1249,12 @@ rbr2: IF(success) upload_completed(xym,str,file_bytes) StringF(logtmp,'Successful - Time: \d:\d CPS: \d',Div(t,50),Mod(t,50),cps) - lprintf(xym,LOG_INFO,logtmp) + lprintf(xym,LOG_DEBUG,logtmp) fcount++ ELSE upload_failed(xym,str) StringF(logtmp,'File Transfer \s', IF xym.cancelled THEN 'Cancelled' ELSE 'Failure') - lprintf(xym,LOG_ERR,logtmp) + lprintf(xym,LOG_ERROR,logtmp) ENDIF ->IF(!(modexymODEM) && ftime) THEN setfdate(str,ftime); @@ -1258,7 +1262,7 @@ rbr2: IF((success=FALSE) AND (file_bytes=0)) IF (DeleteFile(str)=FALSE) StringF(logtmp,'Unable to remove empty file \s', str) - lprintf(xym,LOG_ERR,logtmp) + lprintf(xym,LOG_ERROR,logtmp) ENDIF ENDIF @@ -1273,7 +1277,7 @@ rbr2: ,Mod(Div(total_bytes,cps),50) ,total_files ,Shr(total_bytes,10) AND $3ffffff) - lprintf(xym,LOG_INFO,logtmp) + lprintf(xym,LOG_DEBUG,logtmp) ENDIF ENDWHILE @@ -1352,21 +1356,13 @@ PROC getFileSize(xym,fp) p:=doSeek(xym,fp,0,OFFSET_END) ENDPROC doSeek(xym,fp,p,OFFSET_BEGINING) -PROC doDownloadCompleted(xym:PTR TO xymodem_t,fname,size) - DEF p - p:=xym.zm_download_completed - IF p<>NIL - RETURN p(size) - ENDIF -ENDPROC - PROC doOpen(xym:PTR TO xymodem_t,fname,mode) DEF p p:=xym.zm_fopen IF p<>NIL RETURN p(fname,mode) ENDIF - lprintf(xym,LOG_WARNING,'zm_fopen not set, defaulting to dos library Open') + lprintf(xym,LOG_WARN,'zm_fopen not set, defaulting to dos library Open') ENDPROC Open(fname,mode) PROC doClose(xym:PTR TO xymodem_t,fhandle) @@ -1375,7 +1371,7 @@ PROC doClose(xym:PTR TO xymodem_t,fhandle) IF p<>NIL RETURN p(fhandle) ENDIF - lprintf(xym,LOG_WARNING,'zm_fclose not set, defaulting to dos library Close') + lprintf(xym,LOG_WARN,'zm_fclose not set, defaulting to dos library Close') ENDPROC Close(fhandle) PROC doSeek(xym:PTR TO xymodem_t,fhandle,pos,origin) @@ -1384,7 +1380,7 @@ PROC doSeek(xym:PTR TO xymodem_t,fhandle,pos,origin) IF p<>NIL RETURN p(fhandle,pos,origin) ENDIF - lprintf(xym,LOG_WARNING,'zm_fseek not set, defaulting to dos library Seek') + lprintf(xym,LOG_WARN,'zm_fseek not set, defaulting to dos library Seek') ENDPROC Seek(fhandle,pos,origin) PROC doRead(xym:PTR TO xymodem_t,fhandle,buffer,length) @@ -1393,7 +1389,7 @@ PROC doRead(xym:PTR TO xymodem_t,fhandle,buffer,length) IF p<>NIL RETURN p(fhandle,buffer,length) ENDIF - ->lprintf(xym,LOG_WARNING,'zm_fread not set, defaulting to dos library FRead') + ->lprintf(xym,LOG_WARN,'zm_fread not set, defaulting to dos library FRead') ENDPROC Fread(fhandle,buffer,1,length) PROC doWrite(xym:PTR TO xymodem_t,fhandle,buffer,length) @@ -1402,7 +1398,7 @@ PROC doWrite(xym:PTR TO xymodem_t,fhandle,buffer,length) IF p<>NIL RETURN p(fhandle,buffer,length) ENDIF - ->lprintf(xym,LOG_WARNING,'zm_fwrite not set, defaulting to dos library FWrite') + ->lprintf(xym,LOG_WARN,'zm_fwrite not set, defaulting to dos library FWrite') ENDPROC Fwrite(fhandle,buffer,1,length) crc16tbl: INT $0000, $1021, $2042, $3063, $4084, $50A5, $60C6, $70E7, diff --git a/zmodem.e b/zmodem.e index 1701e57..798722a 100644 --- a/zmodem.e +++ b/zmodem.e @@ -1,6 +1,6 @@ OPT LARGE,MODULE - MODULE 'dos/dos','socket' + MODULE 'dos/dos','socket','*axenums','*bcd','exec' /* way to update errors, error/resume position @@ -12,12 +12,6 @@ way to update errors, error/resume position /* $Id: crc16.c,v 1.7 2014/02/10 04:44:31 deuce Exp $ */ -EXPORT CONST ZM_LOG_DEBUG=4 -EXPORT CONST ZM_LOG_INFO=3 -EXPORT CONST ZM_LOG_NOTICE=2 -EXPORT CONST ZM_LOG_WARNING=1 -EXPORT CONST ZM_LOG_ERR=0 - CONST MAX_PATH=512 CONST NOINP=-1 /* input buffer empty (incom only) */ @@ -428,9 +422,9 @@ EXPORT OBJECT zmodem_t current_file_time:LONG current_file_num:LONG total_files:LONG - total_bytes:LONG + total_bytes[8]:ARRAY OF CHAR files_remaining:LONG - bytes_remaining:LONG + bytes_remaining[8]:ARRAY OF CHAR transfer_start_pos:LONG transfer_start_time1:LONG transfer_start_time2:INT @@ -468,7 +462,6 @@ EXPORT OBJECT zmodem_t block_size:LONG max_block_size:LONG max_file_size:LONG /* 0 = unlimited */ - log_level:PTR TO INT user_data:LONG /* Callbacks */ @@ -528,10 +521,6 @@ ENDPROC Not(crc) PROC lprintf(zm:PTR TO zmodem_t, level, str:PTR TO CHAR) DEF p IF(zm.zm_lputs=NIL) THEN RETURN -1 - - IF(zm.log_level<>NIL) - IF(level > zm.log_level) THEN RETURN 0 - ENDIF p:=zm.zm_lputs ENDPROC p(level,str) @@ -552,6 +541,14 @@ PROC is_cancelled(zm: PTR TO zmodem_t) ENDIF ENDPROC FALSE +PROC download_completed(zm:PTR TO zmodem_t,fname,filesize,sentsize) + DEF p + p:=zm.zm_download_completed + IF p<>NIL + RETURN p(filesize,sentsize) + ENDIF +ENDPROC + PROC upload_completed(zm:PTR TO zmodem_t,fname:PTR TO CHAR,filebytes) DEF p p:=zm.zm_upload_completed @@ -564,12 +561,6 @@ PROC upload_failed(zm:PTR TO zmodem_t,fname:PTR TO CHAR) IF (p<>NIL) THEN p(fname) ENDPROC -PROC download_completed(zm:PTR TO zmodem_t,fname:PTR TO CHAR,filebytes) - DEF p - p:=zm.zm_download_completed - IF (p<>NIL) THEN p(fname,filebytes) -ENDPROC - PROC dupe_check(zm:PTR TO zmodem_t,fname) DEF res=FALSE DEF p @@ -858,7 +849,7 @@ PROC zmodem_send_hex(zm:PTR TO zmodem_t,val) StrCopy(xdigit,'0123456789abcdef') ->StringF(tempstr,'send_hex: \d \h[2] ',val,val) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr) + ->lprintf(zm,LOG_DEBUG,tempstr) zmodem_send_raw(zm, xdigit[Shr(val,4)]) ENDPROC zmodem_send_raw(zm, xdigit[val AND 15]) @@ -884,7 +875,7 @@ PROC zmodem_send_hex_header(zm:PTR TO zmodem_t, p: PTR TO CHAR) type:=p[] ->chr(type,tempstr) ->StringF(tempstr2,'send_hex_header: \s', tempstr) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) zmodem_send_padded_zdle(zm) zmodem_send_raw(zm, ZHEX) @@ -944,7 +935,7 @@ PROC zmodem_send_bin32_header(zm:PTR TO zmodem_t, p: PTR TO CHAR) ->chr(p[],tempstr) ->StringF(tempstr2,'"send_bin32_header: \s',tempstr) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) zmodem_send_padded_zdle(zm) zmodem_send_raw(zm, ZBIN32) @@ -975,7 +966,7 @@ PROC zmodem_send_bin16_header(zm:PTR TO zmodem_t, p: PTR TO CHAR) ->chr(p[],tempstr) ->StringF(tempstr2,'send_bin16_header: \s',tempstr) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) zmodem_send_padded_zdle(zm) @@ -1018,7 +1009,7 @@ PROC zmodem_send_data32(zm: PTR TO zmodem_t, subpkt_type, p: PTR TO CHAR, l) ->chr(subpkt_type,tempstr) ->StringF(tempstr2,'send_data32: \s (\d bytes)', tempstr,l) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) crc:=$ffffffff @@ -1048,7 +1039,7 @@ PROC zmodem_send_data16(zm: PTR TO zmodem_t, subpkt_type,p: PTR TO CHAR, l) ->chr(subpkt_type,tempstr) ->StringF(tempstr2,'send_data16: \s (\d bytes)', tempstr,l) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) crc:=0 @@ -1095,7 +1086,7 @@ PROC zmodem_send_data(zm: PTR TO zmodem_t, subpkt_type, p: PTR TO CHAR, l) IF(zm.frame_in_transit)=0 /* Start of frame, include ZDATA header */ ->StringF(tempstr,'send_data: start of frame, offset \d',zm.current_file_pos) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr) + ->lprintf(zm,LOG_DEBUG,tempstr) zmodem_send_pos_header(zm, ZDATA, zm.current_file_pos, /* Hex? */ FALSE) ENDIF ENDPROC zmodem_send_data_subpkt(zm, subpkt_type, p, l) @@ -1123,26 +1114,26 @@ EXPORT PROC zmodem_send_zfin(zm: PTR TO zmodem_t) DEF zfin_header zfin_header:=[ ZFIN, 0, 0, 0, 0 ]:CHAR - lprintf(zm,ZM_LOG_NOTICE,'Finishing Session (Sending ZFIN)') + lprintf(zm,LOG_DEBUG,'Finishing Session (Sending ZFIN)') ENDPROC zmodem_send_hex_header(zm,zfin_header) PROC zmodem_send_zabort(zm: PTR TO zmodem_t) - lprintf(zm,ZM_LOG_WARNING,'Aborting Transfer (Sending ZABORT)') + lprintf(zm,LOG_WARN,'Aborting Transfer (Sending ZABORT)') ENDPROC zmodem_send_pos_header(zm, ZABORT, 0, /* Hex? */ TRUE) PROC zmodem_send_znak(zm: PTR TO zmodem_t) - lprintf(zm,ZM_LOG_INFO,'Sending ZNAK') + lprintf(zm,LOG_DEBUG,'Sending ZNAK') ENDPROC zmodem_send_pos_header(zm, ZNAK, 0, /* Hex? */ TRUE) PROC zmodem_send_zskip(zm: PTR TO zmodem_t) - lprintf(zm,ZM_LOG_INFO,'Sending ZSKIP') + lprintf(zm,LOG_DEBUG,'Sending ZSKIP') ENDPROC zmodem_send_pos_header(zm, ZSKIP, 0, /* Hex? */ TRUE) PROC zmodem_send_zeof(zm: PTR TO zmodem_t, pos) DEF tempstr[255]:STRING StringF(tempstr,'Sending End-of-File (ZEOF) frame (pos=\d)', pos) - lprintf(zm,ZM_LOG_INFO,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) ENDPROC zmodem_send_pos_header(zm, ZEOF, pos, /* Hex? */ TRUE) /* @@ -1182,7 +1173,7 @@ noret: zm.n_cans:=zm.n_cans+1 IF(zm.n_cans = 5) zm.cancelled:=TRUE - lprintf(zm,ZM_LOG_WARNING,'recv_raw: Cancelled remotely') + lprintf(zm,LOG_WARN,'recv_raw: Cancelled remotely') /* return(TIMEOUT) removed June-12-2005 */ ENDIF ELSE @@ -1231,7 +1222,7 @@ iszdle: */ ->chr(c,tempstr) ->StringF(tempstr2,'x: encoding data subpacket type: \s',tempstr) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) RETURN (c OR ZDLEESC) ELSEIF (c=ZRUB0) RETURN $7f @@ -1240,7 +1231,7 @@ iszdle: ELSEIF (c=XON) OR (c=(XON OR $80)) OR (c=XOFF) OR (c=(XOFF OR $80)) OR (c=ZDLE) chr(c,tempstr) StringF(tempstr2,'"rx: dropping escaped flow ctrl char: \s',tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) ELSE IF(c < 0) THEN RETURN c @@ -1251,7 +1242,7 @@ iszdle: */ ->chr(c,tempstr) ->StringF(tempstr2,'rx: dropping unescaped ctrl char: \s',tempstr) - ->lprintf(zm,ZM_LOG_WARNING,tempstr2) + ->lprintf(zm,LOG_WARN,tempstr2) ->JUMP rxcont ELSE /* @@ -1261,7 +1252,7 @@ iszdle: IF((c AND $60) = $40) THEN RETURN Eor(c,$40) ->chr(c,tempstr) ->StringF(tempstr2,'"rx: illegal sequence: ZDLE \s',tempstr) - ->lprintf(zm,ZM_LOG_WARNING,tempstr2) + ->lprintf(zm,LOG_WARN,tempstr2) loop:=FALSE ENDIF ENDIF @@ -1295,7 +1286,7 @@ EXPORT PROC zmodem_rx(zm: PTR TO zmodem_t) ELSEIF (c=XON) OR (c=(XONOR80)) OR (c=XOFF) OR (c=(XOFFOR80)) chr(c,tempstr) StringF(tempstr2,'rx: dropping flow ctrl char: \s',tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) ELSE /* * if all control characters should be escaped and @@ -1304,7 +1295,7 @@ EXPORT PROC zmodem_rx(zm: PTR TO zmodem_t) IF((zm.escape_ctrl_chars AND (c >= 0) AND ((c AND $60)=0))) chr(c,tempstr) StringF(tempstr2,'rx: dropping unescaped ctrl char: \s',tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) ELSE /* * normal character; return it. @@ -1325,7 +1316,7 @@ EXPORT PROC zmodem_rx(zm: PTR TO zmodem_t) IF (c=XON) OR (c=(XON OR $80)) OR (c=XOFF) OR (c=(XOFF OR $80)) OR (c=ZDLE) chr(c,tempstr) StringF(tempstr2,'"rx: dropping escaped flow ctrl char: \s',tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) ELSEIF (c=ZCRCE) OR (c=ZCRCG) OR (c=ZCRCQ) OR (c=ZCRCW) /* these four are really nasty. * for convenience we just change them into @@ -1335,7 +1326,7 @@ EXPORT PROC zmodem_rx(zm: PTR TO zmodem_t) */ ->chr(c,tempstr) ->StringF(tempstr2,'x: encoding data subpacket type: \s',tempstr) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) RETURN (c OR ZDLEESC) ELSEIF (c=ZRUB0) RETURN $7f @@ -1351,7 +1342,7 @@ EXPORT PROC zmodem_rx(zm: PTR TO zmodem_t) */ ->chr(c,tempstr) ->StringF(tempstr2,'rx: dropping unescaped ctrl char: \s',tempstr) - ->lprintf(zm,ZM_LOG_WARNING,tempstr2) + ->lprintf(zm,LOG_WARN,tempstr2) ->JUMP rxcont ELSE /* @@ -1361,7 +1352,7 @@ EXPORT PROC zmodem_rx(zm: PTR TO zmodem_t) IF((c AND $60) = $40) THEN RETURN Eor(c,$40) ->chr(c,tempstr) ->StringF(tempstr2,'"rx: illegal sequence: ZDLE \s',tempstr) - ->lprintf(zm,ZM_LOG_WARNING,tempstr2) + ->lprintf(zm,LOG_WARN,tempstr2) loop:=FALSE ENDIF ENDIF @@ -1397,7 +1388,7 @@ PROC zmodem_recv_data32(zm: PTR TO zmodem_t, p: PTR TO CHAR, maxlen, l: PTR TO L DEF tempstr[255]:STRING DEF tempstr2[255]:STRING - ->lprintf(zm,ZM_LOG_DEBUG,'recv_data32') + ->lprintf(zm,LOG_DEBUG,'recv_data32') crc:=$ffffffff @@ -1415,7 +1406,7 @@ PROC zmodem_recv_data32(zm: PTR TO zmodem_t, p: PTR TO CHAR, maxlen, l: PTR TO L n++ ENDLOOP l[]:=l[]+n - + subpkt_type:=c AND $ff crc:=ucrc32(subpkt_type,crc) @@ -1430,12 +1421,12 @@ PROC zmodem_recv_data32(zm: PTR TO zmodem_t, p: PTR TO CHAR, maxlen, l: PTR TO L IF(rxd_crc <> crc) chr(subpkt_type,tempstr) StringF(tempstr2,'CRC32 ERROR (\h[8], expected: \h[8]) Bytes=\d, subpacket-type=\s',rxd_crc, crc, l[], tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) RETURN CRCFAILED ENDIF /*chr(subpkt_type,tempstr) StringF(tempstr2,'GOOD CRC32: \h[8] (Bytes=\d, subpacket-type=\s)',crc, l[], tempstr) - lprintf(zm,ZM_LOG_DEBUG,tempstr2)*/ + lprintf(zm,LOG_DEBUG,tempstr2)*/ zm.ack_file_pos:=zm.ack_file_pos+l[] ENDPROC subpkt_type @@ -1450,7 +1441,7 @@ PROC zmodem_recv_data16(zm: PTR TO zmodem_t, p:PTR TO CHAR, maxlen, l: PTR TO L DEF tempstr[255]:STRING ->DEF tempstr2[255]:STRING - ->lprintf(zm,ZM_LOG_DEBUG,'recv_data16') + ->lprintf(zm,LOG_DEBUG,'recv_data16') crc:=0 @@ -1479,11 +1470,11 @@ PROC zmodem_recv_data16(zm: PTR TO zmodem_t, p:PTR TO CHAR, maxlen, l: PTR TO L IF(rxd_crc <> crc) StringF(tempstr,'CRC16 ERROR (\h[4], expected: \h[4]) Bytes=\d',rxd_crc, crc, l[]) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) RETURN CRCFAILED ENDIF /*StringF(tempstr,'GOOD CRC16: \h[4] (Bytes=\d)', crc, l[]) - lprintf(zm,ZM_LOG_DEBUG,tempstr)*/ + lprintf(zm,LOG_DEBUG,tempstr)*/ zm.ack_file_pos:=zm.ack_file_pos+l[] @@ -1499,7 +1490,7 @@ PROC zmodem_recv_data(zm: PTR TO zmodem_t, p:PTR TO CHAR, maxlen, l: PTR TO LONG IF(l=NIL) THEN l:={n} ->StringF(tempstr,'recv_data (\d-bit)', IF zm.receive_32bit_data THEN 32 ELSE 16) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr) + ->lprintf(zm,LOG_DEBUG,tempstr) /* * receive the right type of frame @@ -1517,7 +1508,7 @@ PROC zmodem_recv_data(zm: PTR TO zmodem_t, p:PTR TO CHAR, maxlen, l: PTR TO LONG ->chr(subpkt_type,tempstr) ->StringF(tempstr,'recv_data received subpacket-type: \s',tempstr2) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) SELECT subpkt_type /* @@ -1546,7 +1537,7 @@ PROC zmodem_recv_data(zm: PTR TO zmodem_t, p:PTR TO CHAR, maxlen, l: PTR TO LONG chr(subpkt_type,tempstr) StringF(tempstr,'Received invalid subpacket-type: \s',tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) ENDPROC INVALIDSUBPKT @@ -1608,7 +1599,7 @@ PROC zmodem_recv_hex(zm: PTR TO zmodem_t) ret:=(Shl(n1,4)) OR n0 ->StringF(tempstr,'recv_hex returning: 0x\h[2]', ret) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr) + ->lprintf(zm,LOG_DEBUG,tempstr) ENDPROC ret /* @@ -1626,7 +1617,7 @@ PROC zmodem_recv_bin16_header(zm: PTR TO zmodem_t) DEF tempstr[255]:STRING DEF tempstr2[255]:STRING - ->lprintf(zm,ZM_LOG_DEBUG,'recv_bin16_header') + ->lprintf(zm,LOG_DEBUG,'recv_bin16_header') crc:=0 @@ -1635,7 +1626,7 @@ PROC zmodem_recv_bin16_header(zm: PTR TO zmodem_t) IF(c < 0) chr(c,tempstr) StringF(tempstr2,'recv_bin16_header: \s',tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_DEBUG,tempstr2) RETURN FALSE ENDIF crc:=ucrc16(c,crc) @@ -1647,11 +1638,11 @@ PROC zmodem_recv_bin16_header(zm: PTR TO zmodem_t) IF(rxd_crc <> crc) StringF(tempstr,'CRC16 ERROR: 0x\h, expected: 0x\h', rxd_crc, crc) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) RETURN FALSE ENDIF /*StringF(tempstr,'GOOD CRC16: \h[4]', crc) - lprintf(zm,ZM_LOG_DEBUG,tempstr)*/ + lprintf(zm,LOG_DEBUG,tempstr)*/ zm.rxd_header_len:=5 @@ -1665,7 +1656,7 @@ PROC zmodem_recv_hex_header(zm: PTR TO zmodem_t) DEF rxd_crc DEF tempstr[255]:STRING - ->lprintf(zm,ZM_LOG_DEBUG,'recv_hex_header') + ->lprintf(zm,LOG_DEBUG,'recv_hex_header') FOR i:=0 TO HDRLEN-1 c:=zmodem_recv_hex(zm) @@ -1693,11 +1684,11 @@ PROC zmodem_recv_hex_header(zm: PTR TO zmodem_t) IF(rxd_crc = crc) ->StringF(tempstr,'GOOD CRC16: \h[4]', crc) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr) + ->lprintf(zm,LOG_DEBUG,tempstr) zm.rxd_header_len:=5 ELSE StringF(tempstr,'CRC16 ERROR: 0x\h, expected: 0x\h', rxd_crc, crc) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) RETURN FALSE ENDIF @@ -1721,7 +1712,7 @@ PROC zmodem_recv_bin32_header(zm: PTR TO zmodem_t) DEF rxd_crc DEF tempstr[255]:STRING - ->lprintf(zm,ZM_LOG_DEBUG,'recv_bin32_header') + ->lprintf(zm,LOG_DEBUG,'recv_bin32_header') crc:=$ffffffff @@ -1742,11 +1733,11 @@ PROC zmodem_recv_bin32_header(zm: PTR TO zmodem_t) IF(rxd_crc<>crc) StringF(tempstr,'CRC32 ERROR (\h[8], expected: \h[8]',rxd_crc, crc) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) RETURN FALSE ENDIF ->StringF(tempstr,'GOOD CRC32: \h[8]', crc) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr) + ->lprintf(zm,LOG_DEBUG,tempstr) zm.rxd_header_len:=5 ENDPROC TRUE @@ -1766,7 +1757,7 @@ PROC zmodem_recv_header_raw(zm: PTR TO zmodem_t, errors) DEF tempstr[255]:STRING DEF tempstr2[255]:STRING - ->lprintf(zm,ZM_LOG_DEBUG,'recv_header_raw') + ->lprintf(zm,LOG_DEBUG,'recv_header_raw') zm.rxd_header_len:=0 @@ -1792,7 +1783,7 @@ zmrhcont: IF(c<>ZDLE) chr(c,tempstr) StringF(tempstr2,'recv_header_raw: Expected ZDLE, received: \s',tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) JUMP zmrhcont ENDIF @@ -1817,15 +1808,15 @@ zmrhcont: IF(c < 0) chr(c,tempstr) StringF(tempstr2,'recv_header_raw: \s', tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_DEBUG,tempstr2) RETURN c ENDIF /* * unrecognized header style */ chr(c,tempstr) - StringF(tempstr2,'recv_header_raw: UNRECOGNIZED header style: \s',tempstr) - lprintf(zm,ZM_LOG_ERR,tempstr2) + StringF(tempstr2,'recv_header_raw: UNRECOGNIZED header style: \s',tempstr) + lprintf(zm,LOG_ERROR,tempstr2) IF(errors) THEN RETURN INVHDR JUMP zmrhcont ENDSELECT @@ -1864,7 +1855,7 @@ zmrhcont: ->#if 0 /* def _DEBUG */ ->frame_desc(frame_type,tempstr) ->StringF(tempstr2,'recv_header_raw received header type: \s',tempstr) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) ->#endif ENDPROC frame_type @@ -1877,13 +1868,13 @@ PROC zmodem_recv_header(zm: PTR TO zmodem_t) SELECT ret CASE TIMEOUT - lprintf(zm,ZM_LOG_WARNING,'recv_header TIMEOUT') + lprintf(zm,LOG_WARN,'recv_header TIMEOUT') CASE INVHDR - lprintf(zm,ZM_LOG_WARNING,'recv_header detected an invalid header') + lprintf(zm,LOG_WARN,'recv_header detected an invalid header') DEFAULT ->frame_desc(ret,tempstr) ->StringF(tempstr2,'recv_header returning: \s (pos=\d)',tempstr, frame_pos(zm, ret)) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) IF(ret=ZCAN) zm.cancelled:=TRUE @@ -1911,7 +1902,7 @@ PROC zmodem_recv_header_and_check(zm: PTR TO zmodem_t) ->frame_desc(type,tempstr) ->StringF(tempstr2,'recv_header_and_check returning: \s (pos=\d)',tempstr,frame_pos(zm, type)) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) IF(type=ZCAN) THEN zm.cancelled:=TRUE ENDPROC type @@ -1928,14 +1919,14 @@ PROC zmodem_recv_crc(zm: PTR TO zmodem_t, crc:PTR TO LONG) IF(zmodem_data_waiting(zm,zm.crc_timeout))=FALSE StringF(tempstr,'Timeout waiting for response (\d seconds)',zm.crc_timeout) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) RETURN FALSE ENDIF IF((type:=zmodem_recv_header(zm)))<>ZCRC frame_desc(type,tempstr) StringF(tempstr2,'Received \s instead of ZCRC', tempstr) - lprintf(zm,ZM_LOG_ERR,tempstr2) + lprintf(zm,LOG_ERROR,tempstr2) RETURN FALSE ENDIF IF(crc<>NIL) THEN crc[]:=zm.crc_request @@ -1961,12 +1952,12 @@ PROC zmodem_parse_zrinit(zm: PTR TO zmodem_t) IF(zm.can_overlap_io) THEN 'Can' ELSE 'Cannot', IF(zm.can_fcs_32) THEN 32 ELSE 16, IF(zm.escape_ctrl_chars) THEN 'ALL' ELSE 'Normal') - lprintf(zm,ZM_LOG_INFO,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) zm.recv_bufsize:=(zm.rxd_header[ZP0] OR (Shl(zm.rxd_header[ZP1],8))) IF(zm.recv_bufsize)<>0 StringF(tempstr,'Receiver specified buffer size of: \d', zm.recv_bufsize) - lprintf(zm,ZM_LOG_INFO,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) ENDIF ENDPROC @@ -2015,12 +2006,12 @@ PROC zmodem_handle_zrpos(zm: PTR TO zmodem_t, pos:PTR TO LONG) IF(pos[] <> zm.rxd_header_pos) pos[]:=zm.rxd_header_pos StringF(tempstr,'Resuming transfer from offset: \d',pos[]) - lprintf(zm,ZM_LOG_INFO,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) ENDIF RETURN TRUE ENDIF StringF(tempstr,'Invalid ZRPOS offset: \d', zm.rxd_header_pos) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) ENDPROC FALSE PROC zmodem_handle_zack(zm: PTR TO zmodem_t) @@ -2028,7 +2019,7 @@ PROC zmodem_handle_zack(zm: PTR TO zmodem_t) IF(zm.rxd_header_pos = zm.current_file_pos) THEN RETURN TRUE StringF(tempstr,'ZACK for incorrect offset (\d vs \d)',zm.rxd_header_pos, zm.current_file_pos) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) ENDPROC FALSE /* @@ -2054,7 +2045,7 @@ PROC zmodem_send_from(zm: PTR TO zmodem_t, fp, pos,sent: PTR TO LONG) startfrom:=pos IF doSeek(zm,fp,pos,OFFSET_BEGINING)=-1 StringF(tempstr,'ERROR \d seeking to file offset \d',IoErr(), pos) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) zmodem_send_pos_header(zm, ZFERR, pos, /* Hex? */ TRUE) RETURN ZFERR ENDIF @@ -2114,9 +2105,9 @@ PROC zmodem_send_from(zm: PTR TO zmodem_t, fp, pos,sent: PTR TO LONG) IF((type = ZCRCW) OR (type = ZCRCE)) ->chr(type,tempstr) ->StringF(tempstr2,'Sent end-of-frame (\s sub-packet)', tempstr) - ->lprintf(zm,ZM_LOG_DEBUG,tempstr2) + ->lprintf(zm,LOG_DEBUG,tempstr2) IF(type=ZCRCW) /* ZACK expected */ - ->lprintf(zm,ZM_LOG_DEBUG,'Waiting for ZACK') + ->lprintf(zm,LOG_DEBUG,'Waiting for ZACK') WHILE(is_connected(zm)) IF((ack:=zmodem_recv_header(zm)))<>ZACK THEN RETURN ack @@ -2134,7 +2125,7 @@ PROC zmodem_send_from(zm: PTR TO zmodem_t, fp, pos,sent: PTR TO LONG) IF(n < zm.block_size) StringF(tempstr,'send_from: end of file (or read error) reached at offset: \d',zm.current_file_pos) - lprintf(zm,ZM_LOG_DEBUG,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) zmodem_send_zeof(zm, zm.current_file_pos) IF pos<>zm.current_file_pos THEN zm.send_successful:=TRUE @@ -2151,7 +2142,7 @@ PROC zmodem_send_from(zm: PTR TO zmodem_t, fp, pos,sent: PTR TO LONG) */ WHILE(zmodem_data_waiting(zm, IF zm.consecutive_errors THEN 1 ELSE 0) AND (is_cancelled(zm)=FALSE) AND (is_connected(zm))) - lprintf(zm,ZM_LOG_DEBUG,'Back-channel traffic detected:') + lprintf(zm,LOG_DEBUG,'Back-channel traffic detected:') IF((c:=zmodem_recv_raw(zm)))<0 THEN RETURN c IF(c = ZPAD) @@ -2164,12 +2155,12 @@ PROC zmodem_send_from(zm: PTR TO zmodem_t, fp, pos,sent: PTR TO LONG) rx_type:=zmodem_recv_header(zm) chr(rx_type,tempstr) StringF(tempstr2,'Received back-channel data: \s', tempstr) - lprintf(zm,ZM_LOG_DEBUG,tempstr2) + lprintf(zm,LOG_DEBUG,tempstr2) IF(rx_type >= 0) THEN RETURN rx_type ELSE chr(c,tempstr) StringF(tempstr2,'Received: \s',tempstr) - lprintf(zm,ZM_LOG_DEBUG,tempstr2) + lprintf(zm,LOG_DEBUG,tempstr2) ENDIF ENDWHILE @@ -2184,7 +2175,7 @@ PROC zmodem_send_from(zm: PTR TO zmodem_t, fp, pos,sent: PTR TO LONG) ENDWHILE zm.new_file:=FALSE - ->lprintf(zm,ZM_LOG_DEBUG,'send_from: returning unexpectedly!') + ->lprintf(zm,LOG_DEBUG,'send_from: returning unexpectedly!') /* * end of file reached. @@ -2199,7 +2190,7 @@ EXPORT PROC zmodem_send_files(zm: PTR TO zmodem_t,sentptr: PTR TO LONG, timetake DEF sent zm.files_remaining:=zm.total_files - zm.bytes_remaining:=zm.total_bytes + CopyMem(zm.total_bytes,zm.bytes_remaining,8) timetaken[]:=0 @@ -2212,7 +2203,7 @@ EXPORT PROC zmodem_send_files(zm: PTR TO zmodem_t,sentptr: PTR TO LONG, timetake IF res=FALSE THEN RETURN res IF (zm.send_successful) AND (zm.file_skipped=FALSE) - doDownloadCompleted(zm,fname,sent) + download_completed(zm,fname,zm.current_file_size,sent) ENDIF init:=FALSE @@ -2221,9 +2212,9 @@ EXPORT PROC zmodem_send_files(zm: PTR TO zmodem_t,sentptr: PTR TO LONG, timetake res:=FALSE IF p<>NIL THEN res:=p(fname) zm.files_remaining:=zm.files_remaining-1 - zm.bytes_remaining:=zm.bytes_remaining-sent + subBCD(zm.bytes_remaining,sent) IF zm.files_remaining<0 THEN zm.files_remaining:=0 - IF zm.bytes_remaining<0 THEN zm.bytes_remaining:=0 + IF zm.bytes_remaining[0]=$99 THEN convertToBCD(0,zm.bytes_remaining) IF sentptr<>NIL THEN sentptr[]:=sentptr[]+sent ENDIF UNTIL res=FALSE @@ -2259,7 +2250,7 @@ PROC zmodem_send_file(zm: PTR TO zmodem_t, fname: PTR TO CHAR, request_init,sent fp:=doOpen(zm,fname,MODE_OLDFILE) IF fp=NIL StringF(tempstr,'Error opening file \s',fname) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) RETURN FALSE ENDIF @@ -2278,22 +2269,22 @@ PROC zmodem_send_file(zm: PTR TO zmodem_t, fname: PTR TO CHAR, request_init,sent zm.file_skipped:=FALSE zm.send_successful:=FALSE - IF(zm.no_streaming) THEN lprintf(zm,ZM_LOG_WARNING,'Streaming disabled') + IF(zm.no_streaming) THEN lprintf(zm,LOG_WARN,'Streaming disabled') IF(request_init) zm.errors:=0 WHILE (zm.errors<=zm.max_errors) AND (is_cancelled(zm)=FALSE) AND (is_connected(zm)) IF(zm.errors) StringF(tempstr,'Sending ZRQINIT (\d of \d)',zm.errors+1,zm.max_errors+1) - lprintf(zm,ZM_LOG_NOTICE,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) ELSE - lprintf(zm,ZM_LOG_INFO,'Sending ZRQINIT') + lprintf(zm,LOG_DEBUG,'Sending ZRQINIT') ENDIF i:=zmodem_get_zrinit(zm) EXIT i = ZRINIT frame_desc(i,tempstr) StringF(tempstr2,'send_file: received \s instead of ZRINIT',tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) zm.errors:=zm.errors+1 ENDWHILE IF((zm.errors>=zm.max_errors) OR (is_cancelled(zm)) OR (is_connected(zm))=FALSE) @@ -2301,7 +2292,7 @@ PROC zmodem_send_file(zm: PTR TO zmodem_t, fname: PTR TO CHAR, request_init,sent RETURN FALSE ENDIF ENDIF - lprintf(zm,ZM_LOG_INFO,'Sending ZRQINIT done') + lprintf(zm,LOG_DEBUG,'Sending ZRQINIT done') zm.current_file_size:=getFileSize(zm,fp) strcopy(zm.current_file_name,fname) @@ -2323,13 +2314,13 @@ PROC zmodem_send_file(zm: PTR TO zmodem_t, fname: PTR TO CHAR, request_init,sent IF(zm.management_protect) zfile_frame[ZF1]:=ZF1_ZMPROT - lprintf(zm,ZM_LOG_DEBUG,'send_file: protecting destination') + lprintf(zm,LOG_DEBUG,'send_file: protecting destination') ELSEIF(zm.management_clobber) zfile_frame[ZF1]:=ZF1_ZMCLOB - lprintf(zm,ZM_LOG_DEBUG,'send_file: overwriting destination') + lprintf(zm,LOG_DEBUG,'send_file: overwriting destination') ELSEIF(zm.management_newer) zfile_frame[ZF1]:=ZF1_ZMNEW - lprintf(zm,ZM_LOG_DEBUG,'send_file: overwriting destination if newer') + lprintf(zm,LOG_DEBUG,'send_file: overwriting destination if newer') ELSE zfile_frame[ZF1]:=ZF1_ZMCRC ENDIF @@ -2363,11 +2354,13 @@ PROC zmodem_send_file(zm: PTR TO zmodem_t, fname: PTR TO CHAR, request_init,sent p:=p+StrLen(p) + 1 - StringF(tempstr,'\d \d 0 0 \d \d 0', + formatBCD(zm.bytes_remaining,tempstr2) + + StringF(tempstr,'\d \d 0 0 \d \s 0', zm.current_file_size, /* use for estimating only, could be zero! */ 0, ->(uintmax_t)s.st_mtime zm.files_remaining, - zm.bytes_remaining) + tempstr2) strcopy(p,tempstr,-1) p:=p+StrLen(p) + 1 @@ -2386,17 +2379,17 @@ zsendcont1: */ StringF(tempstr,'Sending ZFILE frame: ''\s''',zm.tx_data_subpacket+StrLen(zm.tx_data_subpacket)+1) - lprintf(zm,ZM_LOG_DEBUG,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) IF((i:=zmodem_send_bin_header(zm,zfile_frame)))<>0 StringF(tempstr,'zmodem_send_bin_header returned \d',i) - lprintf(zm,ZM_LOG_DEBUG,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) JUMP zsendcont1 ENDIF IF((i:=zmodem_send_data_subpkt(zm,ZCRCW,zm.tx_data_subpacket,p - zm.tx_data_subpacket)))<>0 StringF(tempstr,'zmodem_send_data_subpkt returned \d',i) - lprintf(zm,ZM_LOG_DEBUG,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) JUMP zsendcont1 ENDIF /* @@ -2419,15 +2412,15 @@ zsendignore: ->if 0 ->StringF(tempstr,'type : \d',type) - ->lprintf(zm,ZM_LOG_INFO,tempstr) + ->lprintf(zm,LOG_DEBUG,tempstr) ->#endif IF(type = ZCRC) IF(zm.crc_request=0) - lprintf(zm,ZM_LOG_NOTICE,'Receiver requested CRC of entire file') + lprintf(zm,LOG_DEBUG,'Receiver requested CRC of entire file') ELSE StringF(tempstr,'Receiver requested CRC of first \d bytes',zm.crc_request) - lprintf(zm,ZM_LOG_NOTICE,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) ENDIF zmodem_send_pos_header(zm,ZCRC,fcrc32(zm,fp,zm.crc_request),TRUE) type:=zmodem_recv_header(zm) @@ -2435,13 +2428,13 @@ zsendignore: IF(type = ZSKIP) zm.file_skipped:=TRUE - lprintf(zm,ZM_LOG_WARNING,'File skipped by receiver') + lprintf(zm,LOG_WARN,'File skipped by receiver') doClose(zm,fp) RETURN TRUE ENDIF IF (type=ZRINIT) - lprintf(zm,ZM_LOG_WARNING,'ignoring duplicate ZRINIT') + lprintf(zm,LOG_WARN,'ignoring duplicate ZRINIT') JUMP zsendignore ENDIF @@ -2464,7 +2457,7 @@ zsendignore: zm.consecutive_errors:=0 StringF(tempstr,'Sending \s from offset \d', fname, pos) - lprintf(zm,ZM_LOG_DEBUG,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) zm.new_file:=TRUE loop:=TRUE @@ -2492,7 +2485,7 @@ zsendcont2: IF(type = ZSKIP) zm.file_skipped:=TRUE StringF(tempstr,'File skipped by receiver at offset: \d', pos + sent_bytes) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) /* ZOC sends a ZRINIT after mid-file ZSKIP, so consume the ZRINIT here */ zmodem_recv_header(zm) doClose(zm,fp) @@ -2515,7 +2508,7 @@ zsendcont2: chr(type,tempstr) StringF(tempstr,'Received \s at offset: \d', tempstr, zm.current_file_pos) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) IF((zm.block_size = zm.max_block_size) AND (zm.max_block_size > ZBLOCKLEN)) THEN zm.max_block_size:=Div(zm.max_block_size,2) @@ -2532,7 +2525,7 @@ zsendcont2: chr(type,tempstr) StringF(tempstr2,'Transfer failed on receipt of: \s', tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) END zfile_frame[5] doClose(zm,fp) ENDPROC FALSE @@ -2566,7 +2559,7 @@ EXPORT PROC zmodem_recv_files(zm: PTR TO zmodem_t, download_dir:PTR TO CHAR,byte kbytes:=Shr(bytes,10) IF(kbytes<1) THEN kbytes:=0 StringF(tempstr,'Downloading \s \d KBytes) via Zmodem', zm.current_file_name, kbytes) - lprintf(zm,ZM_LOG_INFO,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) REPEAT /* try */ skip:=TRUE @@ -2575,10 +2568,10 @@ EXPORT PROC zmodem_recv_files(zm: PTR TO zmodem_t, download_dir:PTR TO CHAR,byte IF fpath[StrLen(fpath)-1]<>":" THEN StrAdd(fpath,'/') StringF(fpath,'\s\s',download_dir,zm.current_file_name) StringF(tempstr,'fpath=\s',fpath) - lprintf(zm,ZM_LOG_DEBUG,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) IF(dupe_check(zm,fpath)) - lprintf(zm,ZM_LOG_DEBUG,'dupe check triggered') + lprintf(zm,LOG_DEBUG,'dupe check triggered') brk:=TRUE JUMP zreccont1 ENDIF @@ -2586,10 +2579,10 @@ EXPORT PROC zmodem_recv_files(zm: PTR TO zmodem_t, download_dir:PTR TO CHAR,byte IF(fexist(fpath)) l:=flength(fpath) StringF(tempstr,'\s already exists (\d bytes)',fpath,l) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) IF(l>=bytes) StringF(tempstr,'Local file size \d >= remote file size \d',l,bytes) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) p:=zm.zm_duplicate_filename IF(p=NIL) brk:=TRUE @@ -2607,37 +2600,37 @@ EXPORT PROC zmodem_recv_files(zm: PTR TO zmodem_t, download_dir:PTR TO CHAR,byte ENDIF IF((fp:=doOpen(zm,fpath,MODE_OLDFILE)))=NIL StringF(tempstr,'Error \d opening \s', IoErr(), fpath) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) brk:=TRUE JUMP zreccont1 ENDIF ->setvbuf(fp,NULL,_IOFBF,$10000) StringF(tempstr,'Requesting CRC of remote file: \s', zm.current_file_name) - lprintf(zm,ZM_LOG_NOTICE,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) IF(zmodem_request_crc(zm, l))=FALSE doClose(zm,fp) - lprintf(zm,ZM_LOG_ERR,'Failed to request CRC of remote file') + lprintf(zm,LOG_ERROR,'Failed to request CRC of remote file') brk:=TRUE JUMP zreccont1 ENDIF StringF(tempstr,'Calculating CRC of: \s', fpath) - lprintf(zm,ZM_LOG_NOTICE,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) crc:=fcrc32(zm,fp,l) /* Warning: 4GB limit! */ doClose(zm,fp) StringF(tempstr,'CRC of \s (\d bytes): \h[8]',fpath, l, crc) - lprintf(zm,ZM_LOG_INFO,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) StringF(tempstr,'Waiting for CRC of remote file: \s', zm.current_file_name) - lprintf(zm,ZM_LOG_NOTICE,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) IF(zmodem_recv_crc(zm,{rcrc}))=FALSE - lprintf(zm,ZM_LOG_ERR,'Failed to get CRC of remote file') + lprintf(zm,LOG_ERROR,'Failed to get CRC of remote file') ->brk:=TRUE ->JUMP zreccont1 rcrc:=crc ENDIF IF(crc<>rcrc) StringF(tempstr,'Remote file has different CRC value: \h[8]', rcrc) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) p:=zm.zm_duplicate_filename IF(p) IF(p()) @@ -2649,12 +2642,12 @@ EXPORT PROC zmodem_recv_files(zm: PTR TO zmodem_t, download_dir:PTR TO CHAR,byte JUMP zreccont1 ENDIF IF(l=bytes) - lprintf(zm,ZM_LOG_INFO,'CRC, length, and filename match.') + lprintf(zm,LOG_DEBUG,'CRC, length, and filename match.') brk:=TRUE JUMP zreccont1 ENDIF StringF(tempstr,'Resuming download of \s',fpath) - lprintf(zm,ZM_LOG_INFO,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) ENDIF t1,t2:=getZmSystemTime() @@ -2663,7 +2656,7 @@ EXPORT PROC zmodem_recv_files(zm: PTR TO zmodem_t, download_dir:PTR TO CHAR,byte IF((fp:=doOpen(zm,fpath,MODE_READWRITE)))=NIL StringF(tempstr,'Error \d opening/creating/appending \s',IoErr(),fpath) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) brk:=TRUE JUMP zreccont1 ENDIF @@ -2673,7 +2666,7 @@ EXPORT PROC zmodem_recv_files(zm: PTR TO zmodem_t, download_dir:PTR TO CHAR,byte doClose(zm,fp) StringF(tempstr,'Invalid file length \d: \s', start_bytes, fpath) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) brk:=TRUE JUMP zreccont1 ENDIF @@ -2692,15 +2685,15 @@ EXPORT PROC zmodem_recv_files(zm: PTR TO zmodem_t, download_dir:PTR TO CHAR,byte IF(errors AND (l=0)) /* aborted/failed download */ IF(DeleteFile(fpath)) /* don't save 0-byte file */ StringF(tempstr,'Error \d removing \s',IoErr(),fpath) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) ELSE StringF(tempstr,'Deleted 0-byte file \s',fpath) - lprintf(zm,ZM_LOG_INFO,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) ENDIF ELSE IF(lNIL) THEN bytes_received[]:=bytes_received[]+b upload_completed(zm,fpath,l) @@ -2728,7 +2721,7 @@ zreccont1: UNTIL (loop=FALSE) OR (brk=TRUE) /* finally */ IF(skip) - lprintf(zm,ZM_LOG_DEBUG,'Skipping file') + lprintf(zm,LOG_DEBUG,'Skipping file') zmodem_send_zskip(zm) ENDIF zm.current_file_num:=zm.current_file_num+1 @@ -2751,20 +2744,20 @@ PROC zmodem_recv_init(zm: PTR TO zmodem_t) DEF tempstr[255]:STRING DEF tempstr2[255]:STRING - ->lprintf(zm,ZM_LOG_DEBUG,'recv_init') + ->lprintf(zm,LOG_DEBUG,'recv_init') ->#if 0 -> while(is_connected(zm) && !is_cancelled(zm) && (ch=zm.recv_byte(zm,0))!=NOINP) --> lprintf(zm,ZM_LOG_DEBUG,"Throwing out received: %s",chr((uchar)ch)) +-> lprintf(zm,LOG_DEBUG,"Throwing out received: %s",chr((uchar)ch)) ->#endif errors:=0 WHILE ((errors<=zm.max_errors) AND (is_cancelled(zm)=FALSE) AND (is_connected(zm))) IF(errors) StringF(tempstr,'Sending ZRINIT (\d of \d)',errors+1, zm.max_errors+1) - lprintf(zm,ZM_LOG_NOTICE,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) ELSE - lprintf(zm,ZM_LOG_INFO,'Sending ZRINIT') + lprintf(zm,LOG_DEBUG,'Sending ZRINIT') ENDIF zmodem_send_zrinit(zm) @@ -2779,7 +2772,7 @@ PROC zmodem_recv_init(zm: PTR TO zmodem_t) chr(type,tempstr) StringF(tempstr2,'recv_init: Received \s',tempstr) - lprintf(zm,ZM_LOG_DEBUG,tempstr2) + lprintf(zm,LOG_DEBUG,tempstr2) IF(type=ZFILE) zmodem_parse_zfile_subpacket(zm) @@ -2793,9 +2786,9 @@ PROC zmodem_recv_init(zm: PTR TO zmodem_t) frame_desc(type,tempstr) StringF(tempstr2,'recv_init: Received \s instead of ZFILE or ZFIN',tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) StringF(tempstr,'ZF0=\h[2] ZF1=\h[2] ZF2=\h[2] ZF3=\h[2]',zm.rxd_header[ZF0],zm.rxd_header[ZF1],zm.rxd_header[ZF2],zm.rxd_header[ZF3]) - lprintf(zm,ZM_LOG_DEBUG,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) errors++ zmicont1: @@ -2818,7 +2811,7 @@ PROC zmodem_parse_zfile_subpacket(zm: PTR TO zmodem_t) zm.current_file_size:=0 zm.current_file_time:=0 zm.files_remaining:=0 - zm.bytes_remaining:=0 + convertToBCD(0,zm.bytes_remaining) /* i=sscanf((char*)zm.rx_data_subpacket+strlen((char*)zm.rx_data_subpacket)+1,"%"SCNd64" %lo %o %lo %u %"SCNd64 ,&zm.current_file_size /* file size (decimal) */ @@ -2842,20 +2835,20 @@ PROC zmodem_parse_zfile_subpacket(zm: PTR TO zmodem_t) zm.files_remaining:=tmp s:=s+r tmp,r:=Val(s) - zm.bytes_remaining:=tmp + convertToBCD(tmp,zm.bytes_remaining) zm.current_file_time:=tmptime StringF(tempstr,'Zmodem file (ZFILE) data (\d fields): \d',i, zm.rx_data_subpacket+StrLen(zm.rx_data_subpacket)+1) - lprintf(zm,ZM_LOG_DEBUG,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) IF(zm.files_remaining)=FALSE THEN zm.files_remaining:=1 - IF(zm.bytes_remaining)=FALSE THEN zm.bytes_remaining:= zm.current_file_size + IF(convertFromBCD(zm.bytes_remaining)=0) THEN convertToBCD(zm.current_file_size,zm.bytes_remaining) IF(zm.total_files)=FALSE THEN zm.total_files:=zm.files_remaining - IF(zm.total_bytes)=FALSE THEN zm.total_bytes:=zm.bytes_remaining + IF(convertFromBCD(zm.total_bytes))=0 THEN CopyMem(zm.bytes_remaining,zm.total_bytes,8) ENDPROC /* @@ -2875,7 +2868,7 @@ PROC zmodem_recv_file_data(zm: PTR TO zmodem_t, fp, offset) IF(doSeek(zm,fp,offset,OFFSET_BEGINNING))<0 StringF(tempstr,'ERROR \d seeking to file offset \d',IoErr(), offset) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) zmodem_send_pos_header(zm, ZFERR, offset, /* Hex? */ TRUE) RETURN 1 /* errors */ ENDIF @@ -2900,7 +2893,7 @@ PROC zmodem_recv_file_data(zm: PTR TO zmodem_t, fp, offset) IF((zm.max_file_size<>0) AND (pos >= zm.max_file_size)) StringF(tempstr,'Specified maximum file size (\d bytes) reached at offset \d',zm.max_file_size, pos) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) zmodem_send_pos_header(zm, ZFERR, pos, /* Hex? */ TRUE) brk:=TRUE @@ -2916,12 +2909,12 @@ PROC zmodem_recv_file_data(zm: PTR TO zmodem_t, fp, offset) IF(type=ENDOFFRAME) StringF(tempstr,'Received complete frame at offset: \d', pos) - lprintf(zm,ZM_LOG_DEBUG,tempstr) + lprintf(zm,LOG_DEBUG,tempstr) ELSE IF((type>0) AND (zm.local_abort=FALSE)) chr(type,tempstr) StringF(tempstr2,'Received \s at offset: \d', tempstr, pos) - lprintf(zm,ZM_LOG_DEBUG,tempstr2) + lprintf(zm,LOG_DEBUG,tempstr2) ENDIF errors++ ENDIF @@ -2966,7 +2959,7 @@ PROC zmodem_recv_file_frame(zm: PTR TO zmodem_t, fp,pos:PTR TO LONG) IF(zm.rxd_header_pos=pos[]) THEN RETURN type StringF(tempstr,'Ignoring ZEOF as all bytes (\d) have not been received',zm.rxd_header_pos) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) JUMP recframecont ELSEIF (type=ZFIN) OR (type=TIMEOUT) RETURN type @@ -2977,31 +2970,31 @@ PROC zmodem_recv_file_frame(zm: PTR TO zmodem_t, fp,pos:PTR TO LONG) frame_desc(type,tempstr) StringF(tempstr2,'Received \s instead of ZDATA frame', tempstr) - lprintf(zm,ZM_LOG_WARNING,tempstr2) + lprintf(zm,LOG_WARN,tempstr2) recframecont: attempt++ ENDLOOP - lprintf(zm,ZM_LOG_WARNING,'received ZDATA frame') + lprintf(zm,LOG_DEBUG,'received ZDATA frame') IF(zm.rxd_header_pos<>pos[]) StringF(tempstr,'Received wrong ZDATA frame (\d vs \d)"',zm.rxd_header_pos, pos[]) - lprintf(zm,ZM_LOG_WARNING,tempstr) + lprintf(zm,LOG_WARN,tempstr) RETURN FALSE ENDIF REPEAT - ->lprintf(zm,ZM_LOG_DEBUG,'recv_file_frame zmodem_recv_data') + ->lprintf(zm,LOG_DEBUG,'recv_file_frame zmodem_recv_data') type:=zmodem_recv_data(zm,zm.rx_data_subpacket,RXSUBPACKETSIZE,{n},TRUE) - ->lprintf(zm,ZM_LOG_DEBUG,'recv_file_frame zmodem_recv_data complete') + ->lprintf(zm,LOG_DEBUG,'recv_file_frame zmodem_recv_data complete') /* fprintf(stderr,"packet len %d type %d\n",n,type) */ IF ((type = ENDOFFRAME) OR (type = FRAMEOK)) IF(doWrite(zm,fp,zm.rx_data_subpacket,n)<>n) StringF(tempstr,'ERROR \d writing \d bytes at file offset \d',IoErr(), n,pos[]) - lprintf(zm,ZM_LOG_ERR,tempstr) + lprintf(zm,LOG_ERROR,tempstr) zmodem_send_pos_header(zm, ZFERR, pos[], /* Hex? */ TRUE) RETURN FALSE ENDIF @@ -3016,7 +3009,7 @@ recframecont: IF(is_cancelled(zm)) THEN RETURN ZCAN UNTIL type<>FRAMEOK - lprintf(zm,ZM_LOG_DEBUG,'recv_file_frame complete') + lprintf(zm,LOG_DEBUG,'recv_file_frame complete') ENDPROC type EXPORT PROC zmodem_init(zm: PTR TO zmodem_t, cbdata: PTR TO CHAR, @@ -3093,21 +3086,13 @@ EXPORT PROC zmodem_cleanup(zm: PTR TO zmodem_t) Dispose(zm.sendBuffer) ENDPROC -PROC doDownloadCompleted(zm:PTR TO zmodem_t,fname,size) - DEF p - p:=zm.zm_download_completed - IF p<>NIL - RETURN p(size) - ENDIF -ENDPROC - PROC doOpen(zm:PTR TO zmodem_t,fname,mode) DEF p p:=zm.zm_fopen IF p<>NIL RETURN p(fname,mode) ENDIF - lprintf(zm,ZM_LOG_WARNING,'zm_fopen not set, defaulting to dos library Open') + lprintf(zm,LOG_WARN,'zm_fopen not set, defaulting to dos library Open') ENDPROC Open(fname,mode) PROC doClose(zm:PTR TO zmodem_t,fhandle) @@ -3116,7 +3101,7 @@ PROC doClose(zm:PTR TO zmodem_t,fhandle) IF p<>NIL RETURN p(fhandle) ENDIF - lprintf(zm,ZM_LOG_WARNING,'zm_fclose not set, defaulting to dos library Close') + lprintf(zm,LOG_WARN,'zm_fclose not set, defaulting to dos library Close') ENDPROC Close(fhandle) PROC doSeek(zm:PTR TO zmodem_t,fhandle,pos,origin) @@ -3125,7 +3110,7 @@ PROC doSeek(zm:PTR TO zmodem_t,fhandle,pos,origin) IF p<>NIL RETURN p(fhandle,pos,origin) ENDIF - lprintf(zm,ZM_LOG_WARNING,'zm_fseek not set, defaulting to dos library Seek') + lprintf(zm,LOG_WARN,'zm_fseek not set, defaulting to dos library Seek') ENDPROC Seek(fhandle,pos,origin) PROC doRead(zm:PTR TO zmodem_t,fhandle,buffer,length) @@ -3134,7 +3119,7 @@ PROC doRead(zm:PTR TO zmodem_t,fhandle,buffer,length) IF p<>NIL RETURN p(fhandle,buffer,length) ENDIF - ->lprintf(zm,ZM_LOG_WARNING,'zm_fread not set, defaulting to dos library FRead') + ->lprintf(zm,LOG_WARN,'zm_fread not set, defaulting to dos library FRead') ENDPROC Fread(fhandle,buffer,1,length) PROC doWrite(zm:PTR TO zmodem_t,fhandle,buffer,length) @@ -3143,7 +3128,7 @@ PROC doWrite(zm:PTR TO zmodem_t,fhandle,buffer,length) IF p<>NIL RETURN p(fhandle,buffer,length) ENDIF - ->lprintf(zm,ZM_LOG_WARNING,'zm_fwrite not set, defaulting to dos library FWrite') + ->lprintf(zm,LOG_WARN,'zm_fwrite not set, defaulting to dos library FWrite') ENDPROC Fwrite(fhandle,buffer,1,length) crc16tbl: INT $0000, $1021, $2042, $3063, $4084, $50A5, $60C6, $70E7,