Even before the war , President Mahmoud Ahmadinejad was trying to position Iran as the leader of the pan-Muslim world , to unite all Muslims , whether Arabs or Indonesians or Indians , behind the leadership of Tehran .