| | |
| | | |
| | | // check if virtual_transport must be changed |
| | | if ($this->is_update) { |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"].".server", $conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | | // ini_array needs not to be checked, because already done in update.php -> updateDbAndIni() |
| | | |
| | |
| | | global $conf; |
| | | |
| | | //* Create the database |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$conf['powerdns']['database'].' DEFAULT CHARACTER SET '.$conf['mysql']['charset'])) { |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['powerdns']['database'], $conf['mysql']['charset'])) { |
| | | $this->error('Unable to create MySQL database: '.$conf['powerdns']['database'].'.'); |
| | | } |
| | | |
| | | //* Create the ISPConfig database user in the local database |
| | | $query = 'GRANT ALL ON `'.$conf['powerdns']['database'].'` . * TO \''.$conf['mysql']['ispconfig_user'].'\'@\'localhost\';'; |
| | | if(!$this->db->query($query)) { |
| | | $query = 'GRANT ALL ON ??.* TO ?@?'; |
| | | if(!$this->db->query($query, $conf['powerdns']['database'], $conf['mysql']['ispconfig_user'], 'localhost')) { |
| | | $this->error('Unable to create user for powerdns database Error: '.$this->db->errorMessage); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | //* Copy the ISPConfig configuration include |
| | | /* |
| | | $content = $this->get_template_file('apache_ispconfig.conf', true); |
| | | |
| | | $records = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ".$conf["server_id"]." AND virtualhost = 'y'"); |
| | | if(is_array($records) && count($records) > 0) |
| | | { |
| | | foreach($records as $rec) { |
| | | $content .= "NameVirtualHost ".$rec["ip_address"].":80\n"; |
| | | $content .= "NameVirtualHost ".$rec["ip_address"].":443\n"; |
| | | } |
| | | } |
| | | |
| | | $this->write_config_file($conf['apache']['vhost_conf_dir'].'/000-ispconfig.conf', $content); |
| | | */ |
| | | |
| | | $tpl = new tpl('apache_ispconfig.conf.master'); |
| | | $tpl->setVar('apache_version',getapacheversion()); |
| | | |