fixed several login/security related sql problems, fixed dbd definitions, sai update