Barry,
there are some basic errors in the script, it doesn't create any child account as the saveaccount.php file is incorrect
all
variable definitions are incorrect as they come from GET and POST
operations, but in the script they are simply defined as $variable
instead of something like $_REQUEST/POST/GET['variable']
I changed saveaccount.php from:
elseif ($operation == "create")
{
// The CreateAccount page is asking us to create a new account under this master/AppKey
$xml = $accounting->CreateChildAccount($sessionToken, $account, $password, $firstname,
$lastname, $middleinitial, $phonenumber, $emailaddress, $emailformat,
$addressline1, $addressline2, $city, $state, $countryID, $postalcode);
}
to
elseif ($_REQUEST['operation'] == "create")
{
// The CreateAccount page is asking us to create a new account under this master/AppKey
$xml = $accounting->CreateChildAccount($sessionToken, $_REQUEST['account'], $_REQUEST['password'], $firstname,
$lastname, $middleinitial, $phonenumber, $emailaddress, $emailformat,
$addressline1, $addressline2, $city, $state, $countryID, $postalcode);
}
and the account gets created and displays correctly in the
NMP control panel. Btw, the above is only a partial modification, actually all variables need to be corrected. Deleting the account doesn't
work either (same variable issue) see below for the correct version (teste and it works)
if you find any errors let me know...
hope it helps
ciao
Luca
<?php
/****
Author: Nirvanix
Date: 10-20-2007
Website: http://developer.nirvanix.com/
License: See http://developer.nirvanix.com/content/license.aspx
Limited Permissive License
This license governs use of the accompanying software. If you use the software,
you accept this license. If you do not accept the license, do not use or distribute
the software.
****/
// start the session for userData.
session_start();
$pagetitle = "Delete Account";
require_once "header.php";
require_once "NirvanixAPI/Accounting.php";
require_once "NirvanixAPI/Authentication.php";
// Create an Accounting object.
$accounting = new Accounting();
// Get a sessionToken
$auth = new Authentication();
$stxml = $auth->Login($_SESSION['userData']['username'], $_SESSION['userData']['password'],
$_SESSION['userData']['appKey']);
$sessionToken = $stxml[0]["children"][1]["tagData"];
// Check to see if the user has confirmed the operation.
if (isset($_REQUEST['confirmed']))
{
// call to delete the account.
// THIS WILL DELETE ALL FILES UNDER THE CHILD ACCOUNT.
$accounting->DeleteChildAccount($sessionToken, $_REQUEST['account']);
?>
<div class="container">
<h4><?php echo htmlspecialchars($_REQUEST['account']); ?> was deleted successfully.</h4>
<a href="browse.php">Return</a>
</div>
<?php
}
else
{
?>
<div class="container">
<h4>Are you sure you wish to delete the account: <?php
echo htmlspecialchars($_REQUEST['account']); ?></h4><font
size="-1">*All Files will be removed as well.</font><br
/>
<form ENCTYPE="multipart/form-data" action="deleteaccount.php" method="post">
<input type="hidden" name="account" value="<?php echo $_REQUEST['account'] ?>">
<input type="hidden" name="confirmed" value="true">
<input type="submit" value="Delete Child Account"/>
<input type="Button" value="Cancel" onClick="BLOCKED SCRIPT
location.href='browse.php?account=<?php echo $_REQUEST['account'];
?>'; return true;">
</form>
</div>
<?php
}
// Cleanup session
$auth->Logout($sessionToken);
require_once "footer.php";
?>