Exemple #1
0
def browseFilelist(request, *args, **kwrags):
    targetDir   = request.POST.get('target')
    result      = util.getFileGroup(request, targetDir)
     
    userinfo    = UserInfo.getUserInfo(request)
    auth        = Directory.getAuth(userinfo, userinfo.getHomePath() + targetDir)
      
    context = {
        'target'    : targetDir,
        'directory' : result[0],
        'file'      : result[1],
        'readable'  : auth[0],
        'writeable' : auth[1],
        'deletable' : auth[2]
    }
     
    # info("browse.filelist : " + targetDir)
    return HttpResponse(json.dumps(context))    
Exemple #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))