Skip to Content Skip to Menu

CB Privacy Plugin Settings

  • pjohnson
  • pjohnson
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
15 years 4 months ago #99533 by pjohnson
CB Privacy Plugin Settings was created by pjohnson
Hi,

The CB Privacy Plugin looks like it is almost a perfect solution to one of my site requirements. The only issue is that I have to be able to set the privacy (or at least the defaults) for all of the fields for all of the users. E.g. the homePhone field is ALWAYS set so that it will display only to connections of type xxx, and the eMail field is set by default to only display to direct connections, etc.

Any suggestions on the best way to implement this?

Thanks in advance,
Patrick

Please Log in or Create an account to join the conversation.

  • pjohnson
  • pjohnson
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
15 years 4 months ago #99568 by pjohnson
Replied by pjohnson on topic Re:CB Privacy Plugin Settings
Here is what I am thinking of doing (just a rough draft at this point). I would appreciate any suggestions before I dive into it.

In cb.privacy.php in getInstance (line 63), change the query to pull values from a "default user" if there is nothing found for the current user.

E.g. something like this (assuming the id of the default user is 999):

[code:1]SELECT cp2.* FROM comprofiler_privacy AS cp1
RIGHT JOIN comprofiler_privacy AS cp2
ON cp1.userid = $uid
AND cp2.userid = cp1.userid
AND (cp2.userid = $uid OR cp2.userid = 999)
WHERE cp1.userid IS NULL OR cp1.userid = $uid
ORDER BY ... etc.
[/code:1]
Then I might even be able to turn off the "expose privacy setting in profile" when I want the user to be forced to accept the default value.

Does it seem like that would work? Is there a better solution?

Thanks in advance,
Patrick

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum