This property of diodes can be used in a fun way: LEDs emit light, but they can also be used as photodiodes[2]. It's easy with a microcontroller pin that can act as both a digital output and analog input. LEDs are of course not optimized for this use (small sensor area, the package may absorb useful light particularly in the UV, phosphor if present may get in the way), but they can be used as photodetectors. There's even an Arduino sketch[3].
1. http://image.slidesharecdn.com/lect12-photodiodedetectors-13...
The problem should happen with near-infrared, visible, and UV-light. Glass is transparent in the visible range, and depending on type, also in IR / UV, so glass won't work as a shield.
The easiest, reliable way to shield would be wrapping in aluminum foil (also helps against RF-interference).