Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th June 2010, 12:39
jmontoya jmontoya is offline
Member
 
Join Date: May 2010
Location: France
Posts: 52
Thanks: 2
Thanked 4 Times in 4 Posts
Default Remoting : Adding a site (ISPConfig 3 + TheHostingTool Integration)

So... I'm trying to integrate ISPConfig with thehostingtool (THT).

I already did the user registration from THT to ISPCOnfig using the API.

Now, I'm doing the registration of a site. I'm using this function:

PHP Code:
remoting::sites_web_domain_add() 
But the problem is that this function doesn't save the "document_root" field and all the "advanced" settings of the site. I check the file below (the site_web_domain_add() function is using that file to register their fields).

PHP Code:
interface/web/sites/form/web_domain.tform.php 
But I found that in that file there is a "if":
PHP Code:
if($_SESSION["s"]["user"]["typ"] == 'admin') {
 
// code

So the question is: only admins can register that kind of information (document_root, system_user, system_user, etc )?

I guess there are 2 possible solutions: Add a remoting user as a user (don't know if its possible) or to edit the condition to accept also remoting users?

Or maybe I'm not using the correct function to add a site?

What do you think?
__________________
Julio Montoya
BeezNest : http://www.beeznest.com
Blog: http://phpcommit.wordpress.com

Last edited by jmontoya; 14th June 2010 at 14:08.
Reply With Quote
Sponsored Links
  #2  
Old 14th June 2010, 13:33
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,244 Times in 4,110 Posts
Default

Which ISPConfig version do you use?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 14th June 2010, 13:59
jmontoya jmontoya is offline
Member
 
Join Date: May 2010
Location: France
Posts: 52
Thanks: 2
Thanked 4 Times in 4 Posts
Default

ISPConfig 3
__________________
Julio Montoya
BeezNest : http://www.beeznest.com
Blog: http://phpcommit.wordpress.com
Reply With Quote
  #4  
Old 14th June 2010, 14:15
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,244 Times in 4,110 Posts
Default

ISPConfig 3 is the name of the software. And whats the version?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 14th June 2010, 14:34
jmontoya jmontoya is offline
Member
 
Join Date: May 2010
Location: France
Posts: 52
Thanks: 2
Thanked 4 Times in 4 Posts
Default

Latest version from SVN. Revision 1843.
__________________
Julio Montoya
BeezNest : http://www.beeznest.com
Blog: http://phpcommit.wordpress.com
Reply With Quote
  #6  
Old 15th June 2010, 16:39
ivomendonca ivomendonca is offline
Banned
 
Join Date: Sep 2009
Posts: 132
Thanks: 10
Thanked 13 Times in 7 Posts
Default

Quote:
Originally Posted by jmontoya View Post
So... I'm trying to integrate ISPConfig with thehostingtool (THT).

I already did the user registration from THT to ISPCOnfig using the API.

Now, I'm doing the registration of a site. I'm using this function:

PHP Code:
remoting::sites_web_domain_add() 
But the problem is that this function doesn't save the "document_root" field and all the "advanced" settings of the site. I check the file below (the site_web_domain_add() function is using that file to register their fields).

PHP Code:
interface/web/sites/form/web_domain.tform.php 
But I found that in that file there is a "if":
PHP Code:
if($_SESSION["s"]["user"]["typ"] == 'admin') {
 
// code

So the question is: only admins can register that kind of information (document_root, system_user, system_user, etc )?

I guess there are 2 possible solutions: Add a remoting user as a user (don't know if its possible) or to edit the condition to accept also remoting users?

Or maybe I'm not using the correct function to add a site?

What do you think?
1º Add a user(normal not remote) and save is id
2º add a site using the user id

a single remote user is all that you need.

Adding a user and a site worked in 3.0.2.1
Is not working now ?

Last edited by ivomendonca; 15th June 2010 at 16:46.
Reply With Quote
  #7  
Old 15th June 2010, 16:58
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,244 Times in 4,110 Posts
Default

The problem occurs when you try to access settings that are reserved to the administrator user while using the ID of a normal client without this priveliges via the remote API. To force admin permissions to all remoting API operations,edit the file remoting_lib.inc.php line 169:

$_SESSION["s"]["user"]["typ"] = $user['typ'];

and change the line to:

$_SESSION["s"]["user"]["typ"] = 'admin';

I will change this in SVN.

@ivomendonca:

Quote:
1º Add a user(normal not remote) and save is id
Adding the client with the remoting API works as well. No need to do this manually.

Quote:
Adding a user and a site worked in 3.0.2.1
Is not working now ?
This still works. But it can fail depending on the client ID.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
jmontoya (15th June 2010)
  #8  
Old 15th June 2010, 17:26
jmontoya jmontoya is offline
Member
 
Join Date: May 2010
Location: France
Posts: 52
Thanks: 2
Thanked 4 Times in 4 Posts
Default

That will fix the problem great!
__________________
Julio Montoya
BeezNest : http://www.beeznest.com
Blog: http://phpcommit.wordpress.com
Reply With Quote
  #9  
Old 1st August 2010, 04:49
holykim holykim is offline
Member
 
Join Date: Jan 2009
Posts: 53
Thanks: 15
Thanked 3 Times in 2 Posts
Default

Hi All

I had the same problem when I remotely created a web domain.

Data recorded into the DB (web_domain table) but I can't find the advanced part such as system_user, system_group from the DB. I have changed the file remoting_lib.inc.php line 169 as Till recommended in the article at the above but I got another error.

Error: documentroot_error_empty
sysuser_error_empty
sysgroup_error_empty
allow_override_error_empty
php_open_basedir_error_empty

Can you please advise how to resolve this?

//////////////////////////////////////////////////////////////////////////////////

I have a second question related to remote access for using soap from the another server. I have got an error as below.

Uncaught SoapFault exception: [HTTP] Could not connect to host in /var/www/vhosts/.....

It worked with 3.0.2.1... I am not sure but I am guessing it came with the version 3.0.2.2 as I didn't change anything on my ISPConfig server. Can you please advise this also for me?

Thanks in advance.

Harry
Reply With Quote
  #10  
Old 1st August 2010, 10:03
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,244 Times in 4,110 Posts
 
Default

Quote:
Can you please advise how to resolve this?
Set the values in the params array that you pass to the function.

Quote:
Uncaught SoapFault exception: [HTTP] Could not connect to host in /var/www/vhosts/.....

It worked with 3.0.2.1... I am not sure but I am guessing it came with the version 3.0.2.2 as I didn't change anything on my ISPConfig server. Can you please advise this also for me?
The error means that the soap script is unable to connect the the server. You should check the URL that you use in your soap client script and that you do not block the access with a firewall.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
web site creation in ispconfig 3 (vs ispconfig 2) kterz Installation/Configuration 3 5th May 2009 14:38
Adding Server Side Mail Filters for Users to ISPConfig DantePasquale Installation/Configuration 3 24th February 2009 15:09
cannot access ispconfig site Nu2Linux Installation/Configuration 13 3rd January 2009 15:29
IspConfig Remoting Framework Installation geoffmerritt Installation/Configuration 1 27th October 2008 08:26
install successful but no ispconfig site Nu2Linux Installation/Configuration 3 3rd November 2005 23:30


All times are GMT +2. The time now is 09:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.