Exemplo n.º 1
0
        ul li span{
            cursor: pointer;
        }

        ul li span:hover{color: #FF3300;}
    </style>
</head>

<?php 
require 'mysql/sql.php';
//connect to mysql
$pdo = new PDO("mysql:dbname={$dbname};host={$host}", 'doc', 'doc');
$user = new userMgr($pdo);
$group = new groupMgr($pdo);
$file = new fileMgr($pdo);
$allGroupName = $group->getAllName();
$allFile = $file->getAllFile();
function removeExtension($filename)
{
    $filename = explode(".", $filename);
    $newfilename = '';
    for ($i = 0; $i < count($filename) - 1; $i++) {
        $newfilename .= $filename[$i];
    }
    return $newfilename;
}
function listNextLevel($gpList, $group, $file)
{
    if (is_array($gpList)) {
        foreach ($gpList as $k => $childGroup) {
Exemplo n.º 2
0
}
$_SESSION['uuid'] = $uuid;
//现在每页已有的文件数
if (!isset($_SESSION['current_file_count'])) {
    $_SESSION['current_file_count'] = 20;
}
// $_SESSION['current_file_count']=20;
// echo "<script>alert('{$_SESSION['current_file_count']}')</script>";
//每次加载的文件递增数
if (!isset($_SESSION['file_load_step'])) {
    $_SESSION['file_load_step'] = 10;
}
//connect to mysql
$pdo = new PDO("mysql:dbname={$dbname};host={$host}", 'doc', 'doc');
$user = new userMgr($pdo);
$fm = new fileMgr($pdo);
$userPrivilege = $user->getPrivilege($uuid);
$userPrivilege = $userPrivilege['privilege'];
if ($userPrivilege === '0' || !$userPrivilege) {
    $delete_files = FALSE;
    $create_folders = TRUE;
    $delete_folders = FALSE;
    $rename_files = FALSE;
    $rename_folders = FALSE;
    $copy_cut_files = FALSE;
    // for copy/cut files
    $copy_cut_dirs = FALSE;
    // for copy/cut directories
    $preview_text_files = TRUE;
    // eg.: txt, log etc.
    $edit_text_files = FALSE;
Exemplo n.º 3
0
}
include 'include/utils.php';
include 'include/mime_type_lib.php';
if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== FALSE || strpos($_POST['path'], './') === 0) {
    die('wrong path');
}
if (strpos($_POST['name'], '/') !== FALSE) {
    die('wrong path');
}
$path = $current_path . $_POST['path'];
$name = $_POST['name'];
$info = pathinfo($name);
if (!in_array(fix_strtolower($info['extension']), $ext)) {
    die('wrong extension');
}
$pdo = new PDO("mysql:dbname={$dbname};host={$host}", $user, $password);
$fm = new fileMgr($pdo);
$img_size = (string) filesize($path . $name);
// Get the image size as string
$mime_type = get_file_mime_type($path . $name);
// Get the correct MIME type depending on the file.
header('Pragma: private');
header('Cache-control: private, must-revalidate');
header("Content-Type: " . $mime_type);
// Set the correct MIME type
header("Content-Length: " . $img_size);
header('Content-Disposition: attachment; filename="' . $name . '"');
readfile($path . $name);
$mysqlPath = $fm->getFidByPath($path . $name);
$fm->download($mysqlPath['fid'], $_SESSION['uuid']);
exit;
Exemplo n.º 4
0
<?php

require 'mysql/sql.php';
$title = $_POST['title'];
$author = $_POST['author'];
$tags = $_POST['tags'];
$description = $_POST['description'];
$path = $_POST['path'];
if (isset($title) && isset($author) && isset($tags) && isset($description) && isset($path)) {
    $pdo = new PDO("mysql:dbname={$dbname};host={$host}", 'doc', 'doc');
    $fm = new fileMgr($pdo);
    $fm->submitFileInfo($title, $author, $tags, $description, $path);
    echo '完善成功';
} else {
    echo '请完整填写信息';
}
Exemplo n.º 5
0
                     $base_dir = $paths . substr_replace($info['dirname'] . "/", '', 0, strlen($current_path));
                     if (file_exists($base_dir . $fixed_image_creation_name_to_prepend[$k] . $info['filename'] . $fixed_image_creation_to_append[$k] . "." . $info['extension'])) {
                         duplicate_file($base_dir . $fixed_image_creation_name_to_prepend[$k] . $info['filename'] . $fixed_image_creation_to_append[$k] . "." . $info['extension'], $fixed_image_creation_name_to_prepend[$k] . $name . $fixed_image_creation_to_append[$k]);
                     }
                 }
             }
         } else {
             die(lang_Empty_name);
         }
     }
     break;
 case 'star_file':
     $path_thumb = $_POST['path_thumb'];
     $pdo = new PDO("mysql:dbname={$dbname};host={$host}", $user, $password);
     $user = new userMgr($pdo);
     $fm = new fileMgr($pdo);
     $fid = $fm->getFidByPath($path);
     if (!$fm->isFileStard($fid['fid'], $_SESSION['uuid'])) {
         if ($a = $fm->star($_SESSION['uuid'], $fid['fid'])) {
             echo '标星成功';
         } else {
             echo '标星失败';
         }
     } else {
         $st = $fm->getStarsByUid($_SESSION['uuid']);
         $realkey = 0;
         foreach ($st as $key => $value) {
             if ($value->getFid() == $fid['fid']) {
                 $realkey = $key;
                 break;
             }
Exemplo n.º 6
0
<?php 
include 'config/config.php';
if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager") {
    die('forbiden');
}
include 'include/utils.php';
if (isset($_POST['path'])) {
    $storeFolder = $_POST['path'];
    $storeFolderThumb = $_POST['path_thumb'];
} else {
    $storeFolder = $current_path . $_POST["fldr"];
    // correct for when IE is in Compatibility mode
    $storeFolderThumb = $thumbs_base_path . $_POST["fldr"];
}
$pdo = new PDO("mysql:dbname={$dbname};host={$host}", $user, $password);
$fm = new fileMgr($pdo);
$u = new userMgr($pdo);
$uid = $_SESSION['uuid'];
$tags = "0";
$path_pos = strpos($storeFolder, $current_path);
$thumb_pos = strpos($storeFolderThumb, $thumbs_base_path);
if ($path_pos !== 0 || $thumb_pos !== 0 || strpos($storeFolderThumb, '../', strlen($thumbs_base_path)) !== FALSE || strpos($storeFolderThumb, './', strlen($thumbs_base_path)) !== FALSE || strpos($storeFolder, '../', strlen($current_path)) !== FALSE || strpos($storeFolder, './', strlen($current_path)) !== FALSE) {
    die('wrong path');
}
$path = $storeFolder;
$cycle = TRUE;
$max_cycles = 50;
$i = 0;
while ($cycle && $i < $max_cycles) {
    $i++;
    if ($path == $current_path) {