Exemplo n.º 1
0
if (!isset($_GET["params"])) {
    die("<ERROR>Protocol Error</ERROR>");
}
$array = unserialize(base64_decode($_GET["params"]));
if (!is_array($array)) {
    die("<ERROR>Protocol Error</ERROR>");
}
$RemoteArticaServer = $array["RemoteArticaServer"];
$RemoteArticaPort = $array["RemoteArticaPort"];
$RemoteArticaUser = $array["RemoteArticaUser"];
$RemoteArticaPassword = $array["RemoteArticaPassword"];
$RemoteArticaSite = $array["RemoteArticaSite"];
if ($RemoteArticaSite == null) {
    die("<ERROR>Protocol Error: missing FreeWeb website</ERROR>");
}
if (!authProto($RemoteArticaUser, $RemoteArticaPassword, $RemoteArticaSite)) {
    die("<ERROR>Authentication failed</ERROR>");
}
if (isset($_GET["remove"])) {
    remove_container($array);
    die;
}
SendBackup($array);
function authProto($RemoteArticaUser, $RemoteArticaPassword)
{
    if ($RemoteArticaUser == null) {
        return false;
    }
    include "ressources/settings.inc";
    $md5Manager = md5(trim($_GLOBAL["ldap_password"]));
    if (trim(strtolower($_GLOBAL["ldap_admin"])) == trim(strtolower($RemoteArticaUser))) {
Exemplo n.º 2
0
function import_OU()
{
    if (!isset($_POST["AUTH"])) {
        die;
    }
    $datas = unserialize(base64_decode($_POST["AUTH"]));
    $me = $datas["servername"];
    //print_r($datas);
    if (!is_array($datas)) {
        echo "<FAILED>{$me}:: AUTH token is not set</FAILED>";
        die;
    }
    if (!authProto($datas["username"], md5($datas["password"]))) {
        echo "<FAILED>{$me}:: Invalid credentials</FAILED>";
        die;
    }
    $ou = $_POST["ORG"];
    if ($ou == null) {
        echo "<FAILED>{$me}:: Ou is not set....</FAILED>";
        die;
    }
    $filecache = "ressources/logs/web/{$ou}.gz";
    move_uploaded_file($_FILES["EXPORT-OU"]["tmp_name"], "{$filecache}");
    if (!is_file($filecache)) {
        echo "{$me}:: {$filecache} no such file\n{$_FILES["EXPORT-OU"]["tmp_name"]} received failed...";
        return;
    }
    echo "{$me}:: send order to framework...\n";
    $sock = new sockets();
    $logs = unserialize(base64_decode($sock->getFrameWork("services.php?import-ou2={$ou}&filename=" . dirname(__FILE__) . "/{$filecache}")));
    echo @implode("\n", $logs);
    echo "\n\n<SUCCESS>OK</SUCCESS>\n\n";
}