Exemplo n.º 1
0
<?php

if (!empty($_POST['newnameRename']) && strpos($_POST['newnameRename'], DIRECTORY_SEPARATOR) === false) {
    @session_start();
    $a = explode('/', $_POST['oldnameRename']);
    array_pop($a);
    $path = implode('/', $a) . DIRECTORY_SEPARATOR;
    unset($a);
    $dir = $_POST['isdirRename'] == 'true' ? true : false;
    require_once 'ftpCon.php';
    $f = new ftpCon();
    $f->conect(base64_decode($_SESSION[MD5('server')]));
    $f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
    $items = $f->readDir($path);
    if (!in_array($_POST['newnameRename'], $items)) {
        if ($f->rename($_POST['oldnameRename'], $path . $_POST['newnameRename'])) {
            $f->logout();
            if ($dir) {
                ?>
                <script>
                    $('.table').DataTable().destroy();

                    activeClick.parent().parent().find('.nomeArquivo').html('<a href="javascript:void(0);" class="diretorio" data-dir="<?php 
                echo $path . $_POST['newnameRename'] . DIRECTORY_SEPARATOR;
                ?>
"><i class="glyphicon glyphicon-folder-open"></i> <?php 
                echo $_POST['newnameRename'];
                ?>
</a>');

Exemplo n.º 2
0
<?php

require_once 'ftpCon.php';
@session_start();
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
$f->ftp_rdel('teste/');
$f->logout();
Exemplo n.º 3
0
    <script src="addon/comment/comment.js"></script>
    <script src="addon/wrap/hardwrap.js"></script>
    <script src="addon/fold/foldcode.js"></script>
    <script src="addon/fold/brace-fold.js"></script>
    <script src="mode/javascript/javascript.js"></script>
    <script src="keymap/sublime.js"></script>
    <link rel="stylesheet" href="addon/hint/show-hint.css">
    <script src="addon/hint/show-hint.js"></script>
    <script src="addon/hint/anyword-hint.js"></script>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container-fluid">
    <?php 
require_once 'ftpCon.php';
$f = new ftpCon();
$erro = false;
$error = null;
if (!$f->conect(base64_decode($_SESSION[MD5('server')]))) {
    ?>
        <script type="text/javascript">
            bootstrapErro("Erro ao se conectar com o servidor<br><a href='login.php' class='btn btn-warning'>Login</a>");
        </script>
    <?php 
    $erro = true;
} elseif (!$erro) {
    if (!$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]))) {
        ?>
        <script type="text/javascript">
            bootstrapErro("Erro ao efetuar login<br><a href='login.php' class='btn btn-warning'>Login</a>");
        </script>
Exemplo n.º 4
0
<?php

@session_start();
require_once 'ftpCon.php';
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
$dirAtual = $_POST['D'] == '.' ? '' : $_POST['D'];
$f->recSize($dirAtual);
$sizeDir = $f->sizeGet();
?>
Este diretório possuí o tamanho aproximado de <?php 
if ($sizeDir / 1024 >= 1) {
    if ($sizeDir / (1024 * 1024) >= 1) {
        if ($sizeDir / (1024 * 1024 * 1024) >= 1) {
            echo number_format($sizeDir / (1024 * 1024 * 1024), 2, ',', '') . ' GB';
        } else {
            echo number_format($sizeDir / (1024 * 1024), 2, ',', '') . ' MB';
        }
    } else {
        echo number_format($sizeDir / 1024, 2, ',', '') . ' KB';
    }
} else {
    echo $sizeDir . " Bytes";
}
Exemplo n.º 5
0
<?php

@session_start();
require_once 'ftpCon.php';
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
$bool = $f->ftp_rdel($_POST['arq']);
$f->logout();
if (!empty($f->error)) {
    ?>
        <script>
            bootstrapErro("Não foi possível remover <?php 
    echo $_POST['arq'];
    ?>
<br><input type='button' class='btn btn-danger' value='Fechar' data-dismiss='modal'>");
        </script>
        <?php 
} else {
    echo true;
}
Exemplo n.º 6
0
<?php

@session_start();
require_once 'ftpCon.php';
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
$items = $f->readDir($_POST['path']);
if (!in_array($_POST['file'], $items)) {
    if ($_POST['path'] == '.') {
        $_POST['path'] = '';
    }
    if ($f->mkdir($_POST['path'] . $_POST['file'])) {
        ?>
    <script>
        $(document).ready(function() {
                    $('.table').DataTable().destroy();

            $('.table-arquivos').prepend('<tr>' +
                '<td><input type="checkbox" class="homeCheck"></td>' +
                '<td class="nomeArquivo"><a href="javascript:void(0);" class="diretorio" data-dir="<?php 
        echo $_POST['path'] . $_POST['file'] . DIRECTORY_SEPARATOR;
        ?>
"><i class="glyphicon glyphicon-folder-open"></i> <?php 
        echo $_POST['file'];
        ?>
</a></td>' +
                '<td class="tamanhoArquivo">------</td>' +
                '<td class="dataArquivo"><?php 
        echo date('d/M H:i');
        ?>
Exemplo n.º 7
0
<?php

@session_start();
require_once 'ftpCon.php';
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
$f->chmodreset($_POST['nomePropriedades'] . DIRECTORY_SEPARATOR);
if (count($f->errorChmod) > 0) {
    ?>

    <script type="text/javascript">
        bootstrapErro("<ul style='list-style-type: none'><?php 
    foreach ($f->errorChmod as $error) {
        echo '<li>Erro ao alterar as permissoes de ' . $error . '</li>';
    }
    ?>
</ul><br><input type='button' class='btn btn-danger' data-dismiss='modal' value='Fechar'>");
    </script>
    <?php 
} else {
    ?>
    <script>
        $(document).ready(function () {
            activeClick.parent().parent().find('.permissaoArquivo').html('<?php 
    echo $_POST['isdirPropriedades'] == 'true' ? 'drwxr-xr-x' : '-rw-r--r--';
    ?>
');
            $('#propriedadesModal').modal('hide');
        })
    </script>
Exemplo n.º 8
0
<?php

@session_start();
$arqs = explode('|||||', $_POST['arquivosaexcluir']);
array_pop($arqs);
$error = null;
if (count($arqs) > 0) {
    require_once 'ftpCon.php';
    $f = new ftpCon();
    $f->conect(base64_decode($_SESSION[MD5('server')]));
    $f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
    foreach ($arqs as $arq) {
        $f->ftp_rdel($arq);
        if (!empty($f->error)) {
            $_SESSION['erroUpload'][] = 'Não foi possível remover ' . $arq . '';
            $f->error = '';
        }
    }
}
header("Location: index.php?Diretorio=" . $_POST['locationpathexcluirall']);
Exemplo n.º 9
0
<?php

require_once 'ftpCon.php';
@session_start();
$content = $_POST['content'];
$file = $_POST[MD5('fileLocation')];
$fp = fopen('tmpedit', 'w+');
fwrite($fp, $content);
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
if ($f->upload(base64_decode($file), 'tmpedit')) {
    ?>
    <div class="alert alert-success alert-edit-res" style="display: none">Arquivo editado com sucesso.</div>
<?php 
} else {
    ?>
    <div class="alert alert-danger alert-edit-res" style="display: none">Erro ao editar o arquivo.</div>

    <?php 
}
fclose($fp);
$fp = fopen('tmpedit', 'w+');
fwrite($fp, '');
fclose($fp);
$f->logout();
?>
<script>
    $(document).ready(function(){
        $('.alert-edit-res').slideDown();
        setTimeout(function(){
Exemplo n.º 10
0
<?php

@session_start();
$arqs = explode('|||||', $_POST['arqspropriedadesAll']);
array_pop($arqs);
if (count($arqs) > 0) {
    require_once 'ftpCon.php';
    $f = new ftpCon();
    $f->conect(base64_decode($_SESSION[MD5('server')]));
    $f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
    $user = 6;
    $group = 0;
    $other = 0;
    if (!empty($_POST['userAll3'])) {
        $user += 1;
    }
    if (!empty($_POST['groupAll1'])) {
        $group += 4;
    }
    if (!empty($_POST['groupAll2'])) {
        $group += 2;
    }
    if (!empty($_POST['groupAll3'])) {
        $group += 1;
    }
    if (!empty($_POST['otherAll1'])) {
        $other += 4;
    }
    if (!empty($_POST['otherAll2'])) {
        $other += 2;
    }
Exemplo n.º 11
0
<?php

if ((int) substr($_POST['newPermissionN'], 0, 1) >= 6) {
    @session_start();
    require_once 'ftpCon.php';
    $f = new ftpCon();
    $f->conect(base64_decode($_SESSION[MD5('server')]));
    $f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
    if ($_POST['recursivePermissao'] != 'on') {
        if ($f->chmod($_POST['nomePropriedades'], $_POST['newPermissionN'])) {
            ?>
            <script>
                $(document).ready(function () {
                    activeClick.parent().parent().find('.permissaoArquivo').html('<?php 
            echo $_POST['isdirPropriedades'] == 'true' ? 'd' . $_POST['newPermissionT'] : '-' . $_POST['newPermissionT'];
            ?>
');
                    $('#propriedadesModal').modal('hide');
                })
            </script>
            <?php 
        } else {
            ?>
            <script type="text/javascript">
                bootstrapErro("Houve um erro ao trocar as permissões. Tente efetuar o reset de usuários e grupos.<br><input type='button' class='btn btn-danger' data-dismiss='modal' value='Fechar'>");
            </script>
            <?php 
        }
        $f->logout();
    } else {
        $f->chmodr($_POST['nomePropriedades'] . DIRECTORY_SEPARATOR, octdec(str_pad($_POST['newPermissionN'], 4, '0', STR_PAD_LEFT)));
Exemplo n.º 12
0
<?php

require_once 'ftpCon.php';
include "arquivosSuportados.php";
@session_start();
$nameFile = $_POST["file"];
if ($_POST['path'] == '.') {
    $_POST['path'] = '';
}
$fileLocation = $_POST["path"];
$fp = fopen('tmptouch', 'w+');
fwrite($fp, '');
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
$items = $f->readDir($fileLocation);
if (!in_array($nameFile, $items)) {
    if ($f->upload($fileLocation . DIRECTORY_SEPARATOR . $nameFile, 'tmptouch')) {
        ?>
    <script>
        $(document).ready(function () {
            $('.table').DataTable().destroy();

            $('.table-arquivos').prepend('<tr>' +
                '<td><input type="checkbox" class="homeCheck"></td>' +
                '<td class="nomeArquivo"><i class="glyphicon glyphicon-file"></i> <?php 
        echo $nameFile;
        ?>
</a></td>' +
                '<td class="tamanhoArquivo">0 B</td>' +
                '<td class="dataArquivo"><?php 
Exemplo n.º 13
0
<?php 
@session_start();
require_once 'ftpCon.php';
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
$c = 0;
if ($_POST['c5da39db1424d6b7ee693d9b23ee5a39'] == '.') {
    $_POST['c5da39db1424d6b7ee693d9b23ee5a39'] = '';
}
$local = $_POST['c5da39db1424d6b7ee693d9b23ee5a39'];
for ($i = 0; $i < count($_FILES['file']['name']); $i++) {
    if (!empty($_FILES['file']['name'][$i])) {
        $c++;
        if ($_FILES['file']['size'][$i] <= 4194304) {
            if ($f->upload($local . $_FILES['file']['name'][$i], $_FILES['file']['tmp_name'][$i])) {
            } else {
                $_SESSION['erroUpload'][] = 'Não foi possível enviar o arquivo ' . $_FILES['file']['name'][$i];
            }
        } else {
            $_SESSION['erroUpload'][] = 'Não foi possível enviar o arquivo ' . $_FILES['file']['name'][$i] . ", pois o mesmo excede o tamanho limite de upload";
        }
    }
}
if ($c > 0) {
    if (count($_SESSION['erroUpload']) == 0) {
        $_SESSION['erroUpload'] = 'OK';
    }
} else {
    $_SESSION['erroUpload'] = 'N';