file:	tng_manage_permissions_code.php

desc:	code behind permission manager.
---------------------------------------------------------------*/
include_once 'classes/class_login.php';
include_once 'classes/class_dbconn.php';
session_start();
// form is being loaded first time or
// it is being loaded through ajax
if (isset($_SESSION['obj_login'])) {
    if (isset($_POST['ajax_action'])) {
        switch ($_POST['ajax_action']) {
            // request for a list of available
            // forms
            case "get_form_list":
                $form_list = get_form_list();
                $xml = generate_object_list_xml($form_list, "");
                echo $xml;
                break;
                // get the schemas for a particular
                // form
            // get the schemas for a particular
            // form
            case "get_schemas":
                $obj_set = $_POST['ajax_object_set'];
                $form_id = $_POST['form_id'];
                $schema_list = array();
                // now check if the request was
                // for the set of linked schemas
                // or unlinked schemas.
                // call appropriate method accordingly
include_once 'classes/class_dbconn.php';
include_once 'classes/class_form.php';
session_start();
// form is being loaded first time or
// it is being loaded through ajax
if (!isset($_SESSION['obj_login'])) {
    echo "Please Login before proceeding";
} else {
    if (isset($_POST['ajax_action'])) {
        switch ($_POST['ajax_action']) {
            // caller wants list of all available
            // forms
            case "get_forms":
                $form_list = array();
                $xml = "";
                if (get_form_list($form_list)) {
                    $xml = convert_form_list_to_xml($form_list);
                }
                echo $xml;
                break;
                // the caller wishes get details
                // on a particular form
            // the caller wishes get details
            // on a particular form
            case "get_form_details":
                $form_id = $_POST['form_id'];
                $xml = get_form_details($form_id);
                echo $xml;
                break;
            case "toggle_searchable":
                toggle_searchable($_POST['field_id'], $_POST['searchable']);