Ejemplo n.º 1
0
def browseDirectory(request, *args, **kwrags):
    targetDir   = request.POST.get('target')
    result      = util.getDirTree(request, targetDir, 2)
     
    context = {
        'target'    : targetDir,
        'node'      : result 
    }
    
    # info("browse.directory : " + targetDir) 
    return HttpResponse(json.dumps(context))
Ejemplo n.º 2
0
def browse(request, *args, **kwrags):
    targetDir   = request.POST.get('target')
    filelist    = util.getFileGroup(request, targetDir)
    directree   = util.getDirTree(request, targetDir, 2)
 
    userinfo    = UserInfo.getUserInfo(request)
    auth        = Directory.getAuth(userinfo, userinfo.getHomePath() + targetDir)
         
    context = {
        'target'    : targetDir,
        'filelist'  : {
            'directory' : filelist[0],
            'file'      : filelist[1],
            'readable'  : auth[0],
            'writeable' : auth[1],
            'deletable' : auth[2] 
        },
        'directree' : {
            'node'      : directree
        }
    }
     
    # info("browse.all : " + targetDir)    
    return HttpResponse(json.dumps(context))