remove old readme
[atutor.git] / mods / _standard / social / lib / classes / PrivacyControl / SetPrivacyControl.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2009                                                                              */
6 /* Inclusive Design Institute                                   */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
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 /****************************************************************/
13 // $Id$
14
15 //Temp script to set hardcoded PrivacyControl into the db.
16 //This should be done via a user perference config page
17
18 //TODO
19 //use vitals.inc.php, not the scatter ones.
20 define('AT_INCLUDE_PATH', '../../../../../../include/');
21 include_once(AT_INCLUDE_PATH.'config.inc.php');
22 require_once(AT_INCLUDE_PATH.'lib/constants.inc.php');
23 require_once(AT_INCLUDE_PATH.'lib/mysql_connect.inc.php');
24 include('../../constants.inc.php');
25 include('PrivacyObject.class.php');
26 include('PrivacyController.class.php');
27
28 //get user id
29 $user_id = (isset($_SESSION['member_id'])?$_SESSION['member_id']:1);
30
31 //profile_prefs
32 //profile[bsaic info, detailed info, 
33 $profile_prefs = array(
34                                 array(AT_SOCIAL_FRIENDS_VISIBILITY),    //basic info
35                                 array(AT_SOCIAL_FRIENDS_VISIBILITY),    //detailed info
36                                 array(AT_SOCIAL_FRIENDS_VISIBILITY),    //profile status update
37                                 array(AT_SOCIAL_FRIENDS_VISIBILITY),    //media
38                                 array(),                                                                //connection
39                                 array(),                                                                //education
40                                 array(AT_SOCIAL_FRIENDS_VISIBILITY)             //job position
41                                           );
42
43 print_r($profile_prefs);
44 echo '<hr>';
45
46 //search_prefs
47 $search_prefs = array();
48
49 //activity prefs
50 $activity_prefs = array();
51
52 //Updates
53 $po = new PrivacyObject();
54 $po->setProfile($profile_prefs);
55 $po->setSearch($search_prefs);
56 $po->setActivity($activity_prefs);
57
58 //update privacy preference
59 PrivacyController::updatePrivacyPreference($user_id, $po);
60 ?>