Sql injection

Fix SQL injection for UMS, TMS and FMS.
Made some tests, more to come with IMS too.