示例#1
0
         $data['cid'] = $cid;
         $data['displayhtml'] = nexdocsrv_generateFileListing($cid, $reportmode);
         $data['activefolder'] = nexdoc_displayActiveFolder($cid, $reportmode);
         $data['moreactions'] = nexdocsrv_getMoreActions($reportmode);
         $data['header'] = nexdoc_formatHeader($cid, $reportmode);
     } else {
         $data['retcode'] = 401;
         $data['error'] = 'Error: No Access to Folder';
     }
     $retval = json_encode($data);
     firelogmsg("Completed generating AJAX return data");
     break;
 case 'getmorefiledata':
     $filter->cleanData('int', array('cid' => $_POST['cid'], 'level' => $_POST['level']));
     $filter->cleanData('char', array('foldernumber' => $_POST['foldernumber']));
     $_CLEAN = $filter->normalize($filter->getDbData());
     $lastRenderedFolder = $_CLEAN['cid'];
     if ($_CLEAN['foldernumber'] == 'null') {
         $_CLEAN['foldernumber'] = '';
     }
     $retval = '<result>';
     $retval .= '<retcode>200</retcode>';
     $tpl = new Template($_CONF['path_layout'] . 'nexfile');
     $tpl->set_file(array('filelisting_rec' => 'filelisting_record.thtml', 'loadfolder_msg' => 'load_folder_message.thtml', 'tag_link' => 'taglink_record.thtml', 'tag_rec' => 'tagdesc_record.thtml', 'upload_action' => 'upload_link.thtml', 'download_action' => 'download_link.thtml', 'download_disabled' => 'download_disabled_link.thtml', 'editfile_action' => 'editfile_link.thtml'));
     $tpl->set_var('site_url', $_CONF['site_url']);
     $tpl->set_var('layout_url', $_CONF['layout_url']);
     $tpl->set_var('imgset', "{$_CONF['layout_url']}/nexfile/images");
     $retval .= '<displayhtml>' . htmlspecialchars(nexdoc_displayFileListing($tpl, $_CLEAN['cid'], 'getmoredata', $_CLEAN['level'], "{$_CLEAN['foldernumber']}"), ENT_QUOTES, $charset) . '</displayhtml>';
     $retval .= '</result>';
     firelogmsg("Completed generating AJAX return data - cid: {$_CLEAN['cid']}");
     break;
示例#2
0
    } else {
        echo $LANG_FMERR['download4'];
        exit;
    }
    // Check and see if any user has selected files to be downloaded as an archived
} elseif (isset($_POST['multiaction']) and $_POST['multiaction'] == 'archive' and !empty($_POST['checkeditems'])) {
    // delete any older zip archives that were created
    $archiveDirectory = "{$_FMCONF['storage_path']}tmp/";
    if (!file_exists($archiveDirectory)) {
        @mkdir($archiveDirectory);
    }
    $fd = opendir($archiveDirectory);
    while (false !== ($file = @readdir($fd))) {
        if ($file != '.' && $file != '..' && $file != 'CVS' && preg_match('/\\.zip$/i', $file)) {
            $ftimestamp = @fileatime("{$archiveDirectory}{$file}");
            if ($ftimestamp < time() - 600) {
                COM_errorLog("Nexfile: Remove tmp archive file : {$file}");
                @unlink("{$archiveDirectory}{$file}");
            }
        }
    }
    $filter = new sanitizer();
    $cid = $filter->getDbData('int', $_POST['cid']);
    $fileitems = $filter->getDbData('text', $_POST['checkeditems']);
    $files = explode(',', $fileitems);
    include 'lib-archive.php';
    nexdoc_createArchiveFromFiles($cid, $fileitems);
} else {
    echo $LANG_FMERR['download4'];
    exit;
}