The mayor and city council may provide by ordinance for the registration of voters, and no person shall be allowed to vote at any city election except such persons as shall have duly registered in compliance with the terms of said ordinance.