$network = new Network;
     $extra = $form_data['extra'];
     $data = array(
     'network_id'=>PA::$network_info->network_id,
     'extra'=>serialize($extra),
     'changed'=>time()
     );
     $network->set_params($data);
    */
    $msg = "";
    try {
        $nid = $network->save();
        if (sizeof($nid)) {
            $msg = __("Default settings for the network has been saved");
            if (!empty($_REQUEST['config_action']) && $_REQUEST['config_action'] == 'store_as_defaults') {
                $export_config = new NetworkConfig();
                $export_config->buildNetworkSettings($network);
                $export_config->storeSettingsLocal();
                $msg = 'Network default configuration file "' . $export_config->settings_file . '" successfully updated.';
            }
            if (!empty($file)) {
                Storage::link($file, array("role" => "header"));
                // network header
            }
        }
    } catch (CNException $e) {
        $error = TRUE;
        $error_msg = "{$e->message}";
    }
}
//..end of $_POST
 private function handlePOST_restoreRoleToDefaults($request_data)
 {
     global $error_msg;
     $imported_config = new NetworkConfig();
     $restore_roles = $imported_config->importRolesInfo();
     $error_msg = $this->restoreRoleSettings($restore_roles);
 }
                 $email->template = $template;
                 $email->configurable_variables = $configurable_variables;
                 $email->update();
                 $error_msg = __('Email message settings successfully restored.');
             } else {
                 $error_msg = __("Message type \"{$email_type}\" not found in default settings file.");
             }
         } catch (Exception $e) {
             $error = TRUE;
             $error_msg = $e->getMessage();
         }
     }
     break;
 case 'revert_all_messages':
     try {
         $current_config = new NetworkConfig();
         $restored_messages = $current_config->getDefaultMessages(false);
         $current_config->settings['email_messages'] = $restored_messages;
         $current_config->storeSettingsLocal();
         $error_msg = __('Email message settings successfully restored.');
     } catch (Exception $e) {
         $error = TRUE;
         $error_msg = $e->getMessage();
     }
     break;
 case 'store_as_defaults':
     /*
              if(saveEmail(&$error_msg, true)) {
                $error_msg = 'Message template file successfully saved.';
              }
              header("location: configure_email.php?msg=".$error_msg."&email_type=" . $email_type);