The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Update client contact info

Discussion in 'General Discussion' started by jcsolutions, Nov 22, 2002.

  1. jcsolutions

    jcsolutions Well-Known Member

    Joined:
    Nov 4, 2002
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    I am trying to update my clients' control panel email address from a php form on my website. My php script should log into the client's account, pass the email variable to saveemail.html, and update their address.

    Unfortunately, it appears that saveemail.html doesn't pick up the passed variable.

    Would anyone have any ideas on how to do this? Here's what I've been working with:

    // update control panel email address
    // $host is already defined
    $socket = fsockopen($host,2082);
    $user = &$username&;
    $password = $value['password'];
    $authstr = &$user:$password&;
    $pass_cp = base64_encode($authstr);
    $in = &GET saveemail.html?email=$email HTTP/1.0\r\nAuthorization: Basic $pass_cp \r\n&;
    fputs($socket,$in);
    fclose($socket);

    I've also tried
    $in = &GET /frontend/vertex/saveemail.html?email=$email HTTP/1.0\r\nAuthorization: Basic $pass_cp \r\n&;

    and
    $in = &GET http://$host/frontend/vertex/saveemail.html?email=$email HTTP/1.0\r\nAuthorization: Basic $pass_cp \r\n&;

    Any help is greatly appreciated!
     
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    try changing
    $in = &GET http://$host/frontend/vertex/saveemail.html?email=$email HTTP/1.0\r\nAuthorization: Basic $pass_cp \r\n&;

    to

    $in = &GET http://$host:2082/frontend/vertex/saveemail.html?email=$email HTTP/1.0\r\nAuthorization: Basic $pass_cp \r\n&;

    Adding the port.
     
  3. jcsolutions

    jcsolutions Well-Known Member

    Joined:
    Nov 4, 2002
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    Thanks for the quick reply David.

    Unfortunately, adding the host and port didn't work either.
     
  4. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Could you pm me the entire script to look at?
     
  5. jcsolutions

    jcsolutions Well-Known Member

    Joined:
    Nov 4, 2002
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    [quote:b02fe85c02][i:b02fe85c02]posted by dgbaker[/i:b02fe85c02]
    Could you pm me the entire script to look at?[/quote:b02fe85c02]
    I would, but it's 1326 lines! :) I'm integrating small requirements like this email address update into a pre-built script I found called Service Support Manager (SSM).

    Essentially, my entire script is what I already put in my original message. I just use the variable values from the original SSM script for $host, $user, and $password. I've tried printing the values to the screen to make sure they are correct, and they are.

    When a client updates their info in SSM, I want that info to be updated in their control panel as well. I've got the password update working no problem, but this email update is a bit tricky.

    If you (or anyone) can modify the code I've got, or come up with a new approach, that'd be great. I really need to be able to do this somehow, but I'm stuck for ideas right now.

    Thanks.
     
Loading...

Share This Page