Skip to content

Commit

Permalink
Make use of user_get_accessible_projects instead of duplicating code
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Sep 1, 2013
1 parent 430bb25 commit 5946ca5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions changelog_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,7 @@ function print_project_header_changelog ( $p_project_name ) {
}

if ( ALL_PROJECTS == $t_project_id ) {
$t_topprojects = $t_project_ids = user_get_accessible_projects( $t_user_id );
foreach ( $t_topprojects as $t_project ) {
$t_project_ids = array_merge( $t_project_ids, user_get_all_accessible_subprojects( $t_user_id, $t_project ) );
}

$t_project_ids_to_check = array_unique( $t_project_ids );
$t_project_ids_to_check = user_get_all_accessible_projects( $t_user_id, $t_project );
$t_project_ids = array();

foreach ( $t_project_ids_to_check as $t_project_id ) {
Expand Down
7 changes: 1 addition & 6 deletions roadmap_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,7 @@ function print_project_header_roadmap( $p_project_name ) {
}

if ( ALL_PROJECTS == $t_project_id ) {
$t_topprojects = $t_project_ids = user_get_accessible_projects( $t_user_id );
foreach ( $t_topprojects as $t_project ) {
$t_project_ids = array_merge( $t_project_ids, user_get_all_accessible_subprojects( $t_user_id, $t_project ) );
}

$t_project_ids_to_check = array_unique( $t_project_ids );
$t_project_ids_to_check = user_get_all_accessible_projects( $t_user_id, $t_project );
$t_project_ids = array();

foreach ( $t_project_ids_to_check as $t_project_id ) {
Expand Down

0 comments on commit 5946ca5

Please sign in to comment.