2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2009 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
16 * Simple Privacy Object
21 var $activities_prefs;
24 function PrivacyObject(){
25 //For now, default PrivacyObject allows all First degree connection to see everything.
26 $demo = array( AT_SOCIAL_EVERYONE_VISIBILITY=>0,
27 AT_SOCIAL_FRIENDS_VISIBILITY=>1,
28 AT_SOCIAL_FRIENDS_OF_FRIENDS_VISIBILITY=>1,
29 AT_SOCIAL_NETWORK_VISIBILITY=>1,
30 AT_SOCIAL_GROUPS_VISIBILITY=>1
33 $profile_prefs = array(
34 AT_SOCIAL_PROFILE_BASIC => $demo,
35 AT_SOCIAL_PROFILE_PROFILE => $demo,
36 AT_SOCIAL_PROFILE_STATUS_UPDATE => $demo,
37 AT_SOCIAL_PROFILE_MEDIA => $demo,
38 AT_SOCIAL_PROFILE_CONNECTION => $demo,
39 AT_SOCIAL_PROFILE_EDUCATION => $demo,
40 AT_SOCIAL_PROFILE_POSITION => $demo
43 $search_prefs = array(
44 AT_SOCIAL_SEARCH_VISIBILITY => array(AT_SOCIAL_EVERYONE_VISIBILITY=>0, AT_SOCIAL_FRIENDS_VISIBILITY=>1,
45 AT_SOCIAL_FRIENDS_OF_FRIENDS_VISIBILITY=>1, AT_SOCIAL_NETWORK_VISIBILITY=>1,
46 AT_SOCIAL_GROUPS_VISIBILITY=>1),
47 AT_SOCIAL_SEARCH_PROFILE => array(AT_SOCIAL_EVERYONE_VISIBILITY=>1, AT_SOCIAL_FRIENDS_VISIBILITY=>1),
48 AT_SOCIAL_SEARCH_CONNECTION => array(AT_SOCIAL_EVERYONE_VISIBILITY=>1, AT_SOCIAL_FRIENDS_VISIBILITY=>1),
49 AT_SOCIAL_SEARCH_EDUCATION => array(AT_SOCIAL_EVERYONE_VISIBILITY=>1, AT_SOCIAL_FRIENDS_VISIBILITY=>1),
50 AT_SOCIAL_SEARCH_POSITION => array(AT_SOCIAL_EVERYONE_VISIBILITY=>1, AT_SOCIAL_FRIENDS_VISIBILITY=>1)
54 $this->setProfile($profile_prefs);
55 $this->setSearch($search_prefs);
59 //Return bitwise representation of the profile privacy settings
60 function getProfile(){
61 return $this->profile_prefs;
64 //Return bitwise representation of the search privacy settings
66 return $this->search_prefs;
69 //Return bitwise representation of the activity privacy settings
70 function getActivity(){
71 return $this->activity_prefs;
75 * @param mixed array of profile preferences array
77 function setProfile($prefs){
78 $this->profile_prefs = $prefs;
82 * @param mixed array of prefs arrays
84 function setSearch($prefs){
85 $this->search_prefs = $prefs;
88 function setActivity($prefs){
89 $this->activities_prefs = $prefs;