Last year , he promised to quit his military post before the end of 2004 , if the religion-based coalition agreed to accept him as president until 2007 .