\n";
print "There are additional permisssions that can be assigned to user \n";
print "groups that are not specific to any nodes in the privilege tree. \n";
print "Use this portion of the site to manage those permissions.
\n";
}
else
print "User made no reservations in the past week. \n";
}
print "
\n";
}
////////////////////////////////////////////////////////////////////////////////
///
/// \fn recurseGetChildren($node)
///
/// \param $node - a node id
///
/// \return an array of nodes that are children of $node
///
/// \brief foreach child node of $node, adds it to an array and calls
/// self to add that child's children
///
////////////////////////////////////////////////////////////////////////////////
function recurseGetChildren($node) {
$children = array();
$qh = doQuery("SELECT id FROM privnode WHERE parent = $node", 340);
while($row = mysql_fetch_row($qh)) {
array_push($children, $row[0]);
$children = array_merge($children, recurseGetChildren($row[0]));
}
return $children;
}
////////////////////////////////////////////////////////////////////////////////
///
/// \fn printUserPrivRow($privname, $rownum, $privs, $types,
/// $cascadeprivs, $usergroup, $disabled)
///
/// \param $privname - privilege name
/// \param $rownum - number of the privilege row on this page
/// \param $privs - an array of user's privileges
/// \param $types - an array of privilege types
/// \param $cascadeprivs - an array of user's cascaded privileges
/// \param $usergroup - 'user' if this is a user row, or 'group' if this is a
/// group row
/// \param $disabled - 0 or 1; whether or not the checkboxes should be disabled
///
/// \brief prints a table row for this $privname
///
////////////////////////////////////////////////////////////////////////////////
function printUserPrivRow($privname, $rownum, $privs, $types,
$cascadeprivs, $usergroup, $disabled) {
$allprivs = $cascadeprivs + $privs;
print "
\n";
$count = count($types) + 1;
if($blocked) {
print "\n";
}
}
////////////////////////////////////////////////////////////////////////////////
///
/// \fn getUserPrivRowHTML($privname, $rownum, $privs, $types,
/// $cascadeprivs, $usergroup, $disabled)
///
/// \param $privname - privilege name
/// \param $rownum - number of the privilege row on this page
/// \param $privs - an array of user's privileges
/// \param $types - an array of privilege types
/// \param $cascadeprivs - an array of user's cascaded privileges
/// \param $usergroup - 'user' if this is a user row, or 'group' if this is a
/// group row
/// \param $disabled - 0 or 1; whether or not the checkboxes should be disabled
///
/// \return a string of HTML code for a user privilege row
///
/// \brief creates HTML for a user privilege row and returns it
///
////////////////////////////////////////////////////////////////////////////////
function getUserPrivRowHTML($privname, $rownum, $privs, $types,
$cascadeprivs, $usergroup, $disabled) {
$allprivs = $cascadeprivs + $privs;
$text = "";
$js = "";
$text .= "
\n";
# normal rights
$j = 1;
foreach($types as $type) {
if($type == 'block' || $type == 'cascade')
continue;
$bgcolor = "";
$checked = "";
$value = "";
$cascaded = 0;
if(array_key_exists($privname, $cascadeprivs) &&
in_array($type, $cascadeprivs[$privname])) {
$bgcolor = "bgcolor=\"#008000\"";
$checked = "checked";
$value = "value=cascade";
$cascaded = 1;
}
if(array_key_exists($privname, $privs) &&
in_array($type, $privs[$privname])) {
if($cascaded) {
$value = "value=cascadesingle";
}
else {
$checked = "checked";
$value = "value=single";
}
}
// if $type is administer, manageGroup, or manageMapping, and it is not
# checked, and the user is not in the resource owner group, don't print
# the checkbox
if(($type == "administer" || $type == "manageGroup" || $type == "manageMapping") &&
$checked != "checked" &&
! array_key_exists($resourcegroups[$id]["ownerid"], $user["groups"])) {
$text .= "
\n";
}
// if group type is schedule, don't print available or manageMapping checkboxes
// if group type is managementnode, don't print available checkbox
// if group type is serverprofile, don't print manageMapping checkbox
elseif(($grptype == 'schedule' && ($type == 'available' || $type == 'manageMapping')) ||
($grptype == 'managementnode' && $type == 'available') ||
($grptype == 'serverprofile' && $type == 'manageMapping')) {
$text .= "