showuseragent plugin showuseragent plugin
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

showuseragent plugin

Started by 406man, November 02, 2024, 06:02:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

406man

As described in the General Discussion section of this forum, one of my gallery users experienced a strange fault. He was the only user with the fault and it was very difficult to track down as I was unable to reproduce it in my test gallery. I had to modify the source code to dump out various variables to a log file in the live system.  Eventually, when I'd narrowed down the area where the fault was generated I was able to write a plugin to dump out the relevant information. The fault involved the useragent string sent by the web browser to the server. There was no problem with the Coppermine software as the problem lay in the AVG software that he was using.

When installed this plugin will write the HTTP useragent string, plus user id and name of the calling function into the global log file for every CPG transaction. Below is an example of what's written to the log file:

Nov 02, 2024 at 04:52 PM - Showuseragent plugin. Called from: pluginmgr.php; USER_ID is 1; HTTP Useragent string = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0"

Having a plugin makes it much easier to generate the diagnostic information in a live environment than changing the gallery source code.
I fully accept that this plugin will be of minimal interest to most CPG Administrators but there might be circumstances in which the information it provides will be useful

phill104

Well done. Looks quite useful but probably only notes to be turned on during testing/diagnosis.
It is a mistake to think you can solve any major problems just with potatoes.