function list_files() { $base = $_GET["browse-tree"]; $folder = $_GET["dar-list-files"]; $cryt = new SimpleCrypt(); $mounted_path_decrypted = $cryt->decrypt(base64_decode($_GET["mounted-path"])); $tpl = new templates(); $KEY = md5(implode("", $_GET)); if (isset($_SESSION["DAR_FILE_PAGE"][$KEY])) { echo $tpl->_ENGINE_parse_body($_SESSION["DAR_FILE_PAGE"][$KEY], "dar.index.php"); return true; } $folder = str_replace($base, '', $folder); if (substr($folder, strlen($folder) - 1, 1) == '/') { $folder = substr($folder, 0, strlen($folder) - 1); } if (substr($folder, 0, 1) == '/') { $folder = substr($folder, 1, strlen($folder)); } $folder = str_replace('//', '/', $folder); $array = DirFilesCaches($base, $folder, $mounted_path_decrypted); $foldernum = get_path_id($folder, $mounted_path_decrypted); $html = "<table style='width:100%'>\n\t<tr>\n\t\t<td valign='middle'><strong>{$folder}</strong></td>\n\t\t<td width=1%>" . imgtootltip('24-redo.png', "{restore}", "DarLoadPathDetails('{$foldernum}');") . "</td>\n\t</tr>\n\t</table>\n\t<hr>\n\t<table style='width:100%'>\n\t"; while (list($num, $line) = each($array)) { $file_path = $line["PATH"]; $date = $line["DATE"]; $size = $line["SIZE"]; $js = "DarLoadPathDetails('{$num}');"; $size = ParseBytes($size); $html = $html . "\n\t\t<tr " . CellRollOver($js) . ">\n\t\t<td width=1% valign='top'>" . get_img_ext($file_path) . "</td>\n\t\t<td><code style='font-size:11px'>{$file_path}</code></td>\n\t\t<td><code style='font-size:11px'>{$size}</code></td>\n\t\t<td width=1% valign='top' nowrap>{$date}</td>\n\t\t\n\t\t</tr>\n\t\t"; } $html = $html . "</table>"; $_SESSION["DAR_FILE_PAGE"][$KEY] = $html; echo $tpl->_ENGINE_parse_body($html, "dar.index.php"); }
function action_to_text($pattern) { $action["rate"] = "{check_rate_limit}"; $action["size"] = "{check_size_limit}"; $action["rcpt"] = "{check_rcpt_limit}"; $action["note"] = "{event}"; $action["dunno"] = "{accept}"; $action["reject"] = "{reject}"; $action["WARN"] = "{warn}"; $action["greylist"] = "{greylisting}"; $action["greylisting"] = "{greylisting}"; $action["HOLD"] = "{put_in_hold_queue}"; $action["REDIRECT"] = "{redirect_to_email}"; $action["BYPASSAMAVIS"] = "{bypass_amavis}"; $text_action = $action[$pattern]; if (preg_match("#(.+?):(.+?):(.+)#", $pattern, $re)) { if ($re[1] == "rate") { $text_action = "{deny_if} {$action[$re[1]]} {$re[2]}msgs/{$re[3]}s"; } if ($re[1] == "size") { $maxsize = ParseBytes($re[2] / 1024); $text_action = "{deny_if} {$action[$re[1]]} {$maxsize}/{$re[3]}s"; } if ($re[1] == "rcpt") { $text_action = "{deny_if} {$action[$re[1]]} {$re[2]} {recipients}/{$re[3]}s"; } } if (preg_match("#score:(.+)#", $pattern, $re)) { $text_action = "{set_a_score} {$re[1]}"; } if (preg_match("#jump R-([0-9]+)#", $pattern, $re)) { $text_action = "{jumpto} {rule} {$re[1]}"; } if (preg_match("#REDIRECT\\s+(.+)#", $pattern, $re)) { $text_action = "{redirect_to_email} {$re[1]}"; } if (preg_match("#throttle:(.+?):(.+)#", $pattern, $re)) { $text_action = "{domain_throttle} «{$re[2]}»"; } return $text_action; }
function cron_apc_list() { $apc_cache_info = apc_cache_info(); $html = "\n\t<div style='height:500px;overflow:auto'>\n\t<table style='width:100%'>"; while (list($num, $array) = each($apc_cache_info["cache_list"])) { $filename = $array["filename"]; $filename = str_replace(dirname(__FILE__) . "/", "", $filename); $mem_size = ParseBytes($array["mem_size"] / 1024); $access_time = date('D H:i:s', $array["access_time"]); $html = $html . "\n\t\t\t<tr " . CellRollOver() . ">\n\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t<td><strong>{$filename}</strong></td>\n\t\t\t<td width=1% nowrap><strong>{$mem_size}</strong></td>\n\t\t\t<td width=1% nowrap><strong>{$access_time}</strong></td>\n\t\t\t</tr>"; } $html = $html . "</table></div"; echo $html; }
public function DATABASE_INFOS() { $sql = "show TABLE STATUS"; $results = $this->QUERY_SQL($sql, $this->database); $dbsize = 0; $count = 0; while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) { $dbsize += $ligne['Data_length'] + $ligne['Index_length']; $count = $count + 1; } return array($count, ParseBytes($dbsize)); }
function TABLE_STATUS($Max_data_length, $dbsize) { $pourc = $dbsize / $Max_data_length * 100; $pourc = round($pourc, 3); $color = "#5DD13D"; $dbsize = ParseBytes($dbsize); $Max_data_length = ParseBytes($Max_data_length); return "{$dbsize}/{$Max_data_length} {$pourc}%"; return "<div style='width:100%;background-color:white;padding-left:0px;border:1px solid {$color}'>\n\t\t\t\t\t<div id='progression_postfix_compile'>\n\t\t\t\t\t\t<div style='width:{$pourc}%;text-align:center;color:white;padding-top:3px;padding-bottom:3px;background-color:{$color}'>\n\t\t\t\t\t\t\t<strong style='color:#BCF3D6;font-size:12px;font-weight:bold'>{$dbsize}/{$Max_data_length} {$pourc}%</strong></center>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>"; }
function popup_edit_software() { $page = CurrentPageName(); $sql = "SELECT description,filetype,filesize,filename,commandline,ExecuteAfter,MinutesToWait,OCS_PACKAGE FROM files_storage WHERE id_files={$_GET["popup-edit-software"]}"; $q = new mysql(); $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup')); $filesize = ParseBytes($ligne["filesize"]); $ligne["description"] = html_entity_decode($ligne["description"]); $ligne["description"] = br2nl($ligne["description"]); $commandline = $ligne["commandline"]; $ExecuteAfter = $ligne["ExecuteAfter"]; $MinutesToWait = $ligne["MinutesToWait"]; for ($i = 2; $i < 60; $i++) { $mins[$i * 60] = $i; } $MinutesToWait = Field_array_Hash($mins, "MinutesToWait", $MinutesToWait); $form = "<TABLE style='width:98%' class=table_form>\n\t\t <TR>\n\t\t \t <TD class=legend valign='top'>{description}: </TD>\n\t\t \t <TD><TEXTAREA NAME=\"txtDescription\" id=\"txtDescription\" ROWS=\"5\" COLS=\"30\">{$ligne["description"]}</TEXTAREA></TD>\n\t\t </TR>\n\t\t <TR>\n\t\t \t\t<TD class=legend nowrap>{commandline}: </TD>\n\t\t \t\t<TD>" . Field_text("commandline", $commandline) . "</TD>\n\t\t </TR>\t\t \n\t\t\t<TR>\t\n\t\t \t\t<TD class=legend nowrap>{ExecuteAfter}: </TD>\n\t\t \t\t<TD>" . Field_text("ExecuteAfter", $ExecuteAfter) . "</TD>\n\t\t </TR>\t\n\t\t\t<TR>\t\n\t\t \t\t<TD class=legend nowrap>{MinutesToWait}: </TD>\n\t\t \t\t<TD>{$MinutesToWait}</TD>\n\t\t </TR>\t\t\t \t\t \n\t\t<tr>\n\t\t\t<td valing='top' align='right' colspan=2><input type='button' OnClick=\"javascript:SavePackegInfos({$_GET["popup-edit-software"]});\" value=\"{apply} »\">\n\t\t</tr>\n\t\t </table>"; if ($ligne["OCS_PACKAGE"] == 1) { $form = "<table style='width:100%'>\n\t<tr>\n\t<td width=1% valign='top'><img src='img/64-ocs.png'></td>\n\t<td valign='top'>" . RoundedLightWhite("<p><code style='font-size:13px;font-weight:bold'>{$ligne["description"]}</code></p>\n\t<br><code style='font-size:13px;font-weight:bold'>{commandline}: {$commandline}</code>\n\t<br><code style='font-size:10px;font-weight:bold'>{ExecuteAfter}: {$ExecuteAfter}</code>\n\t<br><code style='font-size:13px;font-weight:bold'>{MinutesToWait}:{$ligne["MinutesToWait"]}mn</code>\n\t") . "</td>\n\t</tr>\n\t</table>"; } $html = "<H1>{$ligne["filename"]}</H1>\n\t\n\t<p class=caption style='font-size:14px'>{$filesize} ({$ligne["filetype"]})</p>\n\t<div id='packageinfo'>\n\t\t{$form}\n\t</div>\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function mailspylogs() { $tpl = new templates(); $ini = new Bs_IniHandler(); $sock = new sockets(); $datas = $sock->getfile('mailspylogs'); $title = "<H3>{realtime_events}</h3>"; $tbl = explode("\n", $datas); $tbl = array_reverse($tbl, TRUE); //08-12-22 22:09 time=1229983741 from=<*****@*****.**> to=<*****@*****.**> size=4354 subject=Matthieu Brignone has accepted your LinkedIn invitation if ($_GET["main"] == "emails_received") { $title = null; } $html = "\n\t<div id='spyrevents' style='height:550px;overflow:auto'>\n\t<br>{$title}\n\t<table style='width:100%'>\n\t<tr>\n\t<th> </th>\n\t<th>{date}</th>\n\t<th>{from}</th>\n\t<th>{to}</th>\n\t<th>{size}</th>\n\t<th>{subject}</th>\n\t</tr>\n\t"; while (list($num, $val) = each($tbl)) { if (preg_match('#([0-9\\-]+)\\s+([0-9:]+)\\s+time=([0-9]+)\\s+from=<(.*?)>\\s+to=<(.+?)>\\s+size=([0-9]+)\\s+subject=(.+)#', $val, $reg)) { $date = $reg[1]; $file = null; $time = $reg[2]; $numeric_time = $reg[3]; $from = substr($reg[4], 0, 20); if ($from == null) { $from = "Undisclosed"; } $to = substr($reg[5], 0, 30); $size = ParseBytes($reg[6]); if (preg_match("#(.+?)\\s+file=(.+)#", $reg[7], $e)) { $reg[7] = $e[1]; $file = $e[2]; } $subject = substr($reg[7], 0, 40); $subject = htmlentities($subject); $reg[7] = htmlentities($reg[7]); $tip = "<div style=font-size:12px><div><strong>{from}:</strong>{$reg[4]}</div><div><strong>{to}:</strong>{$reg[5]}</div><div><strong>{subject}:</strong>{$reg[7]}</div>"; $tip = $tip . "<div><strong>{file}:</strong>{$file}</div></div>"; $html = $html . "\n\t\t\t<tr " . CellRollOver(null, $tip) . ">\n\t\t\t<td width=1% nowrap style='border-bottom:1px solid #CCCCCC'><img src='img/fw_bold.gif'></td>\n\t\t\t<td width=1% nowrap style='border-bottom:1px solid #CCCCCC'>{$date} {$time}</td>\n\t\t\t<td style='border-bottom:1px solid #CCCCCC'>{$from}</td>\n\t\t\t<td style='border-bottom:1px solid #CCCCCC'>{$to}</td>\n\t\t\t<td width=1% nowrap style='border-bottom:1px solid #CCCCCC' align='right'>{$size}</td>\n\t\t\t<td style='border-bottom:1px solid #CCCCCC'>{$subject}</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t\n\t\t\t"; } } $html = $html . "</table></div>"; $tpl = new templates(); return $tpl->_ENGINE_parse_body($html); }