<?php
include './core.php';

if( !isset( $user ) || !$user->access['root'] ) access_error();

$accounts = $MySQL->query( "SELECT accountid FROM server.accounts" );

while( $row = $MySQL->fetch_array( $accounts ) )
{
	$cAcc = new Account( (int)$row['accountid'] );
	
	if( $cAcc->rank == 9 && $cAcc->group != 4 )
	{
	    if( $cAcc->rank > 12 )
	       $level = "Administrator";
	    else 
	       $level = "GameMaster";
	    
	    echo "<account>\n";
	    echo "  <username>$cAcc->name</username>\n";
	    echo "  <password>$cAcc->password</password>\n";
	    echo "  <accessLevel>$level</accessLevel>\n";
	    echo "  <created />\n";
	    echo "  <lastLogin />\n";
	    echo "  <chars />\n";
	    echo "  <addressList />\n";
	    echo "</account>\n\n";
	}
}

?>