Small phonebook fixes.

* Fix error when changing visibility level on "edit group" page.
  When trying to update visibility level we should check for other shared groups with same code,
  but script was mistakenly checked for the same group exists and update fails, this patch fixes it.

* User should be able to move to groups only own contacts
  Added dba_valid check for contact before moving it, this function has uid check for non-admin users,
  so users can't anymore move others shared contacts from others shared groups to their own groups.
  This is mostly a security permissions patch.

* Changed check for contact not in any group when moving to group using more suitable function.
Merge pull request #319 from dvoryanchikov/phonebook-patches

Small phonebook fixes.