A French national on trial in Morocco for allegedly leading a Muslim group suspected of the May bombing attacks in Casablanca has told the court he worked for French intelligence.