Afghan soldiers 'had prior warning' of Taliban attack