Create Custom Authority

Post here if you need help setting up your server, etc.
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Create Custom Authority

Post by Z-Man »

That looks like an OK response with some default HTML content. Armaauth wants plain text content. You set the second auth up incorrectly, it seems. Compare (this is the first request sent by the server to the authority):
http://lifeclan.x10.bz/armaauth/0.1/?query=methods
http://tweb.x10.bz/armaauth/0.1/?query=methods
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: Create Custom Authority

Post by LOVER$BOY »

@Z-Man Ah ok. Well I guess that's not what I need...

Well thanks anyway ... i guess i still got to search around or ask people around.

@treclink Are you sure you created that account? If you did, did you place the "index.php" file under http://tweb.x10.bz/armaauth/0.1/ directory or else it won't work.

Some servers don't let custom authorities to work in their field because they said "It's not in the server's white-list."

It may be also that your hosting has a server error (happens sometimes) but that usually happens in the beginning and then quickly is fixed.
Image
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: Create Custom Authority

Post by LOVER$BOY »

Z-Man, I think I figured out how to use the database system for the armaauth/0.1/index.php. The code's below:

Code: Select all

function getPassword( $user ) {
   $sql_server = "localhost";
	$sql_server_usr = "sql_username";
	$sql_server_pas = "sql_password";

	$mysql = mysql_connect($sql_server, $sql_server_usr, $sql_server_pas) or die("mysql_error");
	mysql_select_db("sql_database", $mysql) or die("mysql_error");

	$usr_username = addslashes($user);

	$check = mysql_query('SELECT * FROM table_name WHERE user_column = "'.$usr_username.'"') or die("mysql_error");
	$info = mysql_fetch_array($check) or die("mysql_error");
	$usr_password = $info["pass_column"];
	mysql_close($mysql) or die("mysql_error");
	
    	/*$passwords= array (   
         'username' => 'password'
        );
    	*/
     	$passwords[$user] = $usr_password;

    $password = $passwords[ $user ];
    if ( NULL == $password )
        return NULL;

    return array( $user, $password );
}
I've tested it and it works like a charm :D
Image
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Create Custom Authority

Post by Z-Man »

Yeah, but that only works if the database stores unencrypted passwords, something you should never do.
(Granted, the main weakness of our authentication currently is that even if the database only stores hashes, it's still possible to log in with them in the game, but at least you can't hijack the attached web account.)

On a completely unrelated note, I'm on vacation and only have unexpectedly sporadic net access.
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: Create Custom Authority

Post by LOVER$BOY »

ah ok.

well that's the headache ... im trying to figure out a way to encrypt and decrypt but idk how to ... my knowledge of php is similar to what a baby knows about php :P

Have a safe vacation :)
Image
Post Reply