Changeset 51
- Timestamp:
- 10/22/05 23:02:18 (7 years ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
inc_xml/foaf.inc.php (modified) (1 diff)
-
includes/functions.inc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc_xml/foaf.inc.php
r43 r51 40 40 // Filtre chaque partie du profile, ne laisse que les infos accessibles par tout 41 41 // le monde 42 foreach($user['contact'] as $key => $value) 43 { 44 // on a pas ca dans access? dans le doute, on laisse. 45 if (!array_key_exists($key, $access['contact'])) 46 continue; 47 if (access_weight($access['contact'][$key]) < access_weight($weight)) 48 { 49 // on a pas le droit de l'afficher: on le planque. 50 unset($user['contact'][$key]); 51 } 52 } 42 $user['contact'] = filter_table_with_weight($user['contact'], $access['contact'], $weight); 43 $user['professionel'] = filter_table_with_weight($user['professionel'], $access['professionel'], $weight); 44 $user['general'] = filter_table_with_weight($user['general'], $access['general'], $weight); 53 45 54 46 $friends_r = $db->query('SELECT user_contact.email AS email, user.fname AS fname, user.lname AS lname, user.login AS login, user.id AS id FROM user_contact LEFT JOIN user_general USING(id) LEFT JOIN user USING(id) LEFT JOIN relation USING(id) WHERE relation.id_friend=?', array($id)); -
trunk/includes/functions.inc.php
r36 r51 240 240 } 241 241 242 // Il faudrait avoir un objet pour gerer les profiles, ca permettrait 243 // de gerer ca beaucoup plus facilement/efficacement. 244 function filter_table_with_weight($table, $access, $weight) 245 { 246 foreach ($table as $key => $value) 247 { 248 // on a pas ca dans access? dans le doute, on laisse. 249 if (!array_key_exists($key, $access)) 250 continue; 251 if (access_weight($access[$key]) < access_weight($weight)) 252 { 253 // on a pas le droit de l'afficher: on le planque. 254 unset($table[$key]); 255 } 256 } 257 return $table; 258 } 259 260 242 261 function get_relation_type($my_id, $my_friends_id, $user_id, $user_friends_id) 243 262 {
