Portions created by the Initial Developer are Copyright (C) 2008-2013 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ include "root.php"; require_once "resources/require.php"; //check the permissions require_once "resources/check_auth.php"; if (if_group("admin") || if_group("superadmin")) { //access allowed } else { echo "access denied"; return; } //add multi-lingual support require_once "app_languages.php"; foreach($text as $key => $value) { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } //show the header require_once "resources/header.php"; $document['title'] = $text['title-group_manager']; if (isset($_REQUEST["change"])) { //get the values from the HTTP POST and save them as PHP variables $change = check_str($_REQUEST["change"]); $group_name = check_str($_REQUEST["group_name"]); $sql = "update v_groups set "; $sql .= "group_protected = '$change' "; $sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "and group_name = '$group_name' "; $db->exec(check_sql($sql)); unset($sql); } //show the content echo "
\n"; echo ""; echo ""; echo ""; echo "
"; echo ""; echo ""; echo "\n"; echo "
".$text['header-group_manager']."

"; if (permission_exists('user_view')) { echo " "; } if (permission_exists('group_edit')) { echo " "; } echo "
"; $sql = "SELECT * FROM v_groups "; $sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "order by group_name asc "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; $strlist = "\n"; $strlist .= "\n"; $strlist .= " \n"; $strlist .= " \n"; $strlist .= " \n"; $strlist .= " \n"; $strlist .= " \n"; $strlist .= "\n"; $count = 0; $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); foreach ($result as &$row) { $group_name = $row["group_name"]; $group_protected= $row["group_protected"]; $group_uuid = $row["group_uuid"]; $group_description = $row["group_description"]; if (strlen($group_name) == 0) { $group_name = " "; } if (strlen($group_description) == 0) { $group_description = " "; } $group_description = wordwrap($group_description, 50, "
\n"); if (!if_group("superadmin") && $group_name == "superadmin") { //hide the superadmin group from non superadmin's } else { /* $tr_link = (permission_exists('group_edit')) ? "href='groupedit.php?id=".$group_uuid."'" : null; */ $strlist .= "\n"; $strlist .= "\n"; $strlist .= "\n"; $strlist .= "\n"; $strlist .= "\n"; $strlist .= "\n"; $strlist .= "\n"; } if ($c==0) { $c=1; } else { $c=0; } $count++; } $strlist .= "\n"; $strlist .= ""; $strlist .= "\n"; $strlist .= "\n"; $strlist .= "
".$text['label-group_name']."".$text['label-group_tools']."".$text['label-group_protected']."".$text['label-group_description'].""; if (permission_exists('group_add')) { $strlist .= "$v_link_label_add"; } $strlist .= "
"; /* if (permission_exists('group_edit')) { $strlist .= "".$group_name.""; } else { */ $strlist .= $group_name; /* } */ $strlist .= "\n"; if (permission_exists('group_add') || if_group("superadmin")) { $strlist .= "".$text['label-group_permissions']."  "; } if (permission_exists('group_member_view') || if_group("superadmin")) { $strlist .= "".$text['label-group_members'].""; } $strlist .= "\n"; if ($group_protected == "true") { $strlist .= " \n"; } else { $strlist .= " \n"; } $strlist .= "".$group_description.""; /* if (permission_exists('group_edit')) { $strlist .= "$v_link_label_edit"; } */ if (permission_exists('group_delete')) { $strlist .= "$v_link_label_delete"; } $strlist .= "
 "; if (permission_exists('group_add')) { $strlist .= "$v_link_label_add"; } $strlist .= "
\n"; if ($count > 0) { echo $strlist; } echo "
"; echo "
"; echo "
"; //show the footer require_once "resources/footer.php"; ?>