\include{system.htc} \include{tree.htc} \include{layout.htc} \include{upload.htc} \include{posit.htc} \const{server}{http://\HOST\if(\port!=80){:\port}} \const{server.alias}(\HOST left ".") \const{server.admin}{\ADMIN} % % Some special stuff % \def{setcookie}{xx?}{ \resp.cookie{\1}{\2}{ % domain=\HOST\; path=/\if(\0){; expires=\time2http{\0}} % the domain spec above does not work on modern browsers such as firefox % if host is not a fully qualified dns name path=/\if(\0){; expires=\time2http{\0}} } } \def{redirect}{x}{ \if(\req.version gt "HTTP/1.0"){ \resp.status{\HTTP.303} }{ \resp.status{\HTTP.302} } \if(\1 cnt ":"){ \resp.location{\1} }{ \resp.location{\server\1} } } \def{onget}{r}{ \if("GET HEAD" which \req.method){ \1 } } \def{onpost}{r}{ \if(\req.method eq "POST"){ \1 } } % % Cookie allowance % \def{cookie.allow}{x}{ [ok:=1;name:=first \1;val:=rest \1]; \if(name ne ""){ [ok=0]; \for(i:=0)(i<\ncookie)(i+=1){ \if(\cookie[i].name eq name && \cookie[i].val eq val)(ok=1); } }; [ok] } % % CRONTAB % \cron(211){\sync} \cron(120){\tree.update} \cron(300){\tempfile.update}