Fix SQL injection for UMS and core
Fix compilation for core and protect TMS from SQL injection
For FMS SQL injection