American who fought with Taliban wins prayer ruling