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.

any other cpanel perl modules

Discussion in 'General Discussion' started by fuzzymonkey, Oct 27, 2004.

  1. fuzzymonkey

    fuzzymonkey Well-Known Member

    Joined:
    Jun 11, 2004
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Are there any other cPanel perl modules besides Cpanel::Accounting? Specifically, I'm looking for a function that can return a list of suspended accounts.
     
  2. rapta

    rapta Active Member

    Joined:
    Aug 20, 2003
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    For a small paypal fee I can write you such code.
     
  3. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    This would put the usernames of all suspended account in the @suspended variable.

    Code:
    #!/usr/bin/perl
    # You may need to change this path to /usr/local/bin/perl
    
    opendir(DIR, "/var/cpanel/suspended") or &error("Unable to open the data file");
    @tmp = readdir(DIR);
    closedir(DIR);
    
    foreach(@tmp){
      unless($_ eq '.' || $_ eq '..'){
        push(@suspended,$_);
      }
    }
    
     
Loading...

Share This Page