+ Reply to Thread
Results 1 to 7 of 7

Thread: cPanel Inactive Accounts Remover -- THT Support Included!

  1. #1
    FWS Addict eSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to all eSupun's Avatar
    Join Date
    Apr 2010
    Location
    /usr/local/src/
    Posts
    904
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cPanel Inactive Accounts Remover -- THT Support Included!

    cPanel Inactive Account Removers


    I am contributing to FWS after few months. Hope this will be useful for free web hosting owners.

    I thought I might distribute this cPanel Inactive Account Remover which I developed in order to obtain more room for active free web hosting users.

    More information can be found in here: http://perfectz.info/blog/inactive-a...panel-servers/

    Installation

    Make a backup of every account in the server in case it deletes active accounts by mistake.
    Download the script.
    http://perfectz.info/inactive-accounts-remover.tar.gz

    Modify the config.php according to your settings. The config.php have the following variables which need to be changed.

    PHP Code:
        $ipaddress "192.168.0.1"//Servers IP Address
        
    $host "hostname.example.com"//Hostname
        
    $whmuser "root"//Username which has permissions to grab and delete user accounts
        
    $whmkey ""//WHM Remote Access Key
        
    $db_host "";
        
    $db_name "";
        
    $db_user "";
        
    $db_passwd "";
        
    $date 1330560000//Date in Unix format 
    This $date variable is used to identify the new accounts in the server.
    Some people just don't upload data or forward their domain right after they register with you. In that case it is a good practice to keep this to a date before 2 weeks or back. That's up to you. Remember to convert date to unix date format before you use it. Use http://www.onlineconversion.com/unix_time.htm
    Eg: If you want to delete the inactive accounts created before 1st of May,2012, you will have the unix date as 1335830400.

    Log into your server and upload all the files including config.php which you just modified.
    *Remember not to upload the scripts to publicly accessible place. Upload it to somewhere else.
    Eg:/usr/local/src/

    Make the scripts executable.
    Code:
     chmod +x delete.php listaccts.php whm.php
    Run whm.php and set output into a file.
    Code:
    php whm.php >> Output.html
    The script itself has the functionality to fetch user account data from a cPanel server and delete inactive accounts automatically. This script uses JSON to fetch data and a point system to detect which accounts are to be deleted.


    You can contribute in various ways. I will have my pleasure even though you don't.

    Comments and feedback is highly appreciated.

  2. #2
    NLC sander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud of sander k's Avatar
    Join Date
    Jan 2008
    Location
    Netherlands
    Posts
    2,538
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is conciderd as an active account and what isn't?

  3. #3
    FWS Addict eSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to all eSupun's Avatar
    Join Date
    Apr 2010
    Location
    /usr/local/src/
    Posts
    904
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sander k View Post
    What is conciderd as an active account and what isn't?
    The script is solely based on a point system. It gives points for various statuses of the domain name and hosting account.
    If the hosting account has no disk space used: 3 points
    Domain shows an index: 2 points
    Default web site page: 5 points
    IP does not resolve: 5 points

    And it deletes accounts which has 5 points or more and which is created after $date.

  4. #4
    FWS Addict eSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to all eSupun's Avatar
    Join Date
    Apr 2010
    Location
    /usr/local/src/
    Posts
    904
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If someone do not use TheHostingTool(THT), you can comment the line,
    PHP Code:
    $delete->deleterecord($user); 
    in whm.php.

  5. #5
    NLC sander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud ofsander k has much to be proud of sander k's Avatar
    Join Date
    Jan 2008
    Location
    Netherlands
    Posts
    2,538
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Will this also work on whmcs?

  6. #6
    FWS Addict eSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to alleSupun is a name known to all eSupun's Avatar
    Join Date
    Apr 2010
    Location
    /usr/local/src/
    Posts
    904
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sander k View Post
    Will this also work on whmcs?
    Yes, it would. You just need to add WHMCS's database settings into config.php and modify the following line in delete.php
    PHP Code:
    $sql="DELETE FROM tht_users WHERE user='{$user}'"
    Replace tht_users with the table name which contain your client's data and user with the field which contains his username.

  7. #7
    FWS Addict J J is just really niceJ J is just really niceJ J is just really nice J J's Avatar
    Join Date
    Mar 2006
    Location
    London
    Posts
    751
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is awesome, if only I had this when I was actually running a free web host, this would have come in handy!!!!

+ Reply to Thread

Similar Threads

  1. PrimeGalactic, Shared Plans, cPanel included, Support, and more
    By PrimeGalactic in forum Paid hosting offers
    Replies: 0
    Last Post: July 29th, 2011, 14:36
  2. Replies: 0
    Last Post: July 27th, 2011, 02:55
  3. Replies: 0
    Last Post: July 19th, 2011, 17:20
  4. Replies: 0
    Last Post: August 5th, 2009, 02:34
  5. How do you deal with inactive accounts?
    By TechDudeDan in forum Free hosting discussions
    Replies: 4
    Last Post: July 1st, 2008, 21:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts