GetCurrentSiteAddress(); GetServerSelection( $selectedServerID, $selectedServer ); $serverRec = GetDataForServer( $selectedServer ); if ( $serverRec == NULL ) throw new Exception( sprintf( $errNotFound, $selectedServer ) ); if ( !$serverRec->poweredUp ) throw new Exception( sprintf( $errServerIsDown, $selectedServer ) ); // Get props values from server $serverAdmin = new MgServerAdmin(); $serverAdmin->Open( $selectedServer, $userInfo ); $mappings = GetUnmanagedDataMappings( $serverAdmin ); // Is this our first time here? if ( FirstTimeHere( $pageName ) ) { // Was the selected user passed in the URL? if ( array_key_exists( $selectedMappingID, $_GET ) ) $selectedMapping = $_GET[ $selectedMappingID ]; // Get info for selected user $mappingName = $selectedMapping; $location = $mappings[ $mappingName ]; $serverAdmin->Close(); } // The save button was hit. else { // Get submitted data if ( array_key_exists( $mappingNameID, $_POST ) ) $mappingName = $_POST[ $mappingNameID ]; if ( array_key_exists( $locationID, $_POST ) ) $location = $_POST[ $locationID ]; // Validate inputs. if ( empty( $mappingName ) ) throw new Exception( $errMappingNameMissing ); if ( empty( $location ) ) throw new Exception( $errLocationMissing ); // Update parameters of user. SetUnmanagedDataMapping( $serverAdmin, $mappingName, $location ); if ($mappingName != $selectedMapping) { DeleteUnmanagedDataMapping( $serverAdmin, $selectedMapping ); } $serverAdmin->Close(); // Everything is OK. $confirmationMsg = sprintf( $confSuccessfulAddition, $mappingName ); $selectedMapping = $mappingName; SaveSessionVars(); header( 'Path to External File: unmanageddatamanagement.php?'.strip_tags(SID) ); exit(); } } catch ( MgException $e ) { CheckForFatalMgException( $e ); $errorMsg = $e->GetMessage(); } catch ( Exception $e ) { $errorMsg = $e->getMessage(); } ?>
Alias Name:
Path to External Folder: