_("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; } 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"; $share_type = ""; $share_description = ""; $share_count = 0; $share_accesspublic = 0; $groups_access = array(); $groups_primary = 0; $networks_count = 0; $networks_network = array(); $networks_netmask = array(); $networks_access = array(); function network_startelement($parser, $name, $attrs) { global $networks_count, $networks_name, $networks_network, $networks_netmask, $networks_access; if ($name == "NETWORK") { $networks_name[$networks_count] = $attrs["NAME"]; $networks_network[$networks_count] = $attrs["NETWORK"]; $networks_netmask[$networks_count] = $attrs["NETMASK"]; $networks_access[$networks_count] = "n "; $networks_count++; } } function network_endelement($parser, $name) { } if (is_file("/opt/openfiler/etc/networks.xml")) { $network_parser = xml_parser_create(); xml_set_element_handler($network_parser, "network_startelement", "network_endelement"); $network_fp = fopen("/opt/openfiler/etc/networks.xml", "r"); while ($network_data = fread($network_fp, 4096)) xml_parse($network_parser, $network_data, feof($network_fp)); fclose($network_fp); xml_parser_free($network_parser); } $authp = popen("/usr/bin/sudo /usr/sbin/authconfig --openfiler --kickstart", "r"); $i = 0; while (!feof($authp)) $aresult[$i++] = fgets($authp, 4096); pclose($authp); function share_startelement($parser, $name, $attrs) { global $share_type, $share_description, $share_count, $share_accesspublic, $groups_access, $groups_primary; global $networks_name, $networks_network, $networks_access; if ($name == "KEY") { if ($attrs["NAME"] == "dirtype") $share_type = $attrs["VALUE"]; else if ($attrs["NAME"] == "description") $share_description = $attrs["VALUE"]; else if ($attrs["NAME"] == "dircount") $share_count = $attrs["VALUE"]; } else if ($name == "GROUP") { $gid = $attrs["ID"]; $str = ""; if ($attrs["READ"] == "yes") $str .= "r"; else $str .= " "; if ($attrs["WRITE"] == "yes") $str .= "w"; else $str .= " "; if ($attrs["ACCESS"] == "yes") $str .= "a"; else $str .= " "; $groups_access[$gid] = $str; } else if ($name == "PRIMARY") { $groups_primary = $attrs["ID"]; } else if ($name == "ACCESS") { if ($attrs["PUBLIC"] != "yes") $share_accesspublic = 0; else $share_accesspublic = 1; } else if ($name == "NETWORK") { $str = ""; if ($attrs["ACCESS"] == "rw") $str .= "w"; else if ($attrs["ACCESS"] == "ro") $str .= "o"; else $str .= "n"; if ($attrs["SMB"] == "yes") $str .= "y"; else $str .= " "; if ($attrs["NFS"] == "yes") $str .= "y"; else $str .= " "; if ($attrs["AFP"] == "yes") $str .= "y"; else $str .= " "; if ($attrs["NOSQUASH"] == "yes") $str .= "y"; else $str .= " "; if ($attrs["HTTP"] == "yes") $str .= "y"; else $str .= " "; if ($attrs["NFSACL"] == "yes") $str .= "y"; else $str .= " "; for ($i = 0; $i < count($networks_network); $i++) { if ($networks_name[$i] == $attrs["NETWORK"]) $networks_access[$i] = $str; } } } function share_endelement($parser, $name) { } $share_parent = ""; $share_name = ""; for ($i = (strlen($sharepath) - 2); $i >= 0; $i--) if ($sharepath[$i] == '/') { $share_parent = substr($sharepath, 0, $i); $share_name = substr($sharepath, $i + 1, (strlen($sharepath) - $i - 2)); break; } if (is_file($share_parent . "/" . $share_name . ".info.xml")) { $share_parser = xml_parser_create(); xml_set_element_handler($share_parser, "share_startelement", "share_endelement"); $share_fp = fopen($share_parent . "/" . $share_name . ".info.xml", "r"); while ($share_data = fread($share_fp, 4096)) xml_parse($share_parser, $share_data, feof($share_fp)); fclose($share_fp); xml_parser_free($share_parser); } else { header("Location: ./shares.html"); exit; } $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(); 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); if ($actionnewsharename == "Change") { if (is_dir($share_parent . "/" . $share_name) && is_file($share_parent . "/" . $share_name . ".info.xml") && (!strstr($newsharename, '/')) && (!(is_dir($share_parent . "/" . $newsharename)))) { exec("/usr/bin/sudo /bin/mv -f " . escapeshellarg($share_parent . "/" . $share_name) . " " . escapeshellarg($share_parent . "/" . $newsharename)); exec("/usr/bin/sudo /bin/rm -f " . escapeshellarg($share_parent . "/" . $share_name . ".info.xml")); $fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($share_parent . "/" . $newsharename . ".info.xml"), "w"); fputs($fp, "\n"); fputs($fp, "\n"); fputs($fp, "\t\n"); fputs($fp, "\t\n"); fputs($fp, "\t\n"); reset($groups_access); while (list($g_id, $g_perms) = each($groups_access)) { $xstr = "\t\n"); if ($share_accesspublic == 0) fputs($fp, "\t\n"); else fputs($fp, "\t\n"); for ($i = 0; $i < count($networks_network); $i++) { $xstr = "\t\n"); fputs($fp, "\n"); pclose($fp); apply_configuration(); header("Location: ./shares_edit.html?sort=" . $sortorder . "&sharepath=" . urlencode($share_parent . "/" . $newsharename . "/")); exit; } header("Location: ./shares_edit.html?sort=" . $sortorder . "&sharepath=" . urlencode($share_parent . "/" . $share_name . "/")); exit; } else if ($actionnewsharedescription == "Change") { if (is_dir($share_parent . "/" . $sharename) && is_file($share_parent . "/" . $share_name . ".info.xml")) { $fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($share_parent . "/" . $share_name . ".info.xml"), "w"); fputs($fp, "\n"); fputs($fp, "\n"); fputs($fp, "\t\n"); fputs($fp, "\t\n"); fputs($fp, "\t\n"); reset($groups_access); while (list($g_id, $g_perms) = each($groups_access)) { $xstr = "\t\n"); if ($share_accesspublic == 0) fputs($fp, "\t\n"); else fputs($fp, "\t\n"); for ($i = 0; $i < count($networks_network); $i++) { $xstr = "\t\n"); fputs($fp, "\n"); pclose($fp); apply_configuration(); } header("Location: ./shares_edit.html?sort=" . $sortorder . "&sharepath=" . urlencode($sharepath)); exit; } else if ($action == "setfacl") { if (is_dir($share_parent . "/" . $sharename) && is_file($share_parent . "/" . $share_name . ".info.xml")) { $fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($share_parent . "/" . $share_name . ".info.xml"), "w"); fputs($fp, "\n"); fputs($fp, "\n"); fputs($fp, "\t\n"); fputs($fp, "\t\n"); fputs($fp, "\t\n"); for ($i = 0; $i < count($groups_name); $i++) { $xstr = "\t\n"); if (isset($shareaccesspublic)) { if ($shareaccesspublic != "public") fputs($fp, "\t\n"); else fputs($fp, "\t\n"); } for ($i = 0; $i < count($networks_network); $i++) { $xstr = "\t\n"); fputs($fp, "\n"); pclose($fp); apply_configuration(); } header("Location: ./shares_edit.html?sort=" . $sortorder . "&sharepath=" . urlencode($sharepath)); exit; } else if ($action == "setnacl") { if (is_dir($share_parent . "/" . $sharename) && is_file($share_parent . "/" . $share_name . ".info.xml")) { $fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($share_parent . "/" . $share_name . ".info.xml"), "w"); fputs($fp, "\n"); fputs($fp, "\n"); fputs($fp, "\t\n"); fputs($fp, "\t\n"); fputs($fp, "\t\n"); reset($groups_access); while (list($g_id, $g_perms) = each($groups_access)) { $xstr = "\t\n"); if ($share_accesspublic == 0) fputs($fp, "\t\n"); else fputs($fp, "\t\n"); for ($i = 0; $i < count($networks_network); $i++) { $xstr = "\t\n"); fputs($fp, "\n"); pclose($fp); apply_configuration(); } header("Location: ./shares_edit.html?sort=" . $sortorder . "&sharepath=" . urlencode($sharepath)); 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.

Edit share " . htmlentities($sharepath) . "\n"); print("
\n"); print("\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("
Share name
Share description
\n"); print("
\n"); print("

 

\n"); print("

Back to shares list ]

\n"); print("

 

\n"); print("
\n"); print("

Group access configuration

\n"); if (($groups_primary == 0) && ($share_accesspublic == 0)) print("

A primary group has not been set yet.
This share will not be enabled until a primary group is set first
or the share has been made a guest share.

\n"); print("

If you want to see groups from network directory servers
here, please configure them in the authentication section.

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

/> Public guest access
/> Controlled access

\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\n"); } ?>
">GID ">Group Name ">Type ">P ">R ">W ">A
"); print($groups_gid[$i]); print(""); print(htmlentities($groups_name[$i])); print(""); print($groups_properties[$i]); print(""); print(""); print(""); print(""); print(""); print(""); print(""); print(""); print("

\n"); print("
\n"); print("

 

\n"); print("
\n"); print("

Host access configuration

\n"); if (count($networks_network) > 0) { print("
\n"); print("\n"); print("\n"); print("\n"); print("
\n"); print("\n"); ?> \n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\n"); } print("
">Name ">SMB/CIFS " colspan="5">NFSv3
">None ">RO ">RW ">Root Access ">Export ACLs
" . htmlentities($networks_name[$i]) . "
\n"); print("
\n"); print("

\n"); print("
\n"); } else print("

A list of networks have not been created yet.
You cannot configure network access control unless
you create a list of networks in the Local Networks section.
Until that time, this share will be unavailable.

\n"); print("
\n"); print("
\n"); print("

Are you sure you want to delete
this share?

\n"); print("

Yes / No ]

\n"); print("
\n"); print("

Delete this share ]

\n"); nested_tab_end(); single_end(array()); generic_footer(array()); ?>