_("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(); $volumes_fstype = array(); function volumes_startelement($parser, $name, $attrs) { global $volumes_id, $volumes_name, $volumes_mountpoint, $volumes_vg, $volumes_fstype; 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"]); array_push($volumes_fstype, $attrs["FSTYPE"]); } } 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); $snapshots_id = array(); $snapshots_lvname = array(); $snapshots_vgname = array(); $snapshots_shared = array(); $snapshots_rotateid = array(); $schedule_size = array(); $schedule_share = array(); $schedule_timecounter = array(); $schedule_timemax = array(); $schedule_rotatecounter = array(); $schedule_rotatemax = array(); $schedule_lvname = array(); $schedule_vgname = array(); function snapshots_startelement($parser, $name, $attrs) { global $snapshots_id, $snapshots_lvname, $snapshots_vgname, $snapshots_shared, $snapshots_rotateid; global $schedule_size, $schedule_share; global $schedule_timecounter, $schedule_timemax; global $schedule_rotatecounter, $schedule_rotatemax; global $schedule_lvname, $schedule_vgname; if ($name == "SNAPSHOT") { array_push($snapshots_id, $attrs["ID"]); array_push($snapshots_lvname, $attrs["LVNAME"]); array_push($snapshots_vgname, $attrs["VGNAME"]); array_push($snapshots_shared, $attrs["SHARED"]); array_push($snapshots_rotateid, $attrs["ROTATEID"]); } else if ($name == "SCHEDULE") { array_push($schedule_size, $attrs["SIZE"]); array_push($schedule_share, $attrs["SHARE"]); array_push($schedule_timecounter, $attrs["TIMECOUNTER"]); array_push($schedule_timemax, $attrs["TIMEMAX"]); array_push($schedule_rotatecounter, $attrs["ROTATECOUNTER"]); array_push($schedule_rotatemax, $attrs["ROTATEMAX"]); array_push($schedule_lvname, $attrs["LVNAME"]); array_push($schedule_vgname, $attrs["VGNAME"]); } } function snapshots_endelement($parser, $name) { } $snapshots_parser = xml_parser_create(); xml_set_element_handler($snapshots_parser, "snapshots_startelement", "snapshots_endelement"); $snapshots_fp = fopen("/opt/openfiler/etc/snapshots.xml", "r"); while ($snapshots_data = fread($snapshots_fp, 4096)) xml_parse($snapshots_parser, $snapshots_data, feof($snapshots_fp)); fclose($snapshots_fp); xml_parser_free($snapshots_parser); global $cluster_enabled, $cluster_nodename, $cluster_resource; $cluster_enabled = false; $cluster_nodename = ""; $cluster_resource = array(); function cluster_startelement($parser, $name, $attrs) { global $cluster_enabled, $cluster_nodename, $cluster_resource; if ($name == "CLUSTERING") { if ($attrs["STATE"] == "on") $cluster_enabled = true; else $cluster_enabled = false; } else if ($name == "NODENAME") $cluster_nodename = $attrs["VALUE"]; else if ($name == "RESOURCE") array_push($cluster_resource, $attrs["VALUE"]); } function cluster_endelement($parser, $name) { } $cluster_parser = xml_parser_create(); xml_set_element_handler($cluster_parser, "cluster_startelement", "cluster_endelement"); $cluster_fp = fopen("/opt/openfiler/etc/cluster.xml", "r"); while ($cluster_data = fread($cluster_fp, 4096)) xml_parse($cluster_parser, $cluster_data, feof($cluster_fp)); fclose($cluster_fp); xml_parser_free($cluster_parser); if ($action == "disable") { if ($service == "smb") { exec("/usr/bin/sudo /sbin/service smb stop"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig smb off"); } else if ($service == "nfsv3") { exec("/usr/bin/sudo /sbin/service nfs stop"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig nfs off"); } /* else if ($service == "atalk") { exec("/usr/bin/sudo /sbin/service atalk stop"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig atalk off"); } else if ($service == "ftp") { exec("/usr/bin/sudo /sbin/service vsftpd stop"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig vsftpd off"); } */ else if ($service == "http") { exec("/usr/bin/sudo /sbin/service httpd stop"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig httpd off"); } if ($cluster_enabled) { $service_winbind = (strstr(exec("/usr/bin/sudo /sbin/service winbind status"), "running") ? 1 : 0); $service_smb = (strstr(exec("/usr/bin/sudo /sbin/service smb status"), "running") ? 1 : 0); $service_nfsv3 = (strstr(exec("/usr/bin/sudo /sbin/service nfs status"), "running") ? 1 : 0); $service_http = (strstr(exec("/usr/bin/sudo /sbin/service httpd status"), "running") ? 1 : 0); $clusterp = popen("/usr/bin/sudo /usr/bin/tee /etc/ha.d/haresources", "w"); $cluster_resource_str = ""; for ($i = 0; $i < count($cluster_resource); $i++) $cluster_resource_str .= " " . $cluster_resource[$i]; for ($i = 0; $i < count($volumes_id); $i++) { $fstype = $volumes_fstype[$fsj]; $fs = 0; $fsfound = false; for ($fsi = 0; $fsi < count($fs_info); $fsi++) { if ($fs_info[$fsi]["type"] == $fstype) { $fs = $fsi; $fsfound = true; break; } } if ($fsfound == false) $fs = 0; $cluster_resource_str .= " Filesystem::/dev/" . $volumes_vg[$i] . "/" . $volumes_id[$i] . "::" . "/mnt/" . $volumes_vg[$i] . "/" . $volumes_id[$i] . "::" . $fs_info[$fs]["type"] . "::" . $fs_info[$fs]["mount_options"]; } for ($i = 0; $i < count($snapshots_id); $i++) { $fstype = ""; for ($fsj = 0; $fsj < count($volumes_id); $fsj++) { if (($snapshots_vgname[$i] == $volumes_vg[$fsj]) && ($snapshots_lvname[$i] == $volumes_id[$fsj])) { $fstype = $volumes_fstype[$fsj]; break; } } $fs = 0; $fsfound = false; for ($fsi = 0; $fsi < count($fs_info); $fsi++) { if ($fs_info[$fsi]["type"] == $fstype) { $fs = $fsi; $fsfound = true; break; } } if ($fsfound == false) $fs = 0; $cluster_resource_str .= " Filesystem::/dev/" . $snapshots_vgname[$i] . "/of.snapshot." . $snapshots_lvname[$i] . "." . $snapshots_id[$i] . "::" . "/mnt/snapshots/" . $snapshots_vgname[$i] . "/" . $snapshots_lvname[$i] . "/" . $snapshots_id[$i] . "::" . $fs_info[$fs]["type"] . "::" . $fs_info[$fs]["snapshot_mount_options"]; } if ($service_winbind > 0) $cluster_resource_str .= " winbind"; if ($service_http > 0) $cluster_resource_str .= " httpd"; if ($service_nfsv3 > 0) $cluster_resource_str .= " nfs"; if ($service_smb > 0) $cluster_resource_str .= " smb"; $cluster_resource_str .= " openfiler"; fputs($clusterp, $cluster_nodename . $cluster_resource_str . "\n"); pclose($clusterp); apply_configuration(array("services" => "keep", "chmod" => "no", "chmod_path" => "")); } header("Location: ./services.html"); exit; } else if ($action == "enable") { if ($service == "smb") { exec("/usr/bin/sudo /sbin/service smb start"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig smb on"); } else if ($service == "nfsv3") { exec("/usr/bin/sudo /sbin/service nfs start"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig nfs on"); } /* else if ($service == "atalk") { exec("/usr/bin/sudo /sbin/service atalk start"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig atalk on"); } else if ($service == "ftp") { exec("/usr/bin/sudo /sbin/service vsftpd start"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig vsftpd on"); } */ else if ($service == "http") { exec("/usr/bin/sudo /sbin/service httpd start"); if (!$cluster_enabled) exec("/usr/bin/sudo /sbin/chkconfig httpd on"); } if ($cluster_enabled) { $service_winbind = (strstr(exec("/usr/bin/sudo /sbin/service winbind status"), "running") ? 1 : 0); $service_smb = (strstr(exec("/usr/bin/sudo /sbin/service smb status"), "running") ? 1 : 0); $service_nfsv3 = (strstr(exec("/usr/bin/sudo /sbin/service nfs status"), "running") ? 1 : 0); $service_http = (strstr(exec("/usr/bin/sudo /sbin/service httpd status"), "running") ? 1 : 0); $clusterp = popen("/usr/bin/sudo /usr/bin/tee /etc/ha.d/haresources", "w"); $cluster_resource_str = ""; for ($i = 0; $i < count($cluster_resource); $i++) $cluster_resource_str .= " " . $cluster_resource[$i]; for ($i = 0; $i < count($volumes_id); $i++) { $fstype = $volumes_fstype[$fsj]; $fs = 0; $fsfound = false; for ($fsi = 0; $fsi < count($fs_info); $fsi++) { if ($fs_info[$fsi]["type"] == $fstype) { $fs = $fsi; $fsfound = true; break; } } if ($fsfound == false) $fs = 0; $cluster_resource_str .= " Filesystem::/dev/" . $volumes_vg[$i] . "/" . $volumes_id[$i] . "::" . "/mnt/" . $volumes_vg[$i] . "/" . $volumes_id[$i] . "::" . $fs_info[$fs]["type"] . "::" . $fs_info[$fs]["mount_options"]; } for ($i = 0; $i < count($snapshots_id); $i++) { $fstype = ""; for ($fsj = 0; $fsj < count($volumes_id); $fsj++) { if (($snapshots_vgname[$i] == $volumes_vg[$fsj]) && ($snapshots_lvname[$i] == $volumes_id[$fsj])) { $fstype = $volumes_fstype[$fsj]; break; } } $fs = 0; $fsfound = false; for ($fsi = 0; $fsi < count($fs_info); $fsi++) { if ($fs_info[$fsi]["type"] == $fstype) { $fs = $fsi; $fsfound = true; break; } } if ($fsfound == false) $fs = 0; $cluster_resource_str .= " Filesystem::/dev/" . $snapshots_vgname[$i] . "/of.snapshot." . $snapshots_lvname[$i] . "." . $snapshots_id[$i] . "::" . "/mnt/snapshots/" . $snapshots_vgname[$i] . "/" . $snapshots_lvname[$i] . "/" . $snapshots_id[$i] . "::" . $fs_info[$fs]["type"] . "::" . $fs_info[$fs]["snapshot_mount_options"]; } if ($service_winbind > 0) $cluster_resource_str .= " winbind"; if ($service_http > 0) $cluster_resource_str .= " httpd"; if ($service_nfsv3 > 0) $cluster_resource_str .= " nfs"; if ($service_smb > 0) $cluster_resource_str .= " smb"; $cluster_resource_str .= " openfiler"; fputs($clusterp, $cluster_nodename . $cluster_resource_str . "\n"); pclose($clusterp); apply_configuration(array("services" => "keep", "chmod" => "no", "chmod_path" => "")); } header("Location: ./services.html"); exit; } $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); // $ftp = (strstr(exec("/usr/bin/sudo /sbin/service vsftpd status"), "running") ? 1 : 0); $http = (strstr(exec("/usr/bin/sudo /sbin/service httpd status"), "running") ? 1 : 0); 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.

Enable/Disable services\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("\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("\n"); print("\t\n"); print("\t\n"); print("\t\n"); print("\n"); */ print("
Service NameStatusModification
SMB/CIFS" . (($smb != 0) ? "Enabled" : "Disabled") . "" . (($smb != 0) ? "Disable" : "Enable") . "
NFSv3" . (($nfsv3 != 0) ? "Enabled" : "Disabled") . "" . (($nfsv3 != 0) ? "Disable" : "Enable") . "
HTTP / WebDAV / FTP" . (($http != 0) ? "Enabled" : "Disabled") . "" . (($http != 0) ? "Disable" : "Enable") . "
FTP" . (($ftp != 0) ? "Enabled" : "Disabled") . "" . (($ftp != 0) ? "Disable" : "Enable") . "
\n"); print("
\n"); nested_tab_end(); single_end(array()); generic_footer(array()); ?>