President signs bill extending military courts for 2 years