PDA

View Full Version : Getting / Updating the User Email


sde
10-21-2004, 09:13 AM
I'm trying to sync up the da info with my datbase of customers and their info.

The only critical ID information i see is the email address. This email address is the one that you see and can update when you view "Site Summary / Statistics / Logs"

When a user updates their information in my custom interface, which function would i use to update this field in da?

Save User Email
-or-
Save User Email for Ticket/Messaging system

my second question is what command do i use to get this email address?

toothbrush
10-21-2004, 11:35 AM
I think you will want /CMD_CHANGE_INFO

HTH

edit: just checked in the control panel, this is the correct one.

sde
10-21-2004, 12:01 PM
thanks. i can't quite get it to work. is this how it should look?
<?
$sock = new HTTPSocket;
$sock->connect('1.2.3.4',2222);
$sock->set_login('admin','pass');

$sock->set_method('POST');
$sock->query('/CMD_CHANGE_INFO',
array(
'evalue' => 'sde@mydomain.com',
'domain' => 'mydomain.com',
'email' => 'Save'
));
$result = $sock->fetch_parsed_body();
?>

toothbrush
10-21-2004, 12:05 PM
I'm far from experienced, yet it looks good to me... What exactly is the error (or the output from $result at least, as it should be text in the event of an error)?

sde
10-21-2004, 12:19 PM
$result is an array, and $array[0] is all the html to makeup the page, .. in this html, it shows the email as the new email address, .. however when i log into the control panel, it is my old email address.

sde
10-21-2004, 12:25 PM
it's cause i was logging in as admin. you need to login as the user for /CMD_CHANGE_INFO.

i think i'm understanding better .. so when i do it from the control panel as admin, it uses CMD_MODIFY_USER

but does this mean i have to pass in ALL those values for CMD_MODIFY_USER in order to just change the email address? or can I just pass in the email address as the third parameter?

toothbrush
10-21-2004, 11:01 PM
Originally posted by sde
it's cause i was logging in as admin. you need to login as the user for /CMD_CHANGE_INFO.

i think i'm understanding better .. so when i do it from the control panel as admin, it uses CMD_MODIFY_USER

> yes, this is correct

but does this mean i have to pass in ALL those values for CMD_MODIFY_USER in order to just change the email address? or can I just pass in the email address as the third parameter?

I don't know if you'll have to pass all the variables to CMD_MODIFY_USER as admin, but I think that for your purpose it would surely be easier to use CMD_CHANGE_INFO, as at the time of the update the user's name and password should be available to use to login with the API.

HTH