_("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]; 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"] == "uid") || ($HTTP_POST_VARS["sort"] == "uid")) $sortorder = "uid"; else if (($HTTP_GET_VARS["sort"] == "uname") || ($HTTP_POST_VARS["sort"] == "uname")) $sortorder = "uname"; else if (($HTTP_GET_VARS["sort"] == "utype") || ($HTTP_POST_VARS["sort"] == "utype")) $sortorder = "utype"; else $sortorder = "none"; $authp = popen("/usr/bin/sudo /usr/sbin/authconfig --openfiler --kickstart", "r"); $i = 0; while (!feof($authp)) $aresult[$i++] = fgets($authp, 4096); pclose($authp); $users_uid = array(); $users_name = array(); $users_properties = array(); endpwent(); while ($user_info = getpwent()) { if (($user_info["pw_uid"] >= 500)) { array_push($users_uid, $user_info["pw_uid"]); array_push($users_name, $user_info["pw_name"]); array_push($users_properties, "Unknown"); } } endpwent(); if (strncasecmp($aresult[9], "YES", 3) == 0) { // add NIS users $userp = popen("/usr/bin/sudo /usr/bin/ypcat passwd", "r"); $i = 0; while (!feof($userp)) { $uresult[$i] = explode(":", fgets($userp, 4096)); foreach (($uresult[$i]) as $uresultitem) $uresultitem = trim($uresultitem); if ((strlen($uresult[$i][0]) > 0) && ($uresult[$i][2] >= 500)) { for ($j = 0; $j < count($users_uid); $j++) if (($users_uid[$j] == $uresult[$i][2]) && ($users_name[$j] == $uresult[$i][0]) && ($users_properties[$j] == "Unknown")) $users_properties[$j] = "NIS"; } $i++; } pclose($userp); } if (strncasecmp($aresult[5], "YES", 3) == 0) { // add LDAP users } if (strncasecmp($aresult[2], "YES", 3) == 0) { // add Hesiod users } // add local users $userp = popen("/usr/bin/sudo /bin/cat /etc/passwd", "r"); $i = 0; while (!feof($userp)) { $uresult[$i] = explode(":", fgets($userp, 4096)); foreach (($uresult[$i]) as $uresultitem) $uresultitem = trim($uresultitem); if ((strlen($uresult[$i][0]) > 0) && ($uresult[$i][2] >= 500)) { for ($j = 0; $j < count($users_uid); $j++) if (($users_uid[$j] == $uresult[$i][2]) && ($users_name[$j] == $uresult[$i][0]) && ($users_properties[$j] == "Unknown")) $users_properties[$j] = "Local"; } $i++; } pclose($userp); if ($sortorder == "uname") array_multisort($users_name, $users_properties, $users_uid); else if ($sortorder == "uid") array_multisort($users_uid, $users_name, $users_properties); else if ($sortorder == "utype") array_multisort($users_properties, $users_uid, $users_name); $quota = array(); $quotap = popen("/usr/bin/sudo /usr/sbin/repquota -v -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["requestusers"] == "Save") { for ($i = 0; $i < count($users_uid); $i++) if ($HTTP_POST_VARS["check" . $users_uid[$i]] == "on") { for ($j = 0; $j < count($quota); $j++) { $qline = $quota[$j]; if ($qline[0] == "#" . $users_uid[$i]) break; } if (strlen($HTTP_POST_VARS["ublocks"] . "") <= 0) $ublocks = intval($qline[3]); else $ublocks = $HTTP_POST_VARS["ublocks"]; if (strlen($HTTP_POST_VARS["uinodes"] . "") <= 0) $uinodes = intval($qline[7]); else $uinodes = $HTTP_POST_VARS["uinodes"]; // print($ublocks . " " . $uinodes); exec("/usr/bin/sudo /usr/sbin/setquota -u " . escapeshellarg($users_uid[$i]) . " " . escapeshellarg($ublocks) . " " . escapeshellarg($ublocks) . " " . escapeshellarg($uinodes) . " " . escapeshellarg($uinodes) . " " . escapeshellarg($volume_mountpoint)); } header("Location: ./quota_user.html?sort=" . $sortorder . "&volume=" . urlencode($volume)); exit; } else { for ($i = 0; $i < count($users_uid); $i++) { if ($HTTP_POST_VARS["request" . $users_uid[$i]] == "Save") { exec("/usr/bin/sudo /usr/sbin/setquota -u " . escapeshellarg($users_uid[$i]) . " " . escapeshellarg($HTTP_POST_VARS["ublocks" . $users_uid[$i]]) . " " . escapeshellarg($HTTP_POST_VARS["ublocks" . $users_uid[$i]]) . " " . escapeshellarg($HTTP_POST_VARS["uinodes" . $users_uid[$i]]) . " " . escapeshellarg($HTTP_POST_VARS["uinodes" . $users_uid[$i]]) . " " . escapeshellarg($volume_mountpoint)); header("Location: ./quota_user.html?sort=" . $sortorder . "&volume=" . urlencode($volume)); 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 user quota for that particular
volume in the list below.

 

 


Edit user quota

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

You can mark a number of users below using the 'X' column checkboxes
and set all their quota using the form immediately below.

">Total Space (blocks) ">Total Files ">Save
" align="center"> " align="center"> " align="center">

 

Click on Save after entering new quota values to change a user's quota
for the volume.

\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] == "#" . $users_uid[$i]) break; } 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 ">UID ">Name ">Type ">Total Space (blocks) ">Used Space (blocks) ">Free Space (blocks) ">Total Files ">Used Files ">Free Files ">Save
" . $users_uid[$i] . "" . $users_name[$i] . "" . $users_properties[$i] . "\n"); print("\t\n"); print("\t 0) && (intval($qline[2]) > intval($qline[3]))) ? "#ff8080" : $dvalue) . "\">\n"); print("\t" . intval($qline[2]) . "\n"); print("\t 0) && ((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 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()); ?>