'Not permitted on the premises': Teacher sacked over child porn