Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Aug 2010
    Posts
    5

    Default Inactivity Checker

    Would it be possible to have something like a cron script that i can run that checks /home for any instance of a file called WebLoversRemoveInstantly.php for instance and if the file exists.... suspend the account.

  2. #2
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    525

    Default Re: Inactivity Checker

    Hi JohnnyD1995,

    Yes that's possible.

    What I'd suggest doing is creating a script (Perl, Bash, PHP, whatever) that performs:

    1)`find` for that file.
    2) based on the absolute path of that file, you would know the user's home directory.
    - ie, '/home/dave/public_html/badHackScript.php' => '/home/dave' ...so who ever owns /home/dave
    3) this directory should belong to "dave", but you could verify that by doing a stat of the directory or you could do a recursive grep for the homedir attribute in the userdata directory /var/cpanel/userdata with a regex similar to `grep -rP 'homedir:\s*/home/dave\s*$' ./* 2>/dev/null`
    Code:
    root@004 [/var/cpanel]# grep -rP 'homedir:\s*/home/dave\s*$' ./* 2>/dev/null
    ./userdata/dave/afavaf.dave.com:homedir: /home/dave
    ./userdata/dave/where.dave.com:homedir: /home/dave
    ./userdata/dave/dave.com:homedir: /home/dave
    ./userdata/dave/extradave.dave.com:homedir: /home/dave
    ./userdata/dave/who.dave.com:homedir: /home/dave
    4) now you know for certain that "dave" is the owner (as that is the homedir listed in his file), you can now use our API to suspend the user: XML-API suspendacct

    if you have a remote accesshash, you can use either the Perl PublicAPI or PHP PublicAPI clients (or some other remote query API client) to easily make the request to suspend the account.

    Regards,
    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Request

  3. #3
    Member
    Join Date
    Aug 2010
    Posts
    5

    Default Re: Inactivity Checker

    Yes this sounds exactly what I am looking for

    However sadly I am not good with coding as this should be relatively easy to do maybe someone would be willing to create it for me for.... $5? this is all the cash I have at the moment I am afraid.

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 04-14-2011, 02:42 PM
  2. Spell Checker for SquirrelMail ?
    By sneader in forum E-mail Discussions
    Replies: 2
    Last Post: 12-12-2009, 03:46 PM
  3. Spell Checker for SquirrelMail ?
    By sneader in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 12-11-2009, 05:57 PM
  4. FTP Inactivity logout too Fast
    By JMusic in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-22-2003, 08:39 AM
  5. Bandwidth Checker
    By sketchified in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-26-2002, 09:13 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube