From a6cb09d6671e4dee123e76bb82f15cc897f919ad Mon Sep 17 00:00:00 2001 From: Daniel Stefan Haischt Date: Thu, 4 Jan 2007 12:35:03 +0000 Subject: * synced freenas package to current FreeNAS trunk * unison package file needs to be added to pfsense.com * rc script needs to be tested --- packages/freenas/www/diag_ad_infos.php | 142 ++--- packages/freenas/www/diag_ataidle_infos.php | 119 +++-- packages/freenas/www/diag_disk_infos.php | 93 ++-- packages/freenas/www/diag_fn_logs_daemon.php | 121 +++-- packages/freenas/www/diag_fn_logs_ftp.php | 124 +++-- packages/freenas/www/diag_fn_logs_rsyncd.php | 124 +++-- packages/freenas/www/diag_fn_logs_samba.php | 238 +++++---- packages/freenas/www/diag_fn_logs_settings.php | 377 ++++++------- packages/freenas/www/diag_fn_logs_smartd.php | 124 +++-- packages/freenas/www/diag_fn_logs_sshd.php | 124 +++-- packages/freenas/www/diag_iscsi_infos.php | 102 ++-- packages/freenas/www/diag_mounts_infos.php | 94 ++-- packages/freenas/www/diag_part_infos.php | 86 +-- packages/freenas/www/diag_raid_infos.php | 85 +-- packages/freenas/www/diag_smart_infos.php | 97 ++-- packages/freenas/www/diag_space_infos.php | 87 +-- packages/freenas/www/disks_manage.php | 292 ++++++----- packages/freenas/www/disks_manage_edit.php | 220 ++++---- packages/freenas/www/disks_manage_init.php | 459 ++++++++++------ packages/freenas/www/disks_manage_iscsi.php | 133 ++--- packages/freenas/www/disks_manage_tools.php | 275 ++++++++++ packages/freenas/www/disks_mount.php | 268 +++++----- packages/freenas/www/disks_mount_edit.php | 281 +++++----- packages/freenas/www/disks_mount_tools.php | 211 ++++++++ packages/freenas/www/disks_raid_gconcat.php | 236 +++++++++ packages/freenas/www/disks_raid_gconcat_edit.php | 256 +++++++++ packages/freenas/www/disks_raid_gconcat_infos.php | 143 +++++ packages/freenas/www/disks_raid_gconcat_tools.php | 187 +++++++ packages/freenas/www/disks_raid_gmirror.php | 202 +++---- packages/freenas/www/disks_raid_gmirror_edit.php | 267 +++++----- packages/freenas/www/disks_raid_gmirror_infos.php | 93 ++-- packages/freenas/www/disks_raid_gmirror_init.php | 71 +-- packages/freenas/www/disks_raid_gmirror_tools.php | 152 +++--- packages/freenas/www/disks_raid_graid5.php | 236 +++++++++ packages/freenas/www/disks_raid_graid5_edit.php | 258 +++++++++ packages/freenas/www/disks_raid_graid5_infos.php | 143 +++++ packages/freenas/www/disks_raid_graid5_tools.php | 190 +++++++ packages/freenas/www/disks_raid_gstripe.php | 236 +++++++++ packages/freenas/www/disks_raid_gstripe_edit.php | 258 +++++++++ packages/freenas/www/disks_raid_gstripe_infos.php | 143 +++++ packages/freenas/www/disks_raid_gstripe_tools.php | 187 +++++++ packages/freenas/www/disks_raid_gvinum.php | 218 ++++---- packages/freenas/www/disks_raid_gvinum_edit.php | 250 ++++----- packages/freenas/www/disks_raid_gvinum_infos.php | 99 ++-- packages/freenas/www/disks_raid_gvinum_init.php | 71 +-- packages/freenas/www/disks_raid_gvinum_tools.php | 204 +++---- packages/freenas/www/services_afp.php | 144 ++--- packages/freenas/www/services_ftp.php | 277 +++++----- packages/freenas/www/services_nfs.php | 154 +++--- packages/freenas/www/services_rsyncd.php | 205 ++++---- packages/freenas/www/services_rsyncd_client.php | 434 +++++++-------- packages/freenas/www/services_rsyncd_local.php | 584 +++++++++++++++++++++ packages/freenas/www/services_samba.php | 306 +++++------ packages/freenas/www/services_samba_share.php | 165 ++++++ packages/freenas/www/services_samba_share_edit.php | 156 ++++++ packages/freenas/www/services_unison.php | 245 +++++++++ packages/freenas/www/status_disks.php | 92 ++-- 57 files changed, 7852 insertions(+), 3286 deletions(-) create mode 100644 packages/freenas/www/disks_manage_tools.php create mode 100644 packages/freenas/www/disks_mount_tools.php create mode 100644 packages/freenas/www/disks_raid_gconcat.php create mode 100644 packages/freenas/www/disks_raid_gconcat_edit.php create mode 100644 packages/freenas/www/disks_raid_gconcat_infos.php create mode 100644 packages/freenas/www/disks_raid_gconcat_tools.php create mode 100644 packages/freenas/www/disks_raid_graid5.php create mode 100644 packages/freenas/www/disks_raid_graid5_edit.php create mode 100644 packages/freenas/www/disks_raid_graid5_infos.php create mode 100644 packages/freenas/www/disks_raid_graid5_tools.php create mode 100644 packages/freenas/www/disks_raid_gstripe.php create mode 100644 packages/freenas/www/disks_raid_gstripe_edit.php create mode 100644 packages/freenas/www/disks_raid_gstripe_infos.php create mode 100644 packages/freenas/www/disks_raid_gstripe_tools.php create mode 100644 packages/freenas/www/services_rsyncd_local.php create mode 100644 packages/freenas/www/services_samba_share.php create mode 100644 packages/freenas/www/services_samba_share_edit.php create mode 100644 packages/freenas/www/services_unison.php (limited to 'packages/freenas/www') diff --git a/packages/freenas/www/diag_ad_infos.php b/packages/freenas/www/diag_ad_infos.php index 6c956261..e9882a70 100644 --- a/packages/freenas/www/diag_ad_infos.php +++ b/packages/freenas/www/diag_ad_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + diag_ad_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("Active Directory Infos")); @@ -77,8 +85,8 @@ echo $pfSenseHead->getHTML(); getHTML(); $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php"); $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php"); $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php"); - display_top_tabs($tab_array); + display_top_tabs($tab_array); ?> -
+
AD Authentication disable
"; + echo "AD Authentication disable
"; } else { echo "
";
-            	echo "Accessiblity test to MS domain:
"; - echo htmlspecialchars("Results for net rpc testjoin:") . "
"; - - exec("/usr/local/bin/net rpc testjoin",$rawdata); - foreach ($rawdata as $line) - { - echo htmlspecialchars($line) . "
"; - } - unset ($rawdata); - - echo "
"; - echo htmlspecialchars("Ping winbindd to see if it is alive:") . "
"; - - exec("/usr/local/bin/wbinfo -p",$rawdata); - foreach ($rawdata as $line) - { - echo htmlspecialchars($line) . "
"; - } - unset ($rawdata); - - echo "
"; - echo htmlspecialchars("Check shared secret:") . "
"; - - exec("/usr/local/bin/wbinfo -t",$rawdata); - foreach ($rawdata as $line) - { - echo htmlspecialchars($line) . "
"; - } - unset ($rawdata); - - echo "
"; + echo "Accessiblity test to MS domain:
"; + echo htmlspecialchars("Results for net rpc testjoin:") . "
"; + exec("/usr/local/bin/net rpc testjoin",$rawdata); + foreach ($rawdata as $line) + { + echo htmlspecialchars($line) . "
"; + } + unset ($rawdata); + echo "
"; + echo htmlspecialchars("Ping winbindd to see if it is alive:") . "
"; + exec("/usr/local/bin/wbinfo -p",$rawdata); + foreach ($rawdata as $line) + { + echo htmlspecialchars($line) . "
"; + } + unset ($rawdata); + echo "
"; + echo htmlspecialchars("Check shared secret:") . "
"; + exec("/usr/local/bin/wbinfo -t",$rawdata); + foreach ($rawdata as $line) + { + echo htmlspecialchars($line) . "
"; + } + unset ($rawdata); + echo "
"; echo "
"; } ?> @@ -149,7 +151,7 @@ echo $pfSenseHead->getHTML();
- + diff --git a/packages/freenas/www/diag_ataidle_infos.php b/packages/freenas/www/diag_ataidle_infos.php index b0136a82..7ba6c737 100644 --- a/packages/freenas/www/diag_ataidle_infos.php +++ b/packages/freenas/www/diag_ataidle_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + diag_ataidle_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("ATAidle Infos")); @@ -77,8 +85,8 @@ echo $pfSenseHead->getHTML(); getHTML(); $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php"); $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php"); $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php"); - display_top_tabs($tab_array); + display_top_tabs($tab_array); ?> -
+
@@ -138,7 +141,7 @@ echo $pfSenseHead->getHTML();
"; $disklist=get_ata_disks_list(); - echo "List of Advanced ATA capabilities on all ATA disk:
"; foreach ($disklist as $disknamek => $disknamev) { - - /* Found the channel and device number from the /dev name */ - /* Divise the number by 2, the interger is the channel number, the rest is the device */ - - echo htmlspecialchars("Results for $disknamek:") . "
"; - $value=trim($disknamek,'ad'); - - $value=intval($value); - $channel = $value/2; - $device=$value % 2; - $channel=intval($channel); - - exec("/usr/local/sbin/ataidle $channel $device",$rawdata); - foreach ($rawdata as $line) - { - echo htmlspecialchars($line) . "
"; - } - unset ($rawdata); - } + /* Found the channel and device number from the /dev name */ + /* Divise the number by 2, the interger is the channel number, the rest is the device */ + echo htmlspecialchars("Results for $disknamek:") . "
"; + $value=trim($disknamek,'ad'); + $value=intval($value); + $channel = $value/2; + $device=$value % 2; + $channel=intval($channel); + exec("/usr/local/sbin/ataidle $channel $device",$rawdata); + foreach ($rawdata as $line) + { + echo htmlspecialchars($line) . "
"; + } + unset ($rawdata); + } echo ""; ?>
- + diff --git a/packages/freenas/www/diag_disk_infos.php b/packages/freenas/www/diag_disk_infos.php index 38d73412..31419040 100644 --- a/packages/freenas/www/diag_disk_infos.php +++ b/packages/freenas/www/diag_disk_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + diag_ataidle_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("Disk Infos")); @@ -77,8 +85,8 @@ echo $pfSenseHead->getHTML(); getHTML(); $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php"); $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php"); $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php"); - display_top_tabs($tab_array); + display_top_tabs($tab_array); ?> -
+
@@ -134,7 +135,7 @@ echo $pfSenseHead->getHTML();
"; - echo "List of detected ATA disks:
"; foreach ($iderawdata as $line) { echo htmlspecialchars($line) . "
"; } - unset ($line); - exec("/sbin/camcontrol devlist",$scsirawdata); - echo "List of detected SCSI disks:
"; foreach ($scsirawdata as $line) { - echo htmlspecialchars($line) . "
"; - + echo htmlspecialchars($line) . "
"; } - echo ""; ?>
- + diff --git a/packages/freenas/www/diag_fn_logs_daemon.php b/packages/freenas/www/diag_fn_logs_daemon.php index 2f447b8d..1eaa1f0f 100644 --- a/packages/freenas/www/diag_fn_logs_daemon.php +++ b/packages/freenas/www/diag_fn_logs_daemon.php @@ -1,35 +1,44 @@ + All rights reserved. - originially part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . - All rights reserved. + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("System logs"), @@ -46,16 +55,16 @@ if (!$nentries) if ($_POST['clear']) { - exec("/usr/sbin/clog -i -s 262144 /var/log/daemon.log"); - /* redirect to avoid reposting form data on refresh */ - pfSenseHeader("diag_logs_daemon.php"); - exit; + exec("/usr/sbin/clog -i -s 262144 /var/log/daemon.log"); + /* redirect to avoid reposting form data on refresh */ + pfSenseHeader("diag_fn_logs_daemon.php"); + exit; } /* if ajax is calling, give them an update message */ if(isAjax()) - print_info_box_np($savemsg); - + print_info_box_np($savemsg); + include("head.inc"); /* put your custom HTML head content here */ /* using some of the $pfSenseHead function calls */ @@ -71,36 +80,36 @@ echo $pfSenseHead->getHTML();
+ $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php"); + $tab_array[] = array(gettext("Daemon"), true, "diag_fn_logs_daemon.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php"); + display_top_tabs($tab_array);?>
-
- - - - - - - - - - - -
- Last Daemon log entries -
 
- -
-
+
+ + + + + + + + + + + +
+ Last Daemon log entries +
 
+ +
+
diff --git a/packages/freenas/www/diag_fn_logs_ftp.php b/packages/freenas/www/diag_fn_logs_ftp.php index 02972e0e..21d8cfb2 100644 --- a/packages/freenas/www/diag_fn_logs_ftp.php +++ b/packages/freenas/www/diag_fn_logs_ftp.php @@ -1,35 +1,44 @@ + All rights reserved. - originially part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . - All rights reserved. + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("System logs"), @@ -41,21 +50,20 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); $nentries = $config['syslog']['nentries']; -if (!$nentries) - $nentries = 50; +if (!$nentries) { $nentries = 50; } if ($_POST['clear']) { - exec("/usr/sbin/clog -i -s 262144 /var/log/ftp.log"); - /* redirect to avoid reposting form data on refresh */ - pfSenseHeader("diag_fn_logs_ftp.php"); - exit; + exec("/usr/sbin/clog -i -s 262144 /var/log/ftp.log"); + /* redirect to avoid reposting form data on refresh */ + pfSenseHeader("diag_fn_logs_ftp.php"); + exit; } /* if ajax is calling, give them an update message */ if(isAjax()) - print_info_box_np($savemsg); - + print_info_box_np($savemsg); + include("head.inc"); /* put your custom HTML head content here */ /* using some of the $pfSenseHead function calls */ @@ -71,36 +79,36 @@ echo $pfSenseHead->getHTML();
+ $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php"); + $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php"); + display_top_tabs($tab_array);?>
-
- - - - - - - - - - - -
- Last FTP log entries -
 
- -
-
+
+ + + + + + + + + + + +
+ Last FTP log entries +
 
+ +
+
diff --git a/packages/freenas/www/diag_fn_logs_rsyncd.php b/packages/freenas/www/diag_fn_logs_rsyncd.php index 733ad67f..44ab3d85 100644 --- a/packages/freenas/www/diag_fn_logs_rsyncd.php +++ b/packages/freenas/www/diag_fn_logs_rsyncd.php @@ -1,35 +1,44 @@ + All rights reserved. - originially part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . - All rights reserved. + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("System logs"), @@ -41,20 +50,19 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); $nentries = $config['syslog']['nentries']; -if (!$nentries) - $nentries = 50; +if (!$nentries) { $nentries = 50; } if ($_POST['clear']) { - exec("/usr/sbin/clog -i -s 262144 /var/log/rsyncd.log"); - /* redirect to avoid reposting form data on refresh */ - pfSenseHeader("diag_fn_logs_rsyncd.php"); - exit; + exec("/usr/sbin/clog -i -s 262144 /var/log/rsyncd.log"); + /* redirect to avoid reposting form data on refresh */ + pfSenseHeader("diag_fn_logs_rsyncd.php"); + exit; } /* if ajax is calling, give them an update message */ if(isAjax()) - print_info_box_np($savemsg); - + print_info_box_np($savemsg); + include("head.inc"); /* put your custom HTML head content here */ /* using some of the $pfSenseHead function calls */ @@ -70,36 +78,36 @@ echo $pfSenseHead->getHTML();
+ $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php"); + $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php"); + display_top_tabs($tab_array);?>
-
- - - - - - - - - - - -
- Last RSYNCD log entries -
 
- -
-
+
+ + + + + + + + + + + +
+ Last RSYNCD log entries +
 
+ +
+
diff --git a/packages/freenas/www/diag_fn_logs_samba.php b/packages/freenas/www/diag_fn_logs_samba.php index 75a34df2..436de12d 100644 --- a/packages/freenas/www/diag_fn_logs_samba.php +++ b/packages/freenas/www/diag_fn_logs_samba.php @@ -1,35 +1,44 @@ + All rights reserved. - originially part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . - All rights reserved. + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("System logs"), @@ -41,22 +50,21 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); $nentries = $config['syslog']['nentries']; -if (!$nentries) - $nentries = 50; +if (!$nentries) { $nentries = 50; } if ($_POST['clear']) { - exec("/bin/cp /dev/null /var/log/samba/log.nmbd"); - exec("/bin/cp /dev/null /var/log/samba/log.smbd"); - exec("/bin/cp /dev/null /var/log/samba/log.winbindd"); - /* redirect to avoid reposting form data on refresh */ - pfSenseHeader("diag_fn_logs_samba.php"); - exit; + exec("/bin/cp /dev/null /var/log/samba/log.nmbd"); + exec("/bin/cp /dev/null /var/log/samba/log.smbd"); + exec("/bin/cp /dev/null /var/log/samba/log.winbindd"); + /* redirect to avoid reposting form data on refresh */ + pfSenseHeader("diag_fn_logs_samba.php"); + exit; } /* if ajax is calling, give them an update message */ if(isAjax()) - print_info_box_np($savemsg); - + print_info_box_np($savemsg); + include("head.inc"); /* put your custom HTML head content here */ /* using some of the $pfSenseHead function calls */ @@ -72,91 +80,91 @@ echo $pfSenseHead->getHTML();
+ $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php"); + $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php"); + display_top_tabs($tab_array);?>
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Last nmbd service log entries -
-
-
 
- Last smbd service log entries -
-
-
 
- Last winbindd service log entries -
-
-
 
- -
-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Last nmbd service log entries +
+
+
 
+ Last smbd service log entries +
+
+
 
+ Last winbindd service log entries +
+
+
 
+ +
+
diff --git a/packages/freenas/www/diag_fn_logs_settings.php b/packages/freenas/www/diag_fn_logs_settings.php index 1853df13..a51e8479 100644 --- a/packages/freenas/www/diag_fn_logs_settings.php +++ b/packages/freenas/www/diag_fn_logs_settings.php @@ -1,35 +1,44 @@ + All rights reserved. - originially part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . - All rights reserved. + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("System logs"), @@ -60,61 +69,59 @@ $pconfig['rsyncd'] = isset($config['syslog']['rsyncd']); $pconfig['smartd'] = isset($config['syslog']['smartd']); $pconfig['daemon'] = isset($config['syslog']['daemon']); -if (!$pconfig['nentries']) - $pconfig['nentries'] = 50; +if (!$pconfig['nentries']) { $pconfig['nentries'] = 50; } if ($_POST) { - - unset($input_errors); - $pconfig = $_POST; - - /* input validation */ - if ($_POST['enable'] && !is_ipaddr($_POST['remoteserver'])) { - $input_errors[] = gettext("A valid IP address must be specified."); - } - if (($_POST['nentries'] < 5) || ($_POST['nentries'] > 2000)) { - $input_errors[] = gettext("Number of log entries to show must be between 5 and 2000."); - } - - if (!$input_errors) { - $config['syslog']['reverse'] = $_POST['reverse'] ? true : false; - $config['syslog']['nentries'] = (int)$_POST['nentries']; - $config['syslog']['remoteserver'] = $_POST['remoteserver']; - $config['syslog']['filter'] = $_POST['filter'] ? true : false; - $config['syslog']['dhcp'] = $_POST['dhcp'] ? true : false; - $config['syslog']['portalauth'] = $_POST['portalauth'] ? true : false; - $config['syslog']['vpn'] = $_POST['vpn'] ? true : false; - $config['syslog']['system'] = $_POST['system'] ? true : false; - $config['syslog']['disablelocallogging'] = $_POST['disablelocallogging'] ? true : false; - $config['syslog']['enable'] = $_POST['enable'] ? true : false; - $oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']); - $config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true; - $config['syslog']['rawfilter'] = $_POST['rawfilter'] ? true : false; - $config['syslog']['webservlogs'] = $_POST['webservlogs'] ? true : false; - $config['syslog']['sshd'] = $_POST['sshd'] ? true : false; - $config['syslog']['ftp'] = $_POST['ftp'] ? true : false; - $config['syslog']['rsyncd'] = $_POST['rsyncd'] ? true : false; - $config['syslog']['smartd'] = $_POST['smartd'] ? true : false; - $config['syslog']['daemon'] = $_POST['daemon'] ? true : false; - if($config['syslog']['enable'] == false) - unset($config['syslog']['remoteserver']); - - write_config(); - - $retval = 0; - config_lock(); - $retval = system_syslogd_start(); - if ($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock'])) - $retval |= filter_configure(); - config_unlock(); - $savemsg = get_std_save_message($retval); - } + unset($input_errors); + $pconfig = $_POST; + + /* input validation */ + if ($_POST['enable'] && !is_ipaddr($_POST['remoteserver'])) { + $input_errors[] = gettext("A valid IP address must be specified."); + } + if (($_POST['nentries'] < 5) || ($_POST['nentries'] > 2000)) { + $input_errors[] = gettext("Number of log entries to show must be between 5 and 2000."); + } + + if (!$input_errors) { + $config['syslog']['reverse'] = $_POST['reverse'] ? true : false; + $config['syslog']['nentries'] = (int)$_POST['nentries']; + $config['syslog']['remoteserver'] = $_POST['remoteserver']; + $config['syslog']['filter'] = $_POST['filter'] ? true : false; + $config['syslog']['dhcp'] = $_POST['dhcp'] ? true : false; + $config['syslog']['portalauth'] = $_POST['portalauth'] ? true : false; + $config['syslog']['vpn'] = $_POST['vpn'] ? true : false; + $config['syslog']['system'] = $_POST['system'] ? true : false; + $config['syslog']['disablelocallogging'] = $_POST['disablelocallogging'] ? true : false; + $config['syslog']['enable'] = $_POST['enable'] ? true : false; + $oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']); + $config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true; + $config['syslog']['rawfilter'] = $_POST['rawfilter'] ? true : false; + $config['syslog']['webservlogs'] = $_POST['webservlogs'] ? true : false; + $config['syslog']['sshd'] = $_POST['sshd'] ? true : false; + $config['syslog']['ftp'] = $_POST['ftp'] ? true : false; + $config['syslog']['rsyncd'] = $_POST['rsyncd'] ? true : false; + $config['syslog']['smartd'] = $_POST['smartd'] ? true : false; + $config['syslog']['daemon'] = $_POST['daemon'] ? true : false; + if($config['syslog']['enable'] == false) + unset($config['syslog']['remoteserver']); + + write_config(); + + $retval = 0; + config_lock(); + $retval = system_syslogd_start(); + if ($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock'])) + $retval |= filter_configure(); + config_unlock(); + $savemsg = get_std_save_message($retval); + } } /* if ajax is calling, give them an update message */ if(isAjax()) - print_info_box_np($savemsg); - + print_info_box_np($savemsg); + include("head.inc"); /* put your custom HTML head content here */ /* using some of the $pfSenseHead function calls */ @@ -126,34 +133,34 @@ function enable_change(enable_over) { endis = !(document.iform.enable.checked || enable_over); endis ? color = '#D4D0C8' : color = '#FFFFFF'; - if (document.iform.enable.checked || enable_over) { - document.iform.remoteserver.disabled = 0; - document.iform.filter.disabled = 0; - document.iform.dhcp.disabled = 0; - document.iform.portalauth.disabled = 0; - document.iform.vpn.disabled = 0; + if (document.iform.enable.checked || enable_over) { + document.iform.remoteserver.disabled = 0; + document.iform.filter.disabled = 0; + document.iform.dhcp.disabled = 0; + document.iform.portalauth.disabled = 0; + document.iform.vpn.disabled = 0; document.iform.system.disabled = 0; - document.iform.webservlogs.disabled = 0; + document.iform.webservlogs.disabled = 0; document.iform.sshd.disabled = 0; document.iform.ftp.disabled = 0; document.iform.rsyncd.disabled = 0; document.iform.smartd.disabled = 0; document.iform.daemon.disabled = 0; - - } else { - document.iform.remoteserver.disabled = 1; - document.iform.filter.disabled = 1; - document.iform.dhcp.disabled = 1; - document.iform.portalauth.disabled = 1; - document.iform.vpn.disabled = 1; - document.iform.system.disabled = 1; - document.iform.webservlogs.disabled = 1; + + } else { + document.iform.remoteserver.disabled = 1; + document.iform.filter.disabled = 1; + document.iform.dhcp.disabled = 1; + document.iform.portalauth.disabled = 1; + document.iform.vpn.disabled = 1; + document.iform.system.disabled = 1; + document.iform.webservlogs.disabled = 1; document.iform.sshd.disabled = 1; document.iform.ftp.disabled = 1; document.iform.rsyncd.disabled = 1; document.iform.smartd.disabled = 1; document.iform.daemon.disabled = 1; - } + } /* color adjustments */ document.iform.remoteserver.style.backgrounColor = color; @@ -187,102 +194,108 @@ echo $pfSenseHead->getHTML();
+ $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php"); + $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php"); + $tab_array[] = array(gettext("Settings"), true, "diag_fn_logs_settings.php"); + display_top_tabs($tab_array);?>
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  /> -
 : -
  /> -
-
  /> -
-
  onclick="enable_change(false)" /> -
  onclick="enable_change(false)" /> -
Remote syslog - server - -
-

- /> -
- /> -
- /> -
- /> -
- /> -
- /> -
- /> -
- /> -
- /> -
- /> -
- /> -
-
  -
 :
- -
-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  /> + +
 : + +
  /> +
+ +
  /> +
+ +
  onclick="enable_change(false)" /> + +
  onclick="enable_change(false)" /> + +
Remote syslog server + +
+

+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+
  + +
 :
+ +
+
diff --git a/packages/freenas/www/diag_fn_logs_smartd.php b/packages/freenas/www/diag_fn_logs_smartd.php index ca575631..7e57d543 100644 --- a/packages/freenas/www/diag_fn_logs_smartd.php +++ b/packages/freenas/www/diag_fn_logs_smartd.php @@ -1,35 +1,44 @@ + All rights reserved. - originially part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . - All rights reserved. + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("System logs"), @@ -41,21 +50,20 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); $nentries = $config['syslog']['nentries']; -if (!$nentries) - $nentries = 50; +if (!$nentries) { $nentries = 50; } if ($_POST['clear']) { - exec("/usr/sbin/clog -i -s 262144 /var/log/smartd.log"); - /* redirect to avoid reposting form data on refresh */ - pfSenseHeader("diag_fn_logs_smartd.php"); - exit; + exec("/usr/sbin/clog -i -s 262144 /var/log/smartd.log"); + /* redirect to avoid reposting form data on refresh */ + pfSenseHeader("diag_fn_logs_smartd.php"); + exit; } /* if ajax is calling, give them an update message */ if(isAjax()) - print_info_box_np($savemsg); - + print_info_box_np($savemsg); + include("head.inc"); /* put your custom HTML head content here */ /* using some of the $pfSenseHead function calls */ @@ -71,36 +79,36 @@ echo $pfSenseHead->getHTML();
+ $tab_array[] = array(gettext("SMARTD"), true, "diag_fn_logs_smartd.php"); + $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php"); + display_top_tabs($tab_array);?>
-
- - - - - - - - - - - -
- Last SmartD log entries -
 
- -
-
+
+ + + + + + + + + + + +
+ Last SmartD log entries +
 
+ +
+
diff --git a/packages/freenas/www/diag_fn_logs_sshd.php b/packages/freenas/www/diag_fn_logs_sshd.php index e39230b6..bc61d57f 100644 --- a/packages/freenas/www/diag_fn_logs_sshd.php +++ b/packages/freenas/www/diag_fn_logs_sshd.php @@ -1,35 +1,44 @@ + All rights reserved. - originially part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . - All rights reserved. + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("System logs"), @@ -41,20 +50,19 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); $nentries = $config['syslog']['nentries']; -if (!$nentries) - $nentries = 50; +if (!$nentries) { $nentries = 50; } if ($_POST['clear']) { - exec("/usr/sbin/clog -i -s 262144 /var/log/sshd.log"); - /* redirect to avoid reposting form data on refresh */ - pfSenseHeader("diag_logs_sshd.php"); - exit; + exec("/usr/sbin/clog -i -s 262144 /var/log/sshd.log"); + /* redirect to avoid reposting form data on refresh */ + pfSenseHeader("diag_fn_logs_sshd.php"); + exit; } /* if ajax is calling, give them an update message */ if(isAjax()) - print_info_box_np($savemsg); - + print_info_box_np($savemsg); + include("head.inc"); /* put your custom HTML head content here */ /* using some of the $pfSenseHead function calls */ @@ -70,36 +78,36 @@ echo $pfSenseHead->getHTML();
+ $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php"); + $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php"); + display_top_tabs($tab_array);?>
-
- - - - - - - - - - - -
- Last SSHD log entries -
 
- -
-
+
+ + + + + + + + + + + +
+ Last SSHD log entries +
 
+ +
+
diff --git a/packages/freenas/www/diag_iscsi_infos.php b/packages/freenas/www/diag_iscsi_infos.php index b378f6b2..05c136e8 100644 --- a/packages/freenas/www/diag_iscsi_infos.php +++ b/packages/freenas/www/diag_iscsi_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + diag_iscsi_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("iSCSI Infos")); @@ -77,8 +85,8 @@ echo $pfSenseHead->getHTML(); getHTML(); $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php"); $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php"); $tab_array[7] = array(gettext("iSCSI"), true, "diag_iscsi_infos.php"); - display_top_tabs($tab_array); + display_top_tabs($tab_array); ?> -
+
iSCSI initiator disabled
"; + echo "iSCSI initiator disabled
"; } else { echo "
";
-            	echo "Show the list of available target Name on the iSCSI target
"; - - exec("/usr/local/sbin/iscontrol -d targetaddress={$freenas_config['iscsi']['targetaddress']}",$rawdata); - foreach ($rawdata as $line) - { - echo htmlspecialchars($line) . "
"; - } - unset ($rawdata); + echo "Show the list of available target Name on the iSCSI target
"; + + exec("/usr/local/sbin/iscontrol -d targetaddress={$freenas_config['iscsi']['targetaddress']}",$rawdata); + foreach ($rawdata as $line) + { + echo htmlspecialchars($line) . "
"; + } + unset ($rawdata); echo "
"; } ?> @@ -126,7 +134,7 @@ echo $pfSenseHead->getHTML();
- + diff --git a/packages/freenas/www/diag_mounts_infos.php b/packages/freenas/www/diag_mounts_infos.php index e0bea806..29eb49f5 100644 --- a/packages/freenas/www/diag_mounts_infos.php +++ b/packages/freenas/www/diag_mounts_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + diag_mounts_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("Mount Infos")); @@ -77,8 +85,8 @@ echo $pfSenseHead->getHTML(); getHTML(); $tab_array[5] = array(gettext("Mounts"), true, "diag_mounts_infos.php"); $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php"); $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php"); - display_top_tabs($tab_array); + display_top_tabs($tab_array); ?> -
+
@@ -121,7 +129,7 @@ echo $pfSenseHead->getHTML();
"; echo "List of mounted point:
"; - exec("/sbin/mount",$mountrawdata); - foreach ($mountrawdata as $line) - { + exec("/sbin/mount",$mountrawdata); + foreach ($mountrawdata as $line) + { echo htmlspecialchars($line) . "
"; - } - unset ($line); + } + unset ($line); echo ""; ?>
- + diff --git a/packages/freenas/www/diag_part_infos.php b/packages/freenas/www/diag_part_infos.php index d28e1ae2..011a771c 100644 --- a/packages/freenas/www/diag_part_infos.php +++ b/packages/freenas/www/diag_part_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + diag_part_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("Partition Infos")); @@ -77,8 +85,8 @@ echo $pfSenseHead->getHTML(); getHTML(); $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php"); $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php"); $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php"); - display_top_tabs($tab_array); + display_top_tabs($tab_array); ?> -
+
"; - $disklist = get_physical_disks_list(); - echo "List of partition on all detected disk:
"; foreach ($disklist as $disknamek => $disknamev) { @@ -127,7 +133,7 @@ echo $pfSenseHead->getHTML();
- + diff --git a/packages/freenas/www/diag_raid_infos.php b/packages/freenas/www/diag_raid_infos.php index 32bccf23..88b9a5fc 100644 --- a/packages/freenas/www/diag_raid_infos.php +++ b/packages/freenas/www/diag_raid_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + diag_raid_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("RAID Infos")); @@ -77,8 +85,8 @@ echo $pfSenseHead->getHTML(); getHTML(); $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php"); $tab_array[6] = array(gettext("Software RAID"), true, "diag_raid_infos.php"); $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php"); - display_top_tabs($tab_array); + display_top_tabs($tab_array); ?> -
+
@@ -114,7 +122,6 @@ echo $pfSenseHead->getHTML(); } unset ($line); unset ($rawdata); - echo "Software RAID - gvinum status:
"; exec("/sbin/gvinum list",$rawdata); foreach ($rawdata as $line) { @@ -128,7 +135,7 @@ echo $pfSenseHead->getHTML();
- + diff --git a/packages/freenas/www/diag_smart_infos.php b/packages/freenas/www/diag_smart_infos.php index b2d91157..d265d1b7 100644 --- a/packages/freenas/www/diag_smart_infos.php +++ b/packages/freenas/www/diag_smart_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + diag_smart_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("SMART Infos")); @@ -77,8 +85,8 @@ echo $pfSenseHead->getHTML(); getHTML(); $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php"); $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php"); $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php"); - display_top_tabs($tab_array); + display_top_tabs($tab_array); ?> -
+
"; $disklist = get_physical_disks_list(); - echo "List of SMART capabilities on all detected disk:
"; foreach ($disklist as $disknamek => $disknamev) { - exec("/usr/local/sbin/smartctl -a /dev/$disknamek",$fdiskrawdata); - foreach ($fdiskrawdata as $line) - { - echo htmlspecialchars($line) . "
"; - } - unset ($fdiskrawdata); + exec("/usr/local/sbin/smartctl -a /dev/$disknamek",$fdiskrawdata); + foreach ($fdiskrawdata as $line) + { + echo htmlspecialchars($line) . "
"; + } + unset ($fdiskrawdata); } echo ""; ?> @@ -126,7 +133,7 @@ echo $pfSenseHead->getHTML();
- + diff --git a/packages/freenas/www/diag_space_infos.php b/packages/freenas/www/diag_space_infos.php index b9a7554a..e0726b07 100644 --- a/packages/freenas/www/diag_space_infos.php +++ b/packages/freenas/www/diag_space_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + diag_space_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Diagnostics"), gettext("Space Infos")); @@ -77,8 +85,8 @@ echo $pfSenseHead->getHTML(); getHTML(); $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php"); $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php"); $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php"); - display_top_tabs($tab_array); + display_top_tabs($tab_array); ?> -
+
"; exec("/bin/df -h",$rawdata); - echo "Free Space:
"; foreach ($rawdata as $line) { - echo htmlspecialchars($line) . "
"; + echo htmlspecialchars($line) . "
"; } echo ""; ?> @@ -121,7 +128,7 @@ echo $pfSenseHead->getHTML();
- + diff --git a/packages/freenas/www/disks_manage.php b/packages/freenas/www/disks_manage.php index 9aa8c732..b6dece05 100644 --- a/packages/freenas/www/disks_manage.php +++ b/packages/freenas/www/disks_manage.php @@ -1,40 +1,44 @@ -#!/usr/local/bin/php . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Copyright (C) 2003-2005 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_manage.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -46,61 +50,60 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); if (!is_array($freenas_config['disks']['disk'])) - $freenas_config['disks']['disk'] = array(); - + $freenas_config['disks']['disk'] = array(); + disks_sort(); $a_disk_conf = &$freenas_config['disks']['disk']; if ($_POST) { - - unset($input_errors); - - /* input validation */ - - if ($_POST['apply']) { - $retval = 0; - if (! file_exists($d_sysrebootreqd_path)) { - config_lock(); - /* reload all components that mount disk */ - // disks_mount_all(); - /* Is formated?: If not create FS */ - /* $retval = disk_disks_create_ufs(); */ - - config_unlock(); - } - $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_diskdirty_path)) { - unlink($d_diskdirty_path); + unset($input_errors); + + /* input validation */ + + if ($_POST['apply']) { + $retval = 0; + if (! file_exists($d_sysrebootreqd_path)) { + config_lock(); + /* reload all components that mount disk */ + // disks_mount_all(); + /* Is formated?: If not create FS */ + /* $retval = disk_disks_create_ufs(); */ + + config_unlock(); + } + $savemsg = get_std_save_message($retval); + if ($retval == 0) { + if (file_exists($d_diskdirty_path)) { + unlink($d_diskdirty_path); } - } - } - - /* if this is an AJAX caller then handle via JSON */ - if(isAjax() && is_array($input_errors)) { - input_errors2Ajax($input_errors); - exit; - } - - if (!$input_errors) { - /* No errors detected, so update the config */ - } + } + } + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($input_errors)) { + input_errors2Ajax($input_errors); + exit; + } + + if (!$input_errors) { + /* No errors detected, so update the config */ + } } if ($_GET['act'] == "del") { - if ($a_disk_conf[$_GET['id']]) { - unset($a_disk_conf[$_GET['id']]); - write_config(); - touch($d_diskdirty_path); - pfSenseHeader("disks_manage.php"); - exit; - } + if ($a_disk_conf[$_GET['id']]) { + unset($a_disk_conf[$_GET['id']]); + write_config(); + touch($d_diskdirty_path); + pfSenseHeader("disks_manage.php"); + exit; + } } /* if ajax is calling, give them an update message */ if(isAjax()) - print_info_box_np($savemsg); + print_info_box_np($savemsg); include("head.inc"); /* put your custom HTML head content here */ @@ -124,79 +127,80 @@ echo $pfSenseHead->getHTML(); - +
- +
diff --git a/packages/freenas/www/disks_manage_edit.php b/packages/freenas/www/disks_manage_edit.php index f45c0709..80e11ef3 100644 --- a/packages/freenas/www/disks_manage_edit.php +++ b/packages/freenas/www/disks_manage_edit.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_manage_edit.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -44,13 +52,13 @@ require_once("freenas_functions.inc"); $id = $_GET['id']; if (isset($_POST['id'])) - $id = $_POST['id']; + $id = $_POST['id']; /* get disk list (without CDROM) */ $disklist = get_physical_disks_list(); if (!is_array($freenas_config['disks']['disk'])) - $freenas_config['disks']['disk'] = array(); + $freenas_config['disks']['disk'] = array(); disks_sort(); @@ -58,13 +66,13 @@ $a_disk = &$freenas_config['disks']['disk']; if (isset($id) && $a_disk[$id]) { - $pconfig['name'] = $a_disk[$id]['name']; - $pconfig['harddiskstandby'] = $a_disk[$id]['harddiskstandby']; - $pconfig['acoustic'] = $a_disk[$id]['acoustic']; - $pconfig['fstype'] = $a_disk[$id]['fstype']; - $pconfig['apm'] = $a_disk[$id]['apm']; - $pconfig['udma'] = $a_disk[$id]['udma']; - + $pconfig['name'] = $a_disk[$id]['name']; + $pconfig['harddiskstandby'] = $a_disk[$id]['harddiskstandby']; + $pconfig['acoustic'] = $a_disk[$id]['acoustic']; + $pconfig['fstype'] = $a_disk[$id]['fstype']; + $pconfig['apm'] = $a_disk[$id]['apm']; + $pconfig['udma'] = $a_disk[$id]['udma']; + $pconfig['fullname'] = $a_disk[$id]['fullname']; } if (! empty($_POST)) @@ -80,22 +88,21 @@ if (! empty($_POST)) $reqdfieldsn = split(",", "Name"); do_input_validation_new($_POST, $reqdfields, $reqdfieldsn, &$error_bucket); - $pconfig = $_POST; - - /* check for name conflicts */ - foreach ($a_disk as $disk) - { - if (isset($id) && ($a_disk[$id]) && ($a_disk[$id] === $disk)) - continue; - - if ($disk['name'] == $_POST['name']) - { + $pconfig = $_POST; + + /* check for name conflicts */ + foreach ($a_disk as $disk) + { + if (isset($id) && ($a_disk[$id]) && ($a_disk[$id] === $disk)) { continue; } + + if ($disk['name'] == $_POST['name']) + { $error_bucket[] = array("error" => gettext("This disk already exists in the disk list."), "field" => "name"); break; - } - } - + } + } + if (is_array($error_bucket)) foreach($error_bucket as $elem) $input_errors[] =& $elem["error"]; @@ -106,40 +113,42 @@ if (! empty($_POST)) exit; } - if (!$input_errors) - { - $disks = array(); - - $devname = $_POST['name']; - $devharddiskstandby = $_POST['harddiskstandby']; - $harddiskacoustic = $_POST['acoustic']; - $harddiskapm = $_POST['apm']; - $harddiskudma = $_POST['udma']; - $harddiskfstype = $_POST['fstype']; - - $disks['name'] = $devname; - $disks['harddiskstandby'] = $devharddiskstandby ; - $disks['acoustic'] = $harddiskacoustic ; - if ($harddiskfstype) $disks['fstype'] = $harddiskfstype ; - $disks['apm'] = $harddiskapm ; - $disks['udma'] = $harddiskudma ; - $disks['type'] = $disklist[$devname]['type']; - $disks['desc'] = $disklist[$devname]['desc']; - $disks['size'] = $disklist[$devname]['size']; - - if (isset($id) && $a_disk[$id]) - $a_disk[$id] = $disks; - else - $a_disk[] = $disks; - - touch($d_diskdirty_path); - - disks_set_ataidle(); - write_config(); - - pfSenseHeader("disks_manage.php"); - exit; - } + if (!$input_errors) + { + $disks = array(); + + $devname = $_POST['name']; + $devharddiskstandby = $_POST['harddiskstandby']; + $harddiskacoustic = $_POST['acoustic']; + $harddiskapm = $_POST['apm']; + $harddiskudma = $_POST['udma']; + $harddiskfstype = $_POST['fstype']; + + $disks['name'] = $devname; + $disks['fullname'] = "/dev/$devname"; + $disks['harddiskstandby'] = $devharddiskstandby ; + $disks['acoustic'] = $harddiskacoustic ; + if ($harddiskfstype) { $disks['fstype'] = $harddiskfstype; } + $disks['apm'] = $harddiskapm ; + $disks['udma'] = $harddiskudma ; + $disks['type'] = $disklist[$devname]['type']; + $disks['desc'] = $disklist[$devname]['desc']; + $disks['size'] = $disklist[$devname]['size']; + + if (isset($id) && $a_disk[$id]) { + $a_disk[$id] = $disks; + } else { + $a_disk[] = $disks; + } + + touch($d_diskdirty_path); + + disks_set_ataidle(); + write_config(); + + pfSenseHeader("disks_manage.php"); + exit; + } } include("head.inc"); @@ -160,23 +169,23 @@ echo $pfSenseHead->getHTML(); - + $diskv): ?> + + - @@ -224,12 +233,12 @@ echo $pfSenseHead->getHTML();
Do not set this for CF cards."); ?> @@ -239,19 +248,8 @@ echo $pfSenseHead->getHTML(); diff --git a/packages/freenas/www/disks_manage_init.php b/packages/freenas/www/disks_manage_init.php index 7e120634..7267cec3 100644 --- a/packages/freenas/www/disks_manage_init.php +++ b/packages/freenas/www/disks_manage_init.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_manage_init.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -42,11 +50,49 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); if (!is_array($freenas_config['disks']['disk'])) - $freenas_config['disks']['disk'] = array(); + $freenas_config['disks']['disk'] = array(); disks_sort(); +if (!is_array($freenas_config['gconcat']['vdisk'])) + $freenas_config['gconcat']['vdisk'] = array(); + +gconcat_sort(); + +if (!is_array($freenas_config['gmirror']['vdisk'])) + $freenas_config['gmirror']['vdisk'] = array(); + +gmirror_sort(); + +if (!is_array($freenas_config['graid5']['vdisk'])) + $freenas_config['graid5']['vdisk'] = array(); + +graid5_sort(); + +if (!is_array($freenas_config['gstripe']['vdisk'])) + $freenas_config['gstripe']['vdisk'] = array(); + +gstripe_sort(); + +if (!is_array($freenas_config['gvinum']['vdisk'])) + $freenas_config['gvinum']['vdisk'] = array(); + +gvinum_sort(); + +// Get all fstype supported by FreeNAS +$a_fst = get_fstype_list(); +// Remove NTFS: can't format on NTFS under FreeNAS +unset($a_fst['ntfs']); +// Remove the first blank line 'unknown' +$a_fst = array_slice($a_fst, 1); + $a_disk = &$freenas_config['disks']['disk']; +$a_gconcat = &$freenas_config['gconcat']['vdisk']; +$a_gmirror = &$freenas_config['gmirror']['vdisk']; +$a_gstripe = &$freenas_config['gstripe']['vdisk']; +$a_graid5 = &$freenas_config['graid5']['vdisk']; +$a_gvinum = &$freenas_config['gvinum']['vdisk']; +$all_disk = array_merge($a_disk,$a_gconcat,$a_gmirror,$a_gstripe,$a_graid5,$a_gvinum); if (! empty($_POST)) { @@ -58,8 +104,8 @@ if (! empty($_POST)) $pconfig = $_POST; /* input validation */ - $reqdfields = explode(" ", "disk type"); - $reqdfieldsn = explode(",", "Disk,Type"); + $reqdfields = explode(" ", "disk type"); + $reqdfieldsn = explode(",", "Disk,Type"); do_input_validation_new($_POST, $reqdfields, $reqdfieldsn, &$error_bucket); @@ -69,51 +115,111 @@ if (! empty($_POST)) /* if this is an AJAX caller then handle via JSON */ if(isAjax() && is_array($error_bucket)) { - input_errors2Ajax(NULL, $error_bucket); - exit; + input_errors2Ajax(NULL, $error_bucket); + exit; } - if (!$input_errors) - { - $do_format = true; - $disk = $_POST['disk']; - $type = $_POST['type']; - $diskid = $_POST['id']; - $notinitmbr= $_POST['notinitmbr']; - - /* found the name in the config: Must be a better way for did that */ - - $id=0; - $i=0; - foreach ($a_disk as $disks) - { - $diskname=$disks['name']; - if (strcmp($diskname,$disk)==0) - $id=$i; - $i++; - } - - if ($type == "ufs" || $type == "ufsgpt" || $type == "ufs_no_su" || $type == "ufsgpt_no_su") - $a_disk[$id]['fstype'] = "ufs"; - else - $a_disk[$id]['fstype'] = $type; - write_config(); - } + if (!$input_errors) + { + $do_format = true; + $disk = $_POST['disk']; + $type = $_POST['type']; + $notinitmbr= $_POST['notinitmbr']; + + /* Check if disk is mounted. */ + if(disks_check_mount_fullname($disk)) { + $errormsg = sprintf(gettext("The disk is currently mounted! Unmount this disk first before proceeding."), "disks_mount_tools.php?disk={$disk}&action=umount"); + $do_format = false; + } + + if($do_format) { + /* Get the id of the disk array entry. */ + $NotFound = 1; + $id = array_search_ex($disk, $a_disk, "fullname"); + + if ($id) { + /* Set new filesystem type. */ + $a_disk[$id]['fstype'] = $type; + $NotFound = 0; + } + else { + $id = array_search_ex($disk, $a_gmirror, "fullname"); + } + if (($id !== false) && $NotFound) { + /* Set new filesystem type. */ + $a_gmirror[$id]['fstype'] = $type; + $NotFound = 0; + } + else { + $id = array_search_ex($disk, $a_gstripe, "fullname"); + } + if (($id !== false) && $NotFound) { + /* Set new filesystem type. */ + $a_gstripe[$id]['fstype'] = $type; + $NotFound = 0; + } + else { + $id = array_search_ex($disk, $a_gconcat, "fullname"); + } + if (($id !== false) && $NotFound) { + /* Set new filesystem type. */ + $a_gconcat[$id]['fstype'] = $type; + $NotFound = 0; + } + else { + $id = array_search_ex($disk, $a_graid5, "fullname"); + } + if (($id !== false) && $NotFound) { + /* Set new filesystem type. */ + $a_graid5[$id]['fstype'] = $type; + $NotFound = 0; + } + else { + $id = array_search_ex($disk, $a_gvinum, "fullname"); + } + if (($id !== false) && $NotFound) { + /* Set new filesystem type. */ + $a_gvinum[$id]['fstype'] = $type; + $NotFound = 0; + } + + write_config(); + } + } } if (!isset($do_format)) { - $do_format = false; - $disk = ''; - $type = ''; + $do_format = false; + $disk = ''; + $type = ''; } include("head.inc"); /* put your custom HTML head content here */ /* using some of the $pfSenseHead function calls */ +$pfSenseHead->setCloseHead(false); echo $pfSenseHead->getHTML(); ?> + + "> @@ -126,9 +232,10 @@ echo $pfSenseHead->getHTML(); @@ -141,12 +248,12 @@ echo $pfSenseHead->getHTML(); - + + @@ -154,18 +261,14 @@ echo $pfSenseHead->getHTML(); + $fstname): ?> + + + - +
@@ -177,100 +280,106 @@ echo $pfSenseHead->getHTML(); " /> - - - + + Disk initialization details:"; - echo('
');
-      					ob_end_flush();
-
-      					/* Erase MBR if not checked*/
-
-      					if (!$notinitmbr) {
-      						echo "Erasing MBR\n";
-      						system("dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . " bs=32k count=640");
-
-      					}
-      					else
-      						echo "Keeping the MBR\n";
-
-      					switch ($type)
-      					{
-      					case "ufs":
-      						/* Initialize disk */
-      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
-      						echo "\"fdisk: Geom not found\" is not an error message!\n";
-      						/* Initialise the partition (optional) */
-      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
-      						/* Create s1 label */
-      						system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
-      						// Create filesystem
-      						system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "s1");
-      						break;
-      					case "ufs_no_su":
-      						/* Initialize disk */
-      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
-      						/* Initialise the partition (optional) */
-      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
-      						/* Create s1 label */
-      						system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
-      						// Create filesystem
-      						system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "s1");
-      						break;
-      					case "ufsgpt":
-      						/* Create GPT partition table */
-      						system("/sbin/gpt destroy " . escapeshellarg($disk));
-      						system("/sbin/gpt create -f " . escapeshellarg($disk));
-      						system("/sbin/gpt add -t ufs " . escapeshellarg($disk));
-      						// Create filesystem
-      						system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "p1");
-      						break;
-      					case "ufsgpt_no_su":
-      						/* Create GPT partition table */
-      						system("/sbin/gpt destroy " . escapeshellarg($disk));
-      						system("/sbin/gpt create -f " . escapeshellarg($disk));
-      						system("/sbin/gpt add -t ufs " . escapeshellarg($disk));
-      						// Create filesystem
-      						system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "p1");
-      						break;
-      					case "gmirror":
-      						/* Initialize disk */
-      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
-      						/* Initialise the partition (optional) */
-      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
-      						/* Create s1 label */
-      						//system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
-      						/* Delete old gmirror information */
-      						system("/sbin/gmirror clear /dev/" . escapeshellarg($disk));
-      						break;
-      					case "raid":
-      						/* Initialize disk */
-      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
-      						echo "\"fdisk: Geom not found\"is not an error message!\n";
-      						/* Initialise the partition (optional) */
-      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
-      						/* Create s1 label */
-      						system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
-      						break;
-      					case "msdos":
-      						/* Initialize disk */
-      						system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
-      						echo "\"fdisk: Geom not found\"is not an error message!\n";
-      						/* Initialise the partition (optional) */
-      						system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
-      						/* Create s1 label */
-      						system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
-      						// Create filesystem
-      						system("/sbin/newfs_msdos -F 32 /dev/" . escapeshellarg($disk) . "s1");
-      						break;
-      					}
-
-      					echo('
'); - } - ?> - - + echo "Disk initialization details:"; + echo('
');
+                ob_end_flush();
+  
+                /* Erase MBR if not checked*/
+                if (!$notinitmbr) {
+                  echo "Erasing MBR\n";
+                  system("dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . " bs=32k count=640");
+                }
+                else {
+                  echo "Keeping the MBR and all partitions\n";
+                }
+  
+                switch ($type)
+                {
+                case "ufs":
+                  /* Initialize disk */
+                  echo "Creating one parition:\n";
+                  system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
+                  /* Initialise the partition (optional) */
+                  echo "Initializing parition:\n";
+                  system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
+                  /* Create s1 label */
+                  echo "Creating BSD label:\n";
+                  system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
+                  // Create filesystem
+                  echo "Creating Filesystem:\n";
+                  system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "s1");
+                  echo "Done!\n";
+                  break;
+                case "ufs_no_su":
+                  /* Initialize disk */
+                  echo "Creating one parition:\n";
+                  system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
+                  /* Initialise the partition (optional) */
+                  echo "Initializing parition:\n";
+                  system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
+                  /* Create s1 label */
+                  echo "Creating BSD label:\n";
+                  system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
+                  // Create filesystem
+                  echo "Creating Filesystem:\n";
+                  system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "s1");
+                  echo "Done!\n";
+                  break;
+                case "ufsgpt":
+                  /* Create GPT partition table */
+                  echo "Destroying old GTP information:\n";
+                  system("/sbin/gpt destroy " . escapeshellarg($disk));
+                  echo "Creating GPT partition:\n";
+                  system("/sbin/gpt create -f " . escapeshellarg($disk));
+                  system("/sbin/gpt add -t ufs " . escapeshellarg($disk));
+                  // Create filesystem
+                  echo "Creating Filesystem with Soft Updates:\n";
+                  system("/sbin/newfs -U /dev/" . escapeshellarg($disk) . "p1");
+                  echo "Done!\n";
+                  break;
+                case "ufsgpt_no_su":
+                  /* Create GPT partition table */
+                  echo "Destroying old GTP information:\n";
+                  system("/sbin/gpt destroy " . escapeshellarg($disk));
+                  echo "Creating GPT partition:\n";
+                  system("/sbin/gpt create -f " . escapeshellarg($disk));
+                  system("/sbin/gpt add -t ufs " . escapeshellarg($disk));
+                  // Create filesystem
+                  echo "Creating Filesystem without Soft Updates:\n";
+                  system("/sbin/newfs -m 0 /dev/" . escapeshellarg($disk) . "p1");
+                  echo "Done!\n";
+                  break;
+                case "softraid":
+                  /* Initialize disk */
+                  system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
+                  /* Initialise the partition (optional) */
+                  system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
+                  /* Delete old gmirror information */
+                  system("/sbin/gmirror clear " . escapeshellarg($disk));
+                  echo "Done!\n";
+                  break;
+                case "msdos":
+                  /* Initialize disk */
+                  system("/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk));
+                  /* Initialise the partition (optional) */
+                  system("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($disk) . "s1 bs=32k count=16");
+                  /* Create s1 label */
+                  system("/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto");
+                  // Create filesystem
+                  system("/sbin/newfs_msdos -F 32 /dev/" . escapeshellarg($disk) . "s1");
+                  echo "Done!\n";
+                  break;
+                }
+  
+                echo('
'); + } + ?> + + diff --git a/packages/freenas/www/disks_manage_iscsi.php b/packages/freenas/www/disks_manage_iscsi.php index 96c8eb0d..5180fc1a 100644 --- a/packages/freenas/www/disks_manage_iscsi.php +++ b/packages/freenas/www/disks_manage_iscsi.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_manage_iscsi.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -43,7 +51,7 @@ require_once("freenas_functions.inc"); if (! is_array($freenas_config['iscsi'])) { - $freenas_config['iscsi'] = array(); + $freenas_config['iscsi'] = array(); } $pconfig['enable'] = isset($freenas_config['iscsi']['enable']); @@ -56,23 +64,23 @@ if (! empty($_POST)) unset($error_bucket); /* simple error list */ unset($input_errors); - unset($do_format); - $pconfig = $_POST; + $pconfig = $_POST; + /* input validation */ - if ($_POST['enable']) - { - $reqdfields = array_merge($reqdfields, explode(" ", "targetaddress targetname")); - $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "targetaddress,targetname")); - } - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - - if ($_POST['enable'] && !is_ipaddr($_POST['targetaddress'])){ + if ($_POST['enable']) + { + $reqdfields = array_merge($reqdfields, explode(" ", "targetaddress targetname")); + $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "targetaddress,targetname")); + } + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if ($_POST['enable'] && !is_ipaddr($_POST['targetaddress'])){ $error_bucket[] = array("error" => gettext("A valid IP address must be specified."), "field" => "targetaddress"); } - + if (is_array($error_bucket)) foreach($error_bucket as $elem) $input_errors[] =& $elem["error"]; @@ -83,24 +91,24 @@ if (! empty($_POST)) exit; } - if (!$input_errors) - { - $freenas_config['iscsi']['enable'] = $_POST['enable'] ? true : false; - $freenas_config['iscsi']['targetaddress'] = $_POST['targetaddress']; - $freenas_config['iscsi']['targetname'] = $_POST['targetname']; - - write_config(); - - $retval = 0; - if (! file_exists($d_sysrebootreqd_path)) - { - /* nuke the cache file */ - config_lock(); - services_iscsi_configure(); - config_unlock(); - } - $savemsg = get_std_save_message($retval); - } + if (!$input_errors) + { + $freenas_config['iscsi']['enable'] = $_POST['enable'] ? true : false; + $freenas_config['iscsi']['targetaddress'] = $_POST['targetaddress']; + $freenas_config['iscsi']['targetname'] = $_POST['targetname']; + + write_config(); + + $retval = 0; + if (! file_exists($d_sysrebootreqd_path)) + { + /* nuke the cache file */ + config_lock(); + services_iscsi_configure(); + config_unlock(); + } + $savemsg = get_std_save_message($retval); + } } include("head.inc"); @@ -145,7 +153,8 @@ echo $pfSenseHead->getHTML(); $tab_array = array(); $tab_array[0] = array(gettext("Manage"), false, "disks_manage.php"); $tab_array[1] = array(gettext("Format"), false, "disks_manage_init.php"); - $tab_array[2] = array(gettext("iSCSI Initiator"), true, "disks_manage_iscsi.php"); + $tab_array[2] = array(gettext("Tools"), false, "disks_manage_tools.php"); + $tab_array[3] = array(gettext("iSCSI Initiator"), true, "disks_manage_iscsi.php"); display_top_tabs($tab_array); ?> diff --git a/packages/freenas/www/disks_manage_tools.php b/packages/freenas/www/disks_manage_tools.php new file mode 100644 index 00000000..a0bb3901 --- /dev/null +++ b/packages/freenas/www/disks_manage_tools.php @@ -0,0 +1,275 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("Tools")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (!is_array($freenas_config['disks']['disk'])) + $freenas_config['disks']['disk'] = array(); + +disks_sort(); + +$a_disk_conf = &$freenas_config['disks']['disk']; + +if ($_POST) { + unset($input_errors); + unset($do_action); + + /* input validation */ + $reqdfields = explode(" ", "disk action"); + $reqdfieldsn = explode(",", "Disk,Action"); + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (!$input_errors) + { + $do_action = true; + $disk = $_POST['disk']; + $action = $_POST['action']; + $partition = $_POST['partition']; + $umount = $_POST['umount']; + } +} + +if (!isset($do_action)) +{ + $do_action = false; + $disk = ''; + $action = ''; + $partition = ''; + $umount = false; +} + +/* if ajax is calling, give them an update message */ +if(isAjax()) + print_info_box_np($savemsg); + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +$pfSenseHead->setCloseHead(false); +echo $pfSenseHead->getHTML(); + +?> + + +"> + + + + +
+
+ + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + +
+ + /> + + + + +
+ +
+
  + + "> +
  + + " . gettext("Command output:") . "
"); + echo('
');
+              ob_end_flush();
+  
+              switch($action)
+              {
+                case "fsck":
+                  /* Get the id of the disk. */
+                  $id = array_search_ex($disk, $a_disk, "name");
+                  /* Get the filesystem type of the disk. */ 
+                  $type = $a_disk[$id]['fstype'];
+                  /* Check if disk is mounted. */
+                  $ismounted = disks_check_mount($disk,$partition);
+  
+                  /* Umount disk if necessary. */
+                  if($umount && $ismounted) {
+                    echo("" . gettext("Note") . ": " . gettext("The disk is currently mounted! The mount point will be removed temporary to perform selected command.") . "

"); + disks_umount_ex($disk,$partition); + } + + switch($type) + { + case "": + case "ufs": + case "ufs_no_su": + case "ufsgpt": + case "ufsgpt_no_su": + system("/sbin/fsck_ufs -y -f /dev/" . escapeshellarg($disk . $partition)); + break; + case "gmirror": + case "gvinum": + case "graid5": + $infomsg = sprintf(gettext("Use RAID tools for this disk!"), "disks_raid_{$type}_tools.php"); + print_info_box_np($infomsg); + break; + case "msdos": + system("/sbin/fsck_msdosfs -y -f /dev/" . escapeshellarg($disk . $partition)); + break; + } + + /* Mount disk if necessary. */ + if($umount && $ismounted) { + disks_mount_ex($disk,$partition); + } + + break; + } + echo('
'); + } + ?> +
+
+
+
+ + + + diff --git a/packages/freenas/www/disks_mount.php b/packages/freenas/www/disks_mount.php index c83cec60..9a6a2a63 100644 --- a/packages/freenas/www/disks_mount.php +++ b/packages/freenas/www/disks_mount.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_mount.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -42,7 +50,7 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); if (!is_array($freenas_config['mounts']['mount'])) - $freenas_config['mounts']['mount'] = array(); + $freenas_config['mounts']['mount'] = array(); mount_sort(); @@ -89,23 +97,23 @@ if (! empty($_POST)) if ($_GET['act'] == "del") { - if ($a_mount[$_GET['id']]) { - disks_umount_adv($a_mount[$_GET['id']]); - unset($a_mount[$_GET['id']]); - write_config(); - touch($d_mountdirty_path); - pfSenseHeader("disks_mount.php"); - exit; - } + if ($a_mount[$_GET['id']]) { + disks_umount_adv($a_mount[$_GET['id']]); + unset($a_mount[$_GET['id']]); + write_config(); + touch($d_mountdirty_path); + pfSenseHeader("disks_mount.php"); + exit; + } } if ($_GET['act'] == "ret") { - if ($a_mount[$_GET['id']]) { - disks_mount($a_mount[$_GET['id']]); - pfSenseHeader("disks_mount.php"); - exit; - } + if ($a_mount[$_GET['id']]) { + disks_mount($a_mount[$_GET['id']]); + pfSenseHeader("disks_mount.php"); + exit; + } } include("head.inc"); @@ -126,82 +134,102 @@ echo $pfSenseHead->getHTML(); " . gettext("You must apply the changes in order for them to take effect."));?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
-   - -   - -   - -   - -   - - retry"; - } - echo $stat; - ?> - - - " width="17" height="17" border="0" alt="" /> - - - ');" title="" width="17" height="17" border="0" alt="" /> - -
- - " width="17" height="17" border="0" alt="" /> - -
- - Note: - -
- - - -
- - previously configured disk - -
- + +
+ + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+   + +   + +   + +   + +   + + retry"; + } else { + $stat = gettext("OK"); + } + } + echo $stat; + ?> + + + " width="17" height="17" border="0" alt="" /> + + + ');" title="" width="17" height="17" border="0" alt="" /> + +
+ + " width="17" height="17" border="0" alt="" /> + +
+ + Note: + +
+ + + +
+ + previously configured disk + +
+
+
+ diff --git a/packages/freenas/www/disks_mount_edit.php b/packages/freenas/www/disks_mount_edit.php index 02d7d5f3..b4cd7378 100644 --- a/packages/freenas/www/disks_mount_edit.php +++ b/packages/freenas/www/disks_mount_edit.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_mount_edit.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -42,46 +50,61 @@ require_once("guiconfig.inc"); require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); +$id = $_GET['id']; +if (isset($_POST['id'])) + $id = $_POST['id']; + if (!is_array($freenas_config['mounts']['mount'])) - $freenas_config['mounts']['mount'] = array(); + $freenas_config['mounts']['mount'] = array(); mount_sort(); if (!is_array($freenas_config['disks']['disk'])) - $freenas_config['disks']['disk'] = array(); - + $freenas_config['disks']['disk'] = array(); + disks_sort(); -if (!is_array($freenas_config['raid']['vdisk'])) - $freenas_config['raid']['vdisk'] = array(); +if (!is_array($freenas_config['gvinum']['vdisk'])) + $freenas_config['gvinum']['vdisk'] = array(); gvinum_sort(); if (!is_array($freenas_config['gmirror']['vdisk'])) - $freenas_config['gmirror']['vdisk'] = array(); + $freenas_config['gmirror']['vdisk'] = array(); gmirror_sort(); +if (!is_array($freenas_config['gconcat']['vdisk'])) + $freenas_config['gconcat']['vdisk'] = array(); + +gconcat_sort(); + +if (!is_array($freenas_config['gstripe']['vdisk'])) + $freenas_config['gstripe']['vdisk'] = array(); + +gstripe_sort(); + +if (!is_array($freenas_config['graid5']['vdisk'])) + $freenas_config['graid5']['vdisk'] = array(); + +graid5_sort(); + $a_mount = &$freenas_config['mounts']['mount']; -$a_disk = array_merge($freenas_config['disks']['disk'],$freenas_config['raid']['vdisk'],$freenas_config['gmirror']['vdisk']); +$a_disk = array_merge($freenas_config['disks']['disk'],$freenas_config['gvinum']['vdisk'],$freenas_config['gmirror']['vdisk'],$freenas_config['gconcat']['vdisk'],$freenas_config['gstripe']['vdisk'],$freenas_config['graid5']['vdisk']); /* Load the cfdevice file*/ $filename=$g['varetc_path']."/cfdevice"; if (file_exists($filename)) $cfdevice = trim(file_get_contents("$filename")); - -$id = $_GET['id']; -if (isset($_POST['id'])) - $id = $_POST['id']; - if (isset($id) && $a_mount[$id]) { - $pconfig['mdisk'] = $a_mount[$id]['mdisk']; - $pconfig['partition'] = $a_mount[$id]['partition']; - $pconfig['fstype'] = $a_mount[$id]['fstype']; - $pconfig['sharename'] = $a_mount[$id]['sharename']; - $pconfig['desc'] = $a_mount[$id]['desc']; + $pconfig['mdisk'] = $a_mount[$id]['mdisk']; + $pconfig['partition'] = $a_mount[$id]['partition']; + $pconfig['fullname'] = $a_mount[$id]['fullname']; + $pconfig['fstype'] = $a_mount[$id]['fstype']; + $pconfig['sharename'] = $a_mount[$id]['sharename']; + $pconfig['desc'] = $a_mount[$id]['desc']; } if (! empty($_POST)) @@ -91,59 +114,57 @@ if (! empty($_POST)) /* simple error list */ unset($input_errors); $pconfig = $_POST; - + /* input validation */ $reqdfields = split(" ", "partition mdisk fstype"); $reqdfieldsn = split(",", "Partition,Mdisk,Fstype"); - + do_input_validation_new($_POST, $reqdfields, $reqdfieldsn, &$error_bucket); - - if (($_POST['sharename'] && !is_validsharename($_POST['sharename']))) - { + + if (($_POST['sharename'] && !is_validsharename($_POST['sharename']))) + { $error_bucket[] = array("error" => gettext("The share name may only consist of the characters a-z, A-Z, 0-9, _ , -."), "field" => "sharename"); - } - - - if (($_POST['desc'] && !is_validdesc($_POST['desc']))) - { + } + + + if (($_POST['desc'] && !is_validdesc($_POST['desc']))) + { $error_bucket[] = array("error" => gettext("The description name contain invalid characters."), "field" => "desc"); - - } - $device=$_POST['mdisk'].$_POST['partition']; - - if ($device == $cfdevice ) - { + + } + $device=$_POST['mdisk'].$_POST['partition']; + + if ($device == $cfdevice ) + { $error_bucket[] = array("error" => gettext("Can't mount the system partition 1, the DATA partition is the 2."), "field" => "mdisk"); - - } - - /* check for name conflicts */ - foreach ($a_mount as $mount) - { - if (isset($id) && ($a_mount[$id]) && ($a_mount[$id] === $mount)) - continue; - - /* Remove the duplicate disk use - if ($mount['mdisk'] == $_POST['mdisk']) - { - $input_errors[] = "This device already exists in the mount point list."; - break; - } - */ - - if (($_POST['sharename']) && ($mount['sharename'] == $_POST['sharename'])) - { + + } + + /* check for name conflicts */ + foreach ($a_mount as $mount) + { + if (isset($id) && ($a_mount[$id]) && ($a_mount[$id] === $mount)) + continue; + + /* Check for duplicate mount point */ + if ($mount['mdisk'] == $_POST['mdisk']) + { + $error_bucket[] = array("error" => gettext("This disk/partition is allready configured."), + "field" => "mdisk"); + break; + } + + if (($_POST['sharename']) && ($mount['sharename'] == $_POST['sharename'])) + { $error_bucket[] = array("error" => gettext("Duplicate Share Name."), "field" => "sharename"); - break; - } - - - } - + break; + } + } + if (is_array($error_bucket)) foreach($error_bucket as $elem) $input_errors[] =& $elem["error"]; @@ -154,30 +175,34 @@ if (! empty($_POST)) exit; } - if (!$input_errors) - { - $mount = array(); - $mount['mdisk'] = $_POST['mdisk']; - $mount['partition'] = $_POST['partition']; - $mount['fstype'] = $_POST['fstype']; - $mount['desc'] = $_POST['desc']; - /* if not sharename given, create one */ - if (!$_POST['sharename']) - $mount['sharename'] = "disk_{$_POST['mdisk']}_part_{$_POST['partition']}"; - else - $mount['sharename'] = $_POST['sharename']; - if (isset($id) && $a_mount[$id]) - $a_mount[$id] = $mount; - else - $a_mount[] = $mount; - - touch($d_mountdirty_path); - - write_config(); - - pfSenseHeader("disks_mount.php"); - exit; - } + if (!$input_errors) + { + $mount = array(); + $mount['mdisk'] = $_POST['mdisk']; + $mount['partition'] = $_POST['partition']; + $mount['fstype'] = $_POST['fstype']; + $mount['desc'] = $_POST['desc']; + /* if not sharename given, create one */ + if (!$_POST['sharename']) + $mount['sharename'] = "disk_{$_POST['mdisk']}_part_{$_POST['partition']}"; + else + $mount['sharename'] = $_POST['sharename']; + + // Generate fullname + $mount['fullname'] = "{$mount['mdisk']}{$mount['partition']}"; + + if (isset($id) && $a_mount[$id]) + $a_mount[$id] = $mount; + else + $a_mount[] = $mount; + + touch($d_mountdirty_path); + + write_config(); + + pfSenseHeader("disks_mount.php"); + exit; + } } include("head.inc"); @@ -198,14 +223,15 @@ echo $pfSenseHead->getHTML(); - + + + + + + @@ -213,13 +239,14 @@ echo $pfSenseHead->getHTML(); diff --git a/packages/freenas/www/disks_mount_tools.php b/packages/freenas/www/disks_mount_tools.php new file mode 100644 index 00000000..472b11b1 --- /dev/null +++ b/packages/freenas/www/disks_mount_tools.php @@ -0,0 +1,211 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("Mount Point"), + gettext("Tools")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (!is_array($freenas_config['mounts']['mount'])) + $freenas_config['mounts']['mount'] = array(); + +mount_sort(); + +$a_mount = &$freenas_config['mounts']['mount']; + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + unset($do_action); + + /* input validation */ + $reqdfields = explode(" ", "fullname action"); + $reqdfieldsn = explode(",", "Fullname,Action"); + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if(!$input_errors) + { + $do_action = true; + $fullname = $_POST['fullname']; + $action = $_POST['action']; + } +} + +if(!isset($do_action)) +{ + $do_action = false; + $fullname = ''; + $action = ''; +} + +// URL GET from the disks_manage_init.php page: +// we get the $disk value, must found the $fullname now +if(isset($_GET['disk'])) { + $disk = $_GET['disk']; + $id = array_search_ex($disk, $a_mount, "mdisk"); + + $fullname = $a_mount[$id]['fullname']; +} +if(isset($_GET['action'])) { + $action = $_GET['action']; +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + + +
+ +
+ + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + +
+ +
+ +
  + "> +
+ " . gettext("Command output") . ":
"); + echo('
');
+              ob_end_flush();
+  
+              /* Get the id of the mount array entry. */
+              $id = array_search_ex($fullname, $a_mount, "fullname");
+              /* Get the mount data. */
+              $mount = $a_mount[$id];
+  
+              switch($action)
+              {
+                case "mount":
+                  echo(gettext("Mounting...") . "
"); + $result = disks_mount_fullname($fullname); + break; + case "umount": + echo(gettext("Umounting...") . "
"); + $result = disks_umount_fullname($fullname); + break; + } + + /* Display result */ + echo((0 == $result) ? gettext("Successful") : gettext("Failed")); + + echo('
'); + } + ?> +
+ +
+
+ + + + + diff --git a/packages/freenas/www/disks_raid_gconcat.php b/packages/freenas/www/disks_raid_gconcat.php new file mode 100644 index 00000000..e7fc9f81 --- /dev/null +++ b/packages/freenas/www/disks_raid_gconcat.php @@ -0,0 +1,236 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM Concat"), + gettext("RAID")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (!is_array($freenas_config['gconcat']['vdisk'])) + $freenas_config['gconcat']['vdisk'] = array(); + +gconcat_sort(); + +$raidstatus=get_sraid_disks_list(); + +$a_raid = &$freenas_config['gconcat']['vdisk']; + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + + $pconfig = $_POST; + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if ($_POST['apply']) { + $retval = 0; + if (!file_exists($d_sysrebootreqd_path)) + { + config_lock(); + /* reload all components that create raid device */ + disks_raid_gconcat_configure(); + config_unlock(); + write_config(); + } + $savemsg = get_std_save_message($retval); + if ($retval == 0) { + if (file_exists($d_raidconfdirty_path)) + unlink($d_raidconfdirty_path); + } + } +} + +if ($_GET['act'] == "del") { + if ($a_raid[$_GET['id']]) { + $raidname=$a_raid[$_GET['id']]['name']; + disks_raid_gconcat_delete($raidname); + unset($a_raid[$_GET['id']]); + write_config(); + touch($d_raidconfdirty_path); + pfSenseHeader("disks_raid_gconcat.php"); + exit; + } +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ +" . + gettext("You must apply the changes in order for them to take effect."));?> + + +
+ + + + + + + + + + +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
 
+ + + + +   + +   + + + " width="17" height="17" border="0" alt="" /> + + + " width="17" height="17" border="0" alt="" /> + +
+ + " width="17" height="17" border="0" alt="" /> + +
+ + + +
+ +
+ +
+ + +
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_gconcat_edit.php b/packages/freenas/www/disks_raid_gconcat_edit.php new file mode 100644 index 00000000..f4bd33cc --- /dev/null +++ b/packages/freenas/www/disks_raid_gconcat_edit.php @@ -0,0 +1,256 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM Concat"), + gettext("RAID"), + isset($id) ? gettext("Edit") : gettext("Add")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +$id = $_GET['id']; +if (isset($_POST['id'])) + $id = $_POST['id']; + +if (!is_array($freenas_config['gconcat']['vdisk'])) + $freenas_config['gconcat']['vdisk'] = array(); + +gconcat_sort(); +disks_sort(); + +$a_raid = &$freenas_config['gconcat']['vdisk']; +$all_raid = array_merge((array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['gconcat']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gconcat']['vdisk']); +$a_disk = get_fstype_disks_list("softraid"); + +if (!sizeof($a_disk)) { + $nodisk_errors[] = gettext("You must add disks first."); +} + +if (isset($id) && $a_raid[$id]) { + $pconfig['name'] = $a_raid[$id]['name']; + $pconfig['type'] = $a_raid[$id]['type']; + $pconfig['diskr'] = $a_raid[$id]['diskr']; + $pconfig['fullname'] = $a_raid[$id]['fullname']; +} + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + + $reqdfields = explode(" ", "name"); + $reqdfieldsn = explode(",", "Name"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (($_POST['name'] && !is_validaliasname($_POST['name']))) + { + $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."), + "field" => "name"); + } + + /* check for name conflicts */ + foreach ($a_raid as $raid) + { + if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid)) + continue; + + if ($raid['name'] == $_POST['name']) + { + $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."), + "field" => "name"); + break; + } + } + + /* check the number of RAID disk for volume */ + + if (count($_POST['diskr']) < 2) + $error_bucket[] = array("error" => gettext("There must be a minimum of 2 disks in a JBOD."), + "field" => "diskr"); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) { + $raid = array(); + $raid['name'] = $_POST['name']; + $raid['type'] = "JBOD"; + $raid['diskr'] = $_POST['diskr']; + $raid['desc'] = "Software gconcat JBOD"; + $raid['fullname'] = "/dev/concat/{$raid['name']}"; + + if (isset($id) && $a_raid[$id]) + $a_raid[$id] = $raid; + else + $a_raid[] = $raid; + + $fd = @fopen("$d_raidconfdirty_path", "a"); + if (!$fd) { + echo "ERR Could not save RAID configuration.\n"; + exit(0); + } + fwrite($fd, "$raid[name]\n"); + fclose($fd); + + write_config(); + + pfSenseHeader("disks_raid_gconcat.php"); + exit; + } +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+ +
JBOD
+ $diskv[name] ($diskv[size], $diskv[desc])".(($r_name) ? " - assigned to $r_name" : "")."
\n"; + $i++; + + $i++; + } + + if ($disable_script) + echo "\n"; + ?> +
  + + + + +
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_gconcat_infos.php b/packages/freenas/www/disks_raid_gconcat_infos.php new file mode 100644 index 00000000..09dfd76a --- /dev/null +++ b/packages/freenas/www/disks_raid_gconcat_infos.php @@ -0,0 +1,143 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM Concat"), + gettext("Information")); + +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) { + } +} +if (!isset($do_action)) { +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + +
+ "; + echo "" . gettext("Software RAID information and status") . "
"; + + exec("/sbin/gconcat list",$rawdata); + foreach ($rawdata as $line){ + echo htmlspecialchars($line) . "
"; + } + + unset ($line); + echo ""; + ?> +
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_gconcat_tools.php b/packages/freenas/www/disks_raid_gconcat_tools.php new file mode 100644 index 00000000..7783450d --- /dev/null +++ b/packages/freenas/www/disks_raid_gconcat_tools.php @@ -0,0 +1,187 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM Concat"), + gettext("Tools")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + unset($do_action); + + $reqdfields = explode(" ", "action object"); + $reqdfieldsn = explode(",", "Action,Object"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) { + $do_action = true; + $action = $_POST['action']; + $object = $_POST['object']; + } + } + if (!isset($do_action)) { + $do_action = false; + $action = ''; + $object = ''; +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ +
  + +
+ " . gettext("GCONCAT command output:") . "
"); + echo('
');
+                ob_end_flush();
+              
+                system("/sbin/gmirror $action " . escapeshellarg($object));
+            
+                echo('
'); + } + ?> +
+ + WARNING:
+
+
    +
  1. +
  2. +
+
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_gmirror.php b/packages/freenas/www/disks_raid_gmirror.php index 44b4be70..78390a64 100644 --- a/packages/freenas/www/disks_raid_gmirror.php +++ b/packages/freenas/www/disks_raid_gmirror.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gmirror.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -43,7 +51,7 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); if (!is_array($freenas_config['gmirror']['vdisk'])) - $freenas_config['gmirror']['vdisk'] = array(); + $freenas_config['gmirror']['vdisk'] = array(); gmirror_sort(); @@ -70,33 +78,34 @@ if (! empty($_POST)) exit; } - if ($_POST['apply']) { - $retval = 0; - if (!file_exists($d_sysrebootreqd_path)) - { - config_lock(); - /* reload all components that create raid device */ - disks_raid_gmirror_configure(); - config_unlock(); - write_config(); - } - $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_raidconfdirty_path)) - unlink($d_raidconfdirty_path); - } - } + if ($_POST['apply']) { + $retval = 0; + if (!file_exists($d_sysrebootreqd_path)) + { + config_lock(); + /* reload all components that create raid device */ + disks_raid_gmirror_configure(); + config_unlock(); + write_config(); + } + $savemsg = get_std_save_message($retval); + if ($retval == 0) { + if (file_exists($d_raidconfdirty_path)) + unlink($d_raidconfdirty_path); + } + } } if ($_GET['act'] == "del") { - if ($a_raid[$_GET['id']]) { - $raidname=$a_raid[$_GET['id']]['name']; - disks_raid_gmirror_delete($raidname); - unset($a_raid[$_GET['id']]); - write_config(); - pfSenseHeader("disks_raid_gmirror.php"); - exit; - } + if ($a_raid[$_GET['id']]) { + $raidname=$a_raid[$_GET['id']]['name']; + disks_raid_gmirror_delete($raidname); + unset($a_raid[$_GET['id']]); + write_config(); + touch($d_raidconfdirty_path); + pfSenseHeader("disks_raid_gmirror.php"); + exit; + } } include("head.inc"); @@ -122,82 +131,85 @@ echo $pfSenseHead->getHTML(); -
+
- - + + - + - - + - + - + - + + - - + + @@ -187,7 +200,7 @@ echo $pfSenseHead->getHTML();
  
+ - + - +   - +   - + echo gettext("configuring"); + else { + echo "{$raidstatus[$tempo]['desc']}"; + } + ?>  + " width="17" height="17" border="0" alt="" /> - + " width="17" height="17" border="0" alt="" /> -
- + + " width="17" height="17" border="0" alt="" /> -
diff --git a/packages/freenas/www/disks_raid_gmirror_edit.php b/packages/freenas/www/disks_raid_gmirror_edit.php index b67d90d2..ac08a442 100644 --- a/packages/freenas/www/disks_raid_gmirror_edit.php +++ b/packages/freenas/www/disks_raid_gmirror_edit.php @@ -1,71 +1,80 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gmirror_edit.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), gettext("GEOM Mirror"), gettext("RAID"), - gettext("Edit")); + isset($id) ? gettext("Edit") : gettext("Add")); require_once("freenas_config.inc"); require_once("guiconfig.inc"); require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); +$id = $_GET['id']; +if (isset($_POST['id'])) + $id = $_POST['id']; + if (!is_array($freenas_config['gmirror']['vdisk'])) - $freenas_config['gmirror']['vdisk'] = array(); + $freenas_config['gmirror']['vdisk'] = array(); gmirror_sort(); - -if (!is_array($freenas_config['disks']['disk'])) - $nodisk_errors[] = _DISKSRAIDEDITPHP_MSGADDDISKFIRST; -else - disks_sort(); +disks_sort(); $a_raid = &$freenas_config['gmirror']['vdisk']; +$all_raid = array_merge((array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['gmirror']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gconcat']['vdisk']); +$a_disk = get_fstype_disks_list("softraid"); -$a_disk = &$freenas_config['disks']['disk']; +if (!sizeof($a_disk)) { + $nodisk_errors[] = gettext("You must add disks first."); +} -$id = $_GET['id']; -if (isset($_POST['id'])) - $id = $_POST['id']; - if (isset($id) && $a_raid[$id]) { - $pconfig['name'] = $a_raid[$id]['name']; - $pconfig['type'] = $a_raid[$id]['type']; - $pconfig['balance'] = $a_raid[$id]['balance']; - $pconfig['diskr'] = $a_raid[$id]['diskr']; + $pconfig['name'] = $a_raid[$id]['name']; + $pconfig['fullname'] = $a_raid[$id]['fullname']; + $pconfig['type'] = $a_raid[$id]['type']; + $pconfig['balance'] = $a_raid[$id]['balance']; + $pconfig['diskr'] = $a_raid[$id]['diskr']; } if (! empty($_POST)) @@ -74,36 +83,36 @@ if (! empty($_POST)) unset($error_bucket); /* simple error list */ unset($input_errors); - - $reqdfields = explode(" ", "name"); - $reqdfieldsn = explode(",", "Name"); - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if (($_POST['name'] && !is_validaliasname($_POST['name']))) - { + $reqdfields = explode(" ", "name"); + $reqdfieldsn = explode(",", "Name"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (($_POST['name'] && !is_validaliasname($_POST['name']))) + { $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."), "field" => "name"); - } - - - /* check for name conflicts */ - foreach ($a_raid as $raid) - { - if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid)) - continue; - - if ($raid['name'] == $_POST['name']) - { + } + + + /* check for name conflicts */ + foreach ($a_raid as $raid) + { + if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid)) + continue; + + if ($raid['name'] == $_POST['name']) + { $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."), "field" => "name"); - break; - } - } - - /* check the number of RAID disk for volume */ - - if (count($_POST['diskr']) != 2) + break; + } + } + + /* check the number of RAID disk for volume */ + + if (count($_POST['diskr']) != 2) $error_bucket[] = array("error" => gettext("There must be 2 disks in a RAID 1 volume."), "field" => "diskr"); @@ -117,32 +126,33 @@ if (! empty($_POST)) exit; } - if (!$input_errors) { - $raid = array(); - $raid['name'] = $_POST['name']; - $raid['balance'] = $_POST['balance']; - $raid['type'] = 1; - $raid['diskr'] = $_POST['diskr']; - $raid['desc'] = "Software RAID {$_POST['type']}"; - - if (isset($id) && $a_raid[$id]) - $a_raid[$id] = $raid; - else - $a_raid[] = $raid; - - $fd = @fopen("$d_raidconfdirty_path", "a"); - if (!$fd) { - echo "ERR Could not save RAID configuration.\n"; - exit(0); - } - fwrite($fd, "$raid[name]\n"); - fclose($fd); - - write_config(); - - pfSenseHeader("disks_raid_gmirror.php"); - exit; - } + if (!$input_errors) { + $raid = array(); + $raid['name'] = $_POST['name']; + $raid['balance'] = $_POST['balance']; + $raid['type'] = 1; + $raid['diskr'] = $_POST['diskr']; + $raid['desc'] = "Software RAID {$_POST['type']}"; + $raid['fullname'] = "/dev/mirror/{$raid['name']}"; + + if (isset($id) && $a_raid[$id]) + $a_raid[$id] = $raid; + else + $a_raid[] = $raid; + + $fd = @fopen("$d_raidconfdirty_path", "a"); + if (!$fd) { + echo "ERR Could not save RAID configuration.\n"; + exit(0); + } + fwrite($fd, "$raid[name]\n"); + fclose($fd); + + write_config(); + + pfSenseHeader("disks_raid_gmirror.php"); + exit; + } } include("head.inc"); @@ -162,22 +172,25 @@ echo $pfSenseHead->getHTML();
- + @@ -202,14 +215,14 @@ echo $pfSenseHead->getHTML(); @@ -224,21 +237,17 @@ echo $pfSenseHead->getHTML(); foreach ($a_disk as $diskv) { $r_name=""; - if (strcmp($diskv['fstype'],"gmirror")==0) { - foreach($a_raid as $raid) { - if (in_array($diskv['name'],$raid['diskr'])) { - $r_name=$raid['name']; - - if ($r_name!=$pconfig['name']) - $disable_script.="document.getElementById($i).disabled=1;\n"; - break; - } + foreach($all_raid as $raid) { + if (in_array($diskv['fullname'],(array)$raid['diskr'])) { + $r_name=$raid['name']; + if ($r_name!=$pconfig['name']) $disable_script.="document.getElementById($i).disabled=1;\n"; + break; } - - echo "$diskv[name] ($diskv[size], $diskv[desc])" . (($r_name) ? " - assigned to $r_name" : "") . "
\n"; } + echo "$diskv[name] ($diskv[size], $diskv[desc])".(($r_name) ? " - assigned to $r_name" : "")."
\n"; + $i++; $i++; } diff --git a/packages/freenas/www/disks_raid_gmirror_infos.php b/packages/freenas/www/disks_raid_gmirror_infos.php index 5fb2d1e1..878f571e 100644 --- a/packages/freenas/www/disks_raid_gmirror_infos.php +++ b/packages/freenas/www/disks_raid_gmirror_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gmirror_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -81,22 +89,25 @@ echo $pfSenseHead->getHTML(); @@ -125,7 +136,7 @@ echo $pfSenseHead->getHTML(); - +

diff --git a/packages/freenas/www/disks_raid_gmirror_init.php b/packages/freenas/www/disks_raid_gmirror_init.php index ef991376..2b2d59af 100644 --- a/packages/freenas/www/disks_raid_gmirror_init.php +++ b/packages/freenas/www/disks_raid_gmirror_init.php @@ -1,36 +1,47 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gmirror_init.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +/* ========================================================================== */ +/* == T H I S F I L E I S C U R R E N T L Y N O T U S E D == */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), diff --git a/packages/freenas/www/disks_raid_gmirror_tools.php b/packages/freenas/www/disks_raid_gmirror_tools.php index a79d2a6b..9aae8c2d 100644 --- a/packages/freenas/www/disks_raid_gmirror_tools.php +++ b/packages/freenas/www/disks_raid_gmirror_tools.php @@ -1,36 +1,42 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gmirror_tools.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -48,11 +54,11 @@ if (! empty($_POST)) unset($error_bucket); /* simple error list */ unset($input_errors); - - $reqdfields = explode(" ", "action object"); - $reqdfieldsn = explode(",", "Action,Object"); - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + $reqdfields = explode(" ", "action object"); + $reqdfieldsn = explode(",", "Action,Object"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (is_array($error_bucket)) foreach($error_bucket as $elem) @@ -64,16 +70,16 @@ if (! empty($_POST)) exit; } - if (!$input_errors) { - $do_action = true; - $action = $_POST['action']; - $object = $_POST['object']; - } -} -if (!isset($do_action)) { - $do_action = false; - $action = ''; - $object = ''; + if (!$input_errors) { + $do_action = true; + $action = $_POST['action']; + $object = $_POST['object']; + } + } + if (!isset($do_action)) { + $do_action = false; + $action = ''; + $object = ''; } include("head.inc"); @@ -93,23 +99,26 @@ echo $pfSenseHead->getHTML(); + $tab_array = array(); + $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gmirror.php"); + /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */ + $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gmirror_tools.php"); + $tab_array[2] = array(gettext("Information"), false, "disks_raid_gmirror_infos.php"); + display_top_tabs($tab_array); +?> @@ -143,26 +152,23 @@ echo $pfSenseHead->getHTML();   - - - - - - + + " . gettext("GMIRROR command output:") . "
"); - echo('
');
-    					  ob_end_flush();
-    					
-    					  system("/sbin/gmirror $action " . escapeshellarg($object));
-    				
-    					  echo('
'); - } - ?> - - + echo("" . gettext("GMIRROR command output:") . "
"); + echo('
');
+                ob_end_flush();
+              
+                system("/sbin/gmirror $action " . escapeshellarg($object));
+            
+                echo('
'); + } + ?> + + diff --git a/packages/freenas/www/disks_raid_graid5.php b/packages/freenas/www/disks_raid_graid5.php new file mode 100644 index 00000000..6273b077 --- /dev/null +++ b/packages/freenas/www/disks_raid_graid5.php @@ -0,0 +1,236 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM RAID5"), + gettext("RAID")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (!is_array($freenas_config['graid5']['vdisk'])) + $freenas_config['graid5']['vdisk'] = array(); + +graid5_sort(); + +$raidstatus=get_sraid_disks_list(); + +$a_raid = &$freenas_config['graid5']['vdisk']; + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + + $pconfig = $_POST; + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if ($_POST['apply']) { + $retval = 0; + if (!file_exists($d_sysrebootreqd_path)) + { + config_lock(); + /* reload all components that create raid device */ + disks_raid_graid5_configure(); + config_unlock(); + write_config(); + } + $savemsg = get_std_save_message($retval); + if ($retval == 0) { + if (file_exists($d_raidconfdirty_path)) + unlink($d_raidconfdirty_path); + } + } +} + +if ($_GET['act'] == "del") { + if ($a_raid[$_GET['id']]) { + $raidname=$a_raid[$_GET['id']]['name']; + disks_raid_graid5_delete($raidname); + unset($a_raid[$_GET['id']]); + write_config(); + touch($d_raidconfdirty_path); + pfSenseHeader("disks_raid_graid5.php"); + exit; + } +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ +" . + gettext("You must apply the changes in order for them to take effect."));?> + + +
+ + + + + + + + + + +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
 
+ + + + +   + +   + + + " width="17" height="17" border="0" alt="" /> + + + " width="17" height="17" border="0" alt="" /> + +
+ + " width="17" height="17" border="0" alt="" /> + +
+ + + +
+ +
+ +
+ + +
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_graid5_edit.php b/packages/freenas/www/disks_raid_graid5_edit.php new file mode 100644 index 00000000..27069f6c --- /dev/null +++ b/packages/freenas/www/disks_raid_graid5_edit.php @@ -0,0 +1,258 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM RAID5"), + gettext("RAID"), + isset($id) ? gettext("Edit") : gettext("Add")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +$id = $_GET['id']; +if (isset($_POST['id'])) + $id = $_POST['id']; + +if (!is_array($freenas_config['graid5']['vdisk'])) + $freenas_config['graid5']['vdisk'] = array(); + +graid5_sort(); +disks_sort(); + +$a_raid = &$freenas_config['graid5']['vdisk']; +$all_raid = array_merge((array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['graid5']['vdisk']); +$a_disk = get_fstype_disks_list("softraid"); + +if (!sizeof($a_disk)) { + $nodisk_errors[] = gettext("You must add disks first."); +} + +if (isset($id) && $a_raid[$id]) { + $pconfig['name'] = $a_raid[$id]['name']; + $pconfig['type'] = $a_raid[$id]['type']; + $pconfig['diskr'] = $a_raid[$id]['diskr']; + $pconfig['fullname'] = $a_raid[$id]['fullname']; +} + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + + $reqdfields = explode(" ", "name"); + $reqdfieldsn = explode(",", "Name"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (($_POST['name'] && !is_validaliasname($_POST['name']))) + { + $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."), + "field" => "name"); + } + + /* check for name conflicts */ + foreach ($a_raid as $raid) + { + if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid)) + continue; + + if ($raid['name'] == $_POST['name']) + { + $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."), + "field" => "name"); + break; + } + } + + /* check the number of RAID disk for volume */ + + if (count($_POST['diskr']) < 3) + $error_bucket[] = array("error" => gettext("There must be a minimum of 3 disks in a RAID 5 volume."), + "field" => "diskr"); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) { + $raid = array(); + $raid['name'] = $_POST['name']; + $raid['type'] = "JBOD"; + $raid['diskr'] = $_POST['diskr']; + $raid['desc'] = "Software graid5 RAID 5"; + $raid['fullname'] = "/dev/raid5/{$raid['name']}"; + + if (isset($id) && $a_raid[$id]) + $a_raid[$id] = $raid; + else + $a_raid[] = $raid; + + $fd = @fopen("$d_raidconfdirty_path", "a"); + if (!$fd) { + echo "ERR Could not save RAID configuration.\n"; + exit(0); + } + fwrite($fd, "$raid[name]\n"); + fclose($fd); + + write_config(); + + pfSenseHeader("disks_raid_graid5.php"); + exit; + } +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+ +
+ RAID 5 () +
+ $diskv[name] ($diskv[size], $diskv[desc])".(($r_name) ? " - assigned to $r_name" : "")."
\n"; + $i++; + + $i++; + } + + if ($disable_script) + echo "\n"; + ?> +
  + + + + +
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_graid5_infos.php b/packages/freenas/www/disks_raid_graid5_infos.php new file mode 100644 index 00000000..31506011 --- /dev/null +++ b/packages/freenas/www/disks_raid_graid5_infos.php @@ -0,0 +1,143 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM RAID5"), + gettext("Information")); + +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) { + } +} +if (!isset($do_action)) { +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + +
+ "; + echo "" . gettext("Software RAID information and status") . "
"; + + exec("/sbin/graid5 list",$rawdata); + foreach ($rawdata as $line){ + echo htmlspecialchars($line) . "
"; + } + + unset ($line); + echo ""; + ?> +
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_graid5_tools.php b/packages/freenas/www/disks_raid_graid5_tools.php new file mode 100644 index 00000000..c8b3cf5b --- /dev/null +++ b/packages/freenas/www/disks_raid_graid5_tools.php @@ -0,0 +1,190 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM RAID5"), + gettext("Tools")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + unset($do_action); + + $reqdfields = explode(" ", "action object"); + $reqdfieldsn = explode(",", "Action,Object"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) { + $do_action = true; + $action = $_POST['action']; + $object = $_POST['object']; + } + } + if (!isset($do_action)) { + $do_action = false; + $action = ''; + $object = ''; +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ +
  + +
+ " . gettext("GCONCAT command output:") . "
"); + echo('
');
+                ob_end_flush();
+              
+                system("/sbin/graid5 $action " . escapeshellarg($object));
+            
+                echo('
'); + } + ?> +
+ + WARNING:
+
+
    +
  1. +
  2. +
+
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_gstripe.php b/packages/freenas/www/disks_raid_gstripe.php new file mode 100644 index 00000000..4d5f622d --- /dev/null +++ b/packages/freenas/www/disks_raid_gstripe.php @@ -0,0 +1,236 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM Stripe"), + gettext("RAID")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (!is_array($freenas_config['gstripe']['vdisk'])) + $freenas_config['gstripe']['vdisk'] = array(); + +gstripe_sort(); + +$raidstatus=get_sraid_disks_list(); + +$a_raid = &$freenas_config['gstripe']['vdisk']; + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + + $pconfig = $_POST; + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if ($_POST['apply']) { + $retval = 0; + if (!file_exists($d_sysrebootreqd_path)) + { + config_lock(); + /* reload all components that create raid device */ + disks_raid_gstripe_configure(); + config_unlock(); + write_config(); + } + $savemsg = get_std_save_message($retval); + if ($retval == 0) { + if (file_exists($d_raidconfdirty_path)) + unlink($d_raidconfdirty_path); + } + } +} + +if ($_GET['act'] == "del") { + if ($a_raid[$_GET['id']]) { + $raidname=$a_raid[$_GET['id']]['name']; + disks_raid_gstripe_delete($raidname); + unset($a_raid[$_GET['id']]); + write_config(); + touch($d_raidconfdirty_path); + pfSenseHeader("disks_raid_gstripe.php"); + exit; + } +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ +" . + gettext("You must apply the changes in order for them to take effect."));?> + + +
+ + + + + + + + + + +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
 
+ + + + +   + +   + + + " width="17" height="17" border="0" alt="" /> + + + " width="17" height="17" border="0" alt="" /> + +
+ + " width="17" height="17" border="0" alt="" /> + +
+ + + +
+ +
+ +
+ + +
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_gstripe_edit.php b/packages/freenas/www/disks_raid_gstripe_edit.php new file mode 100644 index 00000000..ab18d6e7 --- /dev/null +++ b/packages/freenas/www/disks_raid_gstripe_edit.php @@ -0,0 +1,258 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM Stripe"), + gettext("RAID"), + gettext("Edit")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +$id = $_GET['id']; +if (isset($_POST['id'])) + $id = $_POST['id']; + +if (!is_array($freenas_config['gstripe']['vdisk'])) + $freenas_config['gstripe']['vdisk'] = array(); + +gstripe_sort(); +disks_sort(); + +$a_raid = &$freenas_config['gstripe']['vdisk']; +$all_raid = array_merge((array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gstripe']['vdisk']); +$a_disk = get_fstype_disks_list("softraid"); + +if (!sizeof($a_disk)) { + $nodisk_errors[] = gettext("You must add disks first."); +} + +if (isset($id) && $a_raid[$id]) { + $pconfig['name'] = $a_raid[$id]['name']; + $pconfig['type'] = $a_raid[$id]['type']; + $pconfig['diskr'] = $a_raid[$id]['diskr']; + $pconfig['fullname'] = $a_raid[$id]['fullname']; +} + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + + $reqdfields = explode(" ", "name"); + $reqdfieldsn = explode(",", "Name"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (($_POST['name'] && !is_validaliasname($_POST['name']))) + { + $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."), + "field" => "name"); + } + + /* check for name conflicts */ + foreach ($a_raid as $raid) + { + if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid)) + continue; + + if ($raid['name'] == $_POST['name']) + { + $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."), + "field" => "name"); + break; + } + } + + /* check the number of RAID disk for volume */ + + if (count($_POST['diskr']) < 2) + $error_bucket[] = array("error" => gettext("There must be a minimum of 2 disks in a RAID 0 volume."), + "field" => "diskr"); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) { + $raid = array(); + $raid['name'] = $_POST['name']; + $raid['type'] = "JBOD"; + $raid['diskr'] = $_POST['diskr']; + $raid['desc'] = "Software gstripe RAID 0"; + $raid['fullname'] = "/dev/stripe/{$raid['name']}"; + + if (isset($id) && $a_raid[$id]) + $a_raid[$id] = $raid; + else + $a_raid[] = $raid; + + $fd = @fopen("$d_raidconfdirty_path", "a"); + if (!$fd) { + echo "ERR Could not save RAID configuration.\n"; + exit(0); + } + fwrite($fd, "$raid[name]\n"); + fclose($fd); + + write_config(); + + pfSenseHeader("disks_raid_gstripe.php"); + exit; + } +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+ +
+ RAID 5 () +
+ $diskv[name] ($diskv[size], $diskv[desc])".(($r_name) ? " - assigned to $r_name" : "")."
\n"; + $i++; + + $i++; + } + + if ($disable_script) + echo "\n"; + ?> +
  + + + + +
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_gstripe_infos.php b/packages/freenas/www/disks_raid_gstripe_infos.php new file mode 100644 index 00000000..5d8a6de0 --- /dev/null +++ b/packages/freenas/www/disks_raid_gstripe_infos.php @@ -0,0 +1,143 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM Stripe"), + gettext("Information")); + +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) { + } +} +if (!isset($do_action)) { +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + +
+ "; + echo "" . gettext("Software RAID information and status") . "
"; + + exec("/sbin/gstripe list",$rawdata); + foreach ($rawdata as $line){ + echo htmlspecialchars($line) . "
"; + } + + unset ($line); + echo ""; + ?> +
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_gstripe_tools.php b/packages/freenas/www/disks_raid_gstripe_tools.php new file mode 100644 index 00000000..6bc7891a --- /dev/null +++ b/packages/freenas/www/disks_raid_gstripe_tools.php @@ -0,0 +1,187 @@ + + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +$pgtitle = array(gettext("System"), + gettext("Disks"), + gettext("GEOM Stripe"), + gettext("Tools")); + +require_once("freenas_config.inc"); +require_once("guiconfig.inc"); +require_once("freenas_guiconfig.inc"); +require_once("freenas_functions.inc"); + +if (! empty($_POST)) +{ + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + unset($do_action); + + $reqdfields = explode(" ", "action object"); + $reqdfieldsn = explode(",", "Action,Object"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) { + $do_action = true; + $action = $_POST['action']; + $object = $_POST['object']; + } + } + if (!isset($do_action)) { + $do_action = false; + $action = ''; + $object = ''; +} + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ +
  + +
+ " . gettext("GSTRIPE command output:") . "
"); + echo('
');
+                ob_end_flush();
+              
+                system("/sbin/gstripe $action " . escapeshellarg($object));
+            
+                echo('
'); + } + ?> +
+ + WARNING:
+
+
    +
  1. +
  2. +
+
+
+
+
+ + + diff --git a/packages/freenas/www/disks_raid_gvinum.php b/packages/freenas/www/disks_raid_gvinum.php index eb18a5f5..134b2fb5 100644 --- a/packages/freenas/www/disks_raid_gvinum.php +++ b/packages/freenas/www/disks_raid_gvinum.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gvinum.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -42,14 +50,14 @@ require_once("guiconfig.inc"); require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); -if (!is_array($freenas_config['raid']['vdisk'])) - $freenas_config['raid']['vdisk'] = array(); +if (!is_array($freenas_config['gvinum']['vdisk'])) + $freenas_config['gvinum']['vdisk'] = array(); gvinum_sort(); $raidstatus=get_sraid_disks_list(); -$a_raid = &$freenas_config['raid']['vdisk']; +$a_raid = &$freenas_config['gvinum']['vdisk']; if (! empty($_POST)) { @@ -59,7 +67,7 @@ if (! empty($_POST)) unset($input_errors); $pconfig = $_POST; - + if (is_array($error_bucket)) foreach($error_bucket as $elem) $input_errors[] =& $elem["error"]; @@ -70,33 +78,34 @@ if (! empty($_POST)) exit; } - if ($_POST['apply']) { - $retval = 0; - if (!file_exists($d_sysrebootreqd_path)) - { - config_lock(); - /* reload all components that create raid device */ - disks_raid_configure(); - config_unlock(); - write_config(); - } - $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_raidconfdirty_path)) - unlink($d_raidconfdirty_path); - } - } -} - -if ($_GET['act'] == "del") { - if ($a_raid[$_GET['id']]) { - $raidname=$a_raid[$_GET['id']]['name']; - disks_raid_gvinum_delete($raidname); - unset($a_raid[$_GET['id']]); - write_config(); - pfSenseHeader("disks_raid_gvinum.php"); - exit; - } + if ($_POST['apply']) { + $retval = 0; + if (!file_exists($d_sysrebootreqd_path)) + { + config_lock(); + /* reload all components that create raid device */ + disks_raid_gvinum_configure(); + config_unlock(); + write_config(); + } + $savemsg = get_std_save_message($retval); + if ($retval == 0) { + if (file_exists($d_raidconfdirty_path)) + unlink($d_raidconfdirty_path); + } + } + } + + if ($_GET['act'] == "del") { + if ($a_raid[$_GET['id']]) { + $raidname=$a_raid[$_GET['id']]['name']; + disks_raid_gvinum_delete($raidname); + unset($a_raid[$_GET['id']]); + write_config(); + touch($d_raidconfdirty_path); + pfSenseHeader("disks_raid_gvinum.php"); + exit; + } } include("head.inc"); @@ -122,82 +131,85 @@ echo $pfSenseHead->getHTML(); + $tab_array = array(); + $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gvinum.php"); + /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */ + $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gvinum_tools.php"); + $tab_array[2] = array(gettext("Information"), false, "disks_raid_gvinum_infos.php"); + display_top_tabs($tab_array); +?> -
+
- - + + - + - - + - + - + - + + - - + +
  
+ - + - +   - +   - + echo "_CONFIGURING"; + else { + echo "{$raidstatus[$tempo]['desc']}"; + } + ?>  + " width="17" height="17" border="0" alt="" /> - + " width="17" height="17" border="0" alt="" /> -
- + + " width="17" height="17" border="0" alt="" /> -
@@ -215,7 +227,7 @@ echo $pfSenseHead->getHTML();
- + diff --git a/packages/freenas/www/disks_raid_gvinum_edit.php b/packages/freenas/www/disks_raid_gvinum_edit.php index b36baef3..e0245419 100644 --- a/packages/freenas/www/disks_raid_gvinum_edit.php +++ b/packages/freenas/www/disks_raid_gvinum_edit.php @@ -1,42 +1,50 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gvinum_edit.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), gettext("GEOM Vinum"), gettext("RAID"), - gettext("Edit")); + isset($id) ? gettext("Edit") : gettext("Add")); require_once("freenas_config.inc"); require_once("guiconfig.inc"); @@ -44,27 +52,28 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); if (!is_array($freenas_config['raid']['vdisk'])) - $freenas_config['raid']['vdisk'] = array(); + $freenas_config['raid']['vdisk'] = array(); gvinum_sort(); +disks_sort(); -if (!is_array($freenas_config['disks']['disk'])) - $nodisk_errors[] = _DISKSRAIDEDITPHP_MSGADDDISKFIRST; -else - disks_sort(); - -$a_raid = &$freenas_config['raid']['vdisk']; - -$a_disk = &$freenas_config['disks']['disk']; +$a_raid = &$freenas_config['gvinum']['vdisk']; +$a_disk = get_fstype_disks_list("softraid"); +$all_raid = array_merge((array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['gmirror']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gconcat']['vdisk']); $id = $_GET['id']; if (isset($_POST['id'])) - $id = $_POST['id']; + $id = $_POST['id']; + +if (!sizeof($a_disk)) { + $nodisk_errors[] = gettext("You must add disks first."); +} if (isset($id) && $a_raid[$id]) { - $pconfig['name'] = $a_raid[$id]['name']; - $pconfig['type'] = $a_raid[$id]['type']; - $pconfig['diskr'] = $a_raid[$id]['diskr']; + $pconfig['name'] = $a_raid[$id]['name']; + $pconfig['fullname'] = $a_raid[$id]['fullname']; + $pconfig['type'] = $a_raid[$id]['type']; + $pconfig['diskr'] = $a_raid[$id]['diskr']; } if (! empty($_POST)) @@ -73,54 +82,52 @@ if (! empty($_POST)) unset($error_bucket); /* simple error list */ unset($input_errors); - - $reqdfields = explode(" ", "name type"); - $reqdfieldsn = explode(",", "Name,Type"); - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if (($_POST['name'] && !is_validaliasname($_POST['name']))) - { + $reqdfields = explode(" ", "name type"); + $reqdfieldsn = explode(",", "Name,Type"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if (($_POST['name'] && !is_validaliasname($_POST['name']))) + { $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."), "field" => "name"); - } - - /* check for name conflicts */ - foreach ($a_raid as $raid) - { - if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid)) - continue; - - if ($raid['name'] == $_POST['name']) - { + } + + /* check for name conflicts */ + foreach ($a_raid as $raid) + { + if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid)) + continue; + + if ($raid['name'] == $_POST['name']) + { $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."), "field" => "name"); - break; - } - } - - /* check the number of RAID disk for volume */ - - /* check the number of RAID disk for volume */ - - switch ($_POST['type']) - { - case 0: - if (count($_POST['diskr']) < 2) + break; + } + } + + /* check the number of RAID disk for volume */ + + switch ($_POST['type']) + { + case 0: + if (count($_POST['diskr']) < 2) $error_bucket[] = array("error" => gettext("There must be a minimum of 2 disks in a RAID 0 volume."), "field" => "diskr"); - break; - case 1: - if (count($_POST['diskr']) != 2) + break; + case 1: + if (count($_POST['diskr']) != 2) $error_bucket[] = array("error" => gettext("There must be 2 disks in a RAID 1 volume."), "field" => "diskr"); - break; - case 5: - if (count($_POST['diskr']) < 3) + break; + case 5: + if (count($_POST['diskr']) < 3) $error_bucket[] = array("error" => gettext("There must be a minimum of 3 disks in a RAID 5 volume."), "field" => "diskr"); - break; - } + break; + } if (is_array($error_bucket)) foreach($error_bucket as $elem) @@ -132,31 +139,32 @@ if (! empty($_POST)) exit; } - if (!$input_errors) { - $raid = array(); - $raid['name'] = $_POST['name']; - $raid['type'] = $_POST['type']; - $raid['diskr'] = $_POST['diskr']; - $raid['desc'] = "Software RAID {$_POST['type']}"; - - if (isset($id) && $a_raid[$id]) - $a_raid[$id] = $raid; - else - $a_raid[] = $raid; - - $fd = @fopen("$d_raidconfdirty_path", "a"); - if (!$fd) { - echo "_DISKSRAIDEDITPHP_MSGERROR"; - exit(0); - } - fwrite($fd, "$raid[name]\n"); - fclose($fd); - - write_config(); - - pfSenseHeader("disks_raid_gvinum.php"); - exit; - } + if (!$input_errors) { + $raid = array(); + $raid['name'] = $_POST['name']; + $raid['type'] = $_POST['type']; + $raid['diskr'] = $_POST['diskr']; + $raid['desc'] = "Software gvinum RAID {$_POST['type']}"; + $raid['fullname'] = "/dev/gvinum/{$raid['name']}"; + + if (isset($id) && $a_raid[$id]) + $a_raid[$id] = $raid; + else + $a_raid[] = $raid; + + $fd = @fopen("$d_raidconfdirty_path", "a"); + if (!$fd) { + echo gettext("ERR Could not save RAID configuration.\n"); + exit(0); + } + fwrite($fd, "$raid[name]\n"); + fclose($fd); + + write_config(); + + pfSenseHeader("disks_raid_gvinum.php"); + exit; + } } include("head.inc"); @@ -176,23 +184,26 @@ echo $pfSenseHead->getHTML(); + $tab_array = array(); + $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gvinum.php"); + /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */ + $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gvinum_tools.php"); + $tab_array[2] = array(gettext("Information"), false, "disks_raid_gvinum_infos.php"); + display_top_tabs($tab_array); +?> @@ -201,7 +212,7 @@ echo $pfSenseHead->getHTML();
- + @@ -213,7 +224,6 @@ echo $pfSenseHead->getHTML(); - @@ -228,7 +238,7 @@ echo $pfSenseHead->getHTML(); $r_name=""; if (strcmp($diskv['fstype'],"raid")==0) { - foreach($a_raid as $raid) { + foreach($all_raid as $raid) { if (in_array($diskv['name'],$raid['diskr'])) { $r_name=$raid['name']; diff --git a/packages/freenas/www/disks_raid_gvinum_infos.php b/packages/freenas/www/disks_raid_gvinum_infos.php index 329c1de1..71a424fa 100644 --- a/packages/freenas/www/disks_raid_gvinum_infos.php +++ b/packages/freenas/www/disks_raid_gvinum_infos.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gvinum_infos.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -59,8 +67,8 @@ if (! empty($_POST)) exit; } - if (!$input_errors) { - } + if (!$input_errors) { + } } if (!isset($do_action)) { } @@ -82,23 +90,26 @@ echo $pfSenseHead->getHTML(); @@ -126,7 +137,7 @@ echo $pfSenseHead->getHTML(); - +
+ $tab_array = array(); + $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gvinum.php"); + /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */ + $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gvinum_tools.php"); + $tab_array[2] = array(gettext("Information"), true, "disks_raid_gvinum_infos.php"); + display_top_tabs($tab_array); +?>
diff --git a/packages/freenas/www/disks_raid_gvinum_init.php b/packages/freenas/www/disks_raid_gvinum_init.php index 46c4b4ef..787c416e 100644 --- a/packages/freenas/www/disks_raid_gvinum_init.php +++ b/packages/freenas/www/disks_raid_gvinum_init.php @@ -1,36 +1,47 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gmirror_init.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ + +/* ========================================================================== */ +/* == T H I S F I L E I S C U R R E N T L Y N O T U S E D == */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), diff --git a/packages/freenas/www/disks_raid_gvinum_tools.php b/packages/freenas/www/disks_raid_gvinum_tools.php index 3fb336f8..343fc221 100644 --- a/packages/freenas/www/disks_raid_gvinum_tools.php +++ b/packages/freenas/www/disks_raid_gvinum_tools.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + disks_raid_gvinum_tools.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("System"), gettext("Disks"), @@ -48,11 +56,12 @@ if (! empty($_POST)) unset($error_bucket); /* simple error list */ unset($input_errors); - - $reqdfields = explode(" ", "action object"); - $reqdfieldsn = explode(",", "Action,Object"); + unset($do_action); - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + $reqdfields = explode(" ", "action object"); + $reqdfieldsn = explode(",", "Action,Object"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (is_array($error_bucket)) foreach($error_bucket as $elem) @@ -64,16 +73,16 @@ if (! empty($_POST)) exit; } - if (!$input_errors) { - $do_action = true; - $action = $_POST['action']; - $object = $_POST['object']; - } -} -if (!isset($do_action)) { - $do_action = false; - $action = ''; - $object = ''; + if (!$input_errors) { + $do_action = true; + $action = $_POST['action']; + $object = $_POST['object']; + } + } + if (!isset($do_action)) { + $do_action = false; + $action = ''; + $object = ''; } include("head.inc"); @@ -93,23 +102,26 @@ echo $pfSenseHead->getHTML(); + $tab_array = array(); + $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gvinum.php"); + /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */ + $tab_array[1] = array(gettext("Tools"), true, "disks_raid_gvinum_tools.php"); + $tab_array[2] = array(gettext("Information"), false, "disks_raid_gvinum_infos.php"); + display_top_tabs($tab_array); +?> @@ -145,47 +157,47 @@ echo $pfSenseHead->getHTML(); - - - + + " . gettext("GVINUM command output:") . "
"); - echo('
');
-      					ob_end_flush();
-      					
-      					switch ($action)
-      					{
-      					case "remove":					
-      						/* Remove recursivly object */
-      						system("/sbin/gvinum rm -r " . escapeshellarg($object));
-      						break;
-      					case "start":
-      						/* Start object */
-      						system("/sbin/gvinum start " . escapeshellarg($object));
-      						break;
-      					case "rebuild":
-      						/* Rebuild RAID 5 parity */
-      						system("/sbin/gvinum rebuildparity " . escapeshellarg($object));
-      						break;
-      					case "list":
-      						/* Disaply a detailed list of object */
-      						system("/sbin/gvinum list " . escapeshellarg($object));
-      						break;
-      					case "forceup":					
-      						/* Force object state up */
-      						system("/sbin/gvinum setstate -f up " . escapeshellarg($object));
-      						break;
-      					case "saveconfig":
-      						/* Save config */
-      						system("/sbin/gvinum saveconfig");
-      						break;
-      					}
-      					
-      					echo('
'); - } - ?> - - + echo("" . gettext("GVINUM command output:") . "
"); + echo('
');
+                ob_end_flush();
+                
+                switch ($action)
+                {
+                case "remove":
+                  /* Remove recursivly object */
+                  system("/sbin/gvinum rm -r " . escapeshellarg($object));
+                  break;
+                case "start":
+                  /* Start object */
+                  system("/sbin/gvinum start " . escapeshellarg($object));
+                  break;
+                case "rebuild":
+                  /* Rebuild RAID 5 parity */
+                  system("/sbin/gvinum rebuildparity " . escapeshellarg($object));
+                  break;
+                case "list":
+                  /* Disaply a detailed list of object */
+                  system("/sbin/gvinum list " . escapeshellarg($object));
+                  break;
+                case "forceup":
+                  /* Force object state up */
+                  system("/sbin/gvinum setstate -f up " . escapeshellarg($object));
+                  break;
+                case "saveconfig":
+                  /* Save config */
+                  system("/sbin/gvinum saveconfig");
+                  break;
+                }
+                
+                echo('
'); + } + ?> + + @@ -201,7 +213,7 @@ echo $pfSenseHead->getHTML();
- + diff --git a/packages/freenas/www/services_afp.php b/packages/freenas/www/services_afp.php index 07410ded..2487c6f7 100644 --- a/packages/freenas/www/services_afp.php +++ b/packages/freenas/www/services_afp.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + services_afp.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Services"), gettext("AFP")); @@ -41,7 +49,7 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); if (!is_array($freenas_config['afp'])) { - $freenas_config['afp'] = array(); + $freenas_config['afp'] = array(); } @@ -57,26 +65,26 @@ if (! empty($_POST)) /* simple error list */ unset($input_errors); $pconfig = $_POST; - + /* input validation */ $reqdfields = split(" ", "afpname"); $reqdfieldsn = split(",", "Afpname"); - + do_input_validation_new($_POST, $reqdfields, $reqdfieldsn, &$error_bucket); - - if ($_POST['enable'] && !$_POST['guest']) - { - if (!$_POST['local']) + + if ($_POST['enable'] && !$_POST['guest']) + { + if (!$_POST['local']) $error_bucket[] = array("error" => gettext("You must select at least one authentication method."), "field" => "local"); - } - if ($_POST['enable'] && !$_POST['local']) - { - if (!$_POST['guest']) + } + if ($_POST['enable'] && !$_POST['local']) + { + if (!$_POST['guest']) $error_bucket[] = array("error" => gettext("You must select at least one authentication method."), "field" => "name"); - } - + } + if (is_array($error_bucket)) foreach($error_bucket as $elem) $input_errors[] =& $elem["error"]; @@ -87,27 +95,27 @@ if (! empty($_POST)) exit; } - if (!$input_errors) - { - $freenas_config['afp']['enable'] = $_POST['enable'] ? true : false; - $freenas_config['afp']['guest'] = $_POST['guest'] ? true : false; - $freenas_config['afp']['local'] = $_POST['local'] ? true : false; - $freenas_config['afp']['afpname'] = $_POST['afpname']; - - write_config(); - - $retval = 0; - if (!file_exists($d_sysrebootreqd_path)) - { - /* nuke the cache file */ - config_lock(); - services_afpd_configure(); - services_zeroconf_configure(); - config_unlock(); - } + if (!$input_errors) + { + $freenas_config['afp']['enable'] = $_POST['enable'] ? true : false; + $freenas_config['afp']['guest'] = $_POST['guest'] ? true : false; + $freenas_config['afp']['local'] = $_POST['local'] ? true : false; + $freenas_config['afp']['afpname'] = $_POST['afpname']; + + write_config(); - $savemsg = get_std_save_message($retval); - } + $retval = 0; + if (!file_exists($d_sysrebootreqd_path)) + { + /* nuke the cache file */ + config_lock(); + services_afpd_configure(); + services_zeroconf_configure(); + config_unlock(); + } + + $savemsg = get_std_save_message($retval); + } } include("head.inc"); @@ -118,13 +126,13 @@ $jscriptstr = << diff --git a/packages/freenas/www/services_nfs.php b/packages/freenas/www/services_nfs.php index b99dd11e..70351bf1 100644 --- a/packages/freenas/www/services_nfs.php +++ b/packages/freenas/www/services_nfs.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + services_nfs.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Services"), gettext("NFS")); @@ -42,14 +50,14 @@ require_once("freenas_functions.inc"); if (!is_array($freenas_config['nfs'])) { - $freenas_config['nfs'] = array(); + $freenas_config['nfs'] = array(); } $pconfig['enable'] = isset($freenas_config['nfs']['enable']); $pconfig['mapall'] = $freenas_config['nfs']['mapall']; list($pconfig['network'],$pconfig['network_subnet']) = - explode('/', $freenas_config['nfs']['nfsnetwork']); + explode('/', $freenas_config['nfs']['nfsnetwork']); if (! empty($_POST)) { @@ -58,26 +66,26 @@ if (! empty($_POST)) /* simple error list */ unset($input_errors); $pconfig = $_POST; - + /* input validation */ - $reqdfields = explode(" ", "network network_subnet"); - $reqdfieldsn = explode(",", "Destination network,Destination network bit count"); - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + $reqdfields = explode(" ", "network network_subnet"); + $reqdfieldsn = explode(",", "Destination network,Destination network bit count"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if (($_POST['network'] && !is_ipaddr($_POST['network']))) { + if (($_POST['network'] && !is_ipaddr($_POST['network']))) { $error_bucket[] = array("error" => gettext("A valid network must be specified."), "field" => "network"); - } - - if (($_POST['network_subnet'] && !is_numeric($_POST['network_subnet']))) { + } + + if (($_POST['network_subnet'] && !is_numeric($_POST['network_subnet']))) { $error_bucket[] = array("error" => gettext("A valid network bit count must be specified."), "field" => "network_subnet"); - - } - - $osn = gen_subnet($_POST['network'], $_POST['network_subnet']) . "/" . $_POST['network_subnet']; - + + } + + $osn = gen_subnet($_POST['network'], $_POST['network_subnet']) . "/" . $_POST['network_subnet']; + if (is_array($error_bucket)) foreach($error_bucket as $elem) $input_errors[] =& $elem["error"]; @@ -88,23 +96,23 @@ if (! empty($_POST)) exit; } - if (!$input_errors) - { - $freenas_config['nfs']['enable'] = $_POST['enable'] ? true : false; - $freenas_config['nfs']['mapall'] = $_POST['mapall']; - $freenas_config['nfs']['nfsnetwork'] = $osn; - write_config(); - - $retval = 0; - if (!file_exists($d_sysrebootreqd_path)) - { - /* nuke the cache file */ - config_lock(); - services_nfs_configure(); - config_unlock(); - } - $savemsg = get_std_save_message($retval); - } + if (!$input_errors) + { + $freenas_config['nfs']['enable'] = $_POST['enable'] ? true : false; + $freenas_config['nfs']['mapall'] = $_POST['mapall']; + $freenas_config['nfs']['nfsnetwork'] = $osn; + write_config(); + + $retval = 0; + if (!file_exists($d_sysrebootreqd_path)) + { + /* nuke the cache file */ + config_lock(); + services_nfs_configure(); + config_unlock(); + } + $savemsg = get_std_save_message($retval); + } } include("head.inc"); @@ -115,17 +123,17 @@ $jscriptstr = << @@ -157,10 +165,10 @@ echo $pfSenseHead->getHTML(); - getHTML(); - / + / + - - + @@ -251,7 +260,7 @@ echo $pfSenseHead->getHTML();
- + diff --git a/packages/freenas/www/services_rsyncd_client.php b/packages/freenas/www/services_rsyncd_client.php index 53d5196b..c1ade277 100644 --- a/packages/freenas/www/services_rsyncd_client.php +++ b/packages/freenas/www/services_rsyncd_client.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + services_rsyncd_client.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Services"), gettext("RSYNCD"), @@ -41,21 +49,14 @@ require_once("guiconfig.inc"); require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); -/* TODO: use pfSense users/groups. */ -if (!is_array($freenas_config['system']['user'])) - $freenas_config['system']['user'] = array(); - -users_sort(); - -$a_user = &$freenas_config['system']['user']; - -if (!is_array($freenas_config['rsync'])) +if (!is_array($freenas_config['rsyncclient'])) { - $freenas_config['rsync'] = array(); + $freenas_config['rsyncclient'] = array(); } $a_months = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $a_weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); +$a_mount = array(); $pconfig['readonly'] = $freenas_config['rsyncd']['readonly']; $pconfig['port'] = $freenas_config['rsyncd']['port']; @@ -64,101 +65,108 @@ $pconfig['maxcon'] = $freenas_config['rsyncd']['maxcon']; $pconfig['rsyncd_user'] = $freenas_config['rsyncd']['rsyncd_user']; $pconfig['enable'] = isset($freenas_config['rsyncd']['enable']); -if (! empty($_POST)) -{ - /* hash */ - unset($error_bucket); - /* simple error list */ - unset($input_errors); - unset($do_format); - $pconfig = $_POST; - - /* input validation */ - if ($_POST['enable']){ - $reqdfields = array_merge($reqdfields, explode(" ", "rsyncserverip sharetosync")); - $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Rsyncserverip,Sharetosync")); - } +if (!is_array($freenas_config['mounts']['mount'])) { + $nodisk_errors[] = gettext("You must configure mount point first."); +} else { + if (! empty($_POST)) + { + /* hash */ + unset($error_bucket); + /* simple error list */ + unset($input_errors); + unset($do_format); + $pconfig = $_POST; - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - - if ($_POST['enable']) { - if (!is_port($_POST['port'])) - $error_bucket[] = array("error" => gettext("The TCP port must be a valid port number."), - "field" => "port"); - else if (!is_numericint($_POST['maxcon'])) - $error_bucket[] = array("error" => gettext("The value provided by the maximum connections field is not a number"), - "field" => "maxcon"); - } + /* input validation */ + if ($_POST['enable']){ + $reqdfields = array_merge($reqdfields, explode(" ", "rsyncserverip sharetosync")); + $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Rsyncserverip,Sharetosync")); + } + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + if ($_POST['enable']) { + if (!is_port($_POST['port'])) + $error_bucket[] = array("error" => gettext("The TCP port must be a valid port number."), + "field" => "port"); + else if (!is_numericint($_POST['maxcon'])) + $error_bucket[] = array("error" => gettext("The value provided by the maximum connections field is not a number"), + "field" => "maxcon"); + } + + if (!is_array($freenas_config['mounts']['mount'])) { + $error_bucket[] = array("error" => gettext("You must configure mount point first."), + "field" => "none"); + } + + if ($_POST['enable'] && !is_ipaddr($_POST['rsyncserverip'])) { + $error_bucket[] = array("error" => gettext("A valid IP address must be specified."), + "field" => "rsyncserverip"); + } - if (!is_array($freenas_config['mounts']['mount'])) { - $error_bucket[] = array("error" => gettext("You must configure mount point first."), - "field" => "none"); + if (is_array($error_bucket)) + foreach($error_bucket as $elem) + $input_errors[] =& $elem["error"]; + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($error_bucket)) { + input_errors2Ajax(NULL, $error_bucket); + exit; + } + + if (!$input_errors) + { + $freenas_config['rsyncclient']['opt_delete'] = $_POST['opt_delete'] ? true : false;; + $freenas_config['rsyncclient']['rsyncserverip'] = $_POST['rsyncserverip']; + $freenas_config['rsyncclient']['minute'] = $_POST['minutes']; + $freenas_config['rsyncclient']['hour'] = $_POST['hours']; + $freenas_config['rsyncclient']['day'] = $_POST['days']; + $freenas_config['rsyncclient']['month'] = $_POST['months']; + $freenas_config['rsyncclient']['weekday'] = $_POST['weekdays']; + $freenas_config['rsyncclient']['rsyncshare'] = $_POST['rsyncshare']; + $freenas_config['rsyncclient']['enable'] = $_POST['enable'] ? true : false; + $freenas_config['rsyncclient']['sharetosync'] = $_POST['sharetosync']; + $freenas_config['rsyncclient']['all_mins'] = $_POST['all_mins']; + $freenas_config['rsyncclient']['all_hours'] = $_POST['all_hours']; + $freenas_config['rsyncclient']['all_days'] = $_POST['all_days']; + $freenas_config['rsyncclient']['all_months'] = $_POST['all_months']; + $freenas_config['rsyncclient']['all_weekdays'] = $_POST['all_weekdays']; + + write_config(); + + $retval = 0; + + if (!file_exists($d_sysrebootreqd_path)){ + /* nuke the cache file */ + config_lock(); + services_rsyncclient_configure(); + services_cron_configure(); + config_unlock(); + } + + $savemsg = get_std_save_message($retval); + } } - if (is_array($error_bucket)) - foreach($error_bucket as $elem) - $input_errors[] =& $elem["error"]; - - /* if this is an AJAX caller then handle via JSON */ - if(isAjax() && is_array($error_bucket)) { - input_errors2Ajax(NULL, $error_bucket); - exit; - } - - if (!$input_errors) - { - $freenas_config['rsyncclient']['opt_delete'] = $_POST['opt_delete'] ? true : false;; - $freenas_config['rsyncclient']['rsyncserverip'] = $_POST['rsyncserverip']; - $freenas_config['rsyncclient']['minute'] = $_POST['minutes']; - $freenas_config['rsyncclient']['hour'] = $_POST['hours']; - $freenas_config['rsyncclient']['day'] = $_POST['days']; - $freenas_config['rsyncclient']['month'] = $_POST['months']; - $freenas_config['rsyncclient']['weekday'] = $_POST['weekdays']; - $freenas_config['rsyncclient']['rsyncshare'] = $_POST['rsyncshare']; - $freenas_config['rsyncclient']['enable'] = $_POST['enable'] ? true : false; - $freenas_config['rsyncclient']['sharetosync'] = $_POST['sharetosync']; - $freenas_config['rsyncclient']['all_mins'] = $_POST['all_mins']; - $freenas_config['rsyncclient']['all_hours'] = $_POST['all_hours']; - $freenas_config['rsyncclient']['all_days'] = $_POST['all_days']; - $freenas_config['rsyncclient']['all_months'] = $_POST['all_months']; - $freenas_config['rsyncclient']['all_weekdays'] = $_POST['all_weekdays']; - - write_config(); - - $retval = 0; - - if (!file_exists($d_sysrebootreqd_path)){ - /* nuke the cache file */ - config_lock(); - services_rsyncclient_configure(); - services_cron_configure(); - config_unlock(); - } - - $savemsg = get_std_save_message($retval); - } -} - -if (is_array($freenas_config['mounts']['mount'])) { - mount_sort(); + mount_sort(); $a_mount = &$freenas_config['mounts']['mount']; - $pconfig['opt_delete'] = isset($freenas_config['rsyncclient']['opt_delete']); - $pconfig['enable'] = isset($freenas_config['rsyncclient']['enable']); - $pconfig['rsyncserverip'] = $freenas_config['rsyncclient']['rsyncserverip']; - $pconfig['rsyncshare'] = $freenas_config['rsyncclient']['rsyncshare']; - $pconfig['minute'] = $freenas_config['rsyncclient']['minute']; - $pconfig['hour'] = $freenas_config['rsyncclient']['hour']; - $pconfig['day'] = $freenas_config['rsyncclient']['day']; - $pconfig['month'] = $freenas_config['rsyncclient']['month']; - $pconfig['weekday'] = $freenas_config['rsyncclient']['weekday']; - $pconfig['sharetosync'] = $freenas_config['rsyncclient']['sharetosync']; - $pconfig['all_mins'] = $freenas_config['rsyncclient']['all_mins']; - $pconfig['all_hours'] = $freenas_config['rsyncclient']['all_hours']; - $pconfig['all_days'] = $freenas_config['rsyncclient']['all_days']; - $pconfig['all_months'] = $freenas_config['rsyncclient']['all_months']; - $pconfig['all_weekdays'] = $freenas_config['rsyncclient']['all_weekdays']; - + $pconfig['opt_delete'] = isset($freenas_config['rsyncclient']['opt_delete']); + $pconfig['enable'] = isset($freenas_config['rsyncclient']['enable']); + $pconfig['rsyncserverip'] = $freenas_config['rsyncclient']['rsyncserverip']; + $pconfig['rsyncshare'] = $freenas_config['rsyncclient']['rsyncshare']; + $pconfig['minute'] = $freenas_config['rsyncclient']['minute']; + $pconfig['hour'] = $freenas_config['rsyncclient']['hour']; + $pconfig['day'] = $freenas_config['rsyncclient']['day']; + $pconfig['month'] = $freenas_config['rsyncclient']['month']; + $pconfig['weekday'] = $freenas_config['rsyncclient']['weekday']; + $pconfig['sharetosync'] = $freenas_config['rsyncclient']['sharetosync']; + $pconfig['all_mins'] = $freenas_config['rsyncclient']['all_mins']; + $pconfig['all_hours'] = $freenas_config['rsyncclient']['all_hours']; + $pconfig['all_days'] = $freenas_config['rsyncclient']['all_days']; + $pconfig['all_months'] = $freenas_config['rsyncclient']['all_months']; + $pconfig['all_weekdays'] = $freenas_config['rsyncclient']['all_weekdays']; + if ($pconfig['all_mins'] == 1){ $all_mins_all = " checked"; } else { @@ -214,49 +222,56 @@ if (is_array($a_mount)) { } } +/* Note: In contrast to FreeNAS we are only using + * three minutes and one hours field(s) + */ $jscriptstr .= << @@ -279,8 +294,9 @@ echo $pfSenseHead->getHTML(); @@ -319,18 +335,18 @@ echo $pfSenseHead->getHTML(); "; - echo $mountv['sharename'] . " (" . $mountv['desc'] . ")
\n"; - $i++; - } + foreach ($a_mount as $mountv) { + echo ""; + echo $mountv['sharename'] . " (" . $mountv['desc'] . ")
\n"; + $i++; + } } else - echo "You must configure mount point before!"; + echo "You must configure mount point before!"; ?>
@@ -356,39 +372,39 @@ echo $pfSenseHead->getHTML();
- " . $i . "\n"; - $i++; - } - ?> + } else { + $is_selected = ""; + } + } + + echo "
+ + + + + + + + diff --git a/packages/freenas/www/services_samba.php b/packages/freenas/www/services_samba.php index 0bb71319..928a6798 100644 --- a/packages/freenas/www/services_samba.php +++ b/packages/freenas/www/services_samba.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + services_samba.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Services"), gettext("CIFS")); @@ -42,11 +50,11 @@ require_once("freenas_functions.inc"); if (!is_array($freenas_config['samba'])) { - $freenas_config['samba'] = array(); + $freenas_config['samba'] = array(); } if (!is_array($freenas_config['mounts']['mount'])) - $freenas_config['mounts']['mount'] = array(); + $freenas_config['mounts']['mount'] = array(); mount_sort(); @@ -58,7 +66,7 @@ $pconfig['serverdesc'] = $freenas_config['samba']['serverdesc']; $pconfig['security'] = $freenas_config['samba']['security']; $pconfig['localmaster'] = $freenas_config['samba']['localmaster']; $pconfig['winssrv'] = $freenas_config['samba']['winssrv']; -$pconfig['hidemount'] = $freenas_config['samba']['hidemount']; +/* $pconfig['hidemount'] = $freenas_config['samba']['hidemount']; */ $pconfig['timesrv'] = $freenas_config['samba']['timesrv']; $pconfig['unixcharset'] = $freenas_config['samba']['unixcharset']; $pconfig['doscharset'] = $freenas_config['samba']['doscharset']; @@ -75,38 +83,38 @@ if (! empty($_POST)) /* simple error list */ unset($input_errors); $pconfig = $_POST; - + /* input validation */ - if ($_POST['enable']) { - $reqdfields = array_merge($reqdfields, explode(" ", "netbiosname workgroup security localmaster")); - $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Netbiosname,Workgroup,Security, Localmaster")); - } - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + if ($_POST['enable']) { + $reqdfields = array_merge($reqdfields, explode(" ", "netbiosname workgroup security localmaster")); + $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Netbiosname,Workgroup,Security, Localmaster")); + } + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if (($_POST['netbiosname'] && !is_domain($_POST['netbiosname']))) { + if (($_POST['netbiosname'] && !is_domain($_POST['netbiosname']))) { $error_bucket[] = array("error" => gettext("The Netbios name contains invalid characters."), "field" => "netbiosname"); - } - if (($_POST['workgroup'] && !is_domain($_POST['workgroup']))) { + } + if (($_POST['workgroup'] && !is_domain($_POST['workgroup']))) { $error_bucket[] = array("error" => gettext("The Workgroup name contains invalid characters."), "field" => "workgroup"); - } - if (($_POST['winssrv'] && !is_ipaddr($_POST['winssrv']))) { + } + if (($_POST['winssrv'] && !is_ipaddr($_POST['winssrv']))) { $error_bucket[] = array("error" => gettext("The WINS server must be an IP address."), "field" => "winssrv"); - } - - if (!is_numericint($_POST['sndbuf'])) { + } + + if (!is_numericint($_POST['sndbuf'])) { $error_bucket[] = array("error" => gettext("PediaXThe SND Buffer value must be a number."), "field" => "sndbuf"); - } - - if (!is_numericint($_POST['rcvbuf'])) { + } + + if (!is_numericint($_POST['rcvbuf'])) { $error_bucket[] = array("error" => gettext("The RCV Buffer value must be a number."), "field" => "rcvbuf"); - } - + } + if (is_array($error_bucket)) foreach($error_bucket as $elem) $input_errors[] =& $elem["error"]; @@ -117,36 +125,36 @@ if (! empty($_POST)) exit; } - if (!$input_errors) - { - $freenas_config['samba']['netbiosname'] = $_POST['netbiosname']; - $freenas_config['samba']['workgroup'] = $_POST['workgroup']; - $freenas_config['samba']['serverdesc'] = $_POST['serverdesc']; - $freenas_config['samba']['security'] = $_POST['security']; - $freenas_config['samba']['localmaster'] = $_POST['localmaster']; - $freenas_config['samba']['winssrv'] = $_POST['winssrv']; - $freenas_config['samba']['hidemount'] = $_POST['hidemount']; - $freenas_config['samba']['timesrv'] = $_POST['timesrv']; - $freenas_config['samba']['doscharset'] = $_POST['doscharset']; - $freenas_config['samba']['unixcharset'] = $_POST['unixcharset']; - $freenas_config['samba']['loglevel'] = $_POST['loglevel']; - $freenas_config['samba']['sndbuf'] = $_POST['sndbuf']; - $freenas_config['samba']['rcvbuf'] = $_POST['rcvbuf']; - $freenas_config['samba']['recyclebin'] = $_POST['recyclebin'] ? true : false; - $freenas_config['samba']['enable'] = $_POST['enable'] ? true : false; - - write_config(); - - $retval = 0; - if (!file_exists($d_sysrebootreqd_path)) { - /* nuke the cache file */ - config_lock(); - services_samba_configure(); - services_zeroconf_configure(); - config_unlock(); - } - $savemsg = get_std_save_message($retval); - } + if (!$input_errors) + { + $freenas_config['samba']['netbiosname'] = $_POST['netbiosname']; + $freenas_config['samba']['workgroup'] = $_POST['workgroup']; + $freenas_config['samba']['serverdesc'] = $_POST['serverdesc']; + $freenas_config['samba']['security'] = $_POST['security']; + $freenas_config['samba']['localmaster'] = $_POST['localmaster']; + $freenas_config['samba']['winssrv'] = $_POST['winssrv']; + /* $freenas_config['samba']['hidemount'] = $_POST['hidemount']; */ + $freenas_config['samba']['timesrv'] = $_POST['timesrv']; + $freenas_config['samba']['doscharset'] = $_POST['doscharset']; + $freenas_config['samba']['unixcharset'] = $_POST['unixcharset']; + $freenas_config['samba']['loglevel'] = $_POST['loglevel']; + $freenas_config['samba']['sndbuf'] = $_POST['sndbuf']; + $freenas_config['samba']['rcvbuf'] = $_POST['rcvbuf']; + $freenas_config['samba']['recyclebin'] = $_POST['recyclebin'] ? true : false; + $freenas_config['samba']['enable'] = $_POST['enable'] ? true : false; + + write_config(); + + $retval = 0; + if (!file_exists($d_sysrebootreqd_path)) { + /* nuke the cache file */ + config_lock(); + services_samba_configure(); + services_zeroconf_configure(); + config_unlock(); + } + $savemsg = get_std_save_message($retval); + } } include("head.inc"); @@ -157,38 +165,38 @@ $jscriptstr = << @@ -203,11 +211,25 @@ echo $pfSenseHead->getHTML(); "> - - -
-
- + +
+ + + + + + +
+ +
+
+ + + +
- - - -
@@ -219,10 +241,10 @@ echo $pfSenseHead->getHTML();
- getHTML();
-
-
- getHTML();
- getHTML();
- getHTML();
- $mountv[sharename]
\n"; - $i++; - } - ?> -
- -
@@ -405,7 +411,11 @@ echo $pfSenseHead->getHTML();
- +
+
+ + +EOD; + +$pfSenseHead->addScript($jscriptstr); +echo $pfSenseHead->getHTML(); + +?> + +"> + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + onClick="enable_change(false)" />  + +
+ +
+ .
+ + +
+ /> + +
  + " /> +
  + + : + +
+ SSHD must be enabled for Unison to work, and the user must have Full Shell enabled."); ?> +
+
+ + + + + diff --git a/packages/freenas/www/status_disks.php b/packages/freenas/www/status_disks.php index 7ab8bed8..704bc467 100644 --- a/packages/freenas/www/status_disks.php +++ b/packages/freenas/www/status_disks.php @@ -1,36 +1,44 @@ . - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + status_disks.php + part of pfSense (http://www.pfSense.com) + Copyright (C) 2006 Daniel S. Haischt + All rights reserved. + + Based on FreeNAS (http://www.freenas.org) + Copyright (C) 2005-2006 Olivier Cochard-Labbé . + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ $pgtitle = array(gettext("Status"), gettext("Disks")); @@ -40,8 +48,8 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); if (!is_array($freenas_config['disks']['disk'])) - $freenas_config['disks']['disk'] = array(); - + $freenas_config['disks']['disk'] = array(); + disks_sort(); $raidstatus=get_sraid_disks_list(); @@ -68,8 +76,8 @@ echo $pfSenseHead->getHTML(); Size Description Status - - + + @@ -85,10 +93,10 @@ echo $pfSenseHead->getHTML(); $stat=disks_status($disk); echo $stat;?>  - - - - $diskv): ?> + + + + $diskv): ?> @@ -103,16 +111,16 @@ echo $pfSenseHead->getHTML();   - - - + + + -- cgit v1.2.3