Exemple #1
0
function GOTMLS_get_quarantine()
{
    $entries = GOTMLS_getfiles($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]);
    $Q_Page = '
	<form method="POST" target="GOTMLS_iFrame" name="GOTMLS_Form_clean"><input type="hidden" id="GOTMLS_fixing" name="GOTMLS_fixing" value="1">';
    if (is_array($entries) && ($key = array_search(".htaccess", $entries))) {
        unset($entries[$key]);
    }
    if (is_array($entries) && ($key = array_search("index.php", $entries))) {
        unset($entries[$key]);
    }
    if (is_array($entries) && count($entries)) {
        $Q_Page .= '<p id="quarantine_buttons" style="display: none;"><input id="repair_button" type="submit" value="' . __("Restore selected files", 'gotmls') . '" class="button-primary" onclick="if (confirm(\'' . __("Are you sure you want to overwrite the previously cleaned files with the selected files in the Quarantine?", 'gotmls') . '\')) { setvalAllFiles(1); loadIframe(\'File Restoration Results\'); } else return false;" /><input id="delete_button" type="submit" class="button-primary" value="' . __("Delete selected files", 'gotmls') . '" onclick="if (confirm(\'' . __("Are you sure you want to permanently delete the selected files in the Quarantine?", 'gotmls') . '\')) { setvalAllFiles(2); loadIframe(\'File Deletion Results\'); } else return false;" /></p><p><b>' . __("The following items have been found to contain malicious code, they have been cleaned, and the original infected file contents have been saved here in the Quarantine. The code is safe here and you do not need to do anything further with these files.", 'gotmls') . '</b></p><p>' . sprintf(__("FYI - these files are found in: %s", 'gotmls'), ' ' . $GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]) . '</p>
		<ul name="found_Quarantine" id="found_Quarantine" class="GOTMLS_plugin known" style="background-color: #ccc; padding: 0;"><h3>' . (count($entries) > 1 ? '<input type="checkbox" onchange="checkAllFiles(this.checked); document.getElementById(\'quarantine_buttons\').style.display = \'block\';"> ' . sprintf(__("Check all %d", 'gotmls'), count($entries)) : "") . __(" Items in Quarantine", 'gotmls') . '<span class="GOTMLS_date">Date Quarantined</span><span class="GOTMLS_date">Date Infected</span></h3>';
        sort($entries);
        $root_path = implode(GOTMLS_slash(), array_slice(GOTMLS_explode_dir(__FILE__), 0, (2 + intval($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"])) * -1));
        foreach ($entries as $entry) {
            $file = GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]) . $entry;
            $filetime = date("Y-m-d H:i", filemtime($file));
            $Q_Page .= '
			<li style="margin: 4px 12px;"><span class="GOTMLS_date">' . $filetime . '</span>';
            $infectime = 'Unknown';
            if (is_file($file) && GOTMLS_get_ext($entry) == "gotmls") {
                $file_date = explode(".", $entry);
                if (count($file_date) > 2 && strlen($file_date[0]) == 5 && $filetime != GOTMLS_sexagesimal($file_date[0])) {
                    $infectime = GOTMLS_sexagesimal($file_date[0]);
                } elseif (count($file_date) > 3 && strlen($file_date[1]) == 5 && $filetime != GOTMLS_sexagesimal($file_date[1])) {
                    $infectime = GOTMLS_sexagesimal($file_date[1]);
                } elseif (@rename($file, GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]) . GOTMLS_sexagesimal($filetime) . ".{$entry}")) {
                    $file = GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]) . GOTMLS_sexagesimal($filetime) . ".{$entry}";
                }
                $Q_Page .= '<span class="GOTMLS_date">' . $infectime . '</span><input type="checkbox" name="GOTMLS_fix[]" value="' . GOTMLS_encode($file) . '" id="check_' . GOTMLS_encode($file) . '" onchange="document.getElementById(\'quarantine_buttons\').style.display = \'block\';" /><img src="' . GOTMLS_images_path . 'blocked.gif" height=16 width=16 alt="Q">' . preg_replace('/9000px;\\&quot;>(.+?)<\\/div>/', '9000px;&quot;>\\1' . GOTMLS_strip4java(GOTMLS_decode($file_date[count($file_date) - 2])) . ' (Quarantined)</div>', GOTMLS_error_link(__("View Quarantined File", 'gotmls'), $file)) . str_replace($root_path, "...", GOTMLS_decode($file_date[count($file_date) - 2]));
            } else {
                $Q_Page .= '<img src="' . GOTMLS_images_path . 'threat.gif" height=16 width=16 alt="?">' . GOTMLS_error_link(__("Foreign File in Quarantine", 'gotmls'), $file) . $entry;
            }
            $Q_Page .= "</a></li>\n";
        }
        $Q_Page .= "\n</ul>";
    } else {
        $Q_Page .= '<h3>' . __("No Items in Quarantine", 'gotmls') . '</h3>';
    }
    return "{$Q_Page}\n</form>\n";
}
Exemple #2
0
function GOTMLS_scandir($dir)
{
    echo "/*<!--*" . "/" . GOTMLS_update_status(sprintf(__("Scanning %s", 'gotmls'), str_replace(dirname($GLOBALS["GOTMLS"]["log"]["scan"]["dir"]), "...", $dir)));
    GOTMLS_flush();
    $li_js = "/*-->*" . "/\nscanNextDir(-1);\n/*<!--*" . "/";
    if (isset($_GET["GOTMLS_skip_dir"]) && $dir == GOTMLS_decode($_GET["GOTMLS_skip_dir"])) {
        if (isset($_GET["GOTMLS_only_file"]) && strlen($_GET["GOTMLS_only_file"])) {
            echo GOTMLS_return_threat("errors", "blocked", GOTMLS_trailingslashit($dir) . GOTMLS_decode($_GET["GOTMLS_only_file"]), GOTMLS_error_link("Failed to read this file!" . GOTMLS_read_error(GOTMLS_trailingslashit($dir) . GOTMLS_decode($_GET["GOTMLS_only_file"])), GOTMLS_trailingslashit($dir) . GOTMLS_decode($_GET["GOTMLS_only_file"])));
        } else {
            echo GOTMLS_return_threat("errors", "blocked", $dir, GOTMLS_error_link(__("Failed to read directory!", 'gotmls')) . GOTMLS_read_error($dir));
        }
    } else {
        $files = GOTMLS_getfiles($dir);
        if (is_array($files)) {
            if (isset($_GET["GOTMLS_only_file"])) {
                if (strlen($_GET["GOTMLS_only_file"])) {
                    $path = GOTMLS_trailingslashit($dir) . GOTMLS_decode($_GET["GOTMLS_only_file"]);
                    if (is_file($path)) {
                        GOTMLS_check_file($path);
                        echo GOTMLS_return_threat("dir", "checked", $path);
                    }
                } else {
                    foreach ($files as $file) {
                        $path = GOTMLS_trailingslashit($dir) . $file;
                        if (is_file($path)) {
                            $file_ext = GOTMLS_get_ext($file);
                            $filesize = @filesize($path);
                            if (in_array($file_ext, $GLOBALS["GOTMLS"]["tmp"]["skip_ext"]) && !preg_match('/social[0-9]*\\.png$/i', $file) || $filesize == 0 || $filesize > (isset($_GET["eli"]) && is_numeric($_GET["eli"]) ? $_GET["eli"] : 1234567)) {
                                echo GOTMLS_return_threat("skipped", "blocked", $path, GOTMLS_error_link(sprintf(__('Skipped because of file size (%1$s bytes) or file extention (%2$s)!', 'gotmls'), $filesize, $file_ext), $file, "potential"));
                            } else {
                                echo "/*-->*" . "/\nscanfilesArKeys.push('" . GOTMLS_encode($dir) . "&GOTMLS_only_file=" . GOTMLS_encode($file) . "');\nscanfilesArNames.push('Re-Checking " . GOTMLS_strip4java($path) . "');\n/*<!--*" . "/" . GOTMLS_return_threat("dirs", "wait", $path);
                            }
                        }
                    }
                    echo GOTMLS_return_threat("dir", "question", $dir);
                }
            } else {
                foreach ($files as $file) {
                    $path = GOTMLS_trailingslashit($dir) . $file;
                    if (is_file($path)) {
                        if (isset($_GET["GOTMLS_skip_file"]) && is_array($_GET["GOTMLS_skip_file"]) && in_array($path, $_GET["GOTMLS_skip_file"])) {
                            $li_js .= "/*-->*" . "/\n//skipped {$path};\n/*<!--*" . "/";
                            if ($path == $_GET["GOTMLS_skip_file"][count($_GET["GOTMLS_skip_file"]) - 1]) {
                                echo GOTMLS_return_threat("errors", "blocked", $path, GOTMLS_error_link(__("Failed to read file!", 'gotmls'), $path));
                            }
                        } else {
                            GOTMLS_check_file($path);
                        }
                    }
                }
                echo GOTMLS_return_threat("dir", "checked", $dir);
            }
        } else {
            echo GOTMLS_return_threat("errors", "blocked", $dir, GOTMLS_error_link(GOTMLS_Failed_to_list_LANGUAGE . ' scandir:' . ($files === false ? ' (FALSE)' : $files)));
        }
    }
    echo GOTMLS_update_status(sprintf(__("Scanned %s", 'gotmls'), str_replace(dirname($GLOBALS["GOTMLS"]["log"]["scan"]["dir"]), "...", $dir)));
    GOTMLS_update_scan_log(array("scan" => array("finish" => time())));
    return $li_js;
}
function GOTMLS_display_header($optional_box = "")
{
    global $wp_version, $current_user;
    get_currentuserinfo();
    $GOTMLS_url_parts = explode('/', GOTMLS_siteurl);
    if (isset($_GET["check_site"]) && $_GET["check_site"]) {
        echo '<div id="check_site" style="z-index: 1234567;"><img src="' . GOTMLS_images_path . 'checked.gif" height=16 width=16 alt="&#x2714;"> ' . __("Tested your site. It appears we didn't break anything", 'gotmls') . ' ;-)</div><script type="text/javascript">window.parent.document.getElementById("check_site_warning").style.backgroundColor=\'#0C0\';</script><li>Please <a target="_blank" href="https://wordpress.org/plugins/gotmls/stats/?compatibility%5Bversion%5D=' . $wp_version . '&compatibility%5Btopic_version%5D=' . GOTMLS_Version . '&compatibility%5Bcompatible%5D=1#compatibility-works">Vote "Works"</a> or <a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/gotmls#postform">write a "Five-Star" Reviews</a> on WordPress.org if you like this plugin.</li><style>#footer, #GOTMLS-metabox-container, #GOTMLS-right-sidebar, #admin-page-container, #wpadminbar, #adminmenuback, #adminmenuwrap, #adminmenu, .error, .updated, .update-nag {display: none !important;} #wpbody-content {padding-bottom: 0;} #wpbody, html.wp-toolbar {padding-top: 0 !important;} #wpcontent, #footer {margin-left: 5px !important;}';
    } else {
        echo '<style>#GOTMLS-right-sidebar {float: right; margin-right: 0px;}';
    }
    $Update_Definitions = GOTMLS_plugin_home . 'definitions.js' . $GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"] . '&js=' . GOTMLS_Version . '&p=GOTMLS&wp=' . $wp_version . '&ts=' . date("YmdHis") . '&key=' . GOTMLS_installation_key . '&d=' . ur1encode(GOTMLS_siteurl);
    $Update_Link = '<div style="text-align: center;"><a href="';
    $new_version = "";
    $file = basename(GOTMLS_plugin_path) . '/index.php';
    $current = get_site_transient("update_plugins");
    if (isset($current->response[$file]->new_version) && version_compare(GOTMLS_Version, $current->response[$file]->new_version, "<")) {
        $new_version = sprintf(__("Upgrade to %s now!", 'gotmls'), $current->response[$file]->new_version) . '<br /><br />';
        $Update_Link .= wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file);
    }
    $Update_Link .= "\">{$new_version}</a></div>";
    $defLatest = is_numeric($Latest = preg_replace('/[^0-9]/', "", GOTMLS_sexagesimal($GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"]))) && is_numeric($Default = preg_replace('/[^0-9]/', "", GOTMLS_sexagesimal($GLOBALS["GOTMLS"]["tmp"]["Definition"]["Default"]))) && $Latest > $Default ? 1 : 0;
    $Update_Div = '<div id="findUpdates" style="display: none;"><center>' . __("Searching for updates ...", 'gotmls') . '<br /><img src="' . GOTMLS_images_path . 'wait.gif" height=16 width=16 alt="Wait..." /><br /><input type="button" value="Cancel" onclick="cancelserver(\'findUpdates\');" /></center></div>';
    echo '
span.GOTMLS_date {float: right; width: 130px; white-space: nowrap;}
.GOTMLS_page {float: left; border-radius: 10px; padding: 0 5px;}
.GOTMLS_quarantine_item {margin: 4px 12px;}
.rounded-corners {margin: 10px; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border: 1px solid #000;}
.shadowed-box {box-shadow: -3px 3px 3px #666; -moz-box-shadow: -3px 3px 3px #666; -webkit-box-shadow: -3px 3px 3px #666;}
.sidebar-box {background-color: #CCC;}
.GOTMLS-scanlog li a {display: none;}
.GOTMLS-scanlog li:hover a {display: block;}
.GOTMLS-sidebar-links {list-style: none;}
.GOTMLS-sidebar-links li img {margin: 3px; height: 16px; vertical-align: middle;}
.GOTMLS-sidebar-links li {margin-bottom: 0 !important;}
.popup-box {background-color: #FFC; display: none; position: absolute; left: 0px; z-index: 10;}
.shadowed-text {text-shadow: #00F -1px 1px 1px;}
.sub-option {float: left; margin: 3px 5px;}
.inside p {margin: 10px;}
.GOTMLS_li, .GOTMLS_plugin li {list-style: none;}
.GOTMLS_plugin {margin: 5px; background: #cfc; border: 1px solid #0f0; padding: 0 5px; border-radius: 3px;}
.GOTMLS_plugin.known, .GOTMLS_plugin.backdoor, .GOTMLS_plugin.htaccess, .GOTMLS_plugin.timthumb, .GOTMLS_plugin.errors {background: #f99; border: 1px solid #f00;}
.GOTMLS_plugin.potential, .GOTMLS_plugin.wp_core, .GOTMLS_plugin.skipdirs, .GOTMLS_plugin.skipped {background: #ffc; border: 1px solid #fc6;}
.GOTMLS ul li {margin-left: 12px;}
.GOTMLS h2 {margin: 0 0 10px;}
.postbox {margin-right: 10px;}
#pastDonations li {list-style: none;}
#quarantine_buttons {position: absolute; right: 0px; top: -54px; margin: 0px; padding: 0px;}
#quarantine_buttons input.button-primary {margin-right: 20px;}
#delete_button {
	background-color: #C33;
	color: #FFF;
	background-image: linear-gradient(to bottom, #C22, #933);
	border-color: #933 #933 #900;
	box-shadow: 0 1px 0 rgba(230, 120, 120, 0.5) inset;
	text-decoration: none; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
	margin-top: 10px;
}
#main-page-title {
	background: url("' . $GLOBALS["GOTMLS"]["tmp"]["protocol"] . '//gravatar.com/avatar/5feb789dd3a292d563fea3b885f786d6?s=64") no-repeat scroll 0 0 transparent;
	height: 64px;
	line-height: 58px;
	margin: 10px 0 0 0;
	max-width: 600px;
	padding: 0 110px 0 84px;
}
#main-page-title h1 {
	background: url("' . $GLOBALS["GOTMLS"]["tmp"]["protocol"] . '//gravatar.com/avatar/8151cac22b3fc543d099241fd573d176?s=64") no-repeat scroll top right transparent;
	height: 64px;
	line-height: 32px;
	margin: 0;
	padding: 0 84px 0 0;
	display: table-cell;
    text-align: center;
    vertical-align: middle;
}
</style>
<div id="div_file" class="shadowed-box rounded-corners sidebar-box" style="padding: 0; display: none; position: fixed; top: ' . $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][1] . '; left: ' . $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][0] . '; width: ' . $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][3] . '; height: ' . $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][2] . '; border: solid #c00; z-index: 112358;"><table style="width: 100%; height: 100%;" cellspacing="0" cellpadding="0"><tr><td style="border-bottom: 1px solid #EEE; height: 32px;" colspan="2">' . GOTMLS_close_button("div_file") . '<h3 onmousedown="grabDiv();" onmouseup="releaseDiv();" id="windowTitle" style="cursor: move; border-bottom: 0px none; z-index: 2345677; position: absolute; left: 0px; top: 0px; margin: 0px; padding: 6px; width: 90%; height: 20px;">' . GOTMLS_Loading_LANGUAGE . '</h3></td></tr><tr><td colspan="2" style="height: 100%"><div style="width: 100%; height: 100%; position: relative; padding: 0; margin: 0;" class="inside"><br /><br /><center><img src="' . GOTMLS_images_path . 'wait.gif" height=16 width=16 alt="..."> ' . GOTMLS_Loading_LANGUAGE . '<br /><br /><input type="button" onclick="showhide(\'GOTMLS_iFrame\', true);" value="' . __("If this is taking too long, click here.", 'gotmls') . '" class="button-primary" /></center><iframe id="GOTMLS_iFrame" name="GOTMLS_iFrame" style="top: 0px; left: 0px; position: absolute; width: 100%; height: 100%; background-color: #CCC;"></iframe></td></tr><tr><td style="height: 20px;"><iframe id="GOTMLS_statusFrame" name="GOTMLS_statusFrame" style="width: 100%; height: 20px; background-color: #CCC;"></iframe></div></td><td style="height: 20px; width: 20px;"><h3 id="cornerGrab" onmousedown="grabCorner();" onmouseup="releaseCorner();" style="cursor: move; height: 24px; width: 24px; margin: 0; padding: 0; z-index: 2345678; overflow: hidden; position: absolute; right: 0px; bottom: 0px;"><span class="dashicons dashicons-editor-expand"></span>&#8690;</h3></td></tr></table></div>
<script type="text/javascript">
function showhide(id) {
	divx = document.getElementById(id);
	if (divx) {
		if (divx.style.display == "none" || arguments[1]) {
			divx.style.display = "block";
			divx.parentNode.className = (divx.parentNode.className+"close").replace(/close/gi,"");
			return true;
		} else {
			divx.style.display = "none";
			return false;
		}
	}
}
function checkAllFiles(check) {
	var checkboxes = new Array(); 
	checkboxes = document["GOTMLS_Form_clean"].getElementsByTagName("input");
	for (var i=0; i<checkboxes.length; i++)
		if (checkboxes[i].type == "checkbox")
			checkboxes[i].checked = check;
}
function setvalAllFiles(val) {
	var checkboxes = document.getElementById("GOTMLS_fixing");
	if (checkboxes)
		checkboxes.value = val;
}
function getWindowWidth(min) {
	if (typeof window.innerWidth != "undefined" && window.innerWidth > min)
		min = window.innerWidth;
	else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth > min)
		min = document.documentElement.clientWidth;
	else if (typeof document.getElementsByTagName("body")[0].clientWidth != "undefined" && document.getElementsByTagName("body")[0].clientWidth > min)
		min = document.getElementsByTagName("body")[0].clientWidth;
	return min;
}
function getWindowHeight(min) {
	if (typeof window.innerHeight != "undefined" && window.innerHeight > min)
		min = window.innerHeight;
	else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientHeight != "undefined" && document.documentElement.clientHeight > min)
		min = document.documentElement.clientHeight;
	else if (typeof document.getElementsByTagName("body")[0].clientHeight != "undefined" && document.getElementsByTagName("body")[0].clientHeight > min)
		min = document.getElementsByTagName("body")[0].clientHeight;
	return min;
}
function loadIframe(title) {
	showhide("GOTMLS_iFrame", true);
	showhide("GOTMLS_iFrame");
	document.getElementById("windowTitle").innerHTML = title;
	if (curDiv) {
		windowW = getWindowWidth(200);
		windowH = getWindowHeight(200);
		if (windowW > 200)
			windowW -= 30;
		if (windowH > 200)
			windowH -= 20;
		if (px2num(curDiv.style.width) > windowW) {
			curDiv.style.width = windowW + "px";
			curDiv.style.left = "0px";
		} else if ((px2num(curDiv.style.left) + px2num(curDiv.style.width)) > windowW) {
			curDiv.style.left = (windowW - px2num(curDiv.style.width)) + "px";
		}
		if (px2num(curDiv.style.height) > windowH) {
			curDiv.style.height = windowH + "px";
			curDiv.style.top = "0px";
		} else if ((px2num(curDiv.style.top) + px2num(curDiv.style.height)) > windowH) {
			curDiv.style.top = (windowH - px2num(curDiv.style.height)) + "px";
		}
		if (px2num(curDiv.style.left) < 0)
			curDiv.style.left = "0px";
		if (px2num(curDiv.style.top)< 0)
			curDiv.style.top = "0px";
	}
	showhide("div_file", true);
	if (IE)
		curDiv.scrollIntoView(true);
}
function cancelserver(divid) {
	document.getElementById(divid).innerHTML = "<div class=\'error\'>' . __("No response from server!", 'gotmls') . '</div>";
}
function checkupdateserver(server, divid) {
	var updatescript = document.createElement("script");
	updatescript.setAttribute("src", server);
	divx = document.getElementById(divid);
	if (divx) {
		divx.appendChild(updatescript);
		if (arguments[2])
			return setTimeout("stopCheckingDefinitions = checkupdateserver(\'"+arguments[2]+"\',\'"+divid+"\')",15000);
		else
			return setTimeout("cancelserver(\'"+divid+"\')",' . ($GLOBALS["GOTMLS"]["tmp"]['execution_time'] + 1) . '000+3000);
	}
}
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var offsetX = 0;
var offsetY = 0;
var offsetW = 0;
var offsetH = 0;
var curX = 0;
var curY = 0;
var curDiv;
function getMouseXY(e) {
	if (IE) { // grab the mouse pos if browser is IE
		curX = event.clientX + document.body.scrollLeft;
		curY = event.clientY + document.body.scrollTop;
	} else {  // grab the mouse pos if browser is Not IE
		curX = e.pageX - document.body.scrollLeft;
		curY = e.pageY - document.body.scrollTop;
	}
	if (curX < 0) {curX = 0;}
	if (curY < 0) {curY = 0;}
	if (offsetX && curX > 10) {curDiv.style.left = (curX - offsetX)+"px";}
	if (offsetY && (curY - offsetY) > 0) {curDiv.style.top = (curY - offsetY)+"px";}
	if (offsetW && (curX - offsetW) > 360) {curDiv.style.width = (curX - offsetW)+"px";}
	if (offsetH && (curY - offsetH) > 200) {curDiv.style.height = (curY - offsetH)+"px";}
	return true;
}
function px2num(px) {
	return parseInt(px.substring(0, px.length - 2), 10);
}
function setDiv(DivID) {
	if (curDiv = document.getElementById(DivID)) {
		if (IE)
			curDiv.style.position = "absolute";
		curDiv.style.left = "' . $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][0] . '";
		curDiv.style.top = "' . $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][1] . '";
		curDiv.style.height = "' . $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][2] . '";
		curDiv.style.width = "' . $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][3] . '";
	}
}
function grabDiv() {
	corner = document.getElementById("windowTitle");
	if (corner) {
		corner.style.width="100%";
		corner.style.height="100%";
	}
	offsetX=curX-px2num(curDiv.style.left); 
	offsetY=curY-px2num(curDiv.style.top);
}
function releaseDiv() {
	corner = document.getElementById("windowTitle");
	if (corner) {
		corner.style.width="90%";
		corner.style.height="20px";
	}
	document.getElementById("GOTMLS_statusFrame").src = "' . admin_url('admin-ajax.php?action=GOTMLS_position&' . GOTMLS_set_nonce(__FUNCTION__ . "341") . '&GOTMLS_x=') . '"+curDiv.style.left+"&GOTMLS_y="+curDiv.style.top;
	offsetX=0; 
	offsetY=0;
}
function grabCorner() {
	corner = document.getElementById("cornerGrab");
	if (corner) {
		corner.style.width="100%";
		corner.style.height="100%";
	}
	offsetW=curX-px2num(curDiv.style.width); 
	offsetH=curY-px2num(curDiv.style.height);
}
function releaseCorner() {
	corner = document.getElementById("cornerGrab");
	if (corner) {
		corner.style.width="20px";
		corner.style.height="20px";
	}
	document.getElementById("GOTMLS_statusFrame").src = "' . admin_url('admin-ajax.php?action=GOTMLS_position&' . GOTMLS_set_nonce(__FUNCTION__ . "360") . '&GOTMLS_w=') . '"+curDiv.style.width+"&GOTMLS_h="+curDiv.style.height;
	offsetW=0; 
	offsetH=0;
}
setDiv("div_file");
</script>
<div id="main-page-title"><h1 style="vertical-align: middle;">Anti-Malware from&nbsp;GOTMLS.NET</h1></div>
<div id="admin-page-container">
<div id="GOTMLS-right-sidebar" style="width: 300px;" class="metabox-holder">
	' . GOTMLS_box(__("Updates & Registration", 'gotmls'), '<ul style=""><li>WordPress: <span class="GOTMLS_date">' . $wp_version . '</span></li>
<li>Plugin: <span class="GOTMLS_date">' . GOTMLS_Version . '</span></li>
<li>Definitions: <span class="GOTMLS_date">' . $GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"] . '</span></li>
<li>' . (!$defLatest ? '<span style="color: #F00;" id="GOTMLS_No_Key">No Key! <input type="button" style="float: right;" value="' . __("Get FREE Key!", 'gotmls') . '" class="button-primary" onclick="showhide(\'GOTMLS_No_Key\');showhide(\'GOTMLS_Key\', true);check_for_updates(\'Definition_Updates\');" /></span><div id="GOTMLS_Key" style="display: none; ' : '<div style="') . 'margin: 0;">Key: <span style="float: right;">' . GOTMLS_installation_key . '</span></div></li></ul>
	<form id="updateform" method="post" name="updateform" action="' . str_replace("GOTMLS_mt=", "GOTMLS_last_mt=", GOTMLS_script_URI) . '&' . GOTMLS_set_nonce(__FUNCTION__ . "373") . '">
		<img style="display: none; float: right; margin-right: 14px;" src="' . GOTMLS_images_path . 'checked.gif" height=16 width=16 alt="definitions file updated" id="autoUpdateDownload" onclick="showhide(\'autoUpdateForm\', true);">
		' . str_replace('findUpdates', 'Definition_Updates', $Update_Div) . '
		<div id="autoUpdateForm" style="display: none;">
		<input type="submit" style="width: 100%;" name="auto_update" value="' . __("Download new definitions!", 'gotmls') . '"> 
		</div>
	</form>
		<div id="registerKeyForm" style="display: none;"><span style="color: #F00">' . __("<p>Get instant access to definition updates.</p>", 'gotmls') . '</span><p>
' . __("If you have not already registered your Key then register now using the form below.<br />* All registration fields are required<br />** I will NOT share your information.", 'gotmls') . '</p>
<form id="registerform" onsubmit="return sinupFormValidate(this);" action="' . GOTMLS_plugin_home . 'wp-login.php?action=register" method="post" name="registerform" target="GOTMLS_iFrame"><input type="hidden" name="redirect_to" id="register_redirect_to" value="/donate/"><input type="hidden" name="user_login" id="register_user_login" value="">
<div>' . __("Your Full Name:", 'gotmls') . '</div>
<div style="float: left; width: 50%;"><input style="width: 100%;" id="first_name" type="text" name="first_name" value="' . $current_user->user_firstname . '" /></div>
<div style="float: left; width: 50%;"><input style="width: 100%;" id="last_name" type="text" name="last_name" value="' . $current_user->user_lastname . '" /></div>
<div style="clear: left; width: 100%;">
<div>' . __("A password will be e-mailed to this address:", 'gotmls') . '</div>
<input style="width: 100%;" id="user_email" type="text" name="user_email" value="' . $current_user->user_email . '" /></div>
<div>
<div>' . __("Your WordPress Site URL:", 'gotmls') . '</div>
<input style="width: 100%;" id="user_url" type="text" name="user_url" value="' . GOTMLS_siteurl . '" readonly /></div>
<div>
<div>' . __("Plugin Installation Key:", 'gotmls') . '</div>
<input style="width: 100%;" id="installation_key" type="text" name="installation_key" value="' . GOTMLS_installation_key . '" readonly /><input id="old_key" type="hidden" name="old_key" value="' . md5($GOTMLS_url_parts[2]) . '" /></div>
<input style="width: 100%;" id="wp-submit" type="submit" name="wp-submit" value="Register Now!" /></form></div>' . $Update_Link, "stuffbox") . '
	<script type="text/javascript">
		function check_for_updates(update_type) {
			showhide(update_type, true);
			stopCheckingDefinitions = checkupdateserver("' . $Update_Definitions . '", update_type, "' . str_replace("://", "://www.", $Update_Definitions) . '");
		}
		function updates_complete(chk) {
			if (auto_img = document.getElementById("autoUpdateDownload")) {
				auto_img.style.display="block";
				check_for_donation(chk);
			}
		}
		function check_for_donation(chk) {
			if (document.getElementById("autoUpdateDownload").src.replace(/^.+\\?/,"")=="0")
				if (chk.substr(0, 8) != "Changed " || chk.substr(8, 1) != "0")
					chk += "\\n\\n' . __("Please make a donation for the use of this wonderful feature!", 'gotmls') . '";
			alert(chk);
		}
		function sinupFormValidate(form) {
			var error = "";
			if(form["first_name"].value == "")	
				error += "' . __("First Name is a required field!", 'gotmls') . '\\n";
			if(form["last_name"].value == "")		
				error += "' . __("Last Name is a required field!", 'gotmls') . '\\n";
			if(form["user_email"].value == "")
				error += "' . __("Email Address is a required field!", 'gotmls') . '\\n";
			else {
				if (uem = document.getElementById("register_user_login"))
					uem.value = form["user_email"].value;
				if (uem = document.getElementById("register_redirect_to"))
					uem.value = "/donate/?email="+form["user_email"].value.replace("@", "%40");
			}
			if(form["user_url"].value == "")
				error += "' . __("Your WordPress Site URL is a required field!", 'gotmls') . '\\n";
			if(form["installation_key"].value == "")
				error += "' . __("Plugin Installation Key is a required field!", 'gotmls') . '\\n";
			if(error != "") {
				alert(error);
				return false;
			} else {
				document.getElementById("Definition_Updates").innerHTML = \'<img src="' . GOTMLS_images_path . 'wait.gif">' . __("Submitting Registration ...", 'gotmls') . '\';
				showhide("Definition_Updates", true);
				setTimeout(\'stopCheckingDefinitions = checkupdateserver("' . $Update_Definitions . '", "Definition_Updates")\', 3000);
				showhide("registerKeyForm");
				return true;
			}
		}
		var divNAtext = false;
		function loadGOTMLS() {
			clearTimeout(divNAtext);
			setDivNAtext();
			' . $GLOBALS["GOTMLS"]["tmp"]["onLoad"] . '
		}
		if (' . $defLatest . ')
			check_for_updates("Definition_Updates");
//		else			showhide("registerKeyForm", true);
		if (divNAtext)
			loadGOTMLS();
		else
			divNAtext=true;
	</script>
	' . GOTMLS_box(__("Resources & Links", 'gotmls'), '
			<div id="pastDonations"></div>
			<form name="ppdform" id="ppdform" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
			<input type="hidden" name="cmd" value="_donations">
			<input type="hidden" name="business" value="*****@*****.**">
			<input type="hidden" name="no_shipping" value="1">
			<input type="hidden" name="no_note" value="1">
			<input type="hidden" name="currency_code" value="USD">
			<input type="hidden" name="tax" value="0">
			<input type="hidden" name="lc" value="US">
			<input type="hidden" name="bn" value="PP-DonationsBF">
			<input type="radio" name="amount" value="14.89">$14+
			<input type="radio" id="default_level_donation" name="amount" value="29.29" checked>$29+
			<input type="radio" id="higher_level_donation" name="amount" value="52.00">$52
			<input type="radio" name="amount" value="86.00">$86
			<input type="radio" name="amount" value="133.70">$133.7
			<input type="hidden" name="item_name" value="Donation to Eli\'s Anti-Malware Plugin">
			<input type="hidden" name="item_number" value="GOTMLS-key-' . GOTMLS_installation_key . '">
			<input type="hidden" name="custom" value="key-' . GOTMLS_installation_key . '">
			<input type="hidden" name="notify_url" value="' . GOTMLS_plugin_home . GOTMLS_installation_key . '/ipn">
			<input type="hidden" name="page_style" value="GOTMLS">
			<input type="hidden" name="return" value="' . GOTMLS_plugin_home . 'donate/?donation-source=paid">
			<input type="hidden" name="cancel_return" value="' . GOTMLS_plugin_home . 'donate/?donation-source=cancel">
			<input type="image" id="pp_button" src="' . GOTMLS_images_path . 'btn_donateCC_WIDE.gif" border="0" name="submitc" alt="' . __("Make a Donation with PayPal", 'gotmls') . '">
			<div>
				<ul class="GOTMLS-sidebar-links">
					<li style="float: right;"><b>on <a target="_blank" href="https://profiles.wordpress.org/scheeeli#content-plugins">WordPress.org</a></b><ul class="GOTMLS-sidebar-links">
						<li><a target="_blank" href="https://wordpress.org/plugins/gotmls/faq/">Plugin FAQs</a></li>
						<li><a target="_blank" href="https://wordpress.org/support/plugin/gotmls">Forum Posts</a></li>
						<li><a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/gotmls">Plugin Reviews</a></li>
					</ul></li>
					<li><img src="//gravatar.com/avatar/5feb789dd3a292d563fea3b885f786d6?s=16" border="0" alt="Plugin site:"><b><a target="_blank" href="' . GOTMLS_plugin_home . '">GOTMLS.NET</a></b></li>
					<li><img src="//gravatar.com/avatar/8151cac22b3fc543d099241fd573d176?s=16" border="0" alt="Developer site:"><b><a target="_blank" href="' . GOTMLS_blog_home . '/category/my-plugins/anti-malware/">Eli\'s Blog</a></b></li>
					<li><img src="https://ssl.gstatic.com/ui/v1/icons/mail/favicon.ico" border="0" alt="mail:"><b><a target="_blank" href="mailto:eli@gotmls.net">Email Eli</a></b></li>
					<li><iframe allowtransparency="true" frameborder="0" scrolling="no" src="https://platform.twitter.com/widgets/follow_button.html?screen_name=GOTMLS&amp;show_count=false" style="width:125px; height:20px;"></iframe></li>
				</ul>
			</div>
			</form>
			<a target="_blank" href="http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=' . urlencode(GOTMLS_siteurl) . '">Google Safe Browsing Diagnostic</a>', "stuffbox") . '
	' . GOTMLS_box(__("Last Scan Status", 'gotmls'), GOTMLS_scan_log(), "stuffbox") . '
	' . $optional_box . '
</div>';
    if (isset($GLOBALS["GOTMLS"]["tmp"]["stuffbox"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["stuffbox"])) {
        echo '
<script type="text/javascript">
function stuffbox_showhide(id) {
	divx = document.getElementById(id);
	if (divx) {
		if (divx.style.display == "none" || arguments[1]) {';
        $else = '
			if (divx = document.getElementById("GOTMLS-right-sidebar"))
				divx.style.width = "30px";
			if (divx = document.getElementById("GOTMLS-main-section"))
				divx.style.marginRight = "30px";';
        foreach ($GLOBALS["GOTMLS"]["tmp"]["stuffbox"] as $md5 => $bTitle) {
            echo "\nif (divx = document.getElementById('inside_{$md5}'))\n\tdivx.style.display = 'block';\nif (divx = document.getElementById('title_{$md5}'))\n\tdivx.innerHTML = '" . GOTMLS_strip4java($bTitle, true) . "';";
            $else .= "\nif (divx = document.getElementById('inside_{$md5}'))\n\tdivx.style.display = 'none';\nif (divx = document.getElementById('title_{$md5}'))\n\tdivx.innerHTML = '" . substr($bTitle, 0, 1) . "';";
        }
        echo '
			if (divx = document.getElementById("GOTMLS-right-sidebar"))
				divx.style.width = "300px";
			if (divx = document.getElementById("GOTMLS-main-section"))
				divx.style.marginRight = "300px";
			return true;
		} else {' . $else . '
			return false;
		}
	}
}
if (getWindowWidth(780) == 780) 
	setTimeout("stuffbox_showhide(\'inside_' . $md5 . '\')", 200);
</script>';
    }
    echo '
	<div id="GOTMLS-main-section" style="margin-right: 300px;">
		<div class="metabox-holder GOTMLS" style="width: 100%;" id="GOTMLS-metabox-container">';
}