1 <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4 <meta http
-equiv
="content-type" content
="text/html; charset=UTF-8">
5 <META HTTP
-EQUIV
="PRAGMAS" CONTENT
="NO-CACHE">
6 <title
>aMule CVS
- Web Control Panel
</title
>
8 <style type
="text/css">
13 a
, a
:active
, a
:link
, a
:visited
17 .down
-header
, .down
-header
-left
, .down
-header
-right
,
18 .down
-line
, .down
-line
-good
, .down
-line
-left
, .down
-line
-good
-left
,
19 .down
-line
-right
, .down
-line
-good
-right
,
20 .up
-header
, .up
-header
-left
, .up
-line
, .up
-line
-left
,
21 .server
-header
, .server
-header
-left
, .server
-line
, .server
-line
-left
,
22 .shared
-header
, .shared
-header
-left
, .shared
-line
, .shared
-line
-changed
,
23 .shared
-line
-left
, .shared
-line
-left
-changed
,
24 .header
, .smallheader
, .commontext
,
25 .upqueue
-header
, .upqueue
-line
, .upqueue
-line
-left
,
26 .websearch
-header
, .websearch
-line
, .addserver
-header
, .addserver
-line
35 background
-color
: #3399FF;
37 .down
-header
, .down
-line
, .down
-line
-good
, .up
-header
, .up
-line
,
38 .server
-header
, .server
-line
, .shared
-header
, .shared
-line
, .shared
-line
-changed
,
39 .upqueue
-header
, .upqueue
-line
,
40 .websearch
-header
, .websearch
-line
, .addserver
-header
, .addserver
-line
44 .down
-header
-left
, .down
-line
-left
, .down
-line
-good
-left
,
45 .server
-header
-left
, .server
-line
-left
, .shared
-header
-left
,
46 .up
-header
-left
, .up
-line
-left
, .shared
-line
-left
, .shared
-line
-left
-changed
, .upqueue
-line
-left
50 .down
-line
-right
, .down
-line
-good
-right
, .down
-header
-right
54 .down
-header
, .down
-header
-left
, .down
-header
-right
,
55 .up
-header
, .up
-header
-left
, .server
-header
, .server
-header
-left
,
56 .shared
-header
, .shared
-header
-left
, .upqueue
-header
,
57 .websearch
-header
, .addserver
-header
59 background
-color
: #0066CC;
63 background
-color
: #0046AC;
67 background
-color
: #003399;
72 background
-color
: #FFFFFF;
75 .down
-line
, .down
-line
-good
, .down
-line
-left
, .down
-line
-good
-left
,
76 .down
-line
-right
, .down
-line
-good
-right
,
77 .up
-line
, .up
-line
-left
, .server
-line
, .server
-line
-left
,
78 .shared
-line
, .shared
-line
-changed
, .shared
-line
-left
, .shared
-line
-left
-changed
,
79 .upqueue
-line
, .upqueue
-line
-left
,
80 .websearch
-line
, .addserver
-line
82 background
-color
: #3399FF;
84 .down
-line
-good
, .down
-line
-good
-left
, .down
-line
-good
-right
, .shared
-line
-changed
, .shared
-line
-left
-changed
90 border
:0px solid
#000000;
91 border
-collapse
: collapse
;
107 <script language
="JavaScript" type
="text/JavaScript">
109 var initvals
= new Object;
112 // apply new options before proceeding
113 //var_dump($HTTP_GET_VARS);
114 if ( ($HTTP_GET_VARS["cmd"] == "apply") && ($_SESSION["guest_login"] == 0) ) {
116 "upload_full_chunks", "first_last_chunks_prio"
118 $conn_opts = array("max_line_up_cap","max_up_limit",
119 "max_line_down_cap","max_down_limit",
120 "max_file_src","max_conn_total");
121 $webserver_opts = array("use_gzip", "autorefresh_time");
124 foreach ($conn_opts as $i) {
125 $curr_value = $HTTP_GET_VARS[$i];
126 if ( $curr_value == "on") $curr_value = 1;
127 if ( $curr_value == "") $curr_value = 0;
129 $all_opts["connection"][$i] = $curr_value;
131 foreach ($file_opts as $i) {
132 $curr_value = $HTTP_GET_VARS[$i];
133 if ( $curr_value == "on") $curr_value = 1;
134 if ( $curr_value == "") $curr_value = 0;
136 $all_opts["files"][$i] = $curr_value;
138 foreach ($webserver_opts as $i) {
139 $curr_value = $HTTP_GET_VARS[$i];
140 if ( $curr_value == "on") $curr_value = 1;
141 if ( $curr_value == "") $curr_value = 0;
143 $all_opts["webserver"][$i] = $curr_value;
145 //var_dump($all_opts);
146 amule_set_options($all_opts);
149 $opts = amule_get_options();
151 $opt_groups = array("connection", "files", "webserver", "coretweaks");
152 //var_dump($opt_groups);
153 foreach ($opt_groups as $group) {
154 $curr_opts = $opts[$group];
155 //var_dump($curr_opts);
156 foreach ($curr_opts as $opt_name => $opt_val) {
157 echo 'initvals["', $opt_name, '"] = "', $opt_val, '";', "\n";
164 var frm
= document
.forms
.mainform
166 var str_param_names
= new Array(
167 "max_line_down_cap", "max_line_up_cap",
168 "max_up_limit", "max_down_limit", "max_file_src",
172 for(i
= 0; i
< str_param_names
.length
; i++
) {
173 frm
[str_param_names
[i
]].value
= initvals
[str_param_names
[i
]];
175 var check_param_names
= new Array(
176 "use_gzip", "upload_full_chunks", "first_last_chunks_prio"
178 for(i
= 0; i
< check_param_names
.length
; i++
) {
179 frm
[check_param_names
[i
]].checked
= initvals
[check_param_names
[i
]] == "1" ?
true : false;
186 <body onload
="init_data();" bgcolor
="#FBDE9C" text
=white link
="#3399FF" vlink
="#3399FF" alink
="#3399FF" marginwidth
=0 marginheight
=0 topmargin
=0 leftmargin
=0 style
="margin:0px">
187 <table border
=0 width
="100%" align
=center cellpadding
=4 cellspacing
=0>
189 <td
class="tabs" align
="left" colspan
="2">
191 <table border
="0" cellpadding
="4" cellspacing
="0">
193 <td
class="tabs" align
="center">
194  
;<a href
="http://www.amule.org" target
="_blank"><img src
="emule.gif"></a
>
195 <font face
="Tahoma" style
="font-size:13pt;" color
="#000000">aMule
<br
>Web Control Panel
</font
>
197 <td
class="tabs" align
="center" width
="30"> 
; </td
>
199 <td align
="center" class="tabs" width
="95">
200 <a href
="servers.php">
201 <img src
="cp_servers.gif"><br
>
205 <td align
="center" class="tabs" width
="95">
206 <a href
="downloads.php">
207 <img src
="cp_download.gif"><br
>
212 <td align
="center" class="tabs" width
="95">
213 <a href
="search.php">
214 <img src
="cp_search.gif"><br
>
218 <td align
="center" class="tabs" width
="95">
220 <a href
="shared.php">
221 <img src
="cp_shared.gif"><br
>
224 <td align
="center" class="tabs" width
="110">
225 <a href
="stat_tree.php">
226 <img src
="cp_stats.gif"><br
>
228 <font color
="#000000">|
</font
>
230 <a href
="stat_graphs.php">Graphs
</a
>
233 <td align
="center" class="tabs" width
="95">
234 <a href
="preferences.php">
235 <img src
="cp_settings.gif"><br
>
240 <td
class="tabs" align
="center" width
="30"> 
;</td
>
241 <td align
="left" class="tabs" width
="95">
242 <img src
="log.gif"> <a href
="index.php?serverinfo=1">Serverinfo
</a
><br
>
243 <img src
="log.gif"> <a href
="index.php?log=1">Log
</a
>
251 <td style
="background-color: #000000; height: 1px" colspan
="2">
256  
; 
;<b
>Connection
:</b
>
258 function CastToXBytes($size)
260 if ( $size < 1024 ) {
261 $result = $size . " bytes";
262 } elseif ( $size < 1048576 ) {
263 $result = ($size / 1024.0) . "KB";
264 } elseif ( $size < 1073741824 ) {
265 $result = ($size / 1048576.0) . "MB";
267 $result = ($size / 1073741824.0) . "GB";
272 $stats = amule_get_stats();
273 if ( $stats["kad_connected"] == 1 ) {
275 if ( $stats["kad_firewalled"] == 1 ) {
276 echo " to KAD (firewalled), ";
281 echo "Not connected to KAD, ";
283 if ( $stats["id"] == 0 ) {
284 echo "not connected to ED2K";
285 } elseif ( $stats["id"] == 0xffffffff ) {
286 echo "connecting to ED2k";
288 echo "connected with ", (($stats["id"] < 16777216) ?
"low" : "high"), " ID to ",
289 $stats["serv_name"], " ", $stats["serv_addr"];
291 echo '<br> <b>Speed:</b> Up: ', CastToXBytes($stats["speed_up"]), 'ps',
292 ' | Down: ', CastToXBytes($stats["speed_down"]), 'ps',
293 '<small> (Limits: ', CastToXBytes($stats["speed_limit_up"]), 'ps/',
294 CastToXBytes($stats["speed_limit_down"]), 'ps)</small> ';
299 <script type
="text/javascript" language
="javascript">
301 s
= "[ " + d
.getDate() +
"/" +
(d
.getMonth() +
1) +
"/" + d
.getFullYear() +
" " + d
.getHours() +
":" +
(d
.getMinutes() < 10 ?
"0" : "") + d
.getMinutes() +
":" +
(d
.getSeconds() < 10 ?
"0" : "") + d
.getSeconds() +
" ]";
306 <td align
=right
class=tabs
>
308 <input type
="button" value
="ed2k://Download" onClick
='self.location.href="index.php?links=1"'>
309 <input type
="button" value
="Logout" onClick
='self.location.href="login.php"'>
317 <form name
="mainform" action
="preferences.php" method
="post">
319 <input type
="hidden" name
="cmd" value
="apply">
320 <table border
=0 align
=center cellpadding
=4 cellspacing
=0 width
="90%">
321 <tr
><td
><font face
=Tahoma style
="font-size:10pt;" color
=black
>Web Control Panel
</font
></td
></tr
>
323 <td align
=left valign
=middle bgcolor
="#0066CC">
324 <font face
=Tahoma style
="font-size:8pt;"><b
>Gzip Compression
</b
></font
>
325 <input type
="checkbox" name
="use_gzip" id
="use_gzip">
329 <td align
=left valign
=top bgcolor
="#3399FF">
330 <font face
=Tahoma style
="font-size:8pt;">
331  
; 
; 
; 
;Save traffic
, especially in graphs
.
338 <td align
=left valign
=middle bgcolor
="#0066CC">
339 <font face
=Tahoma style
="font-size:8pt;"><b
>Refresh
-Time of Pages
</b
></font
>
343 <td align
=left valign
=top bgcolor
="#3399FF">
344 <font face
=Tahoma style
="font-size:8pt;">
345  
; 
; 
; 
;Time in
seconds (zero
=disabled
): <input type
="text" name
="autorefresh_time" id
="autorefresh_time" size
="5" class=dinput
><br
>
351 <tr
><td
><br
><font face
=Tahoma style
="font-size:10pt;" color
=black
>aMule
</font
></td
></tr
>
353 <td align
=left valign
=middle bgcolor
="#0066CC">
354 <font face
=Tahoma style
="font-size:8pt;"><b
>Speed Limits
</b
></font
>
359 <td align
=left valign
=top bgcolor
="#3399FF">
360 <font face
=Tahoma style
="font-size:8pt;">
361  
; 
; 
; 
;Download
: <input type
="text" name
="max_down_limit" id
="max_down_limit" size
="5" class=dinput
> kB
/s
362  
; 
;Upload
: <input type
="text" name
="max_up_limit" id
="max_up_limit" size
="5" class=dinput
> kB
/s
368 <td align
=left valign
=middle bgcolor
="#0066CC">
369 <font face
=Tahoma style
="font-size:8pt;"><b
>Bandwidth Limits
</b
></font
>
374 <td align
=left valign
=top bgcolor
="#3399FF">
375 <font face
=Tahoma style
="font-size:8pt;">
376  
; 
; 
; 
;Download
: <input type
="text" name
="max_line_down_cap" id
="max_line_down_cap" size
="5" class=dinput
> kB
/s
377  
; 
;Upload
: <input type
="text" name
="max_line_up_cap" id
="max_line_up_cap" size
="5" class=dinput
> kB
/s
383 <td align
=left valign
=middle bgcolor
="#0066CC">
384 <font face
=Tahoma style
="font-size:8pt;"><b
>Connection Limits
</b
></font
>
389 <td align
=left valign
=top bgcolor
="#3399FF">
391 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Max Sources Per File
:</font
></td
><td
>
392 <input type
="text" name
="max_file_src" id
="max_file_src" size
="5" class=dinput value
="300"></td
></tr
>
393 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Max
. Connections
:</font
></td
><td
>
394 <input type
="text" name
="max_conn_total" id
="max_conn_total" size
="5" class=dinput value
="499"></td
></tr
>
395 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Max
. new connections
/ 5secs
:</font
></td
><td
>
396 <input type
="text" name
="max_conn_5sec" id
="max_conn_5sec" size
="5" class=dinput value
="20"></td
></tr
>
402 <td align
=left valign
=middle bgcolor
="#0066CC">
404 <font face
=Tahoma style
="font-size:8pt;"><b
>File Settings
</b
></font
>
408 <td align
=left valign
=top bgcolor
="#3399FF">
410 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Try to transfer full chunks to all uploads
</font
></td
><td
>
411 <input type
="checkbox" name
="upload_full_chunks" id
="upload_full_chunks"></td
></tr
>
412 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Try to download first
and last chunks first
</font
></td
><td
>
413 <input type
="checkbox" name
="first_last_chunks_prio" id
="first_last_chunks_prio"></td
></tr
>
419 <td align
=center
><br
><input type
=submit value
="Apply"></td
>