Remote framework: Creating domain alias

Discussion in 'Developers' Forum' started by bahadircolak, May 9, 2010.

  1. bahadircolak

    bahadircolak New Member

    Hi,

    I've uploaded the example files (test.php and soap.lib.php)

    Modified these lines:

    PHP:
    $server_url "http://www.mydomain.com:8080";

    $parameters = array('user' => 'myuser',
                        
    'pass' =>  'mypass');
    when I call:

    PHP:
    if($err $soap_client->getError()) die("Error: ".$err);
    there is no error. I think up to here it's ok...

    When I try the code:

    PHP:
    $params = array (    'sid'       => $session_id,
                        
    'module'    => 'reseller',
                        
    'function'    => 'reseller_list',
                        
    'params'    => '');


    $reseller_list $soap_client->call('service',$params);
    // Error Check
    if($err $soap_client->getError()) die("Error: ".$err);
    print_r($reseller_list);
    It gives the error: Error: SOAP-ENV:Server: Function 'service' doesn't exist

    Also I wasn't able to find how to create a domain alias in the examples...

    Would you help me please. Thanks!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which ISPConfig version do you use? You use the remoting framework for ISPConfig 2 and post here in the ISPConfig 3 forum. So your problem is most likely related to the fact that you use the wrong remoting Library for the installed ispconfig version.
     
  3. bahadircolak

    bahadircolak New Member

    Ooops... Sorry.

    I use ISPConfig 3...

    Where is the examples for it?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Download the ISPConfig 3.0.2.1 tar.gz from sourceforge and unpack it. Inside the tar.gz there is a directory with the name remote_client/examples/ which contains various examples. As we do not have examples for all functions yet, you might want to take a look at the file interface/lib/classes/remoting.inc.php too which contains the server side of the functions to get a list of all function names and their parameters.
     
  5. bahadircolak

    bahadircolak New Member

    Till,

    I'm checking the lib now, it looks very easy to use indeed.

    I've found the function to add a domain alias (sites_web_aliasdomain_add).

    I've checked web_aliasdomain.tform.php for parameters, and now it's working great. Here is the code in case of anyone finds it useful.

    PHP:
    $params = array(    'server_id' => 1// replace
                            
    'domain' => 'test.com'//replace
                            
    'type' =>'alias',
                            
    'parent_domain_id' => 10// replace
                            
    'redirect_type' =>'',
                            
    'redirect_path' =>'',
                            
    'subdomain' =>'*',
                            
    'active' => 'y');
    $client_id =1//replace

    $client->sites_web_aliasdomain_add($session_id$client_id$params); 
     
  6. BorderAmigos

    BorderAmigos New Member

    Straining through code to find functions is up there on the drudgery scale with forced listening of Vogon poetry. As I'm working on a project that uses this, I'll post the list of functions derived from interface/lib/classes/remoting.inc.php here for your amusement as well as some of the variables used in remote_client/examples/.

    Code:
    login($username, $password)
    logout($session_id)
    mail_domain_get($session_id, $domain_id)
    mail_domain_add($session_id, $client_id, $params)
    mail_domain_update($session_id, $client_id, $domain_id, $params)
    mail_domain_delete($session_id, $domain_id)
    mail_user_get($session_id, $primary_id)
    mail_user_add($session_id,$domain_id, $client_id, $params)
    mail_user_update($session_id, $client_id, $domain_id, $params)
    mail_user_delete($session_id,$domain_id)
    mail_user_filter_get($session_id, $primary_id)
    mail_user_filter_add($session_id, $client_id, $params)
    mail_user_filter_update($session_id, $client_id, $primary_id, $params)
    mail_user_filter_delete($session_id,$domain_id)
    mail_alias_get($session_id, $primary_id)
    mail_alias_add($session_id,$domain_id, $client_id, $params)
    mail_alias_update($session_id, $domain_id, $client_id, $params)
    mail_alias_delete($session_id,$domain_id)
    mail_forward_get($session_id, $primary_id)
    mail_forward_add($session_id,$domain_id, $client_id, $params)
    mail_forward_update($session_id, $domain_id, $client_id, $params)
    mail_forward_delete($session_id,$domain_id)
    mail_catchall_get($session_id, $primary_id)
    mail_catchall_add($session_id,$domain_id, $client_id, $params)
    mail_catchall_update($session_id, $domain_id, $client_id, $params)
    mail_catchall_delete($session_id,$domain_id)
    mail_transport_get($session_id, $primary_id)
    mail_transport_add($session_id,$domain_id, $client_id, $params)
    mail_transport_update($session_id, $domain_id, $client_id, $params)
    mail_transport_delete($session_id,$domain_id)
    mail_spamfilter_whitelist_get($session_id, $primary_id)
    mail_spamfilter_whitelist_add($session_id,$domain_id, $client_id, $params)
    mail_spamfilter_whitelist_update($session_id, $domain_id, $client_id, $params)
    mail_spamfilter_whitelist_delete($session_id,$domain_id)
    mail_spamfilter_blacklist_get($session_id, $primary_id)
    mail_spamfilter_blacklist_add($session_id,$domain_id, $client_id, $params)
    mail_spamfilter_blacklist_update($session_id, $domain_id, $client_id, $params)
    mail_spamfilter_blacklist_delete($session_id,$domain_id)
    mail_spamfilter_user_get($session_id, $primary_id)
    mail_spamfilter_user_add($session_id,$domain_id, $client_id, $params)
    mail_spamfilter_user_update($session_id, $domain_id, $client_id, $params)
    mail_spamfilter_user_delete($session_id,$domain_id)
    mail_policy_get($session_id, $primary_id)
    mail_policy_add($session_id,$domain_id, $client_id, $params)
    mail_policy_update($session_id, $domain_id, $client_id, $params)
    mail_policy_delete($session_id,$domain_id)
    mail_fetchmail_get($session_id, $primary_id)
    mail_fetchmail_add($session_id,$domain_id, $client_id, $params)
    mail_fetchmail_update($session_id, $domain_id, $client_id, $params)
    mail_fetchmail_delete($session_id,$domain_id)
    mail_whitelist_get($session_id, $primary_id)
    mail_whitelist_add($session_id,$domain_id, $client_id, $params)
    mail_whitelist_update($session_id, $domain_id, $client_id, $params)
    mail_whitelist_delete($session_id,$domain_id)
    mail_blacklist_get($session_id, $primary_id)
    mail_blacklist_add($session_id,$domain_id, $client_id, $params)
    mail_blacklist_update($session_id, $domain_id, $client_id, $params)
    mail_blacklist_delete($session_id,$domain_id)
    mail_filter_get($session_id, $primary_id)
    mail_filter_add($session_id,$domain_id, $client_id, $params)
    mail_filter_update($session_id, $domain_id, $client_id, $params)
    mail_filter_delete($session_id,$domain_id)
    client_get($session_id, $client_id)
    client_get_id($session_id, $sys_userid)
    client_add($session_id, $reseller_id, $params)
    client_update($session_id, $reseller_id, $client_id, $params)
    client_delete($session_id,$client_id)
    sites_cron_get($session_id, $cron_id)
    sites_cron_add($session_id, $client_id, $params)
    sites_cron_update($session_id, $client_id, $cron_id, $params)
    sites_cron_delete($session_id, $cron_id)
    sites_database_get($session_id, $primary_id)
    sites_database_add($session_id, $client_id, $params)
    sites_database_update($session_id, $client_id, $primary_id, $params)
    sites_database_delete($session_id, $primary_id)
    sites_ftp_user_get($session_id, $primary_id)
    sites_ftp_user_add($session_id, $client_id, $params)
    sites_ftp_user_update($session_id, $client_id, $primary_id, $params)
    sites_ftp_user_delete($session_id, $primary_id)
    sites_shell_user_get($session_id, $primary_id)
    sites_shell_user_add($session_id, $client_id, $params)
    sites_shell_user_update($session_id, $client_id, $primary_id, $params)
    sites_shell_user_delete($session_id, $primary_id)
    sites_web_domain_get($session_id, $primary_id)
    sites_web_domain_add($session_id, $client_id, $params)
    sites_web_domain_update($session_id, $client_id, $primary_id, $params)
    sites_web_domain_delete($session_id, $primary_id)
    sites_web_aliasdomain_get($session_id, $primary_id)
    sites_web_aliasdomain_add($session_id, $client_id, $params)
    sites_web_aliasdomain_update($session_id, $client_id, $primary_id, $params)
    sites_web_aliasdomain_delete($session_id, $primary_id)
    sites_web_subdomain_get($session_id, $primary_id)
    sites_web_subdomain_add($session_id, $client_id, $params)
    sites_web_subdomain_update($session_id, $client_id, $primary_id, $params)
    sites_web_subdomain_delete($session_id, $primary_id)
    dns_zone_get($session_id, $primary_id)
    dns_zone_add($session_id, $client_id, $params)
    dns_zone_update($session_id, $client_id, $primary_id, $params)
    dns_zone_delete($session_id, $primary_id)
    dns_aaaa_get($session_id, $primary_id)
    dns_aaaa_add($session_id, $client_id, $params)
    dns_aaaa_update($session_id, $client_id, $primary_id, $params)
    dns_aaaa_delete($session_id, $primary_id)
    dns_a_get($session_id, $primary_id)
    dns_a_add($session_id, $client_id, $params
    dns_a_update($session_id, $client_id, $primary_id, $params)
    dns_a_delete($session_id, $primary_id)
    dns_alias_get($session_id, $primary_id)
    dns_alias_add($session_id, $client_id, $params)
    dns_alias_update($session_id, $client_id, $primary_id, $params)
    dns_alias_delete($session_id, $primary_id)
    dns_cname_get($session_id, $primary_id)
    dns_cname_add($session_id, $client_id, $params)
    dns_cname_update($session_id, $client_id, $primary_id, $params)
    dns_cname_delete($session_id, $primary_id)
    dns_hinfo_get($session_id, $primary_id)
    dns_hinfo_add($session_id, $client_id, $params)
    dns_hinfo_update($session_id, $client_id, $primary_id, $params)
    dns_hinfo_delete($session_id, $primary_id)
    dns_mx_get($session_id, $primary_id)
    dns_mx_add($session_id, $client_id, $params)
    dns_mx_update($session_id, $client_id, $primary_id, $params)
    dns_mx_delete($session_id, $primary_id)
    dns_ns_get($session_id, $primary_id)
    dns_ns_add($session_id, $client_id, $params)
    dns_ns_update($session_id, $client_id, $primary_id, $params)
    dns_ns_delete($session_id, $primary_id)
    dns_ptr_get($session_id, $primary_id)
    dns_ptr_add($session_id, $client_id, $params)
    dns_ptr_update($session_id, $client_id, $primary_id, $params)
    dns_ptr_delete($session_id, $primary_id)
    dns_rp_get($session_id, $primary_id)
    dns_rp_add($session_id, $client_id, $params)
    dns_rp_update($session_id, $client_id, $primary_id, $params)
    dns_rp_delete($session_id, $primary_id)
    dns_srv_get($session_id, $primary_id)
    dns_srv_add($session_id, $client_id, $params)
    dns_srv_update($session_id, $client_id, $primary_id, $params)
    dns_srv_delete($session_id, $primary_id)
    dns_txt_get($session_id, $primary_id)
    dns_txt_add($session_id, $client_id, $params)
    dns_txt_update($session_id, $client_id, $primary_id, $params)
    dns_txt_delete($session_id, $primary_id)
    
    Code:
    $username
    $password
    $soap_location
    $soap_uri 
    $session_id
    $client_id 
    $primary_id
    
    $params["username"] => 
    $params["password"]
    $params["usertheme"]
    $params["language"]
    $params["server_id"]
    $params["domain"]
    $params["type"]
    $params["parent_domain_id"]
    $params["redirect_type"]
    $params["redirect_path"]
    $params["subdomain"]
    $params["active"]
    $params["source"]
    $params["destination"]
    $params["wb"]
    $params["rid"]
    $params["email"]
    $params["priority"]
    $params["company_name"]
    $params["contact_name"]
    $params["street"]
    $params["zip"]
    $params["city"]
    $params["state"]
    $params["country"]
    $params["telephone"]
    $params["mobile"]
    $params["fax"]
    $params["internet"]
    $params["icq"]
    $params["notes"]
    $params["template_master"]
    $params["template_additional"]
    $params["default_mailserver"]
    $params["limit_maildomain"]
    $params["limit_mailbox"]
    $params["limit_mailalias"]
    $params["limit_mailforward"]
    $params["limit_mailcatchall"]
    $params["limit_mailrouting"]
    $params["limit_mailfilter"]
    $params["limit_fetchmail"]
    $params["limit_mailquota"]
    $params["limit_spamfilter_wblist"]
    $params["limit_spamfilter_user"]
    $params["limit_spamfilter_policy"]
    $params["default_webserver"]
    $params["limit_web_domain"]
    $params["web_php_options"]
    $params["limit_web_aliasdomain"]
    $params["limit_web_subdomain"]
    $params["limit_ftp_user"]
    $params["limit_shell_user"]
    $params["ssh_chroot"]
    $params["default_dnsserver"]
    $params["limit_dns_zone"]
    $params["limit_dns_record"]
    $params["limit_client"]
    $params["default_dbserver"]
    $params["limit_database"]
    $params["limit_cron"]
    $params["limit_cron_type"]
    $params["limit_cron_frequency"]
    $params["database_name"]
    $params["database_user"]
    $params["database_password"]
    $params["database_charset"]
    $params["remote_access"]
    $params["remote_ips"]
    $params["source_server"]
    $params["source_username"]
    $params["source_password"]
    $params["source_delete"]
    $params["pattern"]
    $params["data"]
    $params["action"]
    $params["quota"]
    $params["maildir"]
    $params["homedir"]
    $params["gid"]
    $params["uid"]
    $params["postfix"]
    $params["disableimap"]
    $params["disablepop3"]
    $params["policy_name"]
    $params["virus_lover"]
    $params["spam_lover"]
    $params["banned_files_lover"]
    $params["bad_header_lover"]
    $params["bypass_virus_checks"]
    $params["bypass_banned_checks"]
    $params["bypass_header_checks"]
    $params["transport"]
    $params["sort_order"]
    $params["priority"]
    $params["policy_id"]
    $params["fullname"]
    $params["access"]
    $params["type"]
    
    Salud!
     

Share This Page