/******************************************************************************
* Copyright 1991-2006 by Quantum, Inc. All rights reserved.
* No part of this work may be reproduced or transmitted in any
* form or by any means, electronic or mechanical, including
* photocopying and recording, or by any information storage
* or retrieval system, except as may be expressly permitted by
* the 17 U.S.C. section 101, et. seq., or in writing by
* Quantum, Inc.
*******************************************************************************/
/******************************************************************************
* Name: setupNetwork.htm
* Purpose: Setup the network paramiters
* $Id: setupNetwork.htm 1.33.1.4 2007/07/18 11:36:05MDT Bill Gray (bgray) dev $
* $ADICCopyright: Copyright 2007 Quantum Corp. $
*******************************************************************************/
include('common_admin_inc.htm');
//set_ipv6_enabled( $user, true ); // !?! Set for testing......
//error_log("\n\n\n* * * * S E T I P v 6 t o " . (is_ipv6_enabled()?"E N A B L E D":"D I S A B L E D") . " * * * *\n\n\n");
$IPv6Enabled = is_ipv6_enabled();
// If IPv6 is not enabled don;t bother with the IPv6 stuff
// just go the the original IPv4 page.
if( ! $IPv6Enabled )
{
// Redirect to the IPv4 page
header('location:setupNetworkV4.htm');
}
// Handle the progress screen if opened and get the NEW data
if ($_SERVER[REQUEST_METHOD] == "POST")
{
error_log("IN POST in setupnetwork.htm");
$operationInProgress = true;
$status = new ReturnStatus();
// Save the new Hostname.
set_network_hostname( $user, $_POST['hostname'] );
// Save the New DNS
class CDns
{
var $dnsPrimary;
var $dnsSecondary;
function CDns( $aDnsPrimary, $aDnsSecondary )
{
$this->dnsPrimary = $aDnsPrimary;
$this->dnsSecondary = $aDnsSecondary;
}
};
$dns = new CDns( $_POST['dnsPrimary'], $_POST['dnsSecondary'] );
set_network_dns($user, $dns );
// Changing the hostname or DNS does not require the browser to lose communications with the server
// So we can just do a out()
print $status->out();
return;
}
else
{
// Load stuff up for the first time - We need the hostname fro this page
$netConf = get_network_configuration_ipv4( $user );
error_log("netConf = ". print_r($netConf, true) );
// print_r( $netConf );
// echo "
";
// var_dump( $netConf );
$dns = get_network_dns($user);
error_log("dns = ". print_r($dns, true) );
if( $IPv6Enabled )
{
error_log("IPv6 is enabled to calling it's functions.");
$netConfV6 = get_network_configuration_ipv6( $user );
error_log("netConfV6 = ". print_r($netConfV6, true) );
}
}
// See if we should auto select one of the selection
//error_log( "_GET[selection] =" . $_GET['selection'] );
if( isset($_GET['selection']) )
$forceSel = $_GET['selection'];
else
$forceSel = -1;
?>