Python Forum
Trying to get REMOTE_USER enviroment varibale's value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to get REMOTE_USER enviroment varibale's value
#1
Hello,

I'm trying to grab the http auth username in order for a user to be able to download a file from a basic http auth protected folder as follows:

realfile = form.getvalue('realfile')
authuser = os.environ.get( 'REMOTE_USER', 'Άγνωστος' )

#here we enter in case the user selected a file fro download
if realfile:
# Give user the file he requested
print( '''<meta http-equiv="REFRESH" content="5; URL=../data/files/%s">''' % realfile ) 

Why in your opinion is this happening?
Is it due to the way of "<metahttp-equiv .." that is obstructing this, in a way that when this statemnt executes it sends new headers lossing existing env vars?
Reply


Messages In This Thread
Trying to get REMOTE_USER enviroment varibale's value - by nikos - Jan-30-2017, 11:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Syntax errors: Struggling to setup enviroment and load packages AH56 5 2,980 Jun-30-2021, 01:01 PM
Last Post: AH56
  Assign the sum of 2 consecutive numbers in a list to a varibale Fenaz 3 2,241 Apr-05-2020, 10:30 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020