Commit fbdcc457 authored by tbrehm's avatar tbrehm

- Updated Bind export script.

- Added missing remoting functions
parent b8f15732
<?php
$host="IP-Adresse-ISP-CONFIG-Master-Server";
$user="MYSQL-USER";
$password="PASSWORD";
mysql_connect($host,$user,$password) or die(mysql_error());
mysql_select_db("dbispconfig");
$result = "";
$result = mysql_query("SELECT id,origin,ns,ttl,mbox,serial,refresh,retry,expire,minimum FROM dns_soa;");
function hostname2ipfunktion($tmp1, $timeout = 1)
{
if ($tmp1 == 0)
{
$query = `nslookup -timeout=$timeout -retry=0 $tmp1`;
if(preg_match('/\nAddress: (.*)\n/', $query, $matches))
return trim($matches[1]);
return $tmp1;
}
}
while($row = mysql_fetch_array($result))
{
### Hier ALLES Aktivieren bei Primary Nameserver ########################################################################################
$varx11=substr($row["origin"],0,-1);
unlink("/var/cache/bind/$varx11");
$arr1[$x11]="zone \"$varx11\" in { type master; file \"$varx11\"; };\n";
$x11=$x11+1;
$result2 = mysql_query("select name,type,aux,data from dns_rr where zone=$row[id] ORDER BY name ASC;");
$arr3[0]="\$TTL ".$row['ttl']."\n@ IN SOA ".$row['ns']." ".$row['mbox']." (\n ".$row['serial']." ;Serial\n"." ".$row['refresh']." ;Refresh\n"." ".$row['retry']." ;Retry\n"." ".$row['expire']." ;Expire\n"." ".$row['minimum']." ) ;Minimum\n\n";
$xx1=1;
while($row2 = mysql_fetch_row($result2))
{
$arr2[$xx1]=$row2['0']." IN ".$row2['1']." ";
if ($row2['2']>0)
{
$arr3[$xx1]=$arr2[$xx1].$row2['2']." ".$row2['3']."\n";
}
else
{
$arr3[$xx1]=$arr2[$xx1].$row2['3']."\n";
}
$xx1=$xx1+1;
}
$f = fopen("/var/cache/bind/$varx11", "a+");
foreach($arr3 as $values) fputs($f, $values);
fclose($f);
$arr2=array();
$arr3=array();
### ENDE Primrer Nameserver ###########################################################################################################
### Hier ALLES Aktivieren bei Secondary Nameserver ######################################################################################
# $tmp1 = substr($row["ns"],0,-1);
# $tmp2 = substr($row["origin"],0,-1);
# $nsip = hostname2ipfunktion($tmp1);
# if ($nsip == $tmp1) # {
# echo "$tmp2 $tmp1 Not a valid Nameserver";
# echo "\n";
# }
# else # {
# $arr1[$x11]="zone \"".$tmp2."\" in { type slave; file \"".$tmp2."\"; masters {".$nsip."; }; };\n";
# $x11=$x11+1;
# }
### ENDE Secondary Nameserver ###########################################################################################################
}
unlink ("/etc/bind/named.conf.local");
$fx = fopen("/etc/bind/named.conf.local", "a+");
foreach($arr1 as $values) fputs($fx, $values);
fclose($fx);
exec("/etc/init.d/bind9 reload");
<?php
$host="IP-Adresse-ISP-CONFIG-Master-Server";
$user="MYSQL-USER";
$password="PASSWORD";
mysql_connect($host,$user,$password) or die(mysql_error());
mysql_select_db("dbispconfig");
$result = "";
$result = mysql_query("SELECT id,origin,ns,ttl,mbox,serial,refresh,retry,expire,minimum FROM dns_soa;");
function hostname2ipfunktion($tmp1, $timeout = 1)
{
if ($tmp1 == 0)
{
$query = `nslookup -timeout=$timeout -retry=0 $tmp1`;
if(preg_match('/\nAddress: (.*)\n/', $query, $matches))
return trim($matches[1]);
return $tmp1;
}
}
while($row = mysql_fetch_array($result))
{
### Hier ALLES Aktivieren bei Primary Nameserver ########################################################################################
$varx11=substr($row["origin"],0,-1);
unlink("/var/cache/bind/$varx11");
$arr1[$x11]="zone \"$varx11\" in { type master; file \"$varx11\"; };\n";
$x11=$x11+1;
$result2 = mysql_query("select name,type,aux,data from dns_rr where zone=$row[id] ORDER BY name ASC;");
$arr3[0]="\$TTL ".$row['ttl']."\n@ IN SOA ".$row['ns']." ".$row['mbox']." (\n ".$row['serial']." ;Serial\n"." ".$row['refresh']." ;Refresh\n"." ".$row['retry']." ;Retry\n"." ".$row['expire']." ;Expire\n"." ".$row['minimum']." ) ;Minimum\n\n";
$xx1=1;
while($row2 = mysql_fetch_row($result2))
{
$arr2[$xx1]=$row2['0']." IN ".$row2['1']." ";
if ($row2['2']>0)
{
$arr3[$xx1]=$arr2[$xx1].$row2['2']." ".$row2['3']."\n";
}
else
{
$arr3[$xx1]=$arr2[$xx1].$row2['3']."\n";
}
$xx1=$xx1+1;
}
$f = fopen("/var/cache/bind/$varx11", "a+");
foreach($arr3 as $values) fputs($f, $values);
fclose($f);
$arr2=array();
$arr3=array();
### ENDE Primrer Nameserver ###########################################################################################################
### Hier ALLES Aktivieren bei Secondary Nameserver ######################################################################################
# $tmp1 = substr($row["ns"],0,-1);
# $tmp2 = substr($row["origin"],0,-1);
# $nsip = hostname2ipfunktion($tmp1);
# if ($nsip == $tmp1) # {
# echo "$tmp2 $tmp1 Not a valid Nameserver";
# echo "\n";
# }
# else # {
# $arr1[$x11]="zone \"".$tmp2."\" in { type slave; file \"".$tmp2."\"; masters {".$nsip."; }; };\n";
# $x11=$x11+1;
# }
### ENDE Secondary Nameserver ###########################################################################################################
}
unlink ("/etc/bind/named.conf.local");
$fx = fopen("/etc/bind/named.conf.local", "a+");
foreach($arr1 as $values) fputs($fx, $values);
fclose($fx);
exec("/etc/init.d/bind9 reload");
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -33,35 +33,42 @@
*/
$lista_funkcji = array();
$lista_funkcji['mail_domain_get,mail_domain_add,mail_domain_update,mail_domain_delete'] = 'Mail domain functions<br>';
$lista_funkcji['mail_user_add,mail_user_update,mail_user_delete'] = 'Mail user functions<br>';
$lista_funkcji['mail_alias_add,mail_alias_update,mail_alias_delete'] = 'Mail alias functions<br>';
$lista_funkcji['mail_forward_add,mail_forward_update,mail_forward_delete'] = 'Mail forward functions<br>';
$lista_funkcji['mail_catchall_add,mail_catchall_update,mail_catchall_delete'] = 'Mail catchall functions<br>';
$lista_funkcji['mail_transport_add,mail_transport_update,mail_transport_delete'] = 'Mail transport functions<br>';
$lista_funkcji['mail_whitelist_add,mail_whitelist_update,mail_whitelist_delete'] = 'Mail whitelist functions<br>';
$lista_funkcji['mail_blacklist_add,mail_blacklist_update,mail_blacklist_delete'] = 'Mail blacklist functions<br>';
$lista_funkcji['mail_spamfilter_user_add,mail_spamfilter_user_update,mail_spamfilter_user_delete'] = 'Mail spamfilter user functions<br>';
$lista_funkcji['mail_policy_add,mail_policy_update,mail_policy_delete'] = 'Mail spamfilter policy functions<br>';
$lista_funkcji['mail_fetchmail_add,mail_fetchmail_update,mail_fetchmail_delete'] = 'Mail fetchmail functions<br>';
$lista_funkcji['mail_whitelist_add,mail_whitelist_update,mail_whitelist_delete'] = 'Mail whitelist functions<br>';
$lista_funkcji['mail_blacklist_add,mail_blacklist_update,mail_blacklist_delete'] = 'Mail blacklist functions<br>';
$lista_funkcji['mail_filter_add,mail_filter_update,mail_filter_delete'] = 'Mail filter functions<br>';
$function_list = array();
$function_list['mail_domain_get,mail_domain_add,mail_domain_update,mail_domain_delete'] = 'Mail domain functions<br>';
$function_list['mail_user_add,mail_user_update,mail_user_delete'] = 'Mail user functions<br>';
$function_list['mail_alias_add,mail_alias_update,mail_alias_delete'] = 'Mail alias functions<br>';
$function_list['mail_forward_add,mail_forward_update,mail_forward_delete'] = 'Mail forward functions<br>';
$function_list['mail_catchall_add,mail_catchall_update,mail_catchall_delete'] = 'Mail catchall functions<br>';
$function_list['mail_transport_add,mail_transport_update,mail_transport_delete'] = 'Mail transport functions<br>';
$function_list['mail_whitelist_add,mail_whitelist_update,mail_whitelist_delete'] = 'Mail whitelist functions<br>';
$function_list['mail_blacklist_add,mail_blacklist_update,mail_blacklist_delete'] = 'Mail blacklist functions<br>';
$function_list['mail_spamfilter_user_add,mail_spamfilter_user_update,mail_spamfilter_user_delete'] = 'Mail spamfilter user functions<br>';
$function_list['mail_policy_add,mail_policy_update,mail_policy_delete'] = 'Mail spamfilter policy functions<br>';
$function_list['mail_fetchmail_add,mail_fetchmail_update,mail_fetchmail_delete'] = 'Mail fetchmail functions<br>';
$function_list['mail_whitelist_add,mail_whitelist_update,mail_whitelist_delete'] = 'Mail whitelist functions<br>';
$function_list['mail_blacklist_add,mail_blacklist_update,mail_blacklist_delete'] = 'Mail blacklist functions<br>';
$function_list['mail_filter_add,mail_filter_update,mail_filter_delete'] = 'Mail filter functions<br>';
$function_list['client_get,client_add,client_update,client_delete'] = 'Client functions<br>';
$function_list['sites_cron_get,sites_cron_add,sites_cron_update,sites_cron_delete'] = 'Sites cron functions<br>';
$function_list['sites_database_get,sites_database_add,sites_database_update,sites_database_delete'] = 'Sites database functions<br>';
$function_list['sites_ftp_user_get,sites_ftp_user_add,sites_ftp_user_update,sites_ftp_user_delete'] = 'Sites FTP-User functions<br>';
$function_list['sites_shell_user_get,sites_shell_user_add,sites_shell_user_update,sites_shell_user_delete'] = 'Sites Shell-User functions<br>';
$function_list['sites_web_domain_get,sites_web_domain_add,sites_web_domain_update,sites_web_domain_delete'] = 'Sites Domain functions<br>';
$function_list['sites_web_aliasdomain_get,sites_web_aliasdomain_add,sites_web_aliasdomain_update,sites_web_aliasdomain_delete'] = 'Sites Aliasdomain functions<br>';
$function_list['sites_web_subdomain_get,sites_web_subdomain_add,sites_web_subdomain_update,sites_web_subdomain_delete'] = 'Sites Subdomain functions<br>';
$function_list['dns_zone_get,dns_zone_add,dns_zone_update,dns_zone_delete'] = 'DNS zone functions<br>';
$function_list['dns_a_get,dns_a_add,dns_a_update,dns_a_delete'] = 'DNS a functions<br>';
$function_list['dns_aaaa_get,dns_aaaa_add,dns_aaaa_update,dns_aaaa_delete'] = 'DNS aaaa functions<br>';
$function_list['dns_alias_get,dns_alias_add,dns_alias_update,dns_alias_delete'] = 'DNS alias functions<br>';
$function_list['dns_cname_get,dns_cname_add,dns_cname_update,dns_cname_delete'] = 'DNS cname functions<br>';
$function_list['dns_hinfo_get,dns_hinfo_add,dns_hinfo_update,dns_hinfo_delete'] = 'DNS hinfo functions<br>';
$function_list['dns_mx_get,dns_mx_add,dns_mx_update,dns_mx_delete'] = 'DNS mx functions<br>';
$function_list['dns_ns_get,dns_ns_add,dns_ns_update,dns_ns_delete'] = 'DNS ns functions<br>';
$function_list['dns_ptr_get,dns_ptr_add,dns_ptr_update,dns_ptr_delete'] = 'DNS ptr functions<br>';
$function_list['dns_rp_get,dns_rp_add,dns_rp_update,dns_rp_delete'] = 'DNS rp functions<br>';
$function_list['dns_srv_get,dns_srv_add,dns_srv_update,dns_srv_delete'] = 'DNS srv functions<br>';
$function_list['dns_txt_get,dns_txt_add,dns_txt_update,dns_txt_delete'] = 'DNS txt functions<br>';
$form["title"] = "Remote user";
......@@ -135,7 +142,7 @@ $form["tabs"]['remote_user'] = array (
'regex' => '',
'errmsg' => '',
'default' => '',
'value' => $lista_funkcji,
'value' => $function_list,
'separator' => ';',
'width' => '',
'maxlength' => '',
......
......@@ -48,7 +48,7 @@ $form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match wi
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = 'r'; //r = read, i = insert, u = update, d = delete
$form["tabs"]['policy'] = array (
'title' => "Policy",
......
<?php
require('soap_config.php');
$client = new SoapClient(null, array('location' => $soap_location,
'uri' => $soap_uri));
try {
if($session_id = $client->login($username,$password)) {
echo 'Login successfull. SessionID:'.$session_id.'<br />';
}
$params = array( 'server_id' => 1,
'company_name' => 'Company',
'contact_name' => 'John Doe',
'username' =>'john',
'password' =>'test',
'language' =>'en',
'usertheme' =>'default',
'street' =>'mainstreet 10',
'zip' =>'12345',
'city' =>'Homecity',
'state' =>'non-US',
'country' =>'EN',
'telephone' =>'',
'mobile' =>'',
'fax' =>'',
'email' =>'',
'internet' =>'',
'icq' =>'',
'notes' =>'',
'template_master' => '1',
'template_additional' =>'',
'default_mailserver' =>'1',
'limit_maildomain' =>'1',
'limit_mailbox' =>'-1',
'limit_mailalias' =>'-1',
'limit_mailforward' =>'-1',
'limit_mailcatchall' =>'-1',
'limit_mailrouting' => '-1',
'limit_mailfilter' =>'-1',
'limit_fetchmail' =>'-1',
'limit_mailquota' =>'-1',
'limit_spamfilter_wblist' =>'-1',
'limit_spamfilter_user' =>'-1',
'limit_spamfilter_policy' =>'-1',
'default_webserver' =>'1',
'limit_web_domain' =>'-1',
'web_php_options' =>"SuPHP",
'limit_web_aliasdomain' =>'-1',
'limit_web_subdomain' =>'-1',
'limit_ftp_user' =>'-1',
'limit_shell_user' =>'-1',
'ssh_chroot' =>'None',
'default_dnsserver' =>'1',
'limit_dns_zone' =>'-1',
'limit_dns_record' =>'-1',
'limit_client' =>'0',
'default_dbserver' =>'1',
'limit_database' =>'-1',
'limit_cron' =>'0',
'limit_cron_type' =>'',
'limit_cron_frequency' =>'-1');
$reseller_id = 0;
$domain_id = $client->client_add($session_id, $reseller_id, $params);
if($client->logout($session_id)) {
echo 'Logout.<br />';
}
} catch (SoapFault $e) {
die('SOAP Error: '.$e->getMessage());
}
?>
<?php
require('soap_config.php');
$client = new SoapClient(null, array('location' => $soap_location,
'uri' => $soap_uri));
try {
if($session_id = $client->login($username,$password)) {
echo 'Login successfull. SessionID:'.$session_id.'<br />';
}
$client_id = 3;
$affected_rows = $client->client_delete($session_id, $client_id);
if($client->logout($session_id)) {
echo 'Logout.<br />';
}
} catch (SoapFault $e) {
die('SOAP Error: '.$e->getMessage());
}
?>
<?php
$username = 'axelf';
$password = 'axelf';
$soap_location = 'http://localhost:8080/remote/index.php';
$soap_uri = 'http://localhost:8080/remote/';
require('soap_config.php');
$client = new SoapClient(null, array('location' => $soap_location,
......@@ -12,23 +8,22 @@ $client = new SoapClient(null, array('location' => $soap_location,
try {
if($session_id = $client->login($username,$password)) {
echo 'Zalogowany. Sesja:'.$session_id.'<br />';
}
$params = array( 'server_id' => 1,
'company_name' => 'abm',
'contact_name' => 'artur',
'username' =>'artek123',
'password' =>'artek123',
'language' =>'pl',
if($session_id = $client->login($username,$password)) {
echo 'Login successfull. SessionID:'.$session_id.'<br />';
}
$params = array( 'server_id' => 1,
'company_name' => 'Company',
'contact_name' => 'John Doe 3',
'username' =>'john2',
'password' =>'test',
'language' =>'en',
'usertheme' =>'default',
'street' =>'dobrzanskiego',
'zip' =>'05-071',
'city' =>'sulejowek',
'street' =>'mainstreet 10',
'zip' =>'12345',
'city' =>'Homecity',
'state' =>'non-US',
'country' =>'PL',
'country' =>'EN',
'telephone' =>'',
'mobile' =>'',
'fax' =>'',
......@@ -37,19 +32,19 @@ try {
'icq' =>'',
'notes' =>'',
'template_master' => '1',
'template_additional' =>'',
'default_mailserver' =>'1',
'limit_maildomain' =>'1',
'limit_mailbox' =>'-1',
'limit_mailalias' =>'-1',
'limit_mailforward' =>'-1',
'limit_mailcatchall' =>'-1',
'template_additional' =>'',
'default_mailserver' =>'1',
'limit_maildomain' =>'1',
'limit_mailbox' =>'-1',
'limit_mailalias' =>'-1',
'limit_mailforward' =>'-1',
'limit_mailcatchall' =>'-1',
'limit_mailrouting' => '-1',
'limit_mailfilter' =>'-1',
'limit_fetchmail' =>'-1',
'limit_mailquota' =>'-1',
'limit_spamfilter_wblist' =>'-1',
'limit_spamfilter_user' =>'-1',
'limit_fetchmail' =>'-1',
'limit_mailquota' =>'-1',
'limit_spamfilter_wblist' =>'-1',
'limit_spamfilter_user' =>'-1',
'limit_spamfilter_policy' =>'-1',
'default_webserver' =>'1',
'limit_web_domain' =>'-1',
......@@ -70,19 +65,19 @@ try {
'limit_cron_frequency' =>'-1');
$client_id = 0;
$domain_id = $client->klient_add($session_id,$domain_id, $params);
if($client->logout($session_id)) {
echo 'Wylogowany.<br />';
}
}
catch (SoapFault $e) {
die('SOAP Blad: '.$e->getMessage());
$reseller_id = 0;
$client_id = 3;
$return_client_id = $client->client_update($session_id, $reseller_id, $client_id, $params);
if($client->logout($session_id)) {
echo 'Logout.<br />';
}
} catch (SoapFault $e) {
die('SOAP Error: '.$e->getMessage());
}
?>
<?php
$username = 'admin';
$password = 'admin';
/*
$soap_location = 'http://localhost:8080/ispconfig3/interface/web/remote/index.php';
$soap_uri = 'http://localhost:8080/ispconfig3/interface/web/remote/';
*/
$soap_location = 'http://localhost:8080/remote/index.php';
$soap_uri = 'http://localhost:8080/remote/';
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment