$permissions) { foreach ($permissions as $permission) { $inherited_group_permissions[$tool][]=$permission; } } } $inherited_permissions=$inherited_group_permissions; // ------------------------------------------------------------------ // RETRIEVING THE PERMISSIONS OF THE ROLES OF THE USER // ------------------------------------------------------------------ if (api_get_setting('user_roles')=='true') { // course roles that are assigned to the user $current_user_role_permissions_of_user=get_roles_permissions('user',$user_id); $inherited_permissions=permission_array_merge($inherited_permissions,$current_user_role_permissions_of_user); // NOTE: deze array moet nog gemerged worden met de $inherited_permissions array // (heet momenteel nog $current_group_permissions_of_user omdat voorlopig enkel de // groepsgeërfde permissions in beschouwing worden genomen // dit moet ook de rol permissies van rollen die toegekend worden aan een gebruiker // en de rol permissies van rollen die toegekend worden aan de groepen van een gebruiker // omvatten. // NOTE: checken als de rollen brol wel degelijk geactiveerd is voordat we dit allemaal // ophalen. // platform roles that are assigned to the user $current_user_role_permissions_of_user=get_roles_permissions('user',$user_id, 'platform'); $inherited_permissions=permission_array_merge($inherited_permissions,$current_user_role_permissions_of_user); } // ------------------------------------------------------------------ // RETRIEVING THE PERMISSIONS OF THE ROLES OF THE GROUPS OF THE USER // ------------------------------------------------------------------ if (api_get_setting('group_roles')=='true') { // NOTE: DIT MOET NOG VERDER UITGEWERKT WORDEN foreach ($groups_of_user as $group) { $this_current_group_role_permissions_of_user=get_roles_permissions('user',$user_id); //$inherited_permissions[$tool][]=$permission; } } // --------------------------------------------------- // LIMITED OR FULL // --------------------------------------------------- $current_user_permissions=limited_or_full($current_user_permissions); $inherited_permissions=limited_or_full($inherited_permissions); if (api_get_setting('permissions')=='limited') { $header_array=$rights_limited; } if (api_get_setting('permissions')=='full') { $header_array=$rights_full; } echo "
"; // --------------------------------------------------- // DISPLAYING THE ROLES LIST // --------------------------------------------------- if (api_get_setting('user_roles')=='true') { // the list of the roles for the user echo ''.get_lang('UserRoles').'
'; $current_user_course_roles=get_roles('user',$user_id); $current_user_platform_roles=get_roles('user',$user_id, 'platform'); display_role_list($current_user_course_roles, $current_user_platform_roles); echo '
'; } // --------------------------------------------------- // DISPLAYING THE MATRIX (user permissions) // --------------------------------------------------- echo ''.get_lang('UserPermissions').''; echo "\n"; // the header echo "\t\n"; echo "\t\t\n"; foreach ($header_array as $header_key=>$header_value) { echo "\t\t\n"; } echo "\t\n"; // the main area with the checkboxes or images foreach ($tool_rights as $tool=>$rights) // $tool_rights contains all the possible tools and their rights { echo "\t\n"; echo "\t\t\n"; foreach ($header_array as $key=>$value) { echo "\t\t\n"; } echo "\t\n"; } echo "
".get_lang('Module')."".get_lang($header_value)."
\n"; if (strstr($tool,'BLOG')) { // Not dealing with a real tool here, get name of this blog // Strip blog id $tmp = strpos($tool,'_')+1; $blog_id = substr($tool,$tmp,strlen($tool)); // Get title echo get_lang('Blog').": ".Blog::get_blog_title($blog_id); } else { echo get_lang($tool); } echo "\t\t\n"; if (in_array($value,$rights)) { if ($setting_visualisation=='checkbox') { display_checkbox_matrix($current_user_permissions, $tool, $value, $inherited_permissions,$course_admin); } if ($setting_visualisation=='image') { display_image_matrix($current_user_permissions, $tool, $value,$inherited_permissions, $course_admin); } } // note: in a later stage this part will be replaced by a function // so that we can easily switch between a checkbox approach or an image approach // where every click is in fact a change of status. In the checkbox approach you first have to // do the changes and then store them by clicking the submit button. echo "\t\t
\n"; if ($setting_visualisation=='checkbox') { echo ""; } echo "

"; // --------------------------------------------------- // LEGEND // --------------------------------------------------- echo ''.get_lang('Legend').'
'; echo ' '.get_lang('UserHasPermissionNot').'
'; echo ' '.get_lang('UserHasPermission').'
'; echo ' '.get_lang('UserHasPermissionByRoleGroup').'
'; ?>