PDA

View Full Version : Plugin: Login without pass - unauthorized



sde
04-28-2008, 12:01 AM
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.


$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.

nobaloney
04-28-2008, 08:42 PM
Mike,

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

Jeff

sde
04-28-2008, 09:15 PM
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 :)

sde
04-28-2008, 11:40 PM
Confirmed.

nobaloney
04-29-2008, 10:16 AM
Glad to hear it.

Jeff