/******************************************************************************
* 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: setupNetworkV4.htm 1.5.1.7 2007/08/14 15:13:22MDT Bill Gray (bgray) dev $
* $ADICCopyright: Copyright 2007 Quantum Corp. $
*******************************************************************************/
include('common_admin_inc.htm');
$IPv6Enabled = is_ipv6_enabled();
class CNetInfoV4
{
var $hostname;
var $dhcpEnabled;
var $ip;
var $gateway;
var $netmask;
function CNetInfoV4( $aHostName, $aUseDHCP, $aIpAddr, $aGateway, $aNetmask )
{
$this->hostname = $aHostName;
$this->dhcpEnabled = $aUseDHCP;
$this->ip = $aIpAddr;
$this->gateway = $aGateway;
$this->netmask = $aNetmask;
}
};
// Handle the progress screen if opened and get the NEW data
if ($_SERVER[REQUEST_METHOD] == "POST")
{
$operationInProgress = true;
$status = new ReturnStatus();
$netInfo = new CNetInfoV4($_POST['hostname'], $_POST['useDHCP'], $_POST['ipAddress'], $_POST['gateway'], $_POST['netmask']);
error_log("Setting Network with: ". $_POST['hostname'] .", ". $_POST['useDHCP'].", ".$_POST['ipAddress'].", ". $_POST['gateway'].", ". $_POST['netmask'] );
error_log("Sending: " . print_r($netInfo, true) );
set_network_configuration_ipv4($user, $netInfo );
// Only do the DNS is IPv6 is NOT enabled.
if( ! $IPv6Enabled && ! isset($_POST['useDHCP']) )
{
// 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 );
}
//error_log("Back from extentions - waiting 30 seconds to continue:");
// Give the spawned thread a few seconds to complete so we don't refresh the page with the OLD data
// This happens if the user just changes the host name or DNS without changing the IP address or DHCP
// sleep( 30 );
//error_log("30 seconds is over - the progress window should show now....");
print $status->closeOut(2); // Close the Browser
/*
echo "";
print $status->out();
error_log("Distroying the Session in updateSoftware");
session_destroy();
unset( $_SESSION['login'] );
unset( $_SESSION['user'] );
unset( $_SESSION );
error_log("Exiting now!!!");
exit(0);
*/
return;
}
else
{
// Load stuff up for the first time
$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) );
}
?>
Setup - Network IPv4 | |
Select DHCP to obtain an IP address automatically.
Modifying these settings will restart your network services such as web login. Logins and connections will be lost! if( $IPv6Enabled ){ ?> Select the network settings you would like to modify on the library with the hostname "=$netConf->hostname?>": }else{ ?> Select the network settings you would like to modify: } ?> |