summaryrefslogtreecommitdiff
path: root/user/HTC
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2012-05-18 10:16:04 +0200
committerHenrik Rydberg <rydberg@euromail.se>2012-05-18 10:18:23 +0200
commitf83cc90e1ac9f252dcc36d833505ab5e00ae8e74 (patch)
tree799475b6a878895d597496092c62befcb3dc8234 /user/HTC
parentefe1dd9bf92efbf6ab74f7323c39348b5efae4ce (diff)
Adding the old test user
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'user/HTC')
-rw-r--r--user/HTC/admin.htc143
-rw-r--r--user/HTC/index.htc60
-rw-r--r--user/HTC/lang.htc33
-rw-r--r--user/HTC/prefs.htc55
-rw-r--r--user/HTC/reguser.htc91
5 files changed, 382 insertions, 0 deletions
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 @@
1\clearance{ADM}
2\on.clear{SYS}
3{\cond{T.group}{\user.group}\cond{T.group2}{\user.group}}
4{\const{T.group}{\user.group}\const{T.group2}{\user.group}}
5\cond{T.ID}{0}
6\cond{T.EDIT}{0}
7\cond{T.email}{}
8\cond{T.name}{}
9\cond{T.cmd}{}
10\ldef{uclear}{x}{\forall{ii}{\1}{[ii left ":"] }}
11\page{
12 \db{USERS}{
13 [groups:=\getgroups];
14 [users:=\query{\allowed{\T.group}}{[UID] }];
15 \find.rec{\T.ID}{
16 [this:=users which \T.ID];
17 \if(this>1){\href{\this?ID=[users nth (this-1)]}{Prev}|};
18 \href{\this}{List};
19 \if(this<count users){|\href{\this?ID=[users nth (this+1)]}{Next}}
20 \form{
21 \variable{ID}(UID);
22 \if{\T.EDIT}{
23 \table{bgcolor=#dddddd cellspacing=4 cellpadding=4}{
24 \tr{\td{align=right}{User ID:}\td(UID)}
25 \tr{\td{align=right}{Alias:}\td{\input{alias}{16}(ALIAS)}}
26 \tr{\td{align=right}{Name:}\td{\input{name}{40}(NAME)}}
27 \tr{\td{align=right}{E-mail:}\td{\input{email}{64}(EMAIL)}}
28 }
29 \button{Update}
30 }{
31 \table{bgcolor=#dddddd cellspacing=4 cellpadding=4}{
32 \tr{\td{align=right}{User ID:}\td(UID)}
33 \tr{\td{align=right}{Alias:}\td{\href{\req.uri?ID=[UID]&EDIT=1}(ALIAS)}}
34 \tr{\td{align=right}{Name:}\td(NAME)}
35 \tr{\td{align=right}{E-mail:}\td{\href{\req.uri?ID=[UID]&EDIT=1}(EMAIL)}}
36 \tr{\td{align=right}{Group:}\td(GROUP)}
37 \tr{\td{align=right}{Clearance:}\td{\uclear(ACCESS)}}
38 }
39 \on.clear{ROOT}{
40 \select{group}{
41 \forall{i}(groups){\option{\if(i eq \T.group){selected}}(i)(i)}
42 };
43 \button{+}\button{-}\button{=}
44 \indent{3}\input{group2}{8}\button{++}
45 \if(count ACCESS <= 1){\button{DELETE}}
46 }{
47 \button{\if(\uclear(ACCESS) which \T.group){-}{+} \T.group}
48 }
49 }
50 }
51 }{
52 \h1{Admin \T.group}
53 \form{
54 \on.clear{SYS}{
55 \select{group}{
56 \on.clear{ROOT}{
57 \forall{ii}(groups){\option{\if(ii eq \T.group){selected}}(ii)(ii)}
58 \option{\if(\T.group eq ""){selected}}{}{none}
59 }{
60 \forall{ii}{\user.clear}{
61 \option{\if(ii eq \T.group){selected}}(ii)(ii)
62 }
63 }
64 }
65 \button{Select Group}
66 \indent{3}
67 }
68 \input{email}{24}
69 \indent{2}
70 \button{Add User}
71 }
72 <p>
73 \table{
74 \tr{
75 \td{width=10%}{\bf{ID}}
76 \td{width=10%}{\bf{Alias}}
77 \td{width=40%}{\bf{Name}}
78 \td{width=10%}{\bf{GROUP}}
79 \td{width=30%}{\bf{CLEAR}}
80 }
81 \db{USERS}{
82 \query{\allowed{\T.group}}{
83 \tr{
84 \td{\href{\req.uri?ID=[UID]}(UID)};
85 \td{\href{\req.uri?ID=[UID]&EDIT=1}(ALIAS)};
86 \td(NAME);
87 \td(GROUP);
88 \td{\uclear(ACCESS)}
89 }
90 }
91 }
92 }
93 }
94 }
95}
96\onpost{
97 \switch(first \T.cmd)
98 {++}{
99 \log{addclear \T.group2 for \T.ID};
100 \su{\T.ID}{\user.access.add{\T.group2}\user.update};
101 \redirect{\this?ID=\T.ID}
102 }
103 {+}{
104 \log{addclear \T.group for \T.ID};
105 \su{\T.ID}{\user.access.add{\T.group}\user.update};
106 \redirect{\this?ID=\T.ID}
107 }
108 {-}{
109 \log{remclear \T.group for \T.ID};
110 \su{\T.ID}{\user.access.rem{\T.group}\user.update};
111 \redirect{\this?ID=\T.ID}
112 }
113 {=}{
114 \log{set group \T.group for \T.ID};
115 \on.clear{ROOT}{\su{\T.ID}{\user.group.set{\T.group}\user.update}}
116 \redirect{\this?ID=\T.ID}
117 }
118 {Update}{
119 \log{update name for \T.ID};
120 \su{\T.ID}{
121 \user.name.set{\T.name};
122 \user.alias.set{\T.alias};
123 \user.emails.set{\T.email};
124 \user.update;
125 }
126 \redirect{\this?ID=\T.ID}
127 }
128 {Select}{
129 \on.clear{SYS}{\user.group.set{\T.group}\user.update}
130 \redirect{\referer}
131 }
132 {DELETE}{
133 \log{DELETE \T.ID};
134 \on.clear{ROOT}{\remuser{\T.ID}};
135 \redirect{\referer}
136 }
137 {
138 [uid:=\getuser{\T.email}];
139 \log{add \T.group to [uid]};
140 \su(uid){\user.access.add{\T.group}\user.update};
141 \redirect{\this?ID=[uid]}
142 }
143}
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 @@
1\clearance{}
2\cache{\days{7}}
3\page{
4 \h1{HTC - A Hypertext Compiler/Interpreter}
5 \h3{Henrik Rydberg (Copyright 1998--2001)}
6
7 \bf{HTC} is a small, server based, LaTeX-like language,
8 which is used to efficiently create WWW applications.
9 Among the more useful features are:
10 \ul{
11 \li{
12 \bf{Access control} - HTC uses a cookie-based authorization
13 mechanism to manage users in a highly transparent way.
14 }
15 \li{
16 \bf{Database management} - Built in to the language are tools
17 for managing databases.
18 }
19 \li{
20 \bf{Language control} - HTC handles multiple languages, controllable
21 by standard browser preferences or cookies.
22 }
23 \li{
24 \bf{Math support} - Due to the built-in LaTeX language, HTC can
25 display simple equations directly in HTML, and has a high
26 degree of transferability to any future standard (such as MathML).
27 }
28 \li{
29 \bf{Static/dynamic switching} - HTC can be used to create static
30 mirrors, which increase download performance.
31 }
32 \li{
33 \bf{No frames} - HTC keeps track of the link tree, so that
34 quick access can be made without using frames, and hence
35 suitable also for text-based browsers.
36 }
37 }
38
39 \bf{HTC} is a completely stand-alone \bf{CGI} program written in C++,
40 making heavy use of \bf{STL}; (Standard template library),
41 and using a simple database manager, written the same way.
42 The language interpreter is designed to resemble \bf{LaTeX},
43 and to run quickly. For more information,
44 send me a \href{mailto: \ADMIN}{mail}. /h
45
46 <H3>Examples</H3>
47 <P>
48 If you want to see a sample of what can be
49 done with it, check the sites listed below.
50 \ul{
51 \li{\href{http://fy.chalmers.se/ap/}{Applied Physics}}
52 \li{\href{http://fy.chalmers.se/ap/mst/}{Materials Theory}}
53 \li{\href{http://stern.fy.chalmers.se:2001/}{Student server}}
54 \li{\href{http://fy.chalmers.se/mtrl/}{Materialia}}
55 \li{\href{http://coulomb.fy.chalmers.se:5555/}{H. Rydberg}}
56 \li{\href{http://fy.chalmers.se/atomics/}{Atomics}}
57 }
58 To learn more about the language, look for the
59 icons \image{\icons/htc.gif} and \image{\icons/source.gif}.
60}
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 @@
1\clearance{}
2\const{cmd.def}{Browser default}
3\const{cmd.sv}{Svenska}
4\const{cmd.en}{English}
5\page{
6 \h1{\lang{Language control}{Spr{\aa}kv{\"a}ljare}}
7 [lang:="browser default";];
8 \for(i:=0)(i<\ncookie)(i+=1){\if(\cookie[i].name eq "LANG")(lang=\cookie[i].val;)}
9 <p>
10 \lang{Setting:}{Inst{\"a}llning:} \[[lang]\]
11 <p>
12 \lang{
13 If you're using a browser in which you can specify what language(s)
14 you prefer, you don't need to use this page.
15 }{
16 Om du anv{\"a}nder en webbl{\"a}sare i vilken du sj{\"a}lv
17 kan v{\"a}lja spr{\aa}k, beh{\"o}ver
18 du inte anv{\"a}nda den h{\"a}r sidan.
19 }
20 <p>
21 \form{
22 \button{\cmd.def}
23 \button{\cmd.sv}
24 \button{\cmd.en}
25 }
26}
27\onpost{
28 \switch{\T.cmd}
29 {\cmd.def}{\setcookie{LANG}{deleted}{1}}
30 {\cmd.en}{\setcookie{LANG}{en}}
31 {\cmd.sv}{\setcookie{LANG}{sv}}
32 \redirect{\referer}
33}
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 @@
1\clearance{HTC}
2\setgroup{\user.group}
3\page{
4 \db{PREFS}{
5 [s.ID:=\user.id;@<-s.];
6 \h1{\lang{Preferences}{Inst{\"a}llningar} \time2htc(LASTMOD)}
7 \form{
8 \variable{w.ID}{\user.id};
9 \table{bgcolor=#dddddd}{
10 \tr{
11 \td{align=right}{UID:}\td{\user.id}
12 \td{align=right}{Alias:}\td{\user.alias}
13 }
14 \tr{
15 \td{align=right}{Name:}
16 \td{colspan=3}{\input{NAME}{40}{\user.name}}
17 }
18 \tr{
19 \td{align=right}{E-mail:}
20 \td{colspan=3}{\user.emails}
21 }
22 \tr{
23 \td{align=right}{URL:}
24 \td{colspan=3}{\input{w.URL}{40}(URL)}
25 }
26 \tr{
27 \td{align=right}{Group:}\td{\group}
28 \td{align=right}{Clearance:}\td{\user.clear}
29 }
30 %\tr{\td{align=right}{PIN:}\td{\user.pin}}
31 \tr{
32 \td{align=right}{Position:}\td{colspan=3}{\select.posit{w.POSIT}(POSIT)}
33 }
34 \tr{
35 \td{align=right}{Phone:}\td{\input{w.EXT}{10}(EXT)}
36 \td{align=right}{Room:}\td{\input{w.ROOM}{10}(ROOM)}
37 }
38 \tr{
39 \td{align=right}{Note:}\td{colspan=3}{\input{w.NOTE}{60}(NOTE)}
40 }
41 }
42 \h3{Abstract}
43 \text{w.ABSTRACT}{4}{70}(ABSTRACT)
44 <p>
45 \button{Update}
46 }
47 }
48}
49\onpost{
50 \log{updating prefs};
51 \db{PREFS}{\import{@}{T.w.}[LASTMOD=\now]};
52 \user.name.set{\T.NAME};
53 \user.update;
54 \redirect{\referer}
55}
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 @@
1\clearance{ADM}
2\alias{RegUser}
3\setgroup{\user.group}
4\const{CLEARLIST}{\user.group HTC}
5\page{
6 \title{Register User as \group}
7
8 \switch{\T.RES}
9 {BEM}{
10 \font{color=red}{Bad email.}
11 }
12 {USEX}{
13 \font{color=red}{User already exist.}
14 }
15 {ERR}{
16 \font{color=red}{An error occured - user not added.}
17 }
18
19 <p>
20 \bf{NOTE:} Remember to use \bf{valid, fully qualified e-mail addresses!}.
21 Local network aliases will be added if applicable.
22 If you manage multiple groups, make sure you add this person with
23 the correct clearance!
24 <p>
25 A welcome message will be sent to the new user.
26
27 \form{\uri}{
28 \table{bgcolor=#dddddd}{
29 \tr{
30 \td{align=right}{E-mail:}
31 \td{colspan=3}{\input{EMAIL}{46}}
32 }
33 \tr{
34 \td{align=right}{Name:}
35 \td{colspan=3}{\input{NAME}{46}}
36 }
37 \tr{
38 \td{align=right}{URL:}
39 \td{colspan=3}{\input{w.URL}{46}}
40 }
41 \tr{
42 \td{align=right}{Group:}\td{\group}
43 \td{align=right}{Clearance:}\td{\CLEARLIST}
44 }
45 \tr{
46 \td{align=right}{Position:}\td{colspan=3}{\select.posit{w.POSIT}{Temp}}
47 }
48 \tr{
49 \td{align=right}{Phone:}\td{\input{w.EXT}{10}}
50 \td{align=right}{Room:}\td{\input{w.ROOM}{10}}
51 }
52 \tr{
53 \td{align=right}{Note:}\td{colspan=3}{\input{w.NOTE}{46}}
54 }
55 }
56 <p>
57 \button{Register this User}
58 }
59}
60\onpost{
61 \if(\T.EMAIL cnt "@" && \T.EMAIL cnt "."){
62 \if{\getuser{\T.EMAIL}}{
63 \redirect{\this?RES=USEX}
64 }{
65 \su{\newuser{\CLEARLIST}{\T.EMAIL}{\T.NAME}}{
66 \const{T.w.ID}{\user.id};
67 \db{PREFS}{\import{@}{T.w.}[LASTMOD=\now]}
68 \mail.user{Registration at \server.alias}{
69 \user.name, welcome to the \server.alias server at
70
71 \server/
72
73 Your alias is: \user.alias
74 Your PIN-code is: \user.pin
75
76 Please take a minute or two to go through the pages
77 and familiarize yourself with the login/logout procedure.
78
79 \server/LOGIN/?alias=\user.alias
80
81 /Admin
82 }
83 \redirect{\pwd/admin.htc?ID=\user.id}
84 }{
85 \redirect{\this?RES=ERR}
86 }
87 }
88 }{
89 \redirect{\this?RES=BEM}
90 }
91}