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 12th April 2013, 22:55
MaddinXx MaddinXx is offline
Senior Member
 
Join Date: Jul 2011
Location: Switzerland
Posts: 197
Thanks: 25
Thanked 60 Times in 44 Posts
Default Remote API: Updating DB but not entry in interface

Hi

Today I've written a small script to check mailserver availability. If it's down, it runs a php script which connect's to the remote API.

Code:
<?php

// login credentials
$username = 'XXX;
$password = 'XXX';

// CP URLs
$soap_location = 'https://XXX/remote/index.php';
$soap_uri = 'https://XXX/remote/';

// remote API client
$client = new SoapClient(
	null,
	array(
		'location' => $soap_location,
		'uri' => $soap_uri,
		'trace' => 1,
		'exceptions' => 1
	)
);


try
{
	// login to ISPConfig
	if($session_id = $client->login($username,$password)) {
		echo "Logged successfull. Session ID:". $session_id;
	}

	// DNS record ID
	$id = XXX;
	$client_id = 1;

	// get the DNS record
	$dns_record = $client->dns_cname_get($session_id, $id);

	// new value
	if ($dns_record['data'] != 'XXX')
	{
		$dns_record['data'] = 'XXX';

		// update the DNS record
		$affected_rows = $client->dns_cname_update($session_id, $client_id, $id, $dns_record);

		echo "Number of records that have been changed in the database: ". $affected_rows;
	}

	// logout
	if($client->logout($session_id)) {
		echo 'Logged out.<br />';
	}
}
catch (SoapFault $e)
{
	die('SOAP Error: '.$e->getMessage());
	echo "Please contact the server administator";
}
It's created a job within ISPConfig queue and the DB changes as well. However, the interface shows the old entry and it also does not seem to fire the server's event to update the BIND files.

E.g. the changes are written to DB - and that's it.

Do I have to add something else?

Thanks a lot!
__________________
Rackster Internet Services's presences:
Official | Open Source | Github | Facebook | Twitter
Reply With Quote
Sponsored Links
  #2  
Old 13th April 2013, 12:10
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,466
Thanks: 813
Thanked 5,253 Times in 4,119 Posts
Default

You have to run a update on the zone itself after updatng the cname were you increment the serial by 1.
__________________
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:
MaddinXx (13th April 2013)
  #3  
Old 13th April 2013, 12:57
MaddinXx MaddinXx is offline
Senior Member
 
Join Date: Jul 2011
Location: Switzerland
Posts: 197
Thanks: 25
Thanked 60 Times in 44 Posts
Default

Great, thanks till. Have a good WE
__________________
Rackster Internet Services's presences:
Official | Open Source | Github | Facebook | Twitter
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
Remote API error after updating to 3.0.4 snowfly Installation/Configuration 9 7th November 2011 10:16
PDC_Samba_LDAP misterm Installation/Configuration 0 16th April 2010 13:45
The system is currently updating the configuration files. warlock General 8 21st February 2009 18:15
LDAP tree population error ehpmail Installation/Configuration 0 5th February 2009 22:40
OpenLDAP + Samba Domain Controller On Ubuntu 7.10 bootzcat HOWTO-Related Questions 7 21st March 2008 15:31


All times are GMT +2. The time now is 06:43.


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