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.

Determining if an account is suspended

Discussion in 'cPanel Developers' started by deviantlinux, Mar 25, 2009.

  1. deviantlinux

    deviantlinux Member

    Joined:
    Feb 26, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I've got a WHM app I made, and need to know how to determine if an account is suspended. It lists account usernames, and for each row in the table, I want it to look up (via Cpanel API or something) whether this username's account is suspended. Is there a simpler way (any files that might have suspend info) or anything?

    Thanks,

    Ryan
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. 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
    There are a couple ways of doing this, since this is internal, the xml-api is probably not the most effective way of doing this.

    The fastest way will be to probably look at /var/cpanel/users/USERNAME file for the SUSPENDED=1 string.
     
  4. deviantlinux

    deviantlinux Member

    Joined:
    Feb 26, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    !! CpanelMatt, thank you so much, that is exactly what I've been looking for. Using the XML-Api took forever to load the page, this should be much faster.

    Will the "SUSPENDED" always be there, even if set to 0? Or it will only show up if suspended, and be set to 1?

    Ryan
     
  5. 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
    ryan,
    it can show up if an account has been suspended then unsuspended, then it will SUSPENDED=0
     
  6. deviantlinux

    deviantlinux Member

    Joined:
    Feb 26, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Excellent. One more question:

    On the main CGI page in "/usr/local/cpanel/whostmgr/docroot/cgi/addon_myscript.cgi", my perl script will display fine, and works perfectly. But if I put the same script into a folder in cgi (say "usr/local/cpanel/whostmgr/docroot/cgi/myfolder/newscript.cgi"), it fails to execute, and it seems like it is a permissions problem, since I can run it as root in the shell and it executes fine.

    Is there anything I need to change about the script or will I not be able to link to cgi scripts in my "myfolder" folder since they don't run as root?

    Ryan
     
  7. 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
    Looking at the backend on this, it has to begin with the prefix addon_ and needs to be the actual file.
     
  8. deviantlinux

    deviantlinux Member

    Joined:
    Feb 26, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Sorry, I don't think my last post made sense.

    I have my "addon_myscript.cgi" display HTML stuff. It has links on the page, and they link to the /cgi/myscript/index.cgi, /cgi/myscript/page2.cgi, etc, just like any web page. My question is, do these other scripts, after clicked from the 'addon_myscript.cgi' age, run as root?

    Ryan
     
  9. MHVishal

    MHVishal Registered

    Joined:
    Apr 16, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    excellent this case now seems to be closed Any time Google says they can no longer find malware and the account is unsuspended .All well and good.I'd be happier if we could have reached agreement that was no begin with...
    That and i m alos probably stuck with an extra result of this incident
     
Loading...

Share This Page