$groupNameStr = "";
$l = 0;
foreach ($user_groups as $grpid => $groupname) {
    if ($l != 0) {
        $groupIdStr .= ",";
        $groupNameStr .= ",";
    }
    $groupIdStr .= "'" . $grpid . "'";
    $groupNameStr .= "'" . escape_single_quotes(decode_html($groupname)) . "'";
    $l++;
}
if (isset($_REQUEST["record"]) && $_REQUEST['record'] != '') {
    $reportid = vtlib_purify($_REQUEST["record"]);
    $visiblecriteria = getVisibleCriteria($recordid);
    $report_std_filter->assign("VISIBLECRITERIA", $visiblecriteria);
    $member = getShareInfo($recordid);
    $report_std_filter->assign("MEMBER", $member);
} else {
    $visiblecriteria = getVisibleCriteria();
    $report_std_filter->assign("VISIBLECRITERIA", $visiblecriteria);
}
$report_std_filter->assign("GROUPNAMESTR", $groupNameStr);
$report_std_filter->assign("USERNAMESTR", $userNameStr);
$report_std_filter->assign("GROUPIDSTR", $groupIdStr);
$report_std_filter->assign("USERIDSTR", $userIdStr);
//include("modules/Reports/StandardFilter.php");
//include("modules/Reports/AdvancedFilter.php");
$report_std_filter->display('ReportSharing.tpl');
/** Function to get visible criteria for a report
 *  This function accepts The reportid as an argument
 *  It returns a array of selected option of sharing along with other options
     renameFolder();
     break;
 case 'movefolder':
     moveFolder();
     break;
 case 'deletefolder':
     deleteFolder();
     break;
 case 'sharefolder':
     shareFolder();
     break;
 case 'unsharefolder':
     unshareFolder();
     break;
 case 'getshareinfo':
     getShareInfo();
     break;
 case 'sendfile':
     sendFile();
     break;
 case 'filerevisions':
     getFileRevisions();
     break;
 case 'storagerevisions':
     getStorageRevisions();
     break;
 case 'downloadafile':
     $t = true;
     $err = '';
     if (strlen($_POST['token']) == 0) {
         $t = false;