The fact is that there is no right to privacy regarding the disclosure of an employee's salary and related info. That is unless such protection is given under the terms of an employment contract or union agreement. So while this was quite an unprofessional thing to do on your employer's part, it was not illegal.