_("Your account"))); dual_begin(array()); print("

" . _("Home") . " / " . _("Your account") . "

\n"); 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]; $volume_vg = $volumes_vg[0]; } $fstype = ""; for ($fsj = 0; $fsj < count($volumes_id); $fsj++) { if (($vgname == $volumes_vg[$fsj]) && ($volume == $volumes_id[$fsj])) { $fstype = $volumes_fstype[$fsj]; break; } } $fs = 0; $fsfound = false; for ($fsi = 0; $fsi < count($fs_info); $fsi++) { if ($fs_info[$fsi]["type"] == $fstype) { $fs = $fsi; $fsfound = true; break; } } if ($fsfound == false) $fs = 0; if (isset($volumeinfo)) { for ($i = 0; $i < count($volumes_name); $i++) if ($volumeinfo == ("#!@-" . $volumes_id[$i] . "-#!@-" . $volumes_vg[$i] . "-#!@")) { $volume_mountpoint = $volumes_mountpoint[$i]; $volume_name = $volumes_name[$i]; $volume = $volumes_id[$i]; $volume_vg = $volumes_vg[$i]; break; } } else { for ($i = 0; $i < count($volumes_name); $i++) if (($volumes_id[$i] == $volume) && ($volumes_vg[$i] == $volume_vg)) { $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(ceil($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 = intval(round($HTTP_POST_VARS["gblocks"] * $fs_info[$fs]["fs_block_size"])); 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) . "&volume_vg=" . urlencode($volume_vg) . "&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(intval(round($HTTP_POST_VARS["gblocks" . $groups_gid[$i]] * $fs_info[$fs]["fs_block_size"]))) . " " . escapeshellarg(intval(round($HTTP_POST_VARS["gblocks" . $groups_gid[$i]] * $fs_info[$fs]["fs_block_size"]))) . " " . 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) . "&volume_vg=" . urlencode($volume_vg) . "&list_cur_page=" . urlencode($list_cur_page)); exit; } } } } generic_header(array("title" => _("Administration Section"))); single_begin(array()); print("

" . _("Home") . " / " . _("Administration Section") . "

\n"); ?>

Welcome Administrator. The following are various system information and preferences, arranged into tabs. Please click on a tab to open up that category.

Select Volume

Select a volume below to bring up group quota for that particular
volume in the list below.

 

 


Edit group quota

\n"); print("\n"); print("\n"); print("\n"); print("\n"); ?>

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 in MB " 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 »
\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\t\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("\t\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\n"); } ?>
" align="center">X ">GID ">Name ">Type ">Total Space in MB ">Used Space in MB ">Free Space in MB ">Total Files ">Used Files ">Free Files ">Save
" . $groups_gid[$i] . "" . htmlentities($groups_name[$i]) . "" . $groups_properties[$i] . "\n"); print("\t\n"); print("\t 0) && (intval($qline[2]) > intval($qline[3]))) ? "#ff8080" : $dvalue) . "\">\n"); print("\t" . printf("%.02f", (intval($qline[2]) / $fs_info[$fs]["fs_block_size"])) . "\n"); print("\t 0) && ((intval($qline[3]) - intval($qline[2])) < 0)) ? "#ff8080" : $dvalue) . "\">\n"); print("\t" . ((intval($qline[3]) > 0) ? printf("%.02f", (intval($qline[3]) - intval($qline[2])) / $fs_info[$fs]["fs_block_size"]) : "N/A") . "\n"); print("\t\n"); print("\t\n"); print("\t 0) && (intval($qline[6]) > intval($qline[7]))) ? "#ff8080" : $dvalue) . "\">\n"); print("\t" . intval($qline[6]) . "\n"); print("\t 0) && ((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"); nested_tab_end(); single_end(array()); generic_footer(array()); ?>