/****************************************************************************** * Copyright 1991-2007 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 * ADIC, Inc. *******************************************************************************/ /*############################################################################## # NOTE: The XAJAX stuff MUST be before any Code. # You MUST use both the name and id in all form data to use it in xajax. # Groups of controls like raidoButtons need to all have the SAME name # but different IDs. ##############################################################################*/ require_once("xajax_core/xajax.inc.php"); $xajax = new xajax(); $xajax->registerFunction("getEKM"); session_start(); $user = $_SESSION['user']; $in_xAjax = false; $xAjax_objResponse; include('IOB_inc.htm'); include('common_admin_inc.htm'); class EKMdata { var $primaryIP; var $primaryPort; // default is 3801 (decimal) var $secondaryIP; var $secondaryPort; // default is 3801 (decimal) function EKMdata( $primaryIP, $primaryPort, $secondaryIP, $secondaryPort ) { $this->primaryIP = $primaryIP; $this->primaryPort = $primaryPort; $this->secondaryIP = $secondaryIP; $this->secondaryPort = $secondaryPort; } }; // The php function that is called from JavaScript tough xAjax when the user selects a Blade. function getEKM() { // !?! NOTE: Not using this function - but I left it incase I wanted to switch to using it in the future. global $in_xAjax; // global $xAjax_objResponse; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); /// $in_xAjax = true; error_log("Calling get_ekm($user);"); $ekm_data = get_ekm( $user ); error_log("ekm_data = ". print_r($ekm_data, true) ); $xAjax_objResponse->assign("primIP", "value", $ekm_data->primaryIP ); $xAjax_objResponse->assign("primPort", "value", $ekm_data->primaryPort ); $xAjax_objResponse->assign("secIP", "value", $ekm_data->secondaryIP ); $xAjax_objResponse->assign("secPort", "value", $ekm_data->secondaryPort ); // Some Debug examples //$xAjax_objResponse->script('alert(xajax.$("testlevel[1]").value);'); //$xAjax_objResponse->script('alert(xajax.viewSource());'); /// $in_xAjax = false; return $xAjax_objResponse; } $xajax->processRequest(); /*******************************************************************************************/ // Handle the progress screen if opened and set the NEW data if ($_SERVER[REQUEST_METHOD] == "POST") { $operationInProgress = true; $status = new ReturnStatus(); $thePrimIP = $_POST['primIP']; $thePrimPort = (int)$_POST['primPort']; $theSecIP = $_POST['secIP']; $theSecPort = (int)$_POST['secPort']; $ekm_data = new EKMdata($thePrimIP, $thePrimPort, $theSecIP, $theSecPort); error_log("The data being set is: ". print_r($ekm_data, true) ); set_ekm( $user, $ekm_data ); print $status->out(); return; } else { // Load the data up on the get of the page. $ekm_data = get_ekm( $user ); } ?>
$xajax->printJavascript(); ?>