Add( ADMIN_ROLE ); foreach( $groupUpdateList as $groupName ) { if ( in_array( $groupName, $adminOnList ) ) $groupsToGrant->Add( $groupName ) ; else $groupsToRevoke->Add( $groupName ); } $site->GrantRoleMembershipsToGroups( $roleToUpdate, $groupsToGrant ); $site->RevokeRoleMembershipsFromGroups( $roleToUpdate, $groupsToRevoke ); $confirmationMsg = $confSuccessfulRoleUpdate; // Update author role. $groupsToGrant->Clear(); $groupsToRevoke->Clear(); $roleToUpdate->SetItem( 0, AUTHOR_ROLE ); foreach( $groupUpdateList as $groupName ) { if ( in_array( $groupName, $authorOnList ) ) $groupsToGrant->Add( $groupName ) ; else $groupsToRevoke->Add( $groupName ); } $site->GrantRoleMembershipsToGroups( $roleToUpdate, $groupsToGrant ); $site->RevokeRoleMembershipsFromGroups( $roleToUpdate, $groupsToRevoke ); $confirmationMsg = $confSuccessfulRoleUpdate; } } catch ( MgException $e ) { CheckForFatalMgException( $e ); $errorMsg = $e->GetMessage(); } catch ( Exception $e ) { $errorMsg = $e->getMessage(); } // Load the display table. try { $groups = GetGroups(); $groupCount = sizeof( $groups ); $currPage = GetPageNumber( $groups, $selectedGroup, $pageSize ); GetPageRange( $currPage, $groupCount, $pageSize, $firstPageIndex, $lastPageIndex ); LoadGroupRolesTable( $groupRolesTable, $firstPageIndex, $lastPageIndex ); if ( !array_key_exists( $selectedGroup, $groupRolesTable ) && $groupCount > 0 ) $selectedGroup = $groups[ $firstPageIndex ]; // If not our first time here, use the submitted data if ( !FirstTimeHere( $pageName ) ) { foreach ( $groupRolesTable as $groupName => $val ) { if ( in_array( $groupName, $groupUpdateList ) ) { $val->adminOn = in_array( $groupName, $adminOnList ) ? true : false; $val->authorOn = in_array( $groupName, $authorOnList ) ? true : false; } } } } catch ( MgException $e ) { CheckForFatalMgException( $e ); if ( empty( $errorMsg ) ) $errorMsg = $e->GetMessage(); } catch ( Exception $e ) { if ( empty( $errorMsg ) ) $errorMsg = $e->getMessage(); } ?>
Users Groups  

label = "Edit Roles"; $button->icon = "images/edit.gif"; $button->action = "SetElementValue( '".NEXT_PAGE_ID."', 'assignroles.php' );"; $buttons[0] = $button; DisplayToolbar( $buttons, $formName ); ?> $val ) { ?>
Group Name Administrator Role Map Author Role
'.$key.''; ?> adminOn) { echo 'checked="checked"'; }?>> authorOn) { echo 'checked="checked"'; }?>>