Merge branch 'stable-3.1'
| | |
| | | $app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id); |
| | | |
| | | //* Delete all records (sub-clients, mail, web, etc....) of this client. |
| | | $tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic'; |
| | | $tables = 'cron,client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic,domain'; |
| | | $tables_array = explode(',', $tables); |
| | | $client_group_id = $app->functions->intval($client_group['groupid']); |
| | | |
| | |
| | | $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client_id); |
| | | |
| | | // Get all records (sub-clients, mail, web, etc....) of this client. |
| | | $tables = 'cron,client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain'; |
| | | $tables = 'cron,client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic,domain'; |
| | | $tables_array = explode(',', $tables); |
| | | $client_group_id = $app->functions->intval($client_group['groupid']); |
| | | |
| | |
| | | $data_file = $data_dir.'/admincount'; |
| | | //get number of admins |
| | | $tmp = $app->db->queryOneRecord("SELECT count(userid) AS number FROM sys_user WHERE typ = 'admin'"); |
| | | $admin_user_count_new = intval($tmp['number']); |
| | | |
| | | if(is_file($data_file)) { |
| | | $admin_user_count_old = intval(file_get_contents($data_file)); |
| | | if($admin_user_count_new != $admin_user_count_old) { |
| | | $alert .= "The number of ISPConfig administrator users has changed. Old: $admin_user_count_old New: $admin_user_count_new \n"; |
| | | if($tmp) { |
| | | $admin_user_count_new = intval($tmp['number']); |
| | | |
| | | if(is_file($data_file)) { |
| | | $admin_user_count_old = intval(file_get_contents($data_file)); |
| | | if($admin_user_count_new != $admin_user_count_old) { |
| | | $alert .= "The number of ISPConfig administrator users has changed. Old: $admin_user_count_old New: $admin_user_count_new \n"; |
| | | file_put_contents($data_file,$admin_user_count_new); |
| | | } |
| | | } else { |
| | | // first run, so we save the current count |
| | | file_put_contents($data_file,$admin_user_count_new); |
| | | chmod($data_file,0700); |
| | | } |
| | | } else { |
| | | // first run, so we save the current count |
| | | file_put_contents($data_file,$admin_user_count_new); |
| | | chmod($data_file,0700); |
| | | } |
| | | } |
| | | |