type == MOTHER_NETWORK_TYPE) { $authorization_required = TRUE; //there is specific task assigned to each page //you can see array of tasks in authorize.inc.php $page_task = 'user_defaults';//meta networks require_once "$path_prefix/web/includes/authorize.inc.php"; $configure_permission = $task_perm;//set from authorize.inc.php } else {//old method for spawned networks $configure_permission = current_user_can('configure_network'); } /********/ $msg = ''; if ($_GET['msg']){ $msg = $_GET['msg']; } //echo '
';print_r($_POST);exit;
if ($_POST['save']){
  $count_role  = (int) $_POST['totalcount'] ;
  for($i = 1 ; $i <= $count_role ; $i++) {
    $role_id  = $_POST['link_id'.$i] ; 
    $role = new Roles();
    $task_count  = (int) $_POST['taskcount'] ;
    for($j = 1 ; $j <=$task_count ; $j++) {
      $task_id =  $_POST['taskid'.$j] ; 
      $chk = $role_id .'~'. $task_id;
      if ( $_POST[$chk]) {
        try {
          $role->assign_tasks_to_role($task_id, $role_id) ;   
        }
        catch (PAException $e) {
          $msg = "$e->message";
          $error = TRUE;
        }
      } else {
        $task_exist = Roles::is_roletask_exist($role_id, $task_id);
        if ($task_exist) {
          Roles::delete_taskrole($role_id, $task_id);
        } 
      }
    }
  }
header("Location:assign_tasks.php?msg=9015");
exit;
}

$permission_denied_msg = '';
if ( !$configure_permission ) {
  $error = TRUE;
  $permission_denied_msg = "Sorry! you are not authorized to view the content of this page";
}
$page = new PageRenderer("setup_module", PAGE_TASK_MANAGE, "", 'container_two_column.tpl', 'header.tpl', PRI, HOMEPAGE, $network_info);
$msg = ( !empty($msg) ) ? $msg: $permission_denied_msg;

$page->html_body_attributes = 'class="no_second_tier network_config"';

function setup_module($column, $module, $obj) {
  global $permission_denied_msg,$error;
  if($permission_denied_msg) return 'skip';
    
}

uihelper_error_msg($msg);
uihelper_get_network_style();
echo $page->render();

?>