Security fixes for App Manager

http://manage.dimagi.com/default.asp?119272