_("Your account"))); dual_begin(array()); print("
" . _("You have not authenticated yourself to the system yet with your") . " " . _("username") . " " . _("and") . " " . _("password") . ". " . _("You will not be able to use this section of the website without authenticating yourself first. So, please continue and login using the form on the right hand side.") . "
\n"); dual_middle(array()); show_account_details(array()); dual_end(array()); generic_footer(array()); exit; } $volumes_id = array(); $volumes_name = array(); $volumes_mountpoint = array(); $volumes_vg = array(); function volumes_startelement($parser, $name, $attrs) { global $volumes_id, $volumes_name, $volumes_mountpoint, $volumes_vg; if ($name == "VOLUME") { array_push($volumes_id, $attrs["ID"]); array_push($volumes_name, $attrs["NAME"]); array_push($volumes_mountpoint, $attrs["MOUNTPOINT"]); array_push($volumes_vg, $attrs["VG"]); } } function volumes_endelement($parser, $name) { } $volumes_parser = xml_parser_create(); xml_set_element_handler($volumes_parser, "volumes_startelement", "volumes_endelement"); $volumes_fp = fopen("/opt/openfiler/etc/volumes.xml", "r"); while ($volumes_data = fread($volumes_fp, 4096)) xml_parse($volumes_parser, $volumes_data, feof($volumes_fp)); fclose($volumes_fp); xml_parser_free($volumes_parser); if (count($volumes_name) <= 0) { header("Location: ./volumes.html"); exit; } if (strlen($volume) <= 0) $volume = $volumes_id[0]; for ($i = 0; $i < count($volumes_name); $i++) if ($volumes_id[$i] == $volume) { $volume_mountpoint = $volumes_mountpoint[$i]; $volume_name = $volumes_name[$i]; break; } if (($HTTP_GET_VARS["sort"] == "gid") || ($HTTP_POST_VARS["sort"] == "gid")) $sortorder = "gid"; else if (($HTTP_GET_VARS["sort"] == "gname") || ($HTTP_POST_VARS["sort"] == "gname")) $sortorder = "gname"; else if (($HTTP_GET_VARS["sort"] == "gtype") || ($HTTP_POST_VARS["sort"] == "gtype")) $sortorder = "gtype"; else $sortorder = "none"; $authp = popen("/usr/bin/sudo /usr/sbin/authconfig --openfiler --kickstart", "r"); $i = 0; while (!feof($authp)) $aresult[$i++] = trim(fgets($authp, 4096)); pclose($authp); $groups_gid = array(); $groups_name = array(); $groups_properties = array(); endgrent(); while ($group_info = getgrent()) { if (($group_info["gr_gid"] >= 500)) { array_push($groups_gid, $group_info["gr_gid"]); array_push($groups_name, $group_info["gr_name"]); array_push($groups_properties, "Unknown"); } } endgrent(); $list_n = count($groups_gid); $list_pages = intval(floor($list_n / $list_count)); $list_cur_page = intval($HTTP_GET_VARS["list_cur_page"]); if (($list_cur_page < 0) || ($list_cur_page > ($list_pages - 1))) $list_cur_page = 0; if ($list_cur_page == ($list_pages - 1)) { $list_next_page = 0; $list_prev_page = $list_cur_page - 1; } else if ($list_cur_page == 0) { $list_next_page = $list_cur_page + 1; $list_prev_page = $list_pages - 1; } else { $list_next_page = $list_cur_page + 1; $list_prev_page = $list_cur_page - 1; } if (($list_prev_page < 0) || ($list_prev_page > ($list_pages - 1))) $list_prev_page = 0; if (($list_next_page < 0) || ($list_next_page > ($list_pages - 1))) $list_next_page = 0; $list_start = $list_cur_page * $list_count; $list_end = ($list_cur_page + 1) * $list_count; if ($list_end > $list_n) $list_end = $list_n; if (strncasecmp($aresult[9], "YES", 3) == 0) { // add NIS groups $groupp = popen("/usr/bin/sudo /usr/bin/ypcat group", "r"); $i = 0; while (!feof($groupp)) { $gresult[$i] = explode(":", fgets($groupp, 4096)); foreach (($gresult[$i]) as $gresultitem) $gresultitem = trim($gresultitem); if ((strlen($gresult[$i][0]) > 0) && ($gresult[$i][2] >= 500)) { for ($j = 0; $j < count($groups_gid); $j++) if (($groups_gid[$j] == $gresult[$i][2]) && ($groups_name[$j] == $gresult[$i][0]) && ($groups_properties[$j] == "Unknown")) $groups_properties[$j] = "NIS"; } $i++; } pclose($groupp); } if (strncasecmp($aresult[5], "YES", 3) == 0) { // add LDAP groups } if (strncasecmp($aresult[2], "YES", 3) == 0) { // add Hesiod groups } // add local groups $groupp = popen("/usr/bin/sudo /bin/cat /etc/group", "r"); $i = 0; while (!feof($groupp)) { $gresult[$i] = explode(":", fgets($groupp, 4096)); foreach (($gresult[$i]) as $gresultitem) $gresultitem = trim($gresultitem); if ((strlen($gresult[$i][0]) > 0) && ($gresult[$i][2] >= 500)) { for ($j = 0; $j < count($groups_gid); $j++) if (($groups_gid[$j] == $gresult[$i][2]) && ($groups_name[$j] == $gresult[$i][0]) && ($groups_properties[$j] == "Unknown")) $groups_properties[$j] = "Local"; } $i++; } pclose($groupp); if ($sortorder == "gname") array_multisort($groups_name, $groups_properties, $groups_gid); else if ($sortorder == "gid") array_multisort($groups_gid, $groups_name, $groups_properties); else if ($sortorder == "gtype") array_multisort($groups_properties, $groups_gid, $groups_name); $quota = array(); $quotap = popen("/usr/bin/sudo /usr/sbin/repquota -v -g -n " . escapeshellarg($volume_mountpoint), "r"); while (!feof($quotap)) { $string = trim(fgets($quotap, 4096)); $strarray = explode(" ", $string); $qarray = array(); foreach ($strarray as $strelement) { $element = trim($strelement); if (strlen($element) == 0) continue; else array_push($qarray, $element); } array_push($quota, $qarray); } pclose($quotap); if (count($HTTP_POST_VARS) > 0) { if ($HTTP_POST_VARS["requestgroups"] == "Save") { for ($i = 0; $i < count($groups_gid); $i++) if ($HTTP_POST_VARS["check" . $groups_gid[$i]] == "on") { for ($j = 0; $j < count($quota); $j++) { $qline = $quota[$j]; if ($qline[0] == "#" . $groups_gid[$i]) break; } if (strlen($HTTP_POST_VARS["gblocks"] . "") <= 0) $gblocks = intval($qline[3]); else $gblocks = $HTTP_POST_VARS["gblocks"]; if (strlen($HTTP_POST_VARS["ginodes"] . "") <= 0) $ginodes = intval($qline[7]); else $ginodes = $HTTP_POST_VARS["ginodes"]; // print($gblocks . " " . $ginodes); exec("/usr/bin/sudo /usr/sbin/setquota -g " . escapeshellarg($groups_gid[$i]) . " " . escapeshellarg($gblocks) . " " . escapeshellarg($gblocks) . " " . escapeshellarg($ginodes) . " " . escapeshellarg($ginodes) . " " . escapeshellarg($volume_mountpoint)); } header("Location: ./quota.html?sort=" . $sortorder . "&volume=" . urlencode($volume) . "&list_cur_page=" . urlencode($list_cur_page)); exit; } else { for ($i = 0; $i < count($groups_gid); $i++) { if ($HTTP_POST_VARS["request" . $groups_gid[$i]] == "Save") { exec("/usr/bin/sudo /usr/sbin/setquota -g " . escapeshellarg($groups_gid[$i]) . " " . escapeshellarg($HTTP_POST_VARS["gblocks" . $groups_gid[$i]]) . " " . escapeshellarg($HTTP_POST_VARS["gblocks" . $groups_gid[$i]]) . " " . escapeshellarg($HTTP_POST_VARS["ginodes" . $groups_gid[$i]]) . " " . escapeshellarg($HTTP_POST_VARS["ginodes" . $groups_gid[$i]]) . " " . escapeshellarg($volume_mountpoint)); header("Location: ./quota.html?sort=" . $sortorder . "&volume=" . urlencode($volume) . "&list_cur_page=" . urlencode($list_cur_page)); exit; } else if ($HTTP_POST_VARS["request96"] == "Save") { exec("/usr/bin/sudo /usr/sbin/setquota -g 96 " . escapeshellarg($HTTP_POST_VARS["gblocks96"]) . " " . escapeshellarg($HTTP_POST_VARS["gblocks96"]) . " " . escapeshellarg($HTTP_POST_VARS["ginodes96"]) . " " . escapeshellarg($HTTP_POST_VARS["ginodes96"]) . " " . escapeshellarg($volume_mountpoint)); header("Location: ./quota.html?sort=" . $sortorder . "&volume=" . urlencode($volume) . "&list_cur_page=" . urlencode($list_cur_page)); exit; } } } } generic_header(array("title" => _("Administration Section"))); single_begin(array()); print("Welcome Administrator. The following are various system information and preferences, arranged into tabs. Please click on a tab to open up that category.
Select a volume below to bring up group quota for that particular
volume in the list below.
You can mark a number of groups below using the 'X' column checkboxes
and set all their quota using the form immediately below.
" align="center">Total Space (blocks) | " align="center">Total Files | " align="center">Save |
" align="center"> | " align="center"> | " align="center"> |
Click on Save after entering new quota values to change a group's quota
for the volume.
">« Previous page | "> | ">Next page » |
" align="center">X | ">GID | ">Name | ">Type | ">Total Space (blocks) | ">Used Space (blocks) | ">Free Space (blocks) | ">Total Files | ">Used Files | ">Free Files | ">Save | \n"); print("\t | " . $groups_gid[$i] . " | \n"); print("\t" . htmlentities($groups_name[$i]) . " | \n"); print("\t" . $groups_properties[$i] . " | \n"); for ($j = 0; $j < count($quota); $j++) { $qline = $quota[$j]; if ($qline[0] == "#" . $groups_gid[$i]) break; $qline = array(); } print("\t\n"); print("\t\n"); print("\t | \n"); print("\t0) && (intval($qline[2]) > intval($qline[3]))) ? "#ff8080" : $dvalue) . "\">\n"); print("\t" . intval($qline[2]) . "\n"); print("\t | \n"); print("\t0) && ((intval($qline[3]) - intval($qline[2])) < 0)) ? "#ff8080" : $dvalue) . "\">\n"); print("\t" . ((intval($qline[3]) > 0) ? (intval($qline[3]) - intval($qline[2])) : "N/A") . "\n"); print("\t | \n"); print("\t\n"); print("\t\n"); print("\t | \n"); print("\t0) && (intval($qline[6]) > intval($qline[7]))) ? "#ff8080" : $dvalue) . "\">\n"); print("\t" . intval($qline[6]) . "\n"); print("\t | \n"); print("\t0) && ((intval($qline[7]) - intval($qline[6])) < 0)) ? "#ff8080" : $dvalue) . "\">\n"); print("\t" . ((intval($qline[7]) > 0) ? (intval($qline[7]) - intval($qline[6])) : "N/A") . "\n"); print("\t | \n"); print("\t\n"); print("\t\n"); print("\t | \n"); print("\n"); } ?>
Click on Save after entering new quota values to change the guest account's quota
for the volume.
" align="center">Total Space (blocks) | " align="center">Used Space (blocks) | " align="center">Free Space (blocks) | " align="center">Total Files | " align="center">Used Files | " align="center">Free Files | " align="center">Save |
" align="center"> | " align="center"> | " align="center"> 0) ? (intval($qline[3]) - intval($qline[2])) : "N/A")); ?> | " align="center"> | " align="center"> | " align="center"> 0) ? (intval($qline[7]) - intval($qline[6])) : "N/A")); ?> | " align="center"> |
\n"); nested_tab_end(); single_end(array()); generic_footer(array()); ?>