Przeglądaj źródła

updated UserAcl

Piotr Labudda 8 lat temu
rodzic
commit
6c6951156a
1 zmienionych plików z 7 dodań i 7 usunięć
  1. 7 7
      SE/se-lib/UserAcl.php

+ 7 - 7
SE/se-lib/UserAcl.php

@@ -374,10 +374,10 @@ class UserAcl {
 		$this->_cache_save('permsByProcesID', $procesID);
 	}
 
-	public function getPermsForTable($idTable) {
+	public function getPermsForTable($idTable) { // @returns [ permInfo group by ID_CELL ]; permInfo = [ ID_CELL, CELL_NAME, SORT_PRIO, PERM_R, PERM_W, PERM_... ]
 		$sqlIdProcesListSql = $this->getUsedUserProcesIdsSql();
 		if (!$sqlIdProcesListSql) return [];
-		$tableCellToProcesSql = <<<SQL
+		$tableCellToProcesSql = "
 			select z.`ID` as `ID_CELL`
 					, z.`DESC` as `CELL_NAME`
 					, z.`DESC_PL` as `CELL_LABEL`
@@ -406,12 +406,12 @@ class UserAcl {
 				-- group by z.`ID`, wsk.`ID_PROCES`
 				group by z.`ID`
 				order by z.`SORT_PRIO`
-SQL;
-		//echo'<pre>UserAcl::getPermsForTable('.$idTable.')::$tableCellToProcesSql ';print_r($tableCellToProcesSql);echo'</pre>';
+		";
 		$userPermsForTable = array();
-		$db = DB::getDB();
-		$res = $db->query($tableCellToProcesSql);
-		while ($h = $db->fetch_assoc($res)) {
+		// $db = DB::getDB();
+		// $res = $db->query($tableCellToProcesSql);
+		// while ($h = $db->fetch_assoc($res)) {
+		foreach (DB::getPDO()->fetchAll($tableCellToProcesSql) as $h) {
 			$idCell = $h['ID_CELL'];
 			$userPermsForTable[$idCell] = $h;
 		}