• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Release] Simple Register

Experienced Elementalist
Joined
Feb 7, 2010
Messages
213
Reaction score
15
PHP:
<?php
if (isset($_POST['name'])
    && isset($_POST['password']))
    {
    echo '<h1>ADDED!</h1><div style="display:none;">';    
$name = $_POST['name']; 
$password = $_POST['password'];
        
        
require_once( 'HessianClient.php' ); 

require_once('./accountApi.inc.php');
require_once('./ServerVersion.inc.php');

$url = 'http://127.0.0.1:9337';
$version = 8;

// echo "URL = $url\n";

$serverVer = new ServerVersion($url, 'AccountAPI');
$path = $serverVer->getVersionPath($version);
if (is_null($path)) {
  // echo "Supported versions are:\n";
  $versions = $serverVer->getSupportedVersions();
  // print_r($versions);
  // echo "\n";
  die("api version $version not supported");
} 

// echo "Path = $path\n";

$proxy = new HessianClient($url . $path); 

registerAccountMethods($url . $path);

$result = $proxy->createAccountEx($name, $password, AccessLevel::User(), AccountStatus::Active());
echo '</div>';
if ($result->isOk()) {
  echo "Created!\n";
} else {
  echo "Failed! " . $result->toString();
}

// echo "\nDEBUG\n";
var_export($result);

// echo "\nDEBUG\n";
$result = $proxy->getAccountStatus($name);
var_export($result);

$proxy->setAccountStatus($name, AccountStatus::Active());

// echo "\nDEBUG\n";
$result = $proxy->getAccountStatus($name);
var_export($result);

} else {
?>


<h1>JustOds - Game Register</h1>
<div style="width:450px;margin:0 auto 0; text-align:center;">
<form method="post">
        <p>Accountname:<br/><input value="" type="text" name="name" /></p>
        <p>Password:<br/><input value="" type="password" name="password" /></p>
        <p><center><input value="Register" type="submit" name="submit" /></center></p>
    </form>
</div>
<?php
}
?>
:ehh:
 
Newbie Spellweaver
Joined
Apr 20, 2012
Messages
9
Reaction score
0
Re: Simple Register

Doesn't work, please update it.
 
Back
Top