Go Back   cPanel Forums > cPanel® and WHM® (for Linux® and FreeBSD® Servers) > cPanel and WHM Discussions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-23-2008, 09:25 AM
Registered User
 
Join Date: Mar 2008
Posts: 20
frkandris is on a distinguished road
parking a domain and creating e-mail domain forwarder at the same time?

dear whm users,

i am trying to get whm to park a domain and add a domain email forward at the same time. but this can be done in a very difficult way (parking a domain at whm, loggin into cpanel, adding the domain email forwarder). sadly the api has no trigger after parking a domain.

i wonder if anybody has a clue how to do this in an easier way.

thanks in advice,
frkandris
--
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-28-2008, 03:46 AM
Registered User
 
Join Date: Mar 2008
Posts: 20
frkandris is on a distinguished road
Smile

up i still wonder if anybody has an idea about this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-28-2008, 01:36 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by frkandris View Post
dear whm users,

i am trying to get whm to park a domain and add a domain email forward at the same time. but this can be done in a very difficult way (parking a domain at whm, loggin into cpanel, adding the domain email forwarder). sadly the api has no trigger after parking a domain.

i wonder if anybody has a clue how to do this in an easier way.

thanks in advice,
frkandris
--
For a trigger, were you just looking at the hooks in /scripts or were you also looking into using the API2 hooks available at /usr/local/cpanel/hooks (documentation is in the README file in that path)?
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-02-2008, 02:32 PM
Registered User
 
Join Date: Mar 2008
Posts: 20
frkandris is on a distinguished road
i checked both locations but could not find any hooks called after parking a domain. is there one?

thanks in advice,
andris
--
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-05-2008, 10:53 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by frkandris View Post
i checked both locations but could not find any hooks called after parking a domain. is there one?

thanks in advice,
andris
--
You must create one per the documentation in the README file.
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-21-2008, 07:14 AM
Registered User
 
Join Date: Mar 2008
Posts: 20
frkandris is on a distinguished road
Smile help needed

thanks for the advice. the readme says almost nothing usable about this i am not a beginner in coding, so any little clue (what and where to create) would help.

thanks in advice,
andris
--
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-21-2008, 12:59 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
I think one thing that would make understanding hooks much easier is actually seeing the API2 calls used by the x3 interface. It's very difficult to understand hooks without having a basic knowledge of API2. I did a brief overview of API2 in my Customizing cPanel presentation at last year's conference which you can view at:

http://www.cpanel.net/docs/seminar07...ing_cPanel.pdf

You can find the source for the X3 interface in /usr/local/cpanel/base/frontend/x3 - looking at the actual API calls will help you learn what parameters to expect.

For a sample hook, look at:
/usr/local/cpanel/hooks/passwd/change_password.example

The accompanying page for changing passwords in the X3 interface is ...:2082/frontend/x3/passwd/index.html, which is stored in /usr/local/cpanel/base/frontend/x3/passwd/index.html

This should help shed some insight onto hooks and how they work, especially in conjunction with the actual API2 calls that trigger the hooks.
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-12-2008, 04:46 PM
Registered User
 
Join Date: Mar 2008
Posts: 20
frkandris is on a distinguished road
Smile how to call api2 after hook

thanks dave, i think now i understand the concept of api2 quite well.

all i still wonder is how can i call the script with api2 usage in it right after parking a domain. (the WHM park function calls "/scripts/park", which is in the whm binary, so i cannot put anything before/after it.. right?)

frkandris
--
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 06-13-2008, 01:38 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by frkandris View Post
thanks dave, i think now i understand the concept of api2 quite well.

all i still wonder is how can i call the script with api2 usage in it right after parking a domain. (the WHM park function calls "/scripts/park", which is in the whm binary, so i cannot put anything before/after it.. right?)

frkandris
--
Let make sure I understand you correctly. You want to call a script every time a domain is parked, after the domain has been parked, correct?
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 06-14-2008, 11:12 AM
Registered User
 
Join Date: Mar 2008
Posts: 20
frkandris is on a distinguished road
Smile

Quote:
Originally Posted by cPanelDavidG View Post
Let make sure I understand you correctly. You want to call a script every time a domain is parked, after the domain has been parked, correct?
correct

frkandris
--
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 06-16-2008, 09:36 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by frkandris View Post
correct

frkandris
--
Currently, this is an API1 call, here's the code from X3 that creates a parked domain:

HTML Code:
<cpanel Park="park($FORM{'domain'})">
You may want to read the README file in /usr/local/cpanel/hooks to learn how to use cPanel Hooks. Also check out the example file it refers to.

cPanel Hooks are called after an action has been performed by cPanel.

With all of this information, you should be able to put together your own hook .
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 08-13-2008, 11:11 AM
Registered User
 
Join Date: Mar 2008
Posts: 20
frkandris is on a distinguished road
Smile

thank you, it works fine in cpanel.

meanwhile i realized that the misunderstanding was about cpanel vs whm - i was about to call a hook after the park from whm (which is not possible, as the support says).

thanks anyway
andris
--
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:24 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc