From f83cc90e1ac9f252dcc36d833505ab5e00ae8e74 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Fri, 18 May 2012 10:16:04 +0200 Subject: Adding the old test user Signed-off-by: Henrik Rydberg --- user/HTC/admin.htc | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++ user/HTC/index.htc | 60 +++++++++++++++++++++ user/HTC/lang.htc | 33 ++++++++++++ user/HTC/prefs.htc | 55 ++++++++++++++++++++ user/HTC/reguser.htc | 91 ++++++++++++++++++++++++++++++++ 5 files changed, 382 insertions(+) create mode 100644 user/HTC/admin.htc create mode 100644 user/HTC/index.htc create mode 100644 user/HTC/lang.htc create mode 100644 user/HTC/prefs.htc create mode 100644 user/HTC/reguser.htc (limited to 'user/HTC') diff --git a/user/HTC/admin.htc b/user/HTC/admin.htc new file mode 100644 index 0000000..c1369e9 --- /dev/null +++ b/user/HTC/admin.htc @@ -0,0 +1,143 @@ +\clearance{ADM} +\on.clear{SYS} +{\cond{T.group}{\user.group}\cond{T.group2}{\user.group}} +{\const{T.group}{\user.group}\const{T.group2}{\user.group}} +\cond{T.ID}{0} +\cond{T.EDIT}{0} +\cond{T.email}{} +\cond{T.name}{} +\cond{T.cmd}{} +\ldef{uclear}{x}{\forall{ii}{\1}{[ii left ":"] }} +\page{ + \db{USERS}{ + [groups:=\getgroups]; + [users:=\query{\allowed{\T.group}}{[UID] }]; + \find.rec{\T.ID}{ + [this:=users which \T.ID]; + \if(this>1){\href{\this?ID=[users nth (this-1)]}{Prev}|}; + \href{\this}{List}; + \if(this + \table{ + \tr{ + \td{width=10%}{\bf{ID}} + \td{width=10%}{\bf{Alias}} + \td{width=40%}{\bf{Name}} + \td{width=10%}{\bf{GROUP}} + \td{width=30%}{\bf{CLEAR}} + } + \db{USERS}{ + \query{\allowed{\T.group}}{ + \tr{ + \td{\href{\req.uri?ID=[UID]}(UID)}; + \td{\href{\req.uri?ID=[UID]&EDIT=1}(ALIAS)}; + \td(NAME); + \td(GROUP); + \td{\uclear(ACCESS)} + } + } + } + } + } + } +} +\onpost{ + \switch(first \T.cmd) + {++}{ + \log{addclear \T.group2 for \T.ID}; + \su{\T.ID}{\user.access.add{\T.group2}\user.update}; + \redirect{\this?ID=\T.ID} + } + {+}{ + \log{addclear \T.group for \T.ID}; + \su{\T.ID}{\user.access.add{\T.group}\user.update}; + \redirect{\this?ID=\T.ID} + } + {-}{ + \log{remclear \T.group for \T.ID}; + \su{\T.ID}{\user.access.rem{\T.group}\user.update}; + \redirect{\this?ID=\T.ID} + } + {=}{ + \log{set group \T.group for \T.ID}; + \on.clear{ROOT}{\su{\T.ID}{\user.group.set{\T.group}\user.update}} + \redirect{\this?ID=\T.ID} + } + {Update}{ + \log{update name for \T.ID}; + \su{\T.ID}{ + \user.name.set{\T.name}; + \user.alias.set{\T.alias}; + \user.emails.set{\T.email}; + \user.update; + } + \redirect{\this?ID=\T.ID} + } + {Select}{ + \on.clear{SYS}{\user.group.set{\T.group}\user.update} + \redirect{\referer} + } + {DELETE}{ + \log{DELETE \T.ID}; + \on.clear{ROOT}{\remuser{\T.ID}}; + \redirect{\referer} + } + { + [uid:=\getuser{\T.email}]; + \log{add \T.group to [uid]}; + \su(uid){\user.access.add{\T.group}\user.update}; + \redirect{\this?ID=[uid]} + } +} diff --git a/user/HTC/index.htc b/user/HTC/index.htc new file mode 100644 index 0000000..85e9d70 --- /dev/null +++ b/user/HTC/index.htc @@ -0,0 +1,60 @@ +\clearance{} +\cache{\days{7}} +\page{ + \h1{HTC - A Hypertext Compiler/Interpreter} + \h3{Henrik Rydberg (Copyright 1998--2001)} + + \bf{HTC} is a small, server based, LaTeX-like language, + which is used to efficiently create WWW applications. + Among the more useful features are: + \ul{ + \li{ + \bf{Access control} - HTC uses a cookie-based authorization + mechanism to manage users in a highly transparent way. + } + \li{ + \bf{Database management} - Built in to the language are tools + for managing databases. + } + \li{ + \bf{Language control} - HTC handles multiple languages, controllable + by standard browser preferences or cookies. + } + \li{ + \bf{Math support} - Due to the built-in LaTeX language, HTC can + display simple equations directly in HTML, and has a high + degree of transferability to any future standard (such as MathML). + } + \li{ + \bf{Static/dynamic switching} - HTC can be used to create static + mirrors, which increase download performance. + } + \li{ + \bf{No frames} - HTC keeps track of the link tree, so that + quick access can be made without using frames, and hence + suitable also for text-based browsers. + } + } + + \bf{HTC} is a completely stand-alone \bf{CGI} program written in C++, + making heavy use of \bf{STL}; (Standard template library), + and using a simple database manager, written the same way. + The language interpreter is designed to resemble \bf{LaTeX}, + and to run quickly. For more information, + send me a \href{mailto: \ADMIN}{mail}. /h + +

Examples

+

+ If you want to see a sample of what can be + done with it, check the sites listed below. + \ul{ + \li{\href{http://fy.chalmers.se/ap/}{Applied Physics}} + \li{\href{http://fy.chalmers.se/ap/mst/}{Materials Theory}} + \li{\href{http://stern.fy.chalmers.se:2001/}{Student server}} + \li{\href{http://fy.chalmers.se/mtrl/}{Materialia}} + \li{\href{http://coulomb.fy.chalmers.se:5555/}{H. Rydberg}} + \li{\href{http://fy.chalmers.se/atomics/}{Atomics}} + } + To learn more about the language, look for the + icons \image{\icons/htc.gif} and \image{\icons/source.gif}. +} diff --git a/user/HTC/lang.htc b/user/HTC/lang.htc new file mode 100644 index 0000000..28e93fc --- /dev/null +++ b/user/HTC/lang.htc @@ -0,0 +1,33 @@ +\clearance{} +\const{cmd.def}{Browser default} +\const{cmd.sv}{Svenska} +\const{cmd.en}{English} +\page{ + \h1{\lang{Language control}{Spr{\aa}kv{\"a}ljare}} + [lang:="browser default";]; + \for(i:=0)(i<\ncookie)(i+=1){\if(\cookie[i].name eq "LANG")(lang=\cookie[i].val;)} +

+ \lang{Setting:}{Inst{\"a}llning:} \[[lang]\] +

+ \lang{ + If you're using a browser in which you can specify what language(s) + you prefer, you don't need to use this page. + }{ + Om du anv{\"a}nder en webbl{\"a}sare i vilken du sj{\"a}lv + kan v{\"a}lja spr{\aa}k, beh{\"o}ver + du inte anv{\"a}nda den h{\"a}r sidan. + } +

+ \form{ + \button{\cmd.def} + \button{\cmd.sv} + \button{\cmd.en} + } +} +\onpost{ + \switch{\T.cmd} + {\cmd.def}{\setcookie{LANG}{deleted}{1}} + {\cmd.en}{\setcookie{LANG}{en}} + {\cmd.sv}{\setcookie{LANG}{sv}} + \redirect{\referer} +} diff --git a/user/HTC/prefs.htc b/user/HTC/prefs.htc new file mode 100644 index 0000000..c2522e0 --- /dev/null +++ b/user/HTC/prefs.htc @@ -0,0 +1,55 @@ +\clearance{HTC} +\setgroup{\user.group} +\page{ + \db{PREFS}{ + [s.ID:=\user.id;@<-s.]; + \h1{\lang{Preferences}{Inst{\"a}llningar} \time2htc(LASTMOD)} + \form{ + \variable{w.ID}{\user.id}; + \table{bgcolor=#dddddd}{ + \tr{ + \td{align=right}{UID:}\td{\user.id} + \td{align=right}{Alias:}\td{\user.alias} + } + \tr{ + \td{align=right}{Name:} + \td{colspan=3}{\input{NAME}{40}{\user.name}} + } + \tr{ + \td{align=right}{E-mail:} + \td{colspan=3}{\user.emails} + } + \tr{ + \td{align=right}{URL:} + \td{colspan=3}{\input{w.URL}{40}(URL)} + } + \tr{ + \td{align=right}{Group:}\td{\group} + \td{align=right}{Clearance:}\td{\user.clear} + } + %\tr{\td{align=right}{PIN:}\td{\user.pin}} + \tr{ + \td{align=right}{Position:}\td{colspan=3}{\select.posit{w.POSIT}(POSIT)} + } + \tr{ + \td{align=right}{Phone:}\td{\input{w.EXT}{10}(EXT)} + \td{align=right}{Room:}\td{\input{w.ROOM}{10}(ROOM)} + } + \tr{ + \td{align=right}{Note:}\td{colspan=3}{\input{w.NOTE}{60}(NOTE)} + } + } + \h3{Abstract} + \text{w.ABSTRACT}{4}{70}(ABSTRACT) +

+ \button{Update} + } + } +} +\onpost{ + \log{updating prefs}; + \db{PREFS}{\import{@}{T.w.}[LASTMOD=\now]}; + \user.name.set{\T.NAME}; + \user.update; + \redirect{\referer} +} diff --git a/user/HTC/reguser.htc b/user/HTC/reguser.htc new file mode 100644 index 0000000..0a5835c --- /dev/null +++ b/user/HTC/reguser.htc @@ -0,0 +1,91 @@ +\clearance{ADM} +\alias{RegUser} +\setgroup{\user.group} +\const{CLEARLIST}{\user.group HTC} +\page{ + \title{Register User as \group} + + \switch{\T.RES} + {BEM}{ + \font{color=red}{Bad email.} + } + {USEX}{ + \font{color=red}{User already exist.} + } + {ERR}{ + \font{color=red}{An error occured - user not added.} + } + +

+ \bf{NOTE:} Remember to use \bf{valid, fully qualified e-mail addresses!}. + Local network aliases will be added if applicable. + If you manage multiple groups, make sure you add this person with + the correct clearance! +

+ A welcome message will be sent to the new user. + + \form{\uri}{ + \table{bgcolor=#dddddd}{ + \tr{ + \td{align=right}{E-mail:} + \td{colspan=3}{\input{EMAIL}{46}} + } + \tr{ + \td{align=right}{Name:} + \td{colspan=3}{\input{NAME}{46}} + } + \tr{ + \td{align=right}{URL:} + \td{colspan=3}{\input{w.URL}{46}} + } + \tr{ + \td{align=right}{Group:}\td{\group} + \td{align=right}{Clearance:}\td{\CLEARLIST} + } + \tr{ + \td{align=right}{Position:}\td{colspan=3}{\select.posit{w.POSIT}{Temp}} + } + \tr{ + \td{align=right}{Phone:}\td{\input{w.EXT}{10}} + \td{align=right}{Room:}\td{\input{w.ROOM}{10}} + } + \tr{ + \td{align=right}{Note:}\td{colspan=3}{\input{w.NOTE}{46}} + } + } +

+ \button{Register this User} + } +} +\onpost{ + \if(\T.EMAIL cnt "@" && \T.EMAIL cnt "."){ + \if{\getuser{\T.EMAIL}}{ + \redirect{\this?RES=USEX} + }{ + \su{\newuser{\CLEARLIST}{\T.EMAIL}{\T.NAME}}{ + \const{T.w.ID}{\user.id}; + \db{PREFS}{\import{@}{T.w.}[LASTMOD=\now]} + \mail.user{Registration at \server.alias}{ + \user.name, welcome to the \server.alias server at + + \server/ + + Your alias is: \user.alias + Your PIN-code is: \user.pin + + Please take a minute or two to go through the pages + and familiarize yourself with the login/logout procedure. + + \server/LOGIN/?alias=\user.alias + + /Admin + } + \redirect{\pwd/admin.htc?ID=\user.id} + }{ + \redirect{\this?RES=ERR} + } + } + }{ + \redirect{\this?RES=BEM} + } +} -- cgit v1.2.3