function priv_info($url, &$hit) { global $db; $sql = "SELECT * FROM auth_content INNER JOIN auth_group ON (auth_content.gid=auth_group.gid) INNER JOIN auth_priv ON (auth_content.pid=auth_priv.pid) WHERE tname='" . $url . "'"; $result = $db->query($sql); while ($all = $db->fetch_array($result, 1)) { if ($all["neg"] == -1) { $hit[$url]["del"][$all["ggroup"]] .= $all["priv"] . ","; } else { $hit[$url]["add"][$all["ggroup"]] .= $all["priv"] . ","; } } if ($url != "/") { $url = dirname($url); priv_info($url, $hit); } return $hit; }
function get_chefred($url) { global $db, $member_edit, $member_publish; // chefredakteure holen $infos = ""; $priv_info = priv_info($url, $infos); $array_priv_edit = array(); $member_edit = array(); $member_publish = array(); foreach ($priv_info as $priv_url => $value) { if (is_array($value["add"])) { foreach ($value["add"] as $group => $rights) { $sql = "SELECT *\n FROM auth_group\n JOIN auth_member\n ON (auth_group.gid=auth_member.gid)\n JOIN auth_user\n ON (auth_member.uid=auth_user.uid)\n WHERE ggroup='" . $group . "'"; $result = $db->query($sql); $member = array(); while ($data = $db->fetch_array($result, 1)) { $member[$data["username"]] = "<a href=\"mailto:" . $data["email"] . "\">" . $data["vorname"] . " " . $data["nachname"] . "</a>"; if (strstr($rights, "edit") && !strstr($value["del"][$group], "edit")) { $member_edit[$data["username"]] = "<a href=\"mailto:" . $data["email"] . "\">" . $data["vorname"] . " " . $data["nachname"] . "</a>"; } if (strstr($rights, "publish") && !strstr($value["del"][$group], "publish")) { $member_publish[$data["username"]] = "<a href=\"mailto:" . $data["email"] . "\">" . $data["vorname"] . " " . $data["nachname"] . "</a>"; } } } } } }
case "add": $dataloop["legende"][$key]["color"] = $value["color"]; $dataloop["legende"][$key]["text"] = "Zugewiesenes Recht"; break; case "del": $dataloop["legende"][$key]["color"] = $value["color"]; $dataloop["legende"][$key]["text"] = "Negiertes Recht"; break; } } // ausgeben der url wo man sich gerade befindet $ausgaben["url"] = $url; $url2 = $url; $infos = ""; // erstellen der info - box $infos = priv_info($url, $infos); // wenn parameter 2 gesetzt ist, info-box oeffnen if ($environment["parameter"][2] != "") { $ausgaben["display"] = "visible"; } else { $ausgaben["display"] = "none"; } // holen aller rechte $sql = "SELECT * FROM " . $cfg["righted"]["db"]["priv"]["entries"]; $result = $db->query($sql); while ($all = $db->fetch_array($result, 1)) { $all_rights[] = $all[$cfg["righted"]["db"]["priv"]["name"]]; } // holen aller gruppen $sql = "SELECT * FROM " . $cfg["righted"]["db"]["group"]["entries"]; $result = $db->query($sql);