source: branches/monitor-improvement/oscam-http.h@ 1041

Last change on this file since 1041 was 1041, checked in by Admin, 13 years ago

add httpidle config option to status page

File size: 31.1 KB
Line 
1#include "globals.h"
2
3#define SERVER "webserver/1.0"
4#define PROTOCOL "HTTP/1.0"
5#define RFC1123FMT "%a, %d %b %Y %H:%M:%S GMT"
6#define AUTHREALM "OScam"
7#define AUTHNONCEVALIDSECS 15
8#define MAXGETPARAMS 100
9
10#define CSS "p {color: white; }\n\
11h2 {color: orange; font-family: Arial; font-size: 14px; line-height: 12px;}\n\
12h4 {color: black; font-family: Arial; font-size: 12px; line-height: 9px; }\n\
13TABLE{background-color:#66CCFF;}\n\
14TD{height:10px; border:1px solid gray; font-family: Arial; font-size: 11px; padding:5px; background-color:#6666FF;}\n\
15TH{height:10px; border:1px solid gray; font-family: Arial; font-size: 12px; padding:5px; background-color:#330033;color:#FFFF00;}\n\
16TR.s TD{background-color:#6666FF;}\n\
17TR.r TD{background-color:orange;}\n\
18TR.p TD{background-color:yellow;}\n\
19TR.c TD{background-color:green;}\n\
20TR.online TD{background-color:#009900;}\n\
21TR.expired TD{background-color:orange;}\n\
22DIV.log{border:1px solid black;background-color: black; font-family:\"Courier New\", monospace ; color:yellow; font-size: 11px;}\n\
23TABLE.menu{background-color:black; align:center; font-size: 10px;}\n\
24TABLE.menu TD{border:2px outset lightgrey; background-color:silver; font-color:black; font-family: Arial;}\n\
25TABLE.status{background-color:#66CCFF;empty-cells:show;}\n\
26TABLE.invisible TD {border:0px; font-family: Arial; font-size: 12px; padding:5px; background-color:#6666FF;}}\n\
27TD.menu {border:2px outset lightgrey; background-color:silver; font-color:black; font-family: Arial; font-size:11px;}\n\
28body {background-color: grey; font-family: Arial; font-size: 12px;}\n\
29A:link {text-decoration: none; color:blue}\n\
30A:visited {text-decoration: none; color:blue}\n\
31A:active {text-decoration: none; color:white}\n\
32A:hover {text-decoration: none; color: red;}"
33
34#define TPLHEADER "\
35<HTML>\n\
36 <HEAD>\n\
37 <TITLE>OSCAM ##CS_VERSION## build ###CS_SVN_VERSION##</TITLE>\n\
38 <link rel=\"stylesheet\" type=\"text/css\" href=\"site.css\">\n\
39 ##REFRESH##\
40 </HEAD>\n\
41 <BODY>\n\
42 <H2>OSCAM ##CS_VERSION## build ###CS_SVN_VERSION##</H2>"
43
44#define TPLFOOTER "\
45 <HR/><H4>OSCAM Webinterface - ##CURDATE## ##CURTIME##</H4>\
46 </BODY>\
47</HTML>"
48
49#define TPLREFRESH "\
50<meta http-equiv=\"refresh\" content=\"##REFRESHTIME##\"; URL=/status.html\" />\n"
51
52#define TPLMENU "\
53 <TABLE border=0 class=\"menu\">\n\
54 <TR>\n\
55 <TD CLASS=\"menu\"><A HREF=\"status.html\">STATUS</TD>\n\
56 <TD CLASS=\"menu\"><A HREF=\"config.html\">CONFIGURATION</TD>\n\
57 <TD CLASS=\"menu\"><A HREF=\"readers.html\">READERS</TD>\n\
58 <TD CLASS=\"menu\"><A HREF=\"userconfig.html\">USERS</TD>\n\
59 <TD CLASS=\"menu\"><A HREF=\"services.html\">SERVICES</TD>\n\
60 </TR>\n\
61 </TABLE>"
62
63#define TPLCONFIGMENU "\
64 <BR><BR>\n\
65 <TABLE border=0 class=\"menu\">\n\
66 <TR>\n\
67 <TD CLASS=\"menu\"><A HREF=\"config.html?part=global\">Global</TD>\n\
68 <TD CLASS=\"menu\"><A HREF=\"config.html?part=camd33\">Camd3.3</TD>\n\
69 <TD CLASS=\"menu\"><A HREF=\"config.html?part=camd35\">Camd3.5</TD>\n\
70 <TD CLASS=\"menu\"><A HREF=\"config.html?part=newcamd\">Newcamd</TD>\n\
71 <TD CLASS=\"menu\"><A HREF=\"config.html?part=radegast\">Radegast</TD>\n\
72 <TD CLASS=\"menu\"><A HREF=\"config.html?part=cccam\">Cccam</TD>\n\
73 <TD CLASS=\"menu\"><A HREF=\"config.html?part=gbox\">Gbox</TD>\n\
74 ##TPLCONFIGMENUANTICASC##\
75 <TD CLASS=\"menu\"><A HREF=\"config.html?part=monitor\">Monitor</TD>\n\
76 <TD CLASS=\"menu\"><A HREF=\"config.html?part=serial\">Serial</TD>\n\
77 </TR>\n\
78 </TABLE>"
79
80#ifdef CS_ANTICASC
81#define TPLCONFIGMENUANTICASC "<TD CLASS=\"menu\"><A HREF=\"config.html?part=anticasc\">Anticascading</TD>\n"
82#endif
83
84#define TPLSTATUS "\
85 ##TPLHEADER##\
86 ##TPLMENU##\n\
87 <BR><BR>\n\
88 <form action=\"status.html\" method=\"get\">\n\
89 <select name=\"hideidle\">\n\
90 <option value=\"0\" ##HIDEIDLECLIENTSSELECTED0##>Show idle clients</option>\n\
91 <option value=\"1\" ##HIDEIDLECLIENTSSELECTED1##>Hide idle clients</option>\n\
92 </select>\n\
93 <input type=\"submit\" value=\"Update\">\n\
94 </form>\n\
95 <TABLE WIDTH=\"100%\" cellspacing=\"0\" class=\"status\">\n\
96 <TR>\n\
97 <TH>PID</TH>\n\
98 <TH>Typ</TH>\n\
99 <TH>ID</TH>\n\
100 <TH>Label</TH>\n\
101 <TH>AU</TH>\n\
102 <TH>0</TH>\n\
103 <TH>Address</TH>\n\
104 <TH>Port</TH>\n\
105 <TH>Protocol</TH>\n\
106 <TH>Login</TH>\n\
107 <TH>Login</TH>\n\
108 <TH>Time</TH>\n\
109 <TH>caid:srvid</TH>\n\
110 <TH>Last Channel</TH>\n\
111 <TH>Idle</TH>\n\
112 <TH>CWOK</TH>\n\
113 <TH>CWNOK</TH>\n\
114 <TH>0</TH>\n\
115 </TR>\n\
116 ##CLIENTSTATUS##\
117 </TABLE><BR>\n\
118 <DIV class=\"log\">\n\
119 ##LOGHISTORY##\
120 </DIV>\n\
121 ##TPLFOOTER##"
122
123#define TPLCLIENTSTATUSBIT "\
124 <TR class=\"##CLIENTTYPE##\">\n\
125 <TD>##CLIENTPID##</TD>\n\
126 <TD>##CLIENTTYPE##</TD>\n\
127 <TD>##CLIENTCNR##</TD>\n\
128 <TD>##CLIENTUSER##</TD>\n\
129 <TD>##CLIENTCAU##</TD>\n\
130 <TD>##CLIENTCRYPTED##</TD>\n\
131 <TD>##CLIENTIP##</TD>\n\
132 <TD>##CLIENTPORT##</TD>\n\
133 <TD>##CLIENTPROTO##</TD>\n\
134 <TD>##CLIENTLOGINDATE##</TD>\n\
135 <TD>##CLIENTLOGINTIME##</TD>\n\
136 <TD>##CLIENTLOGINSECS##</TD>\n\
137 <TD>##CLIENTCAID##:##CLIENTSRVID##</TD>\n\
138 <TD>##CLIENTSRVNAME##</TD>\n\
139 <TD>##CLIENTIDLESECS##</TD>\n\
140 <TD>##CWOK##</TD>\n\
141 <TD>##CWNOK##</TD>\n\
142 <TD>##CLIENTCON##</TD>\n\
143 </TR>\n"
144
145#define TPLUSERCONFIGLIST "\
146 ##TPLHEADER##\
147 ##TPLMENU##\n\
148 ##MESSAGE##\
149 <BR><BR>\
150 <TABLE cellspacing=\"0\" cellpadding=\"10\">\n\
151 <TR>\n\
152 <TH>Label</TH>\n\
153 <TH>Status</TH>\n\
154 <TH>Last Channel</TH>\n\
155 <TH>Idle (Sec)</TH>\n\
156 <TH colspan=\"2\" align=\"center\">Action</TH>\n\
157 </TR>\n\
158 ##USERCONFIGS##\
159 <TR>\n\
160 <FORM action=\"user_edit.html\" method=\"get\">\n\
161 <TD>New User:</TD>\n\
162 <TD colspan=\"2\"><input name=\"user\" type=\"text\"></TD>\n\
163 <TD colspan=\"3\" align=\"center\"><input type=\"submit\" value=\"Add User\"></TD>\n\
164 </FORM>\n\
165 <TR>\n\
166 </TABLE>\n\
167 ##TPLFOOTER##"
168
169#define TPLUSERCONFIGLISTBIT "\
170 <TR class=\"##CLASSNAME##\">\n\
171 <TD>##USER##</TD>\n\
172 <TD>##STATUS####EXPIRED##</TD>\n\
173 <TD>##LASTCHANNEL##</TD>\n\
174 <TD>##IDLESECS##</TD>\n\
175 <TD><A HREF=\"user_edit.html?user=##USERENC##\">Edit Settings</A></TD>\n\
176 <TD><A HREF=\"userconfig.html?user=##USERENC##&action=delete\">Delete User</A></TD>\n\
177 </TR>\n"
178
179#define TPLUSEREDIT "\
180##TPLHEADER##\
181##TPLMENU##\n\
182##MESSAGE##\
183<BR><BR>\n\
184 <form action=\"user_edit.html\" method=\"get\">\n\
185 <input name=\"user\" type=\"hidden\" value=\"##USERNAME##\">\n\
186 <TABLE cellspacing=\"0\">\n\
187 <TR>\n\
188 <TH>&nbsp;</TH>\n\
189 <TH>Edit User ##USERNAME##</TH>\n\
190 <TR>\n\
191 <TD>Password:</TD>\n\
192 <TD><input name=\"pwd\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##PASSWORD##\"></TD>\n\
193 </TR>\n\
194 <TR>\n\
195 <TD>Exp. Date:</TD>\n\
196 <TD><input name=\"expdate\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##EXPDATE##\"></TD>\n\
197 </TR>\n\
198 <TR>\n\
199 <TD>Group:</TD>\n\
200 <TD><input name=\"group\" type=\"text\" size=\"10\" maxlength=\"10\" value=\"##GROUPS##\"></TD>\n\
201 </TR>\n\
202 <TR>\n\
203 <TD>Hostname:</TD>\n\
204 <TD><input name=\"hostname\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##DYNDNS##\"></TD>\n\
205 </TR>\n\
206 <TR>\n\
207 <TD>Uniq:</TD>\n\
208 <TD><select name=\"uniq\">\n\
209 <option value=\"0\" ##UNIQSELECTED0##>none</option>\n\
210 <option value=\"1\" ##UNIQSELECTED1##>strict</option>\n\
211 <option value=\"2\" ##UNIQSELECTED2##>per IP</option>\n\
212 </SELECT></TD>\n\
213 </TR>\n\
214 <TR>\n\
215 <TD>Sleep:</TD>\n\
216 <TD><input name=\"sleep\" type=\"text\" size=\"4\" maxlength=\"4\" value=\"##SLEEP##\"></TD>\n\
217 </TR>\n\
218 <TR>\n\
219 <TD>Monlevel:</TD>\n\
220 <TD><select name=\"monlevel\">\n\
221 <option value=\"0\" ##MONSELECTED0##>no access to monitor</option>\n\
222 <option value=\"1\" ##MONSELECTED1##>only server and own procs</option>\n\
223 <option value=\"2\" ##MONSELECTED2##>all procs, but viewing only, default</option>\n\
224 <option value=\"3\" ##MONSELECTED3##>all procs, reload of oscam.user possible</option>\n\
225 <option value=\"4\" ##MONSELECTED4##>complete access</option>\n\
226 </select></TD>\n\
227 </TR>\n\
228 <TR>\n\
229 <TD>AU:</TD>\n\
230 <TD><select name=\"au\">\n\
231 <option value=\" \" ##AUSELECTED##>none</option>\n\
232 <option value=\"1\" ##AUTOAUSELECTED##>auto</option>\n\
233 ##RDROPTION##\
234 </select></TD>\n\
235 </TR>\n\
236 <TR>\n\
237 <TD>Services:</TD>\n\
238 <TD>\n\
239 <TABLE cellspacing=\"0\" class=\"invisible\">##SIDS##\
240 </TD>\n\
241 </TR>\n\
242 </TABLE>\n\
243 <TR>\n\
244 <TD>CAID:</TD>\n\
245 <TD><input name=\"caid\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##CAIDS##\"></TD>\n\
246 </TR>\n\
247 <TR>\n\
248 <TD>Ident:</TD>\n\
249 <TD><input name=\"ident\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##IDENTS##\"></TD>\n\
250 </TR>\n\
251 <TR>\n\
252 <TD>Betatunnel:</TD>\n\
253 <TD><input name=\"betatunnel\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##BETATUNNELS##\"></TD>\n\
254 </TR>\n\
255 ##TPLUSEREDITANTICASC##\
256 <TR>\n\
257 <TD align=\"center\"><input type=\"submit\" name=\"action\" value=\"Save\" title=\"Save settings and reload users\"></TD>\n\
258 <TD align=\"center\"><input name=\"newuser\" type=\"text\" size=\"20\" maxlength=\"20\" title=\"Enter new username if you want to clone this user\">&nbsp;&nbsp;&nbsp;<input type=\"submit\" name=\"action\" value=\"Save As\" title=\"Save as new user and reload users\"></TD>\n\
259 </TR>\n\
260 </TABLE>\n\
261</form>\n\
262##TPLFOOTER##"
263
264#define TPLUSEREDITRDRSELECTED "\t<option value=\"##READERNAME##\" ##SELECTED##>##READERNAME##</option>"
265
266#define TPLUSEREDITSIDOKBIT "\
267 <TR>\n\
268 <TD><INPUT NAME=\"services\" TYPE=\"CHECKBOX\" VALUE=\"##SIDLABEL##\" ##CHECKED##> ##SIDLABEL##</TD>\n"
269
270#define TPLUSEREDITSIDNOBIT "\
271 <TD><INPUT NAME=\"services\" TYPE=\"CHECKBOX\" VALUE=\"!##SIDLABEL##\" ##CHECKED##> !##SIDLABEL##</TD>\n\
272 </TR>\n"
273
274#ifdef CS_ANTICASC
275# define TPLUSEREDITANTICASC "\
276 <TR>\n\
277 <TD>Anticascading numusers:</TD>\n\
278 <TD><input name=\"numusers\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"##AC_USERS##\"></TD>\n\
279 </TR>\n\
280 <TR>\n\
281 <TD>Anticascading penalty:</TD>\n\
282 <TD><input name=\"penalty\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"##AC_PENALTY##\"></TD>\n\
283 </TR>\n"
284#endif
285
286#define TPLSIDTAB "\
287 ##TPLHEADER##\
288 ##TPLMENU##\n\
289 <BR><BR><DIV class=\"log\">\n\
290 ##SIDTABS##\
291 </DIV>\n\
292 ##TPLFOOTER##"
293
294#define TPLSIDTABBIT "\
295label=##LABEL##<BR>\n\
296caid(##CAIDNUM##)=##CAIDS##<BR>\n\
297provider(##PROVIDNUM##)=##PROVIDS##<BR>\n\
298services(##SRVIDNUM##)=##SRVIDS##<BR><BR>\n"
299
300#define TPLREADERS "\
301##TPLHEADER##\
302##TPLMENU##\n\
303<BR><BR>\n\
304 <TABLE cellspacing=\"0\" cellpadding=\"10\">\n\
305 <TR>\n\
306 <TH>Reader</TH>\n\
307 <TH>Protocol</TH>\n\
308 <TH>Action</TH>\n\
309 </TR>\n\
310 ##READERLIST##\
311 </TABLE>\n\
312##TPLFOOTER##"
313
314#define TPLREADERSBIT "\
315 <TR>\n\
316 <TD>##READERNAME##</TD>\n\
317 <TD>##CTYP##</TD>\n\
318 <TD><A HREF=\"readerconfig.html?reader=##READERNAMEENC##\">Edit Settings</A> &nbsp;|&nbsp; <A HREF=\"entitlements.html?reader=##READERNAME##\">Show Entitlements</A></TD>\n\
319 </TR>\n"
320
321#define TPLENTITLEMENTS "\
322##TPLHEADER##\
323##TPLMENU##\n\
324<BR><BR>Entitlements for ##READERNAME##<BR><BR>\n\n\
325<DIV class=\"log\">\n\
326 ##LOGHISTORY##\
327</DIV>\n\
328##TPLFOOTER##"
329
330#define TPLREADERCONFIG "\
331##TPLHEADER##\
332##TPLMENU##\n\
333<BR><BR>\n\
334##MESSAGE##\
335 <form action=\"readerconfig.html?action=execute\" method=\"get\"><input name=\"reader\" type=\"hidden\" value=\"##READERNAME##\">\n\
336 <TABLE cellspacing=\"0\">\n\
337 <TR>\n\
338 <TH>&nbsp;</TH>\n\
339 <TH>Edit Reader ##READERNAME##</TH>\n\
340 </TR>\n\
341 <TR>\n\
342 <TD>Device:</TD>\n\
343 <TD><input name=\"device\" type=\"text\" size=\"30\" maxlength=\"50\" value=\"##DEVICE####R_PORT####L_PORT##\"></TD>\n\
344 </TR>\n\
345 <TR>\n\
346 <TD>Group:</TD>\n\
347 <TD><input name=\"grp\" type=\"text\" size=\"10\" maxlength=\"10\" value=\"##GRP##\"></TD>\n\
348 </TR>\n\
349 <TR>\n\
350 <TD>Key:</TD>\n\
351 <TD><input name=\"key\" type=\"text\" size=\"30\" maxlength=\"50\" value=\"##NCD_KEY##\"></TD>\n\
352 </TR>\n\
353 <TR>\n\
354 <TD>Pincode:</TD>\n\
355 <TD><input name=\"pincode\" type=\"text\" size=\"30\" maxlength=\"50\" value=\"##PINCODE##\"></TD>\n\
356 </TR>\n\
357 <TR>\n\
358 <TD>Readnano:</TD>\n\
359 <TD><input name=\"readnano\" type=\"text\" size=\"30\" maxlength=\"50\" value=\"##EMMFILE##\"></TD>\n\
360 </TR>\n\
361 <TR>\n\
362 <TD>Services:</TD>\n\
363 <TD>\n\
364 <TABLE cellspacing=\"0\" class=\"invisible\">##SIDS##\
365 </TD>\n\
366 </TR>\n\
367 </TABLE>\n\
368 <TR>\n\
369 <TD>Inactivitytimeout:</TD>\n\
370 <TD><input name=\"inactivitytimeout\" type=\"text\" size=\"30\" maxlength=\"50\" value=\"##INACTIVITYTIMEOUT##\"></TD>\n\
371 </TR>\n\
372 <TR>\n\
373 <TD>Reconnecttimeout:</TD>\n\
374 <TD><input name=\"reconnecttimeout\" type=\"text\" size=\"30\" maxlength=\"50\" value=\"##RECEIVETIMEOUT##\"></TD>\n\
375 </TR>\n\
376 <TR>\n\
377 <TD>Disableserverfilter:</TD>\n\
378 <TD><input name=\"disableserverfilter\" type=\"text\" size=\"30\" maxlength=\"50\" value=\"##DISABLESERVERFILTER##\"></TD>\n\
379 </TR>\n\
380 <TR>\n\
381 <TD>Fallback:</TD>\n\
382 <TD><input name=\"fallback\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"##FALLBACK##\"></TD>\n\
383 </TR>\n\
384 <TR>\n\
385 <TD>CAID:</TD>\n\
386 <TD><input name=\"caid\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##CAIDS##\"></TD>\n\
387 </TR>\n\
388 <TR>\n\
389 <TD>Boxid:</TD>\n\
390 <TD><input name=\"boxid\" type=\"text\" size=\"30\" maxlength=\"50\" value=\"##BOXID##\"></TD>\n\
391 </TR>\n\
392 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
393 </TABLE>\n\
394<BR><BR>Saving not yet implemented - Nothing changes on click<BR><BR>\n\
395##TPLFOOTER##"
396#define TPLSAVETEMPLATES "##TPLHEADER##\
397##TPLMENU##\n\
398<br><b>Saved ##CNT## templates to ##PATH##</b><br>\n\
399##TPLFOOTER##"
400#define TPLREADERCONFIGSIDOKBIT "\
401 <TR>\n\
402 <TD><INPUT NAME=\"services\" TYPE=\"CHECKBOX\" VALUE=\"##SIDLABEL##\" ##CHECKED##> ##SIDLABEL##</TD>\n"
403
404#define TPLREADERCONFIGSIDNOBIT "\
405 <TD><INPUT NAME=\"services\" TYPE=\"CHECKBOX\" VALUE=\"!##SIDLABEL##\" ##CHECKED##> !##SIDLABEL##</TD>\n\
406 </TR>\n"
407
408#define TPLCONFIGGBOX "\
409##TPLHEADER##\
410##TPLMENU##\n\
411##TPLCONFIGMENU##\n\
412<BR><BR>\n\
413##MESSAGE##\
414<form action=\"config.html\" method=\"get\">\n\
415 <input name=\"part\" type=\"hidden\" value=\"gbox\">\n\
416 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
417 <TABLE cellspacing=\"0\">\n\
418 <TR><TH>&nbsp;</TH><TH>Edit Gbox Config </TH></TR>\n\
419 <TR><TD>Password:</TD><TD><input name=\"password\" type=\"text\" size=\"10\" maxlength=\"8\" value=\"##PASSWORD##\"></TD></TR>\n\
420 <TR><TD>Maxdist:</TD><TD><input name=\"maxdist\" type=\"text\" size=\"5\" maxlength=\"2\" value=\"##MAXDIST##\"></TD></TR>\n\
421 <TR><TD>Ignorelist:</TD><TD><input name=\"ignorelist\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##IGNORELIST##\"></TD></TR>\n\
422 <TR><TD>Onlineinfos:</TD><TD><input name=\"onlineinfos\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##ONLINEINFOS##\"></TD></TR>\n\
423 <TR><TD>Cardinfos:</TD><TD><input name=\"cardinfos\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##CARDINFOS##\"></TD></TR>\n\
424 <TR><TD>Locals:</TD><TD><input name=\"locals\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##LOCALS##\"></TD></TR>\n\
425 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
426 </TABLE>\n\
427##TPLFOOTER##"
428
429#ifdef CS_ANTICASC
430#define TPLCONFIGANTICASC "\
431##TPLHEADER##\
432##TPLMENU##\n\
433##TPLCONFIGMENU##\n\
434<BR><BR>\n\
435##MESSAGE##\
436<form action=\"config.html\" method=\"get\">\n\
437 <input name=\"part\" type=\"hidden\" value=\"anticasc\">\n\
438 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
439 <TABLE cellspacing=\"0\">\n\
440 <TR><TH>&nbsp;</TH><TH>Edit Anticascading Config</TH></TR>\n\
441 <TR><TD>Enabled:</TD><TD><input name=\"enabled\" type=\"checkbox\" value=\"1\" ##CHECKED##>\n\
442 <TR><TD>Numusers:</TD><TD><input name=\"numusers\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##NUMUSERS##\"></TD></TR>\n\
443 <TR><TD>Sampletime:</TD><TD><input name=\"sampletime\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##SAMPLETIME##\"></TD></TR>\n\
444 <TR><TD>Samples:</TD><TD><input name=\"samples\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##SAMPLES##\"></TD></TR>\n\
445 <TR><TD>Penalty:</TD><TD><input name=\"penalty\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##PENALTY##\"></TD></TR>\n\
446 <TR><TD>AClogfile:</TD><TD><input name=\"aclogfile\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##ACLOGFILE##\"></TD></TR>\n\
447 <TR><TD>Fakedelay:</TD><TD><input name=\"fakedelay\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##FAKEDELAY##\"></TD></TR>\n\
448 <TR><TD>Denysamples:</TD><TD><input name=\"denysamples\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##DENYSAMPLES##\"></TD></TR>\n\
449 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
450 </TABLE>\n\
451</form>\n\
452##TPLFOOTER##"
453#endif
454
455#define TPLCONFIGCCCAM "\
456##TPLHEADER##\
457##TPLMENU##\n\
458##TPLCONFIGMENU##\n\
459<BR><BR>\n\
460##MESSAGE##\
461<form action=\"config.html\" method=\"get\">\n\
462 <input name=\"part\" type=\"hidden\" value=\"cccam\">\n\
463 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
464 <TABLE cellspacing=\"0\">\n\
465 <TR><TH>&nbsp;</TH><TH>Edit Cccam Config</TH></TR>\n\
466 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
467 </TABLE>\n\
468</form>\n\
469<BR><BR>Configuration Cccam not yet implemented<BR><BR>\n\
470##TPLFOOTER##"
471
472#define TPLCONFIGMONITOR "\
473##TPLHEADER##\
474##TPLMENU##\n\
475##TPLCONFIGMENU##\n\
476<BR><BR>\n\
477##MESSAGE##\
478<form action=\"config.html\" method=\"get\">\n\
479 <input name=\"part\" type=\"hidden\" value=\"monitor\">\n\
480 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
481 <input name=\"httphideidleclients\" type=\"hidden\" value=\"0\">\n\
482 <TABLE cellspacing=\"0\">\n\
483 <TR><TH>&nbsp;</TH><TH>Edit Monitor Config</TH></TR>\n\
484 <TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##MONPORT##\"></TD></TR>\n\
485 <TR><TD>Serverip:</TD><TD><input name=\"serverip\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##SERVERIP##\"></TD></TR>\n\
486 <TR><TD>Nocrypt:</TD><TD><input name=\"nocrypt\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##NOCRYPT##\">wrong, see Ticket #265</TD></TR>\n\
487 <TR><TD>Aulow:</TD><TD><input name=\"aulow\" type=\"text\" size=\"5\" maxlength=\"1\" value=\"##AULOW##\"></TD></TR>\n\
488 <TR>\n\
489 <TD>Monlevel:</TD>\n\
490 <TD><select name=\"monlevel\">\n\
491 <option value=\"0\" ##MONSELECTED0##>no access to monitor</option>\n\
492 <option value=\"1\" ##MONSELECTED1##>only server and own procs</option>\n\
493 <option value=\"2\" ##MONSELECTED2##>all procs, but viewing only, default</option>\n\
494 <option value=\"3\" ##MONSELECTED3##>all procs, reload of oscam.user possible</option>\n\
495 <option value=\"4\" ##MONSELECTED4##>complete access</option>\n\
496 </select></TD>\n\
497 </TR>\n\
498 <TR><TD>Hideclientto:</TD><TD><input name=\"hideclient_to\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##HIDECLIENTTO##\"></TD></TR>\n\
499 <TR><TD>Httpport:</TD><TD><input name=\"httpport\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##HTTPPORT##\"></TD></TR>\n\
500 <TR><TD>Httpuser:</TD><TD><input name=\"httpuser\" type=\"text\" size=\"20\" maxlength=\"20\" value=\"##HTTPUSER##\"></TD></TR>\n\
501 <TR><TD>Httppwd:</TD><TD><input name=\"httppwd\" type=\"text\" size=\"20\" maxlength=\"20\" value=\"##HTTPPASSWORD##\"></TD></TR>\n\
502 <TR><TD>Httpcss:</TD><TD><input name=\"httpcss\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##HTTPCSS##\"></TD></TR>\n\
503 <TR><TD>Httprefresh:</TD><TD><input name=\"httprefresh\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##HTTPREFRESH##\"></TD></TR>\n\
504 <TR><TD>Httptpl:</TD><TD><input name=\"httptpl\" type=\"text\" size=\"50\" maxlength=\"100\" value=\"##HTTPTPL##\"></TD></TR>\n\
505 <TR><TD>HttpHideIdleClients:</TD><TD><input name=\"httphideidleclients\" type=\"checkbox\" value=\"1\" ##CHECKED##>\n\
506 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
507 </TABLE>\n\
508</form>\n\
509##TPLFOOTER##"
510
511#define TPLCONFIGRADEGAST "\
512##TPLHEADER##\
513##TPLMENU##\n\
514##TPLCONFIGMENU##\n\
515<BR><BR>\n\
516##MESSAGE##\
517<form action=\"config.html\" method=\"get\">\n\
518 <input name=\"part\" type=\"hidden\" value=\"radegast\">\n\
519 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
520 <TABLE cellspacing=\"0\">\n\
521 <TR><TH>&nbsp;</TH><TH>Edit Radegast Config</TH></TR>\n\
522 <TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##PORT##\"></TD></TR>\n\
523 <TR><TD>Serverip:</TD><TD><input name=\"serverip\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##SERVERIP##\"></TD></TR>\n\
524 <TR><TD>Allowed:</TD><TD><input name=\"allowed\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##ALLOWED##\">wrong, see Ticket #265</TD></TR>\n\
525 <TR><TD>User:</TD><TD><input name=\"user\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##USER##\"></TD></TR>\n\
526 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
527 </TABLE>\n\
528</form>\n\
529##TPLFOOTER##"
530
531#define TPLCONFIGNEWCAMD "\
532##TPLHEADER##\
533##TPLMENU##\n\
534##TPLCONFIGMENU##\n\
535<BR><BR>\n\
536##MESSAGE##\
537<form action=\"config.html\" method=\"get\">\n\
538 <input name=\"part\" type=\"hidden\" value=\"newcamd\">\n\
539 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
540 <TABLE cellspacing=\"0\">\n\
541 <TR><TH>&nbsp;</TH><TH>Edit Newcamd Config</TH></TR>\n\
542 <TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"80\" maxlength=\"200\" value=\"##PORT##\"></TD></TR>\n\
543 <TR><TD>Serverip:</TD><TD><input name=\"serverip\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##SERVERIP##\"></TD></TR>\n\
544 <TR><TD>Key:</TD><TD><input name=\"key\" type=\"text\" size=\"35\" maxlength=\"28\" value=\"##KEY##\"></TD></TR>\n\
545 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
546 </TABLE>\n\
547</form>\n\
548##TPLFOOTER##"
549
550#define TPLCONFIGGLOBAL "\
551##TPLHEADER##\
552##TPLMENU##\n\
553##TPLCONFIGMENU##\n\
554<BR><BR>\n\
555##MESSAGE##\
556<form action=\"config.html\" method=\"get\">\n\
557 <input name=\"part\" type=\"hidden\" value=\"global\">\n\
558 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
559 <TABLE cellspacing=\"0\">\n\
560 <TR><TH>&nbsp;</TH><TH>Edit Global Config</TH></TR>\n\
561 <TR><TD>Serverip:</TD><TD><input name=\"serverip\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##SERVERIP##\"></TD></TR>\n\
562 <TR><TD>Logfile:</TD><TD><input name=\"logfile\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##LOGFILE##\"></TD></TR>\n\
563 <TR><TD>PID File:</TD><TD><input name=\"pidfile\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##PIDFILE##\"></TD></TR>\n\
564 <TR><TD>Usrfile:</TD><TD><input name=\"usrfile\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##USERFILE##\"></TD></TR>\n\
565 <TR><TD>CWlogdir:</TD><TD><input name=\"cwlogdir\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##CWLOGDIR##\"></TD></TR>\n\
566 <TR><TD>Clienttimeout:</TD><TD><input name=\"clienttimeout\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##CLIENTTIMEOUT##\"></TD></TR>\n\
567 <TR><TD>Fallbacktimeout:</TD><TD><input name=\"fallbacktimeout\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##FALLBACKTIMEOUT##\"></TD></TR>\n\
568 <TR><TD>Clientmaxidle:</TD><TD><input name=\"clientmaxidle\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##CLIENTMAXIDLE##\"></TD></TR>\n\
569 <TR><TD>Cachedelay:</TD><TD><input name=\"cachedelay\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##CACHEDELAY##\"></TD></TR>\n\
570 <TR><TD>Bindwait:</TD><TD><input name=\"bindwait\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##BINDWAIT##\"></TD></TR>\n\
571 <TR><TD>Netprio:</TD><TD><input name=\"netprio\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##NETPRIO##\"></TD></TR>\n\
572 <TR><TD>Resolvedelay:</TD><TD><input name=\"resolvedelay\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##RESOLVEDELAY##\"></TD></TR>\n\
573 <TR><TD>Sleep:</TD><TD><input name=\"sleep\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##SLEEP##\"></TD></TR>\n\
574 <TR><TD>Unlockparental:</TD><TD><input name=\"unlockparental\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##UNLOCKPARENTAL##\"></TD></TR>\n\
575 <TR><TD>Nice:</TD><TD><input name=\"nice\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##NICE##\"></TD></TR>\n\
576 <TR><TD>Serialreadertimeout:</TD><TD><input name=\"serialreadertimeout\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##SERIALTIMEOUT##\"></TD></TR>\n\
577 <TR><TD>Maxlogsize:</TD><TD><input name=\"maxlogsize\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##MAXLOGSIZE##\"></TD></TR>\n\
578 <TR><TD>Showecmdw:</TD><TD><input name=\"showecmdw\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##SHOWECMDW##\"></TD></TR>\n\
579 <TR><TD>Waitforcards:</TD><TD><input name=\"waitforcards\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##WAITFORCARDS##\"></TD></TR>\n\
580 <TR><TD>Preferlocalcards:</TD><TD><input name=\"preferlocalcards\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##PREFERLOCALCARDS##\"></TD></TR>\n\
581 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
582 </TABLE>\n\
583</form>\n\
584<BR><BR>Configuration Global not yet implemented chengings havn't any effect<BR><BR>\n\
585##TPLFOOTER##"
586
587#define TPLCONFIGCAMD33 "\
588##TPLHEADER##\
589##TPLMENU##\n\
590##TPLCONFIGMENU##\n\
591<BR><BR>\n\
592##MESSAGE##\
593<form action=\"config.html\" method=\"get\">\n\
594 <input name=\"part\" type=\"hidden\" value=\"camd33\">\n\
595 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
596 <TABLE cellspacing=\"0\">\n\
597 <TR><TH>&nbsp;</TH><TH>Edit Camd33 Config</TH></TR>\n\
598 <TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##PORT##\"></TD></TR>\n\
599 <TR><TD>Serverip:</TD><TD><input name=\"serverip\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##SERVERIP##\"></TD></TR>\n\
600 <TR><TD>Key:</TD><TD><input name=\"key\" type=\"text\" size=\"35\" maxlength=\"28\" value=\"##KEY##\"></TD></TR>\n\
601 <TR><TD>Passive:</TD><TD><input name=\"passive\" type=\"text\" size=\"3\" maxlength=\"1\" value=\"##PASSIVE##\"></TD></TR>\n\
602 <TR><TD>Nocrypt:</TD><TD><input name=\"nocrypt\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##NOCRYPT##\">wrong, see Ticket #265</TD></TR>\n\
603 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
604 </TABLE>\n\
605</form>\n\
606<BR><BR>Configuration camd33 not yet implemented<BR><BR>\n\
607##TPLFOOTER##"
608
609#define TPLCONFIGCAMD35 "\
610##TPLHEADER##\
611##TPLMENU##\n\
612##TPLCONFIGMENU##\n\
613<BR><BR>\n\
614##MESSAGE##\
615<form action=\"config.html\" method=\"get\">\n\
616 <input name=\"part\" type=\"hidden\" value=\"camd35\">\n\
617 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
618 <TABLE cellspacing=\"0\">\n\
619 <TR><TH>&nbsp;</TH><TH>Edit Camd35 Config</TH></TR>\n\
620 <TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##PORT##\"></TD></TR>\n\
621 <TR><TD>Serverip:</TD><TD><input name=\"serverip\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##SERVERIP##\"></TD></TR>\n\
622 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
623 </TABLE>\n\
624</form>\n\
625<BR><BR>Configuration camd35 not yet implemented<BR><BR>\n\
626##TPLFOOTER##"
627
628#define TPLCONFIGSERIAL "\
629##TPLHEADER##\
630##TPLMENU##\n\
631##TPLCONFIGMENU##\n\
632<BR><BR>\n\
633##MESSAGE##\
634<form action=\"config.html\" method=\"get\">\n\
635 <input name=\"part\" type=\"hidden\" value=\"serial\">\n\
636 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
637 <TABLE cellspacing=\"0\">\n\
638 <TR><TH>&nbsp;</TH><TH>Edit Serial Config</TH></TR>\n\
639 <TR><TD>Device:</TD><TD><input name=\"device\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##SERIALDEVICE##\"></TD></TR>\n\
640 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
641 </TABLE>\n\
642</form>\n\
643<BR><BR>Configuration Serial not yet implemented<BR><BR>\n\
644##TPLFOOTER##"
645
646enum refreshtypes {REFR_ACCOUNTS, REFR_READERS, REFR_SERVER, REFR_ANTICASC};
647
648char *tpl[]={
649 "HEADER",
650 "FOOTER",
651 "MENU",
652 "REFRESH",
653 "STATUS",
654 "CLIENTSTATUSBIT",
655 "USERCONFIGLIST",
656 "USERCONFIGLISTBIT",
657 "SIDTAB",
658 "SIDTABBIT",
659 "READERS",
660 "READERSBIT",
661 "ENTITLEMENTS",
662 "READERCONFIG",
663 "READERCONFIGSIDOKBIT",
664 "READERCONFIGSIDNOBIT",
665 "USEREDIT",
666 "USEREDITRDRSELECTED",
667 "USEREDITSIDOKBIT",
668 "USEREDITSIDNOBIT",
669 "SAVETEMPLATES",
670 "CONFIGMENU",
671 "CONFIGGBOX",
672 "CONFIGCCCAM",
673 "CONFIGMONITOR",
674 "CONFIGRADEGAST",
675 "CONFIGNEWCAMD",
676 "CONFIGGLOBAL",
677 "CONFIGCAMD33",
678 "CONFIGCAMD35",
679 "CONFIGSERIAL"
680#ifdef CS_ANTICASC
681 ,"USEREDITANTICASC"
682 ,"CONFIGANTICASC"
683 ,"CONFIGMENUANTICASC"
684#endif
685};
686
687char *tplmap[]={
688 TPLHEADER,
689 TPLFOOTER,
690 TPLMENU,
691 TPLREFRESH,
692 TPLSTATUS,
693 TPLCLIENTSTATUSBIT,
694 TPLUSERCONFIGLIST,
695 TPLUSERCONFIGLISTBIT,
696 TPLSIDTAB,
697 TPLSIDTABBIT,
698 TPLREADERS,
699 TPLREADERSBIT,
700 TPLENTITLEMENTS,
701 TPLREADERCONFIG,
702 TPLREADERCONFIGSIDOKBIT,
703 TPLREADERCONFIGSIDNOBIT,
704 TPLUSEREDIT,
705 TPLUSEREDITRDRSELECTED,
706 TPLUSEREDITSIDOKBIT,
707 TPLUSEREDITSIDNOBIT,
708 TPLSAVETEMPLATES,
709 TPLCONFIGMENU,
710 TPLCONFIGGBOX,
711 TPLCONFIGCCCAM,
712 TPLCONFIGMONITOR,
713 TPLCONFIGRADEGAST,
714 TPLCONFIGNEWCAMD,
715 TPLCONFIGGLOBAL,
716 TPLCONFIGCAMD33,
717 TPLCONFIGCAMD35,
718 TPLCONFIGSERIAL
719#ifdef CS_ANTICASC
720 ,TPLUSEREDITANTICASC
721 ,TPLCONFIGANTICASC
722 ,TPLCONFIGMENUANTICASC
723#endif
724};
725
726struct templatevars {
727 int varscnt;
728 int varsalloc;
729 int tmpcnt;
730 int tmpalloc;
731 char **names;
732 char **values;
733 char **tmp;
734};
735
736struct uriparams {
737 int paramcount;
738 char *params[MAXGETPARAMS];
739 char *values[MAXGETPARAMS];
740};
741
742static char hex2ascii[256][2];
743static char noncekey[33];
744
745
746char *tpl_addVar(struct templatevars *vars, int append, char *name, char *value);
747char *tpl_addTmp(struct templatevars *vars, char *value);
748char *tpl_printf(struct templatevars *vars, int append, char *varname, char *fmtstring, ...);
749char *tpl_getVar(struct templatevars *vars, char *name);
750struct templatevars *tpl_create();
751void tpl_clear(struct templatevars *vars);
752char *tpl_getUnparsedTpl(const char* name);
753char *tpl_getTpl(struct templatevars *vars, const char* name);
754char *parse_auth_value(char *value);
755void calculate_nonce(char *result, int resultlen);
756int check_auth(char *authstring, char *method, char *path, char *expectednonce);
757void send_headers(FILE *f, int status, char *title, char *extra, char *mime);
758void send_css(FILE *f);
759char *getParam(struct uriparams *params, char *name);
760int tpl_saveIncludedTpls(const char *path);
Note: See TracBrowser for help on using the repository browser.