Merge /home/vl/tasks/0216-ldap_auth_lab/src/nginx-ldap-auth

This commit is contained in:
Vladimir Homutov 2016-10-10 16:51:28 +03:00
commit c61f0137b7
1 changed files with 6 additions and 1 deletions

View File

@ -128,7 +128,12 @@ class AuthHandler(BaseHTTPRequestHandler):
else:
addr = "-"
sys.stdout.write("%s - %s [%s] %s\n" % (addr, self.ctx['user'],
if not hasattr(self, 'ctx'):
user = '-'
else:
user = ctx['user']
sys.stdout.write("%s - %s [%s] %s\n" % (addr, user,
self.log_date_time_string(), format % args))
def log_error(self, format, *args):