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!

Getting list of cpanel users using PHP CLI to display within WHM plugin

Discussion in 'cPanel Developers' started by sh33pz, Feb 15, 2013.

  1. sh33pz

    sh33pz Registered

    Joined:
    Aug 28, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    51
    Hello,

    I am assuming, one can just, cat /etc/passwd for users and then check to see if they are in the /var/cpanel/users
    dir? Or is there a better way?
     
  2. morissette

    morissette Well-Known Member

    Joined:
    May 24, 2009
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    66
    Location:
    Austin, TX
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. sh33pz

    sh33pz Registered

    Joined:
    Aug 28, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    51
  4. morissette

    morissette Well-Known Member

    Joined:
    May 24, 2009
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    66
    Location:
    Austin, TX
    cPanel Access Level:
    Root Administrator
    This is perl but I'm sure you can do the same with PHP to check if access hash exists and then make one if it doesnt.

    if ( ! -f '/root/.accesshash' ) {
    $ENV{REMOTE_USER} = 'root';
    system('/usr/local/cpanel/bin/realmkaccesshash');
    }
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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