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!

Change CPanel/MySQL password for user at the same time

Discussion in 'General Discussion' started by monks, Mar 15, 2006.

  1. monks

    monks Registered

    Joined:
    Dec 30, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    151
    This is my first post.

    I´ve done som searching and couldn´t find what i was looking for.
    Currently I´v got at php page in my customers cpanel that let them change their cpanel password. The php page does that with this function:

    PHP:
    function changepass ($host,$user,$accesshash,$usessl,$acctpass,$acctuser) {
        
    $result whmreq("/scripts/passwd?remote=1&nohtml=1&password=${acctpass}&domain=${acctuser}&user=${acctuser}&submit-domain=Change%0D%0A++++++Password",$host,$user,$accesshash,$usessl);
        if (
    $cpanelaccterr != "") { return; }
        return 
    $result;
    }
    The reaseon I don´t want them to change their password via the original cpanel password page is that I want to update another DB thats located on another server with some information whenever a user change the password.

    I don´t want the user to be able to create or delete their databases och db-user so before I give a user their login/pass i set this up.

    eg.
    cpanel username: tester
    cpanel password: whatever

    mysql db: tester_tester
    mysql user: tester_tester
    mysql password: whatever

    so here comes my question.
    Is it possible to change the password for the mysqluser with a script like the one to change the cpanel password, so whenever a user change their cpanel password the mysql password also changes to the new password.
     
  2. monks

    monks Registered

    Joined:
    Dec 30, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    151
    Nevermind.
    I figured out how to do it.
     
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