Exemple #1
0
 function GetLetter($ID)
 {
     $z = CTask::GetById($ID);
     if ($r = $z->Fetch()) {
         if ($r['LETTER']) {
             return $r['LETTER'];
         }
     }
     return false;
 }
Exemple #2
0
						$anonym = $g_NAME;
					if($path=="/")
						$perm = $CUR_PERM["/"][$g_ID];
					else
						$perm = $CUR_PERM[$arParsedPath["LAST"]][$g_ID];

					if (substr($perm,0,2) == 'T_')
						$taskId = intval(substr($perm,2));
					elseif(strlen($perm) == 1)
						$taskId = CTask::GetIdByLetter($perm,'main','file');
					else
						$taskId = 'NOT_REF';

					if ($taskId != 'NOT_REF')
					{
						$z = CTask::GetById($taskId);
						if (!($r = $z->Fetch()))
							$taskId = 'NOT_REF';
					}
					//if(isset($arSubordGroups) && !in_array($g_ID,$arSubordGroups))
					//{
					//	$hidden_groups .= '<input type="hidden" name="g_'.$g_ID.'" value="'.$taskId.'">';
					//	continue;
					//}
				?>
				<tr>
					<td>
						[<a href="/freetrix/admin/group_edit.php?ID=<?php 
echo $g_ID;
?>
&lang=<?php 
             }
         } else {
             $showField = "&nbsp;";
         }
     }
     $row->AddField("PERMS", $showField);
 }
 $showField = "";
 if (in_array("PERMS_B", $arVisibleColumns)) {
     $showField = "&nbsp;";
     if (($USER->CanDoOperation('fileman_view_permissions') || $USER->CanDoOperation('fileman_edit_all_settings')) && $USER->CanDoFileOperation('fm_view_permission', $arPath)) {
         $arP = $APPLICATION->GetFileAccessPermission(array($site, $fpath), IntVal($show_perms_for) > 0 ? array($show_perms_for) : false, true);
         end($arP);
         $cur_dir_taskId = current($arP);
         if ($cur_dir_taskId) {
             $z = CTask::GetById($cur_dir_taskId);
             if ($r = $z->Fetch()) {
                 if ($r['NAME']) {
                     $showField = GetMessage(strtoupper($r['NAME']));
                     if (strlen($showField) <= 0) {
                         $showField = $r['NAME'];
                     }
                 }
             }
         }
     }
 }
 $row->AddField("PERMS_B", $showField);
 $arActions = array();
 if ($Elem["TYPE"] == "F") {
     if ($USER->CanDoFileOperation('fm_view_listing', $arPath)) {
Exemple #4
0
					$groupID = trim($groupID);
					if($groupID == '')
						continue;
				}
				elseif (!$isAdmin)
					continue;

				// if not set task - delete permission
				$taskID = intval($taskID);
				if ($taskID <= 0)
				{
					unset($arSavePermission[$groupID]);
					continue;
				}

				$obTask = CTask::GetById($taskID);
				if ( ($arTask = $obTask->Fetch()) && $arTask["LETTER"] && $arTask["SYS"] == "Y")
					$permLetter = $arTask["LETTER"];
				else
					$permLetter = "T_".$taskID;

				$arSavePermission[$groupID] = $permLetter;
			}
		}

		$APPLICATION->SetFileAccessPermission(array($site, $path), $arSavePermission);

		if ($e = $APPLICATION->GetException())
			$strWarning = $e->msg;
	}
         if ($cur_dir_taskId) {
             $z = CTask::GetById($cur_dir_taskId);
             if ($r = $z->Fetch()) {
                 if ($r['NAME']) {
                     $showField = GetMessage(strtoupper($r['NAME']));
                     if (strlen($showField) <= 0) {
                         $showField = $r['NAME'];
                     }
                 }
             }
         }
         $add_tasks = $arP[1];
         $len = count($add_tasks);
         if ($len > 0) {
             for ($i = 0; $i < $len; $i++) {
                 $z = CTask::GetById($add_tasks[$i]);
                 if ($r = $z->Fetch()) {
                     if ($r['NAME']) {
                         $showField .= ', ' . $r['NAME'];
                     }
                 }
             }
         }
     }
 }
 $row->AddField("PERMS_B", $showField);
 $arActions = array();
 if ($Elem["TYPE"] == "F") {
     if ($USER->CanDoFileOperation('fm_view_listing', $arPath)) {
         if ($USER->CanDoOperation('fileman_edit_menu_elements') && preg_match('/^\\.(.*)?\\.menu\\.(php|html|php3|php4|php5|phtml)$/', $f_NAME, $regs) && $USER->CanDoFileOperation('fm_edit_existent_file', $arPath)) {
             $arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("FILEMAN_ADMIN_EDIT_AS_MENU"), "DEFAULT" => true, "ACTION" => $lAdmin->ActionRedirect("fileman_menu_edit.php?path=" . urlencode($path) . "&site=" . $site . "&name=" . urlencode($regs[1]) . "&" . $addUrl . "&" . GetFilterParams("filter_") . ""));