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.

Problem with a Roundcube plugin and cPanel

Discussion in 'E-mail Discussions' started by Astral God, Sep 27, 2010.

  1. Astral God

    Astral God Well-Known Member

    Joined:
    Sep 27, 2010
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    127.0.0.1
    cPanel Access Level:
    Root Administrator
    Hello all cPanel users and devs. ;)

    I'm having a litle problem with a Roundcube webmail plugin. This one was written to let the users change their emails account passwords through Roundcube. The plugin works well, but, only when the cPanel language is English. In my case, cPanel is in French language, so, the plugin works (the password is correctly changed) but the plugin interface returns an error saying that the system as an error and the password can't be changed.

    If you want moire details, just check this thread in Roundcube Trac system:

    #1487015 (Password plugin always return error even if it works good) – Roundcube Webmail

    this attached file: Attachment – Roundcube Webmail

    and specialy this comment from alec:

    Can someone helps me fixing this ? Thanks a lot. :)
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Astral God,

    Taking a quick look at the RoundCube cPanel driver (cpanel.php). It looks like they are not coding against our APIs.

    Simply, they should be using the API2 call Email::passwdpop and Email::liskpopswithdisk. Instead they are coding against the UI, which as you've observed first hand, is a fragile method of programmatic coding.

    It's very clear where the problem is; this driver will always return a failure message for any language other than English:
    Code:
    94 if(strpos($response, 'success') && !strpos($response, 'failure'))
    91	                {
    92	                        return true;
    93	                }
    
    The above code shows that their scanning the HTML return page for the English word Success or Failure. These words will change based on the language setting of cPanel. The API will always return English words PLUS it returns an integer result: 1 for success, 0 for failure.

    It shouldn't be too difficult to refactor the cPanel driver. If I get a moment, I'll see what I can do. I can't make any promises since this is not our code; I'm kinda swamped with work and the cPanel conference is next week (gotta get ready!).

    Best Regards,
    -DavidN
     
  3. Astral God

    Astral God Well-Known Member

    Joined:
    Sep 27, 2010
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    127.0.0.1
    cPanel Access Level:
    Root Administrator
    Ok thank you for your help.

    I've trackback your answer to Roudcube Trac to the attention of developers of Roudcube Plugins with cPanel. Maybe in the future they will use the APIs. :)
     
  4. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If they need any help, please have them let us know and we would be glad to assist them.
     
  5. acmeous

    acmeous Registered

    Joined:
    Feb 20, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I was facing the same issue with my BlueHost hosting. Though my errors were in English only :).
    I solved that problem with help of RoundCube Forum members and you will need an updated patched cPanel driver which does the trick.
    Here is how I solved it - /http://acmeous.blogspot.in/2012/02/how-to-enable-change-password-for.html
    I documented the process as well as I can so that it can help you guys also. Let me know if this works for you too.
     
Loading...

Share This Page