| | |
| | | $from_host = $conf['hostname']; |
| | | } |
| | | |
| | | // Delete ISPConfig user, in case that it exists |
| | | $this->db->query("DELETE FROM mysql.user WHERE User = '".$cf['ispconfig_user']."' AND Host = '".$from_host."';"); |
| | | $this->db->query("DELETE FROM mysql.db WHERE Db = '".$cf['database']."' AND Host = '".$from_host."';"); |
| | | $this->db->query('FLUSH PRIVILEGES;'); |
| | | |
| | | //* Create the ISPConfig database user |
| | | $query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON '.$cf['database'].".* " |
| | | ."TO '".$cf['ispconfig_user']."'@'".$from_host."' " |
| | | ."IDENTIFIED BY '".$cf['ispconfig_password']."';"; |
| | | if(!$this->db->query($query)) { |
| | | $this->error('Unable to create database user: '.$cf['ispconfig_user']); |
| | | $this->error('Unable to create database user: '.$cf['ispconfig_user'].' Error: '.$this->db->errorMessage); |
| | | } |
| | | |
| | | //* Reload database privelages |
| | |
| | | if(is_file($conf["postfix"]["config_dir"].'/master.cf')) copy($conf["postfix"]["config_dir"].'/master.cf',$conf["postfix"]["config_dir"].'/master.cf~'); |
| | | $content = rf("tpl/master_cf_amavis.master"); |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr("127.0.0.1:10025",$content)) { |
| | | if(!stristr($content,"127.0.0.1:10025")) { |
| | | af($conf["postfix"]["config_dir"].'/master.cf',$content); |
| | | } |
| | | |
| | |
| | | |
| | | public function configure_getmail() |
| | | { |
| | | global $conf; |
| | | |
| | | $config_dir = $conf['getmail']['config_dir']; |
| | | |
| | | if(!is_dir($config_dir)) exec("mkdir -p ".escapeshellcmd($config_dir)); |
| | |
| | | |
| | | public function configure_apache() |
| | | { |
| | | global $conf; |
| | | |
| | | //* Create the logging directory for the vhost logfiles |
| | | exec('mkdir -p /var/log/ispconfig/httpd'); |
| | | |
| | |
| | | |
| | | $dist_init_scripts = $conf['init_scripts']; |
| | | |
| | | if(is_dir("/etc/Bastille.backup")) caselog("rm -rf /etc/Bastille.backup", __FILE__, __LINE__); |
| | | if(is_dir("/etc/Bastille")) caselog("mv -f /etc/Bastille /etc/Bastille.backup", __FILE__, __LINE__); |
| | | @mkdir("/etc/Bastille", octdec($directory_mode)); |
| | | if(is_dir("/etc/Bastille.backup/firewall.d")) caselog("cp -pfr /etc/Bastille.backup/firewall.d /etc/Bastille/", __FILE__, __LINE__); |