Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Changing password on cPanel updating on other database

Discussion in 'cPanel Developers' started by Glazzito, Nov 16, 2010.

  1. Glazzito

    Glazzito Member

    Joined:
    Oct 21, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Portugal
    Hello..

    I'm wondering if it is possible to when a client change's his password on cPanel, it will send the password to a another script ( PHP ) to update my clients database..

    I need to know if it is possible because, i'm developing a custom client area where my clients are going to be able to customize all of the hosting account without entering the cPanel... But if a client changes the password on the cPanel i'm not going to be able to use my interface anymore, because the password i will have is not going to be correct..

    I have the passwords encrypted, but they can be encrypted using my own algorithm..


    Sorry for my rusty english ;)


    Thanks in advance!
     
  2. MattDees

    MattDees Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I think that the Universal Password Trap is what you are looking for:

    Universal Password Trap

    This allows you to execute custom code whenever a password is modified in cpanel.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Glazzito

    Glazzito Member

    Joined:
    Oct 21, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Portugal
    Thank you, i believe thats it..
    But i dont have the know how on how to do this, i have read the documentation on that, and i have seen the example too, but i dont know if this way will work.

    Code taken from stackoverflow.com/
    Code:
    exec('/usr/bin/php', 'myscript.php', @arguments);
    There is another example:
    Code:
    require LWP::UserAgent;
    
     my $ua = LWP::UserAgent->new;
     $ua->timeout(10);
     $ua->env_proxy;
    
     my $response = $ua->get('http://me.com/phpscript.php?foo=bar');
    
     if ($response->is_success) {
         print $response->decoded_content;  # or whatever
     }
     else {
         die $response->status_line;
     }
    But honestly i don't know if both works or not =s
     
  4. MattDees

    MattDees Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you're familiar with PHP, I would advise using the exec method (actually I would advise using system() with the same parameters, exec() will exit once it finishes, system will not).

    Just pass in whatever data via @ARGV and do whatever magic you need to do.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Glazzito

    Glazzito Member

    Joined:
    Oct 21, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Portugal
    Ok, thank you for your quick answers i will try it out for sure ;)

    Thanks again!

    - G l a z z
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice