Any judge or inspector of election who permits any person to vote at any primary or election who is not registered in accordance with law, except a person in actual military service or a person as to whom a court of competent jurisdiction has ordered that he shall be permitted to vote, or who permits any registered elector to vote knowing that such registered elector is not qualified to vote, whether or not such person has been challenged, or who permits any person who has been lawfully challenged to vote at any primary or election without requiring the proof of the right of such person to vote which is required by law, or who refuses to permit any duly registered and qualified elector to vote at any primary or election, with the knowledge that such elector is entitled to vote, shall be guilty of a felony of the third degree, and, upon conviction thereof, shall be sentenced to pay a fine not exceeding fifteen thousand ($15,000) dollars, and to undergo an imprisonment of not more than seven (7) years, or both.
25 P.S.§ 3523