If the said clerk, or other party having in charge said registration book, shall knowingly prevent anyone qualified to register, or shall likewise knowingly register anyone or allow anyone to register who is not qualified to register, he shall be subject to be punished on conviction therefore [therefor] as prescribed by section 3 of this Act [Charter]. Should anyone register, or attempt to register or vote, or attempt to vote illegally in such election, he, on conviction thereof, shall be likewise punished.