MOODLE2: Adding security to scripts