_("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 ($HTTP_POST_VARS["action"] == "Create") { if (strlen($HTTP_POST_VARS["volumedescription"]) <= 0) $volumedescription = $volumename; /* Custom mount paths are disabled for now $mountpath = trim($mountpath); if (substr($mountpath, strlen($mountpath) - 1, 1) == "/") $mountpath = substr($mountpath, 0, strlen($mountpath) - 1); */ $volumename = strtolower($volumename); $mountpath = "/mnt/openfiler/" . $volumename; $exists = 0; for ($i = 0; $i < count($volumes_id); $i++) if ($volumes_id[$i] == $volumename) { $exists = 1; break; } if (($exists == 0) && (!is_dir($mountpath)) && (!is_file($mountpath))) { exec("/usr/bin/sudo /sbin/lvm lvcreate -L " . escapeshellarg($reqspace) . " -n " . escapeshellarg($volumename) . " " . escapeshellarg($vgname)); $lvp = popen("/usr/bin/sudo /sbin/lvm lvdisplay -c /dev/" . escapeshellarg($vgname) . "/" . escapeshellarg($volumename), "r"); $i = 0; while (!feof($lvp)) $lvds[$i++] = fgets($lvp, 4096); pclose($lvp); $lvinfo = explode(":", trim($lvds[0], " ")); if ($lvinfo[0] == ("/dev/" . $vgname . "/" . $volumename)) { exec("/usr/bin/sudo /sbin/mkfs.ext2 -j /dev/" . escapeshellarg($vgname) . "/" . escapeshellarg($volumename)); array_push($volumes_id, $volumename); array_push($volumes_name, urldecode($volumedescription)); array_push($volumes_mountpoint, $mountpath . "/"); array_push($volumes_vg, $vgname); $volumesp = popen("/usr/bin/sudo /usr/bin/tee /opt/openfiler/etc/volumes.xml", "w"); fputs($volumesp, "\n"); fputs($volumesp, "\n"); for ($i = 0; $i < count($volumes_id); $i++) fputs($volumesp, "\t\n"); fputs($volumesp, "\n\n"); pclose($volumesp); exec("/usr/bin/sudo /bin/mkdir -p " . escapeshellarg($mountpath)); $fstabp = popen("/usr/bin/sudo /usr/bin/tee -a /etc/fstab", "w"); fputs($fstabp, "/dev/" . $vgname . "/" . $volumename . " " . $mountpath . " ext3 defaults,usrquota,grpquota,acl,user_xattr 0 0\n"); pclose($fstabp); exec("/usr/bin/sudo /bin/mount " . escapeshellarg($mountpath)); exec("/usr/bin/sudo /bin/touch " . escapeshellarg($mountpath) . "/aquota.group " . escapeshellarg($mountpath) . "/aquota.user"); exec("/usr/bin/sudo /bin/chown root:root " . escapeshellarg($mountpath) . "/aquota.group " . escapeshellarg($mountpath) . "/aquota.user"); exec("/usr/bin/sudo /bin/chmod 600 " . escapeshellarg($mountpath) . "/aquota.group " . escapeshellarg($mountpath) . "/aquota.user"); exec("/usr/bin/sudo /sbin/quotacheck -ug " . escapeshellarg($mountpath)); exec("/usr/bin/sudo /bin/umount " . escapeshellarg($mountpath)); exec("/usr/bin/sudo /bin/mount -a"); exec("/usr/bin/sudo /sbin/quotaon -ug " . escapeshellarg($mountpath)); } } header("Location: ./volumes.html"); 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.

0) printf("
\n"); print("

Block storage statistics for volume group \"" . htmlentities($vginfo[0]) . "\"

\n"); print("
\n"); print("\n"); print("\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\n"); print("\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\n"); print("
Total SpaceUsed SpaceFree Space
" . $vginfo[11] . " bytes (" . ($vginfo[11] / 1024) . " MB)" . ($vginfo[14] * ($vginfo[12])) . " bytes (" . (($vginfo[14] * ($vginfo[12])) / 1024) . " MB)" . ($vginfo[15] * ($vginfo[12])) . " bytes (" . (($vginfo[15] * ($vginfo[12])) / 1024) . " MB)
\n"); print("
\n"); print("

 

\n"); print("

Create a volume in \"" . htmlentities($vginfo[0]) . "\"

\n"); print("
\n"); print("\n"); print("
\n"); print("\n"); print("\n"); print("\t\n"); print("\t\n"); print("\n"); print("\n"); print("\t\n"); print("\t\n"); print("\n"); print("\n"); print("\t\n"); print("\t\n"); print("\n"); /* Custom mount paths are disabled for now print("\n"); print("\t\n"); print("\t\n"); print("\n"); */ print("\n"); print("\t\n"); print("\n"); print("
Volume Name (must be specified like a UNIX filename without its path)
Volume Description
Required Space (MB)
Mount Path
\n"); print("
\n"); print("
\n"); } nested_tab_end(); single_end(array()); generic_footer(array()); ?>