My employment contracts have all required at minimum that I inform them of any commercial work I am doing outside my employment for them, and sometimes required that I get approval from them before beginning. Having some undisclosed second employment would definitely be grounds for firing, if they wanted.
Apropos of all the valid concerns with this, I don't think "being asked by someone outside the company to do something at the company you currently work for" would ever be described as "undisclosed second employment".
I asked two questions specifically because a clause like this in an employment contract is there to enable termination no matter if the act is legal or not. Also, breaking your employment contract can make you liable for damages if the employer can demonstrate them.