Every person who executes any of the functions of a public office without having taken and duly filed the required oath of office, or without having executed and duly filed the required security, is guilty of a Class 2 misdemeanor; and in addition to the punishment prescribed therefor, he forfeits his right to the office. Nothing in this section shall be construed to affect the validity of acts done by a person exercising the functions of a public office in fact, where other persons than himself are interested in maintaining the validity of such acts.
SDCL 3-1-8