customer template and support module questions

Discussion in 'General' started by pyte, Dec 13, 2022.

  1. pyte

    pyte Well-Known Member HowtoForge Supporter

    Hi,
    is there a easy way to set the customer template on all customers at once? Should it work, when i edit the setting via the database?

    Another thing, is there a way to customize or disable the "Support" Module for customers?
     
  2. pyte

    pyte Well-Known Member HowtoForge Supporter

    Ok found at least some customizability for the support module, it's located in the "System configuration -> Misc -> Show message function in help module".
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    That should probably work. But I would recommend to test it with one user first :)
     
    pyte likes this.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You can also configure default modules in /usr/local/ispconfig/interface/lib/config.inc.php
     
  5. pyte

    pyte Well-Known Member HowtoForge Supporter

    That just did the trick for me. I checked the ID of the template in question, it is "1". Then i updated every record in tables "client" and set the template_master to '1' where the client_id does _not_ match '1', as client_id 1 is my admin/reseller.
    Code:
    UPDATE client SET template_master = '1' WHERE client_id != '1';
    
    The changes are displayed in the Interface correctly.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Are all the limits below really correct? If I remember correctly, ISPConfig calculates the limits based on the selected template(s) and inserts them in client table, so you'll likely have to update the limit values as well and not just the template id.
     
  7. pyte

    pyte Well-Known Member HowtoForge Supporter

    They all seem to be set correctly. As there was an issue with the jailkit option beforehand, as it was not set at all, triggering a warning. I did not update the ssh_chroot field in the database, only the template_master, and the jailkit options are all set correctly now.

    EDIT: wait a sec... maybe thats only a displaying thing in the interface, i'll check the tables
     
  8. pyte

    pyte Well-Known Member HowtoForge Supporter

    Well upon checking, it seems like he respected the limts set template.
    I've checked it with these:
    Code:
    select limit_maildomain, customer_no from client where limit_maildomain != 50;
    
    select limit_database, customer_no from client where limit_database != 10;
    I assume that neither limit_maildomain nor limit_data base are 50 or 10 respectively in the default. These statements just return 1 entries, the admin which is expected. But i'm wondering how?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Might be that, by viewing the clients limits and switching from one form tab to the other, they got updated. if you want to test it, do the same change in a different customer and then test if the customer can exceed the limit. For the test, you might even alter the template to set a limit of 1 for something, so you don't have to add 50 test items).
     
  10. pyte

    pyte Well-Known Member HowtoForge Supporter

    You are right. It updates the limits only if you open the "Limits" Tab for that customer, after chaning the template via SQL UPDATE statement. So the correct next step would be to update all limits in the client table to the value set in the tamplate itself right? Or is there anything else i should look out for?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes. Just update all fields to match the ones from the template.

    No, everything else should be fine then.
     
    pyte likes this.
  12. pyte

    pyte Well-Known Member HowtoForge Supporter

    Well for anyone that needs to do the same i generated the SQL statement to update all the relevant parts.
    Waring: Use on your own risk. There are fields that need to be customized that contain server ids and other stuff and assumes there is only 1 admin with client_id 1. Don't ever run random SQL from the web when you don't know what it does.
    Code:
    UPDATE client SET
    template_master = '1',
    limit_maildomain = '50',
    limit_mailbox = '100',
    limit_mailalias = '-1',
    limit_mailaliasdomain = '-1',
    limit_mailforward  = '-1',
    limit_mailcatchall = '-1',
    limit_mailrouting = '-1',
    limit_mail_wblist = '-1',
    limit_mailfilter = '-1',
    limit_fetchmail = '0',
    limit_mailquota = '10240',
    limit_spamfilter_wblist = '-1',
    limit_spamfilter_user = '-1',
    limit_spamfilter_policy = '-1',
    limit_mail_backup = 'y',
    limit_relayhost  = 'n',
    default_xmppserver = '0',
    xmpp_servers = '',
    limit_xmpp_domain = '0',
    limit_xmpp_user = '0',
    limit_xmpp_muc = '0',
    limit_xmpp_anon = '0',
    limit_xmpp_auth_options = '0',
    limit_xmpp_vjud = '0',
    limit_xmpp_proxy = '0',
    limit_xmpp_status = '0',
    limit_xmpp_pastebin = '0',
    limit_xmpp_httparchive = '0',
    default_webserver = '3',
    web_servers = '3,4',
    limit_web_ip = '',
    limit_web_domain = '100',
    limit_web_quota = '10240',
    limit_traffic_quota = '-1',
    web_php_options = 'fast-cgi,mod,php-fpm',
    limit_cgi = 'n',
    limit_ssi = 'n',
    limit_perl = 'n',
    limit_ruby = 'n',
    limit_python = 'n',
    force_suexec = 'y',
    limit_hterror = 'y',
    limit_wildcard = 'n',
    limit_ssl = 'y',
    limit_ssl_letsencrypt = 'n',
    limit_web_subdomain = '-1',
    limit_web_aliasdomain = '-1',
    limit_ftp_user = '10',
    limit_shell_user = '0',
    ssh_chroot  = 'jailkit',
    limit_webdav_user = '0',
    limit_backup = 'n',
    limit_directive_snippets = 'n',
    limit_aps = '0',
    default_dnsserver = '6',
    db_servers = '5',
    limit_dns_zone = '-1',
    default_slave_dnsserver = '3',
    limit_dns_slave_zone = '-1',
    limit_dns_record = '-1',
    default_dbserver = '5',
    dns_servers = '6',
    limit_database = '10',
    limit_database_user = '-1',
    limit_database_quota = '10240',
    limit_cron = '0',
    limit_cron_type = 'url',
    limit_cron_frequency = '5',
    limit_client = '0',
    limit_domainmodule = '0',
    limit_mailmailinglist  = '-1',
    limit_openvz_vm = '0',
    limit_openvz_vm_template_id = '0'
    WHERE client_id != '1';
    
     
    Last edited: Dec 13, 2022
    ahrasis and till like this.
  13. pyte

    pyte Well-Known Member HowtoForge Supporter

    Do i have to manually change the database on all hosts in a multiserver setup? I've changed the database entries for the "client" table on the master, but the slaves don't seem to respect the changes?
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    The limit data is read on the master only anyway, so it does not matter which values the client systems have.
     
    pyte likes this.
  15. pyte

    pyte Well-Known Member HowtoForge Supporter

    Cheers thank you!
     
  16. pyte

    pyte Well-Known Member HowtoForge Supporter

    I've removed the "help" section from the file:
    Code:
    $conf['modules_available'] = 'dashboard,admin,mail,sites,monitor,client,dns'; # ,help removed
    $conf['interface_modules_enabled'] = 'dashboard,mail,sites,dns,tools'; # ,help removed
    
    Still the Interface has the module visible, is there something else that i need to change for it to work?
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    These settings are for new users only, existing users have the modules stored in sys_user table.
     
    pyte likes this.
  18. pyte

    pyte Well-Known Member HowtoForge Supporter

    I've done it with the following sql. The WHERE condition is done to not affect the Reseller/Admin User aswell.
    Code:
    UPDATE sys_user SET modules = "dashboard,mail,sites,dns,tools" WHERE modules = "dashboard,mail,sites,dns,tools,help";
    Works like a charm.
     
    ahrasis and till like this.

Share This Page