No officer or employee of the city shall ever accept, directly or indirectly, any gift, favor, privilege or employment from any public utility corporation enjoying a grant of any franchise, privilege or easement from the city during the term of office of such officer, or during such employment of such employee, except as may be authorized by law or ordinance. Any officer or employee of the city who shall violate the provisions of this section shall be guilty of a misdemeanor and may be punished by any fine that may be prescribed by ordinance for this offense, and shall forthwith be removed from office.