New ISPConfig module for WHMCS

Discussion in 'Tips/Tricks/Mods' started by cwispy, Dec 11, 2014.

Thread Status:
Not open for further replies.
  1. BenM

    BenM Member

    Yes, i do. But ist local behind a nat. I will change this to the public IP, one moment.
     
  2. BenM

    BenM Member

    I made the change but make no diff. What script part can i test to get a hold of the machines ip?
     
  3. cwispy

    cwispy Active Member

    This is the line that queries ispconfig for the ip address.

    $zoneip = $client->server_get( $session_id, $tmpl['web_servers'] );

    and it returns the value $zoneip['server']['ip_address'] which is used in the dns create command.
     
  4. BenM

    BenM Member

    okay, i will check this out
     
  5. cwispy

    cwispy Active Member

    Add the line ++ below and post the output of the module log line server_get

    if ( $dns == 'on' ) {

    $zoneip = $client->server_get( $session_id, $tmpl['web_servers'] );
    ++ logModuleCall('ispconfig','server_get',$domain_id,$zoneip,'','');
     
  6. BenM

    BenM Member

    Array
    (
    [permissions] => Array
    (
    [allow_shell_user] => yes
    [admin_allow_server_config] => superadmin
    [admin_allow_server_services] => superadmin
    [admin_allow_server_ip] => superadmin
    [admin_allow_remote_users] => superadmin
    [admin_allow_system_config] => superadmin
    [admin_allow_server_php] => superadmin
    [admin_allow_langedit] => superadmin
    [admin_allow_new_admin] => superadmin
    [admin_allow_del_cpuser] => superadmin
    [admin_allow_cpuser_group] => superadmin
    [admin_allow_firewall_config] => superadmin
    [admin_allow_osupdate] => superadmin
    [admin_allow_software_packages] => superadmin
    [admin_allow_software_repo] => superadmin
    [remote_api_allowed] => yes
    [password_reset_allowed] => yes
    [session_regenerate_id] => yes
    )

    [ids] => Array
    (
    [ids_anon_enabled] => yes
    [ids_anon_log_level] => 1
    [ids_anon_warn_level] => 5
    [ids_anon_block_level] => 20
    [ids_user_enabled] => yes
    [ids_user_log_level] => 1
    [ids_user_warn_level] => 10
    [ids_user_block_level] => 25
    [ids_admin_enabled] => no
    [ids_admin_log_level] => 1
    [ids_admin_warn_level] => 5
    [ids_admin_block_level] => 100
    [sql_scan_enabled] => yes
    [sql_scan_action] => warn
    [apache_directives_scan_enabled] => yes
    [nginx_directives_scan_enabled] => yes
    [ids_enabled] => no
    [ids_log_level] => 1
    [ids_warn_level] => 5
    [ids_block_level] => 100
    )

    [systemcheck] => Array
    (
    [security_admin_email] => root@localhost
    [security_admin_email_subject] => Security alert from server
    [warn_new_admin] => yes
    [warn_passwd_change] => no
    [warn_shadow_change] => no
    [warn_group_change] => no
    )

    [global] => Array
    (
    [webserver] => apache
    [mailserver] => postfix
    [dnsserver] => mydns
    )

    [server] => Array
    (
    [auto_network_configuration] => n
    [ip_address] => 84.31.46.153
    [netmask] => 255.255.255.0
    [v6_prefix] =>
    [gateway] => 192.168.1.1
    [firewall] => bastille
    [hostname] => server5.web-direct.nl
    [nameservers] => 8.8.8.8,8.8.4.4
    [loglevel] => 2
    [admin_notify_events] => 1
    [backup_dir] => /var/backup
    [backup_dir_is_mount] => n
    [backup_mode] => rootgz
    [backup_time] => 0:00
    [backup_delete] => n
    [monit_url] =>
    [monit_user] =>
    [monit_password] =>
    [munin_url] =>
    [munin_user] =>
    [munin_password] =>
    [monitor_system_updates] => y
    [migration_mode] => n
    )

    [mail] => Array
    (
    [module] => postfix_mysql
    [maildir_path] => /var/vmail/[domain]/[localpart]
    [homedir_path] => /var/vmail
    [maildir_format] => maildir
    [dkim_path] => /var/lib/amavis/dkim
    [dkim_strength] => 1024
    [pop3_imap_daemon] => dovecot
    [mail_filter_syntax] => sieve
    [mailuser_uid] => 5000
    [mailuser_gid] => 5000
    [mailuser_name] => vmail
    [mailuser_group] => vmail
    [mailbox_virtual_uidgid_maps] => n
    [relayhost] =>
    [relayhost_user] =>
    [relayhost_password] =>
    [mailbox_size_limit] => 0
    [message_size_limit] => 0
    [mailbox_quota_stats] => y
    [realtime_blackhole_list] =>
    [overquota_notify_admin] => y
    [overquota_notify_client] => y
    [overquota_notify_freq] => 7
    [overquota_notify_onok] => n
    [sendmail_path] => /usr/sbin/sendmail
    )

    [getmail] => Array
    (
    [getmail_config_dir] => /etc/getmail
    )

    [web] => Array
    (
    [server_type] => apache
    [website_basedir] => /var/www
    [website_path] => /var/www/clients/client[client_id]/web[website_id]
    [website_symlinks] => /var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/
    [website_symlinks_rel] => n
    [network_filesystem] => n
    [vhost_conf_dir] => /etc/apache2/sites-available
    [vhost_conf_enabled_dir] => /etc/apache2/sites-enabled
    [nginx_vhost_conf_dir] => /etc/nginx/sites-available
    [nginx_vhost_conf_enabled_dir] => /etc/nginx/sites-enabled
    [security_level] => 20
    [user] => www-data
    [group] => www-data
    [nginx_user] => www-data
    [nginx_group] => www-data
    [apps_vhost_enabled] => y
    [apps_vhost_port] => 8081
    [apps_vhost_ip] => _default_
    [apps_vhost_servername] =>
    [php_open_basedir] => [website_path]/web:[website_path]/private:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
    [htaccess_allow_override] => All
    [awstats_conf_dir] => /etc/awstats
    [awstats_data_dir] => /var/lib/awstats
    [awstats_pl] => /usr/lib/cgi-bin/awstats.pl
    [awstats_buildstaticpages_pl] => /usr/share/awstats/tools/awstats_buildstaticpages.pl
    [php_ini_path_apache] => /etc/php5/apache2/php.ini
    [php_ini_path_cgi] => /etc/php5/cgi/php.ini
    [check_apache_config] => y
    [enable_sni] => y
    [enable_spdy] => n
    [skip_le_check] => n
    [enable_ip_wildcard] => y
    [overtraffic_notify_admin] => y
    [overtraffic_notify_client] => y
    [nginx_cgi_socket] => /var/run/fcgiwrap.socket
    [php_fpm_init_script] => php5-fpm
    [php_fpm_ini_path] => /etc/php5/fpm/php.ini
    [php_fpm_pool_dir] => /etc/php5/fpm/pool.d
    [php_fpm_start_port] => 9010
    [php_fpm_socket_dir] => /var/lib/php5-fpm
    [set_folder_permissions_on_update] => n
    [add_web_users_to_sshusers_group] => y
    [connect_userid_to_webid] => n
    [connect_userid_to_webid_start] => 10000
    [web_folder_protection] => y
    [php_ini_check_minutes] => 1
    [overquota_notify_admin] => y
    [overquota_notify_client] => y
    [overquota_notify_freq] => 7
    [overquota_db_notify_admin] => y
    [overquota_db_notify_client] => y
    [overquota_notify_onok] => n
    )

    [dns] => Array
    (
    [bind_user] => root
    [bind_group] => bind
    [bind_zonefiles_dir] => /etc/bind
    [named_conf_path] => /etc/bind/named.conf
    [named_conf_local_path] => /etc/bind/named.conf.local
    [disable_bind_log] => n
    )

    [fastcgi] => Array
    (
    [fastcgi_starter_path] => /var/www/php-fcgi-scripts/[system_user]/
    [fastcgi_starter_script] => .php-fcgi-starter
    [fastcgi_alias] => /php/
    [fastcgi_phpini_path] => /etc/php5/cgi/
    [fastcgi_children] => 8
    [fastcgi_max_requests] => 5000
    [fastcgi_bin] => /usr/bin/php-cgi
    [fastcgi_config_syntax] => 1
    )

    [jailkit] => Array
    (
    [jailkit_chroot_home] => /home/[username]
    [jailkit_chroot_app_sections] => basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh
    [jailkit_chroot_app_programs] => /usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico
    [jailkit_chroot_cron_programs] => /usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php
    )

    [vlogger] => Array
    (
    [config_dir] => /etc
    )

    [cron] => Array
    (
    [init_script] => cron
    [crontab_dir] => /etc/cron.d
    [wget] => /usr/bin/wget
    )

    [rescue] => Array
    (
    [try_rescue] => n
    [do_not_try_rescue_httpd] => n
    [do_not_try_rescue_mysql] => n
    [do_not_try_rescue_mail] => n
    )

    [xmpp] => Array
    (
    [xmpp_use_ispv6] => n
    [xmpp_bosh_max_inactivity] => 30
    [xmpp_server_admins] => [email protected], [email protected]
    [xmpp_modules_enabled] => saslauth, tls, dialback, disco, discoitems, version, uptime, time, ping, admin_adhoc, admin_telnet, bosh, posix, announce, offline, webpresence, mam, stream_management, message_carbons
    [xmpp_port_http] => 5290
    [xmpp_port_https] => 5291
    [xmpp_port_pastebin] => 5292
    [xmpp_port_bosh] => 5280
    )

    )
     
  7. cwispy

    cwispy Active Member

    That shows that the information needed is being returned, so why that is not being passed to the server during the creation, is a mystery.

    [server] => Array
    (
    [auto_network_configuration] => n
    [ip_address] => 84.31.46.153
     
  8. BenM

    BenM Member

    manual input IP on the script works okay in ispconfig
    so thats strange
     
  9. BenM

    BenM Member

    if ( $dns == 'on' ) {

    $zoneip = $client->server_get( $session_id, $tmpl['web_servers'] );
    $zoneip['ip_address'] = '1.1.1.1';
    logModuleCall('ispconfig','CreatePreDNSZone',$domain,'DNS Template '.$client_id." ".$dnstemplate." ".$domain." ".$zoneip['server']['ip_address']." ".$nameserver1." ".$nameserver2." ".$soaemail,'','');
    $dns_id = $client->dns_templatezone_add( $session_id, $client_id, $dnstemplate, $domain, $zoneip['ip_address'], $nameserver1, $nameserver2, $soaemail );
    logModuleCall('ispconfig','CreatePostDNSZone',$domain,'DNS Template '.$dnstemplate,'','');

    }
     
  10. cwispy

    cwispy Active Member

    Try this.
    Code:
            if ( $dns == 'on' ) {
              
                $zoneip = $client->server_get( $session_id, $tmpl['web_servers'] );
                $tmpip = $zoneip['server']['ip_address'];
                logModuleCall('ispconfig','server_get',$domain_id, $tmpip,'','');
    
                logModuleCall('ispconfig','CreatePreDNSZone',$domain,'DNS Template '.$client_id." ".$dnstemplate." ".$domain." ".$tmpip." ".$nameserver1." ".$nameserver2." ".$soaemail,'','');
     
  11. BenM

    BenM Member

    output createprednszone seems okay
    DNS Template 68 2 host-direct.nl 84.31.46.153 ns5.web-direct.nl ns5.nl [email protected]
     
  12. cwispy

    cwispy Active Member

    with the above code I just posted?

    If so edit this line too.

    PHP:
                $dns_id $client->dns_templatezone_add$session_id$client_id$dnstemplate$domain,  $tmpip$nameserver1$nameserver2$soaemail );
     
  13. BenM

    BenM Member

    DNS Template 69 2 host-direct.nl 84.31.46.153 ns5.web-direct.nl ns5.nl [email protected]

    but no ip
     
  14. BenM

    BenM Member

    yes, this works
     
  15. cwispy

    cwispy Active Member

    Ok thanks. I will edit and commit those changes.
     
  16. BenM

    BenM Member

    got time for one other?
     
  17. cwispy

    cwispy Active Member

    Whats the other one?
     
  18. BenM

    BenM Member

    using the side bar login to controlpanel redirects me to whmcs frontpage instead of ispconfig server
     
  19. cwispy

    cwispy Active Member

    I was thinking about removing that from the side bar. There is already the login available under the information tab.
     
  20. BenM

    BenM Member

    okay, i found this one clear to the users.
     
Thread Status:
Not open for further replies.

Share This Page