The official acts of any person in possession of a public office and exercising the functions thereof shall be valid and binding as official acts in regard to all persons interested or affected thereby, whether such person is lawfully entitled to hold office or not and whether such person is lawfully qualified or not, but such person shall be liable to all penalties imposed by law for usurping or unlawfully holding office or for exercising the functions thereof without lawful right or without being qualified according to law.
Ala. Code § 36-1-2 (1975)