detecting privacy settings

Inside the dolphin code, how do I detect the privacy settings.

Specifically if the profile is private.

 

Thanks!

 

http://www.mytikibar.com
Quote · 19 Oct 2011

 steve, not sure what you are asking, but i think i just wrote about relatively the same thing when another member inquired about setting the default privacy of albums to members. 

Inside the dolphin code, how do I detect the privacy settings.

Specifically if the profile is private.

 

Thanks!

 

 all of these privacy actions are in the database. 

 

sys_privacy_actions

 

if i missed the mark on this one, please clarify what you are seeking. also in the source, you can find some info in /inc/classes/

 

BxDolxxx files

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 19 Oct 2011

I have a mod that displays user's avatars, if someone is private, I do not want it displayed.

 

so I want to do this in the code

if (is_private(memberID))return;  

so it doesn't display

 

Ok, so I have a google bot that browses my web site, it requires an account and it keeps showing up as being on line or earning points.  I set it to private, and I dont want it showing.  Then realized if other members are private they shouldn't show up either.

 

 

http://www.mytikibar.com
Quote · 19 Oct 2011

 ok then i would start looking in the modules/boonex/avatar dir, and see what you could dig up there. i would presume that is where you are going to find that. 

I have a mod that displays user's avatars, if someone is private, I do not want it displayed.

 

so I want to do this in the code

if (is_private(memberID))return;  

 

so it doesn't display

 

 

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 19 Oct 2011

But where does it read the settings for privacy for the member?

since avatar is a module, I am not sure that the avatar module will care.  lol!

 

It must be in bxdolprofile.php  somewhere.

 

http://www.mytikibar.com
Quote · 19 Oct 2011

 well on the avatar it wouldnt, so you would use the avatar module, to query the database, to check the privacy setting, then based on the result, you would then either display the avatar or hide it. 

But where does it read the settings for privacy for the member?

since avatar is a module, I am not sure that the avatar module will care.  lol!

 

It must be in bxdolprofile.php  somewhere.

 

 that is what i would believe would need to transpire. could be off, but i basically from 

 

taken from BxDolPrivacy.php

 

/**

 * Privacy settings for any content.

 *

 * Integration of the content with privacy engine allows site member 

 * to organize the access to his content.

 *

 * Related classes:

 *  BxDolPrivacyQuery - database queries.

 *  BxDolPrivacySearch - organize members search using necessary criteria.

 *  BxDolPrivacyView - super class for all representations.

 *  BxBasePrivacyView - base template representation.

 *  BxTemplPrivacyView - custom template representation.

 *

 * Example of usage:

 * 1. Register your privacy actions in `sys_privacy_actions` database table.

 * 2. Add one privacy field(with INT type) in the table with your items for each action. 

 *    For example, for action 'comment', the field name should be 'allow_comment_to'.

 * 3. Add group choosers for necessary actions in the form, which is used to add new items.

 *

 *    $oPrivacy = new BxDolPrivacy();

 *    $oPrivacy->getGroupChooser($iItemOwnerId, $sModuleUri, $sModuleAction);

 *

 * 4. Check privacy when any user tries to view an item.

 *

 *    $oPrivacy = new BxDolPrivacy($sTable, $sFieldId, $sFieldOwnerId);

 *    if($oPrivacy->check($sAction, $iObjectId, $iViewerId)) {

 *     //show necessary content

 *    }

 *

 *    @see an example of integration in the default Dolphin's modules(feedback, events, sites, etc)

 *

 *

 * Memberships/ACL:

 * Doesn't depend on user's membership.

 *

 *

 * Alerts:

 * no alerts available

 *

 */

 

so you would query the database on the Profiles table on the field --> PrivacyDefaultGroup AND OR Allow_View_To 

based on your query result, you would either display the avatar, or not. 

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 19 Oct 2011

There is no global function to do that, but the privacy class has a function to check it. To use it you would do something like this.

$oPrivacy = new BxDolPrivacy('Profiles', 'ID', 'ID');
if (!$oPrivacy->check('view', $ID_of_profile_being_viewed, 0)) return;

https://www.deanbassett.com
Quote · 19 Oct 2011

Great job Deano!  That worked!

 

Please review my newest topic for my weekend project.  ;)

http://www.mytikibar.com
Quote · 20 Oct 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.