From e59a9e4bed29f60616b5be722d4af2ca816eb44b Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 29 Jun 2023 18:03:34 -0400 Subject: [PATCH] Generic user icon instead of 404 when avatar not found. Doing a 404 and then substituting a font-awesome icon makes it 404 over and over and over again. This is better. --- webcit-ng/server/user_functions.c | 6 +++++- .../static/images/generic-user-icon-32px.png | Bin 0 -> 891 bytes 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 webcit-ng/static/images/generic-user-icon-32px.png diff --git a/webcit-ng/server/user_functions.c b/webcit-ng/server/user_functions.c index 0b4548ec3..de4233dfb 100644 --- a/webcit-ng/server/user_functions.c +++ b/webcit-ng/server/user_functions.c @@ -37,7 +37,11 @@ void fetch_user_photo(struct http_transaction *h, struct ctdlsession *c, char *u return; } - do_404(h); + // The user has no avatar on file. Redirect to a generic avatar. + http_redirect(h, "/ctdl/s/images/generic-user-icon-32px.png"); + + // Sending a 404 makes the browser request the same thing over and over again. + // do_404(h); } diff --git a/webcit-ng/static/images/generic-user-icon-32px.png b/webcit-ng/static/images/generic-user-icon-32px.png new file mode 100644 index 0000000000000000000000000000000000000000..47149221ad9b2b9ac6120a46a22a5a14705dbf7b GIT binary patch literal 891 zcmV->1BCpEP)Px&HAzH4R9HvFR?kZtK@@&76BEUzEqDn;ywqtHu@VpkZ_-nRp6sD$DHIAqq5U87 zKa}=RDDrZ8o{|FyE`-Qd+&Yk zdyl|1FLKTHp=$uMv$HqK;R>v=vboi$D+{ z1UqAFRoC?=aY4iekjv$cEMeUNKmg(#Yr*gULIBF>kHf>m(KsMt0njvUx91>nGI28BZ?qPl)D*>*Agl%OQ>AycOec5bUCCy3> zNSkAtw(?g9yPSd-$&Vj3kK3$;n&kbXqjqaZ{j3oiVzW$z+x)l?vP0+4-$5muA4!TW4lw22OsR zl+nVQl+y1sm3sDge!f^J6fAkVP$+5-})jkNzxn=H&0AVJh-^HSVzPGm7>Y-?ei%DA@sbzzkhyrclS%!d8HD{gL8AQQpd+%A6l2z zbAe(S5pM%PgH#BOnN3haP6=b%2}<9OjNJdcvGH0?Q;{nc0M#YEe7|-8{{T+=OE4yx R4@Lk0002ovPDHLkV1jMcl^Xy6 literal 0 HcmV?d00001 -- 2.39.2