From: serassio <> Date: Sat, 23 Apr 2005 19:20:30 +0000 (+0000) Subject: Bug #798: username format addition into errorpage.c X-Git-Tag: SQUID_3_0_PRE4~802 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=523f44f597c2f3d283df527f6b2c9a067fe0ea1e;p=thirdparty%2Fsquid.git Bug #798: username format addition into errorpage.c %a for the authenticated user name Forward port of 2.5 patch. --- diff --git a/src/errorpage.cc b/src/errorpage.cc index e1ab1072a4..93725a0da4 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -1,6 +1,6 @@ /* - * $Id: errorpage.cc,v 1.199 2004/12/20 16:30:35 robertc Exp $ + * $Id: errorpage.cc,v 1.200 2005/04/23 13:20:30 serassio Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -557,6 +557,7 @@ errorDump(ErrorState * err, MemBuf * mb) #define CVT_BUF_SZ 512 /* + * a - User identity x * B - URL with FTP %2f hack x * c - Squid error code x * d - seconds elapsed since request received x @@ -600,16 +601,29 @@ errorConvert(char token, ErrorState * err) switch (token) { + case 'a': + + if (r->auth_user_request) + p = r->auth_user_request->username(); + + if (!p) + p = "-"; + + break; + case 'B': p = r ? ftpUrlWith2f(r) : "[no URL]"; + break; case 'c': p = errorPageName(err->type); + break; case 'e': memBufPrintf(&mb, "%d", err->xerrno); + break; case 'E':