Hi,
It looks to me like someone’s home electronics project, and from what you say about the connections, it is probably a home-made solar regulator.
With it being located near the locker door, it may have had a portable solar panel connected as required.
Is the black block some kind of connector?it’s not clear from the photo.
If you’ve no use for a solar panel then either ignore it or disconnect and remove the box.
TBH, even if you are thinking about using solar at some point I’d put new kit in as there will be no way of knowing how effective (or safe) this would be.