Plugin: Login without pass - unauthorized

sde

Verified User
Joined
Sep 11, 2004
Messages
213
Location
Temecula, CA
I'm using the lastest version of the PHP HTTPSocket class from within a plugin. The following code will work if I pass a valid password argument, but when don't, I get an 'unathorized' error.

Code:
$sock = new HTTPSocket;

$sock->connect($_SERVER['SERVER_ADDR'], $_SERVER['SERVER_PORT']);
$sock->set_login($_SERVER['USERNAME']);
$sock->query('/CMD_API_SHOW_USER_CONFIG');
$result = $sock->fetch_result();

From what I understand, I should be able to use this command, as a user, without sending a password if I am using it from within an installed DA plugin.
 
Mike,

I seem to remember that you mentioned to me that you might have a fix for this. Do you?

Jeff
 
Yes, I haven't had a chance to open the project today yet, but John mentioned that the issue is most likely that I'm not using '127.0.0.1'.

To use the httpsocket class inside a plugin, and not have to pass the password in, you need to use the localhost. Makes sense to me :)
 
Back
Top