#NEWLINE# @ login_required ( ) #NEWLINE# def documents( request ) : #NEWLINE# #INDENT# if request . user . is_authenticated : #NEWLINE# #INDENT# extra_context = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# ppath = request . GET . get ( 'path' , '' ) #NEWLINE# ppath = urllib . unquote ( ppath . rstrip ( '/' ) ) #NEWLINE# path = clean_path ( ppath ) #NEWLINE# if ( path != ppath ) : #NEWLINE# #INDENT# path = '' #NEWLINE# #UNINDENT# extra_context [ 'path' ] = path #NEWLINE# if request . user . is_anonymous ( ) : #NEWLINE# #INDENT# extra_context [ 'bpersonal_folder' ] = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# extra_context [ 'bpersonal_folder' ] = SiteOptions . objects . is_access_valid ( request . user , 'zorna_personal_documents' ) #NEWLINE# extra_context [ 'bpersonal_dir' ] = ( 'U%s/' % request . user . pk ) #NEWLINE# get_upload_user ( request . user ) #NEWLINE# #UNINDENT# communities = get_communities ( request . user ) #NEWLINE# ao = [ com . pk for com in communities if com . enable_documents ] #NEWLINE# if ao : #NEWLINE# #INDENT# extra_context [ 'bcommunities_folder' ] = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# extra_context [ 'bcommunities_folder' ] = False #NEWLINE# #UNINDENT# ao = get_allowed_shared_folders ( request . user , [ 'reader' , 'manager' , 'writer' ] ) #NEWLINE# if ao : #NEWLINE# #INDENT# extra_context [ 'bshared_folder' ] = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# extra_context [ 'bshared_folder' ] = False #NEWLINE# #UNINDENT# if ( path and ( path [ 0 ] == 'U' ) ) : #NEWLINE# #INDENT# extra_context [ 'dir_url' ] = reverse ( 'personal_folder_content' ) #NEWLINE# extra_context [ 'bshared_folder' ] = False #NEWLINE# extra_context [ 'bcommunities_folder' ] = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( path and ( path [ 0 ] == 'F' ) ) : #NEWLINE# #INDENT# extra_context [ 'dir_url' ] = reverse ( 'shared_folder_content' ) #NEWLINE# extra_context [ 'bpersonal_folder' ] = False #NEWLINE# extra_context [ 'bcommunities_folder' ] = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( path and ( path [ 0 ] == 'C' ) ) : #NEWLINE# #INDENT# extra_context [ 'dir_url' ] = reverse ( 'communities_folder_content' ) #NEWLINE# extra_context [ 'bshared_folder' ] = False #NEWLINE# extra_context [ 'bpersonal_folder' ] = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# extra_context [ 'dir_url' ] = '' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( com [ 'bpersonal_folder' ] or extra_context [ 'bcommunities_folder' ] or extra_context [ 'bshared_folder' ] ) : #NEWLINE# #INDENT# context = RequestContext ( request ) #NEWLINE# return render_to_response ( 'fileman/fm_home.html' , extra_context , context_instance = context ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return HttpResponseForbidden ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return HttpResponseForbidden ( )