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.

user domains in /scripts/postkillacct

Discussion in 'cPanel Developers' started by robagar, Jan 16, 2011.

  1. robagar

    robagar Member

    Joined:
    Jan 13, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Is it possible to get a list of all domains (main, addon and parked) associated with an account within /scripts/postkillacct? Looking at the API docs, I can see domainuserinfo, but nothing along the lines of "userdomaininfo". Am I being dim? Would such a function work in postkillacct anyway?
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I think you're looking for the API2 call [URL="http://docs.cpanel.net/twiki/bin/vief/ApiDocs/Api2/ApiDomainLookup#DomainLookup::getbasedomains"DomainLookup::getbasedomains[/URL].

    Any information you wish to retrieve about the domain prior to termination needs to be done on the prekillacct script. Often times developers want to do something AFTER the account is gone, but need account information for whatever their custom action is. So they write a prekillacct script to store all the account details they need (in you case the various domain info) into a file. Then in a postkillacct they open the file and read in all the detail and perform their custom action.

    Best Regards,
    -DavidN
     
  3. robagar

    robagar Member

    Joined:
    Jan 13, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    OK, cheers. I imagine updating dns configs after account deletion is a common requirement.

    I take it the deletion process could be aborted after prekillacct ..?
     
    #3 robagar, Jan 17, 2011
    Last edited: Jan 17, 2011
  4. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Script Hooks are their own process and do not influence the main action. A Custom Event Handler is the only hooking mechanism that runs "inline"; who's calling operation verifies the return status of a "pre" action. Custom Events are cPanel API calls, not WHM operations or scripts in the /scripts/ directory.

    As far as I know, there's no way to preempt a killacct script call...or WHM "Terminate Account" operation.

    Regards,
    -DavidN
     
Loading...

Share This Page