_("Your account")));
dual_begin(array());
print("
\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 ($action == "createfolder")
{
if (is_valid_foldername($newfolderid))
if (!is_dir($sourcepath . $newfolderid))
{
exec("/usr/bin/sudo /bin/mkdir " . escapeshellarg($sourcepath . $newfolderid));
$fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($sourcepath . $newfolderid . ".info.xml"), "w");
fputs($fp, "\n");
fputs($fp, "\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\n");
fputs($fp, "\n");
pclose($fp);
if ((strlen($prevpath) > 0) && (strlen($prevfolder) > 0) && is_file($prevpath . $prevfolder . ".info.xml"))
{
$fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($prevpath . $prevfolder . ".info.xml"), "w");
fputs($fp, "\n");
fputs($fp, "\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\n");
fputs($fp, "\n");
pclose($fp);
}
}
header("Location: ./shares.html");
exit;
}
else if ($action == "deletefolder")
{
if (is_valid_foldername($folderid))
if (is_dir($sourcepath . $folderid . "/"))
{
if ($regenerateconfig == "yes")
{
$smb = (strstr(exec("/usr/bin/sudo /sbin/service smb status"), "running") ? 1 : 0);
$nfsv3 = (strstr(exec("/usr/bin/sudo /sbin/service nfs status"), "running") ? 1 : 0);
$atalk = (strstr(exec("/usr/bin/sudo /sbin/service atalk status"), "running") ? 1 : 0);
if ($smb)
exec("/usr/bin/sudo /sbin/service smb stop");
if ($nfsv3)
exec("/usr/bin/sudo /sbin/service nfs stop");
if ($atalk)
exec("/usr/bin/sudo /sbin/service atalk stop");
}
exec("/usr/bin/sudo /bin/rm -rf " . escapeshellarg($sourcepath . $folderid . "/"));
exec("/usr/bin/sudo /bin/rm -f " . escapeshellarg($sourcepath . $folderid . ".info.xml"));
$parent_dir = "";
for ($i = (strlen($sourcepath) - 2); $i >= 0; $i--)
if ($sourcepath[$i] == '/')
{
$parent_dir = substr($sourcepath, 0, $i);
$child_dir = substr($sourcepath, $i + 1, (strlen($sourcepath) - $i - 2));
break;
}
if ((strlen($parent_dir) > 0) && (strlen($child_dir) > 0))
{
$parent_dir_type = "";
$parent_dir_description = "";
$parent_dir_count = 0;
function parent_dir_startelement($parser, $name, $attrs)
{
global $parent_dir_type, $parent_dir_description, $parent_dir_count;
if ($name == "KEY")
{
if ($attrs["NAME"] == "dirtype")
$parent_dir_type = $attrs["VALUE"];
else if ($attrs["NAME"] == "description")
$parent_dir_description = $attrs["VALUE"];
else if ($attrs["NAME"] == "dircount")
$parent_dir_count = $attrs["VALUE"];
}
}
function parent_dir_endelement($parser, $name)
{
}
if (is_file($parent_dir . "/" . $child_dir . ".info.xml"))
{
$parent_dir_parser = xml_parser_create();
xml_set_element_handler($parent_dir_parser, "parent_dir_startelement", "parent_dir_endelement");
$parent_dir_fp = fopen($parent_dir . "/" . $child_dir . ".info.xml", "r");
while ($parent_dir_data = fread($parent_dir_fp, 4096))
xml_parse($parent_dir_parser, $parent_dir_data, feof($parent_dir_fp));
fclose($parent_dir_fp);
xml_parser_free($parent_dir_parser);
$parent_dir_count--;
if ($parent_dir_count < 0)
$parent_dir_count = 0;
if ($parent_dir_count == 0)
$parent_dir_type = "leaf";
$fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($parent_dir . "/" . $child_dir . ".info.xml"), "w");
fputs($fp, "\n");
fputs($fp, "\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\n");
fputs($fp, "\n");
pclose($fp);
}
}
if ($regenerateconfig == "yes")
apply_configuration();
}
header("Location: ./shares.html");
exit;
}
else if ($action == "renamefolder")
{
if (is_valid_foldername($foldername))
if (is_dir($folderpath . $foldername) && is_file($folderpath . $foldername . ".info.xml")
&& (!strstr($newfoldername, '/')) && (!(is_dir($folderpath . $newfoldername))))
{
exec("/usr/bin/sudo /bin/mv -f " . escapeshellarg($folderpath . $foldername) . " " . escapeshellarg($folderpath . $newfoldername));
exec("/usr/bin/sudo /bin/rm -f " . escapeshellarg($folderpath . $foldername . ".info.xml"));
$fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($folderpath . $newfoldername . ".info.xml"), "w");
fputs($fp, "\n");
fputs($fp, "\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\n");
fputs($fp, "\n");
pclose($fp);
}
header("Location: ./shares.html");
exit;
}
else if ($action == "renamedescription")
{
if (is_valid_foldername($foldername))
if (is_dir($folderpath . $foldername) && is_file($folderpath . $foldername . ".info.xml"))
{
$fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($folderpath . $foldername . ".info.xml"), "w");
fputs($fp, "\n");
fputs($fp, "\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\n");
fputs($fp, "\n");
pclose($fp);
}
header("Location: ./shares.html");
exit;
}
else if ($action == "makeshare")
{
if (is_valid_foldername($foldername) && ($dirtype == "leaf"))
if (is_dir($folderpath . $foldername) && is_file($folderpath . $foldername . ".info.xml"))
{
$fp = popen("/usr/bin/sudo /usr/bin/tee " . escapeshellarg($folderpath . $foldername . ".info.xml"), "w");
fputs($fp, "\n");
fputs($fp, "\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\t\n");
fputs($fp, "\n");
fputs($fp, "\n");
pclose($fp);
}
header("Location: ./shares_edit.html?sharepath=" . urlencode($folderpath . $foldername . "/"));
exit;
}
generic_header(array("title" => _("Administration Section")));
single_begin(array());
print("" . _("Home") . " / " . _("Administration Section") . "
\n");
$curcolor = $GLOBALS["color_table_row2"];
$imgid = $GLOBALS["color_table_row2_colstr"];
function getcolor()
{
global $curcolor, $imgid;
if ($curcolor == $GLOBALS["color_table_row1"])
{
$curcolor = $GLOBALS["color_table_row2"];
$imgid = $GLOBALS["color_table_row2_colstr"];
}
else
{
$curcolor = $GLOBALS["color_table_row1"];
$imgid = $GLOBALS["color_table_row1_colstr"];
}
return $curcolor;
}
?>
Welcome Administrator. The following are various system information and preferences, arranged
into tabs. Please click on a tab to open up that category.
There are no existing volumes. Please go to the volumes section and create some volumes.");
?>
|