forked from poppyred/1.6.x
/
thinclient.softs.php
executable file
·357 lines (268 loc) · 9.42 KB
/
thinclient.softs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<?php
include_once('ressources/class.templates.inc');
include_once('ressources/class.ldap.inc');
include_once('ressources/class.users.menus.inc');
if(posix_getuid()==0){die();}
$user=new usersMenus();
if($user->AsVirtualBoxManager==false){
$tpl=new templates();
echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
die();exit();
}
if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["services"])){services();exit;}
if(isset($_GET["windows_manager"])){windows_drivers();exit;}
if(isset($_GET["utilities"])){utilities_drivers();exit;}
if(isset($_GET["sound"])){sound_drivers();exit;}
if(isset($_GET["storage"])){storage_module();exit;}
if(isset($_GET["module"])){save_module();exit;}
if(isset($_GET["package"])){save_package();exit;}
js();
function js(){
$page=CurrentPageName();
$tpl=new templates();
$title=$tpl->_ENGINE_parse_body('{services}');
$html="
function ThinCLientSoftLoadpage(){
YahooWin2('750','$page?popup=yes','$title');
}
var x_ThinClientHardWare= function (obj) {
var tempvalue=obj.responseText;
if(tempvalue.length>3){alert(tempvalue);}
}
function ThinClientHardWare(id){
var XHR = new XHRConnection();
XHR.appendData('module',id);
if(document.getElementById('id_'+id).checked){XHR.appendData('enabled',1);}else{XHR.appendData('enabled',0);}
XHR.sendAndLoad('$page', 'GET',x_ThinClientHardWare);
}
function ThinClientPackage(id){
var XHR = new XHRConnection();
XHR.appendData('package',id);
if(document.getElementById('id_'+id).checked){XHR.appendData('enabled',1);}else{XHR.appendData('enabled',0);}
XHR.sendAndLoad('$page', 'GET',x_ThinClientHardWare);
}
ThinCLientSoftLoadpage()";
echo $html;
}
function popup(){
$page=CurrentPageName();
$tpl=new templates();
$array["services"]='{services}';
$array["windows_manager"]='{windows_manager}';
$array["utilities"]="{utilities}";
while (list ($num, $ligne) = each ($array) ){
$html[]= $tpl->_ENGINE_parse_body("<li><a href=\"$page?$num=yes\"><span>$ligne</span></a></li>\n");
}
echo "
<div id=main_config_thinclient_softs style='width:100%;height:650px;overflow:auto'>
<ul>". implode("\n",$html)."</ul>
</div>
<script>
$(document).ready(function(){
$('#main_config_thinclient_softs').tabs({
load: function(event, ui) {
$('a', ui.panel).click(function() {
$(ui.panel).load(this.href);
return false;
});
}
});
});
</script>";
}
function services(){
$page=CurrentPageName();
$tpl=new templates();
$sql="SELECT `package` FROM thinclient_package_modules";
$q=new mysql;
$results=$q->QUERY_SQL($sql,'artica_backup');
while($ligne=mysql_fetch_array($results,MYSQL_ASSOC)){
$modules[trim($ligne["package"])]=true;
}
$mds=array("rdesktop"=>"X RDP client for Windows Terminal Services (ver 1.6).",
"vncviewer"=>"VNC client (vncviewer)",
"ica"=>"Citrix ICA client ver. 11",
"tarantella"=>"Tarantella client support",
"ica_wfc"=>"Citrix ICA manager ver. 11",
"xnes"=>"XDM in a window client",
"rxvt"=>"Light Xterm Client (vt102)",
"xterm"=>"Xterm Client (vt220)",
"ssh"=>"Secure Shell client",
"tn5250"=>"5250 terminal emulator",
"dillo"=>"Dillo light web browser",
"nx"=>"No Machine NX client",
"2x"=>"2X client",
"java"=>"Java runtime",
"firefox"=>"Firefox web browser ver. 3.0.x",
"flash"=>"Flash plug-in ver. 9.0",
"kiosk"=>"Sets Firefox in kiosk mode (full screen requires a WM)",
"thinlinc"=>"Cendio Thinlinc terminal client ver. 3.0.0-1979",
"vmview"=>"Open-vmware view client 4.0.1");
$html="
<table cellspacing='0' cellpadding='0' border='0' class='tableView'>
<thead class='thead'>
<tr>
<th colspan=2> </th>
</tr>
</thead>
<tbody class='tbody'>";
$enable_service["rdesktop"]=true;
while (list ($num, $ligne) = each ($mds) ){
if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
if($modules[$num]){$def=1;}else{$def=0;}
if(!$enable_service["$num"]){
$js[]="document.getElementById('id_$num').disabled=true;";
}
$html=$html."
<tr class=$classtr>
<td width=1%>". Field_checkbox("id_$num",1,$def,"ThinClientPackage('{$num}')")."</td>
<td width=99% style='font-size:13px'>$ligne</td>
</tr>
";}
$final_js=@implode("\n",$js);
$html=$html."
</tbody>
</table>
<script>
function DisablePackagesServices(){
$final_js
}
DisablePackagesServices();
</script>";
echo $tpl->_ENGINE_parse_body($html);
}
function utilities_drivers(){
$page=CurrentPageName();
$tpl=new templates();
$sql="SELECT `package` FROM thinclient_package_modules";
$q=new mysql;
$results=$q->QUERY_SQL($sql,'artica_backup');
while($ligne=mysql_fetch_array($results,MYSQL_ASSOC)){
$modules[trim($ligne["package"])]=true;
}
$mds=array("xtdesk"=>"Adds icons to desktop",
"ttf-freefont"=>"GNU freefont true type font. Improves the looks of icewm, firefox etc. (3.5 MB)",
"www"=>"Web access to client. From a browser: http://<IP number> The standard page is for general user settings, administrative access is on port 6800.",
"lp_server"=>"Remote printing daemon (JetDirect compatible)",
"lpr"=>"LPR Print Server, for use with samba-server package",
"lprng"=>"LPRng Print Server, supports network based printing",
"sshd"=>"Dropbear secure shell server",
"tftpd"=>"Built in tftpd server. Useful for making a tftpserver for thinstation on a WAN over a slow link.",
"samba-server"=>"Samba server FS Support, allows you to share local floppy/cdrom/hd/printer to other Windows PCs. Needs supermount for removeable media.",
"samba-client"=>"Samba smbclient, gives a shell like environment to access an samba server ",
"hdupdate"=>"Package for updating TS images on a hardisk over a network connection",
"scp"=>"Add ability to download files over internet using scp. This package adds some networking based options for downloading configuration files or in using hdupdate package.",
"openvpn"=>"OpenVPN Client Support",
"gemplus410"=>"Card reader Gemplus 410 (Serial) and Gemplus 430 (USB)",
"ccidreader"=>"Generic USB card reader");
$html="
<table cellspacing='0' cellpadding='0' border='0' class='tableView'>
<thead class='thead'>
<tr>
<th colspan=2> </th>
</tr>
</thead>
<tbody class='tbody'>";
while (list ($num, $ligne) = each ($mds) ){
if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
if($modules[$num]){$def=1;}else{$def=0;}
$js[]="document.getElementById('id_$num').disabled=true;";
$html=$html."
<tr class=$classtr>
<td width=1%>". Field_checkbox("id_$num",1,$def,"ThinClientPackage('{$num}')")."</td>
<td width=99% style='font-size:13px'>$ligne</td>
</tr>
";}
$final_js=@implode("\n",$js);
$html=$html."
</tbody>
</table>
<script>
function DisablePackagesUtilities(){
$final_js
}
DisablePackagesUtilities();
</script>
";
echo $tpl->_ENGINE_parse_body($html);
}
function windows_drivers(){
$page=CurrentPageName();
$tpl=new templates();
$sql="SELECT `package` FROM thinclient_package_modules";
$q=new mysql;
$results=$q->QUERY_SQL($sql,'artica_backup');
while($ligne=mysql_fetch_array($results,MYSQL_ASSOC)){
$modules[trim($ligne["package"])]=true;
}
$mds=array("blackbox"=>"Blackbox window manager. Makes TS a light workstation.",
"icewm"=>"ICEWM window manager. Makes TS a light workstation.",
"icewm-theme-bernstein"=>"bernstein GTK2 style",
"icewm-theme-bluecrux"=>"GTK2 style",
"icewm-theme-liquid"=>"Mac liquid style",
"icewm-theme-xp"=>"Windows XP style");
$html="
<table cellspacing='0' cellpadding='0' border='0' class='tableView'>
<thead class='thead'>
<tr>
<th colspan=2> </th>
</tr>
</thead>
<tbody class='tbody'>";
while (list ($num, $ligne) = each ($mds) ){
if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
if($modules[$num]){$def=1;}else{$def=0;}
$js[]="document.getElementById('id_$num').disabled=true;";
$html=$html."
<tr class=$classtr>
<td width=1%>". Field_checkbox("id_$num",1,$def,"ThinClientPackage('{$num}')")."</td>
<td width=99% style='font-size:13px'>$ligne</td>
</tr>
";}
$final_js=@implode("\n",$js);
$html=$html."
</tbody>
</table>
<script>
function DisablePackagesWindows(){
$final_js
}
DisablePackagesWindows();
</script>";
echo $tpl->_ENGINE_parse_body($html);
}
function save_package(){
$q=new mysql();
$module=$_GET["package"];
$mds=array("blackbox"=>"Blackbox window manager. Makes TS a light workstation.",
"icewm"=>"ICEWM window manager. Makes TS a light workstation.",
"icewm-theme-bernstein"=>"Select ONE icewm theme package.",
"icewm-theme-bluecrux"=>"GTK2 style",
"icewm-theme-liquid"=>"Mac liquid style",
"icewm-theme-xp"=>"Windows XP style");
if($mds[$module]<>null){
while (list ($num, $ligne) = each ($mds) ){
$sql="DELETE FROM thinclient_package_modules WHERE `package`='$num';";
$q->QUERY_SQL($sql,'artica_backup');
}
}
if($_GET["enabled"]==1){
$sql="INSERT INTO thinclient_package_modules (`package`) VALUES ('$module');";
}else{
$sql="DELETE FROM thinclient_package_modules WHERE `package`='$module';";
}
$q->QUERY_SQL($sql,'artica_backup');
if(!$q->ok){echo $q->mysql_error;}
if($module=="xorg6-via"){
$sql="DELETE FROM thinclient_package_modules WHERE `package`='xorg6-openchrome';";
$q->QUERY_SQL($sql,'artica_backup');
$sql="DELETE FROM thinclient_package_modules WHERE `package`='xorg6-unichrome';";
$q->QUERY_SQL($sql,'artica_backup');
}
if($module=="xorg6-unichrome"){
$sql="DELETE FROM thinclient_package_modules WHERE `package`='xorg6-via';";
$q->QUERY_SQL($sql,'artica_backup');
}
}
?>