_("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 (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]; $volume_id = $volumes_id[$i]; $volume_vg = $volumes_vg[$i]; break; } endpwent(); while ($user_info = getpwent()) { if ($user_info["pw_name"] == $usercookie) $user_uid = $user_info["pw_uid"]; } endpwent(); $user_groups_gid = array(); $user_groups_name = array(); endgrent(); while ($group_info = getgrent()) { if (in_array($usercookie, $group_info["gr_mem"])) { array_push($user_groups_gid, $group_info["gr_gid"]); array_push($user_groups_name, $group_info["gr_name"]); } } endgrent(); generic_header(array("title" => _("Your account"))); single_begin(array()); print("

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

\n"); ?>

Hi ! The following are your account 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 quota for that particular
volume in the list below.

 

 


Volume - " . $volume_name . " (" . $volume_id . ")\n"); $volume_path = "/dev/" . escapeshellarg($volume_vg) . "/" . escapeshellarg($volume_id); $user_quota = array(); $user_quotap = popen("/usr/bin/sudo /usr/sbin/repquota -v -n " . escapeshellarg($volume_path), "r"); while (!feof($user_quotap)) { $string = trim(fgets($user_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($user_quota, $qarray); } pclose($user_quotap); $group_quota = array(); $group_quotap = popen("/usr/bin/sudo /usr/sbin/repquota -v -g -n " . escapeshellarg($volume_path), "r"); while (!feof($group_quotap)) { $string = trim(fgets($group_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($group_quota, $qarray); } pclose($group_quotap); print("

User quota

\n"); $qfound = false; for ($i = 0; $i < count($user_quota); $i++) { $qline = $user_quota[$i]; if ($qline[0] == "#" . $user_uid) { $qfound = true; break; } } if ($qfound == true) { ?>
" 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"> " 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")); ?>
No user quota has been configured on this volume for this user.

"); } print("

Group quota

\n"); ?> \n"); print("\t\n"); 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">GID " align="center">Group Name " 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
" . htmlentities($user_groups_gid[$i]) . "" . htmlentities($user_groups_name[$i]) . "\n"); print("\t" . intval($qline[3]) . "\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" . intval($qline[7]) . "\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