#!D:/Users/AndreasM/aucblogo/aucblogo_client.exe setCaseIgnored false be cgitest5 bury [cgitest5 cgiproc cgi cgi5call] tmp=runSecure security_connect [cgiproc] output tmp be cgiproc local [out err result] buryname "out catch "error [ out=(Word "|Content-type: Text/html; charset=iso-8859-1 |) changeDir "|D:/Users/AndreasM/aucblogo| result=cgi "|D:/Apache2.2/htdocs/| &out ; closeall if result=="reset [reset] (GC true) ] err=error if not emptyP err [ out=(Word out first butFirst err "\ in\ first bF bF err "\( first bF bF bF bF err "|)
|) ] print Nodes output out end be cgi dname &out local [ err errout request_method query_string content_length query_length maxArgs argCount name value start_name start_value end_value end_name namename i gr ch1 ch2 %run %action %animate %stop %reset %commands %console %history %framenr %errout %time %username %lastusername %lastlastusername %splitter1 %splitter12 %splitter2 %splitter22 %splitter23 docommands fname graphhtml graphhtmlpath consolehtml consolehtmlpath outputhtml framename framepath txt o memsize oldmemsize maxmem minmem ] maxmem=10*1000*1000 minmem=10*1000 %username="guest %lastusername=" %lastlastusername=" %splitter1="50% %splitter12="50% %splitter2="50% %splitter22="40% %splitter23="10% %commands=" %console=" %history=" %action=" %errout=" request_method=getEnv "REQUEST_METHOD query_string =getEnv "QUERY_STRING content_length=getEnv "CONTENT_LENGTH ;request_method="GET ;query_string ="|heading=10&time=1234| ;content_length=getenv "CONTENT_LENGTH ;print query_string if (empty? request_method) or2 empty? query_string [ goTo "nix ] query_length=0 if request_method==" [output []] if request_method=="|GET| or2 request_method=="|POST| [ if query_string==" [output []] ; ifElse content_length==" ; [ query_length=count query_string ; ][ query_length=Int content_length ; ] ] ;pr query_length ;pr count query_string ; if request_method=="POST ; [ if content_length==0 [output []] ; query_length=Int content_length ; setReader "stdin ; query_string=readRawLine ; setReader [] ; ] maxArgs=20 name=Array maxArgs value=Array maxArgs for [i 1 maxArgs 1] [ name.i=[] value.i=[] ] end_value=0 argCount=1 ;pause while [end_value < query_length] [ start_name=end_value+1 end_name=start_name while [and [end_name<=query_length][query_string.end_name !="|=|]] [ end_name=end_name+1 ] name.argCount=Items start_name end_name-1 query_string name.argCount=decode_string name.argCount start_value=end_name+1 end_value=start_value while [end_value 0 [ for [i 1 argCount 1] [ if not empty? name.i [ namename=Word "% name.i make namename value.i bury namelist namename ] ] ] tag "nix if not name? "%reset [%reset="] if not name? "%animate [%animate="] if not name? "%stop [%stop="] if not Name? "graphs [ graphs=Table 31 frames=Table 31 commands=Table 31 historys=Table 31 memsizes=Table 31 users= [ guest andreas stefan swirke christian robert clem pavel brian david michael gerhard ] bury [[][users commands historys memsizes]] ] if not Member? %username users [ %username="guest ] if empty? graphs.%username [ frames.%username=Frame [] %username wxdefault_frame_style [0 0][400 300] graphs.%username=Graph frames.%username FrameSetClientSize frames.%username 400 300 FrameIconize frames.%username true memsizes.%username=maxmem ] ifelse Name? "%commands [ ifelse %username == %lastusername [ commands.%username=%commands historys.%username=%history ][ if not empty? commands.%username [ %commands=commands.%username %history=historys.%username ] (pr %lastlastusername %lastusername %username) %lastlastusername=%lastusername %lastusername=%username ] ][ %commands=commands.%username if %commands==[] [%commands=" ] %history=historys.%username if %history==[] [%history=" ] ] ; fname=BitAnd butFirst genSym 63 GraphSetCurrent graphs.%username fname=%username local [txtname] outputhtml=Word %username "|.output.html| txtname=(Word dname outputhtml) ifElse name? "%framenr [::framenr=%framenr][%framenr=0 ::framenr=0] if not Number? ::framenr [pr ::framenr ::framenr=0] ::singleshot=Name? "::framenr ifElse %reset !="reset [ ifelse %action=="console [ docommands=%console ][ docommands=%commands ] (type "\; %username ":\ docommands "\ ) logname=Word dname "cgitest5.txt openAppend logname setWriter logname (print (Word "\; %username ":\ docommands)) setWriter [] close logname ; %commands=strip_html %commands ;(type "B %commands "Y) if Member? txtname allopen [ close txtname ] openWrite txtname setWriter txtname type "
			setCaseIgnored true
			oldmemsize=Nodes.3
			cgi5call docommands %username memsizes.%username oldmemsize framenr
			memsizes.%username=memsizes.%username-Nodes.3+oldmemsize
			if memsizes.%username < minmem
			[	memsizes.%username=minmem
			]
			if memsizes.%username > maxmem
			[	memsizes.%username=maxmem
			]
			setCaseIgnored false
			changeDir "|D:/Users/AndreasM/aucblogo|
			err=error
			ifElse not emptyP err
			[	errout=(Word "|
			
				| 
					first butFirst err 
					"\ in\  first bF bF err
					"\( first bF bF bF bF err "\)
"|
|) ][ errout=" ] type "
setWriter [] close txtname ][ errout=" ] setSaveSize [400 300] saveScreen (Word dname fname "|.png|) ; openRead (Word dname fname "|.png|) ; close (Word dname fname "|.png|) GraphSetCurrent [] graphhtml=(Word %username "|.graph.html|) graphhtmlpath=(Word dname graphhtml) openWrite graphhtmlpath setWriter graphhtmlpath (type "|
|) setWriter [] close graphhtmlpath consolehtml=(Word %username "|.console.html|) consolehtmlpath=(Word dname consolehtml) openWrite consolehtmlpath setWriter consolehtmlpath (type "|
|) setWriter [] close consolehtmlpath txt=" if File? txtname [ openRead txtname setReader txtname txt=readChars FileSize txtname setReader [] close txtname eraseFile txtname ] ; This is process number | GetProcessId "|. ;
|) o=(Word "| | errout) ; if name? "argCount ; [ for [i 1 argCount] ; [ o=(word o name.i "|=| value.i "\ ) ; ] ; ] ; o=word o getEnvTable o=(Word o "|
|) ifElse %animate=="animate and2 %stop !="stop [ o=(Word o "| | ; "| | "| | "| |) ][ o=(Word o "| | ; "| | "| |) ] o=(Word o "| |) o=(Word o Int memsizes.%username/1000 "|KB| "|
|) framename=(Word %username ".html) framepath=Word dname framename openWrite framepath setWriter framepath type o setWriter [] close framepath out=(Word out "| |) ; updateVars if %reset=="reset [output "reset] output [] end be decode_string str ; local [length outpos ch1 ch2 n] length=count str outpos=1 for [i 1 length 1] [ ifElse str.i == "|&| [; str.outpos="| | ; outpos=outpos+1 ][ ifElse str.i == "% [ i=i+1 ch1=upperCase str.i i=i+1 ch2=upperCase str.i n=toInt Word ch1 ch2 16 if n != 10 [ str.outpos=Char n outpos=outpos+1 ] ][ str.outpos=str.i outpos=outpos+1 ] ] ] output Items 1 outpos-1 str end be strip_html in inmax=count in inp=1 outp=1 while [inp <= inmax] [ ifelse in.inp=="< [ ifelse and [inp+5<=inmax][(items inp inp+5 in)=="|
|] [ in.outp=Char 13 inp=inp+6 outp=outp+1 ][ ifelse and [inp+3<=inmax][(items inp inp+3 in)=="|

|] [ in.outp=Char 13 inp=inp+4 outp=outp+1 ][ while [and [inp <=inmax][in.inp != ">]] [ inp=inp+1 ] inp=inp+1 ]] ][ ifelse in.inp=="& [ ifelse and [inp+5<=inmax][(items inp inp+5 in)==" \;] [ inp=inp+6 in.outp="\ outp=outp+1 ][ ifelse and [inp+5<=inmax][(items inp inp+5 in)==""\;] [ inp=inp+6 in.outp="" outp=outp+1 ][ inp=inp+1 ]] ][ ifelse (or (in.inp==char 13) (and in.inp=="\ [inp+6<=inmax][(items inp+1 inp+6 in)=="|
|]) (and in.inp=="\ inp+1>inmax)) [ inp=inp+1 ][ in.outp=in.inp inp=inp+1 outp=outp+1 ]]] ] output items 1 outp-1 in end be test_strip foreach strip_html "|ac
d e| [ (pr ? ascii ?) ] s=strip_html "|to p1
   pr 5
end
p1| pr s foreach s [ (pr ? ascii ?) ] end end ;cgitest5 be reset setCaseIgnored false ; foreach allopen [close ?] clearShadows setUpdateGraph true setPenColor 0 setScreenColor 7 setFloodColor 0 setPenSize [1 1] disableCylinderLines disableTexture enableLineSmooth setDepthFunc 1 setLabelFont [Times] setLabelAlign 0 0 showTurtle PenDown setLightAmbient RGB 0.1 0.1 0.1 setLightDiffuse RGB 1 1 1 unperspective clearScreen refresh wrap insertMode notFullScreen deleteTextures (GC true) erase remove "cgitest5 remove "cgitest5::cgiproc remove "cgitest5::cgi remove "cgitest5::reset Procedures erase remove "cgitest5::cgiproc::out Names ; erase (List [] [] ; remove "cgitest5 ; remove "cgitest5::cgiproc ; remove "cgitest5::cgi ; first bF bF Tables) ; erase buried (GC true) end to cgi5call docommands username memsize oldmemsize framenr catch "error [ (runSecure security_dlcall +security_iodll +security_shell +security_filewrite ;+security_fileread ;+security_dirs +security_thread ;+security_keyboard +security_gui ;+security_erase +security_buried +security_namespace docommands 1024 ;stack size (in bytes) 1000000 ;graphic record size (in graphic primitives) memsize+oldmemsize ;memory size (in bytes) 65536 ;max. number of nodes 7000 ;timeout (in milliseconds) username [username memsize framenr] ; ^-- get pushed on the varStack in Namespace username ) ] end