| | |
| | | function updateDbAndIni() { |
| | | global $inst, $conf; |
| | | |
| | | //* check sql-mode |
| | | $check_sql_mode = $inst->db->queryOneRecord("SELECT @@sql_mode"); |
| | | if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') { |
| | | echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add\n\n"; |
| | | echo " sql-mode=\"NO_ENGINE_SUBSTITUTION\"\n\n"; |
| | | echo"to the mysqld-section in your mysql-config and restart mysqld afterwards\n"; |
| | | die(); |
| | | } |
| | | |
| | | //* Update $conf array with values from the server.ini that shall be preserved |
| | | $tmp = $inst->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . '.server', $conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | |
| | | |
| | | |
| | | |
| | | function setDefaultServers(){ |
| | | global $inst, $conf; |
| | | |
| | | // clients |
| | | $clients = $inst->db->queryAllRecords("SELECT * FROM ".$conf["mysql"]["database"].".client"); |
| | | if(is_array($clients) && !empty($clients)){ |
| | | foreach($clients as $client){ |
| | | // mailserver |
| | | if(trim($client['mail_servers']) == '') $inst->db->query("UPDATE ?? SET mail_servers = ? WHERE client_id = ?", $conf["mysql"]["database"].".client", trim($client['default_mailserver']), $client['client_id']); |
| | | // webserver |
| | | if(trim($client['web_servers']) == '') $inst->db->query("UPDATE ?? SET web_servers = ? WHERE client_id = ?", $conf["mysql"]["database"].".client", trim($client['default_webserver']), $client['client_id']); |
| | | // dns server |
| | | if(trim($client['dns_servers']) == '') $inst->db->query("UPDATE ?? SET dns_servers = ? WHERE client_id = ?", $conf["mysql"]["database"].".client", trim($client['default_dnsserver']), $client['client_id']); |
| | | // db server |
| | | if(trim($client['db_servers']) == '') $inst->db->query("UPDATE ?? SET db_servers = ? WHERE client_id = ?", $conf["mysql"]["database"].".client", trim($client['default_dbserver']), $client['client_id']); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |