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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Change user within plugin

Discussion in 'cPanel Developers' started by darklord1, Jan 3, 2017.

  1. darklord1

    darklord1 Well-Known Member

    Joined:
    Jul 8, 2006
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    156
    cPanel Access Level:
    Root Administrator
    Ok,

    So basically, I have a cPanel plugin, that I'm looking to make it possible that when root drops into a cPanel account, they can do things that a user simply does not have access too.

    Basically, There are root level files that need to be editable, but only root actually CAN make the edits.
    Right now, a cPanel user can only read the files, which is done on purpose but the files themselves have a web interface made for editing.

    I've already made it work how I'd like within WHM, but I would like to make more user friendly by making it "In-line" with the cPanel environment.


    Anyone got any ideas on how I might make this work?

    A couple options I've already considered are:
    1, Making a queue system so it's submitted then gets executed later on either via cron or via root login.
    2, Somehow getting the right cpsession ID and loading the WHM side in an iframe or something of that nature (haven't figured out how to get the cpsession ID yet).
     
  2. darklord1

    darklord1 Well-Known Member

    Joined:
    Jul 8, 2006
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    156
    cPanel Access Level:
    Root Administrator
    ok,

    So, I can't seem to find a way to su upto the user, that's fine.

    I think I've found another way, getting the WHM cpsession ID from the user, This has proven to be very difficult.

    Is there a live API call or something that can identify and give me the cpsession ID for the reseller or root who is accessing the cPanel?

    This will allow me to make a WHM call to redirect to the WHM side of my plugin.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Would the Single Sign-On feature help? It's documented at:

    Guide to API Authentication - Software Development Kit - cPanel Documentation

    Thank you.
     
  4. darklord1

    darklord1 Well-Known Member

    Joined:
    Jul 8, 2006
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    156
    cPanel Access Level:
    Root Administrator
    I'm afraid not.

    The problem is that the script will have no idea who the user is, it has to be able to validate that the person is a reseller/root, then it will have to be able to su upto that user OR get the WHM token for that user.

    So far this has still eluded me.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    I'm not sure what you are seeking is possible, however you can reach out directly to our integration developers by sending an email to integration@cpanel.net if you like additional help with this topic.

    Thank you.
     
Loading...

Share This Page