tbrehm
2012-06-08 4b9329a0f204c190f9cae6c072c9827d05d269e6
server/plugins-available/apache2_plugin.inc.php
@@ -367,6 +367,9 @@
            }
         }
         //* Remove protection of old folders
         $app->system->web_folder_protection($data['old']['document_root'],false);
         //* Move the site data
         $tmp_docroot = explode('/',$data['new']['document_root']);
         unset($tmp_docroot[count($tmp_docroot)-1]);
@@ -593,10 +596,11 @@
         }
      }
      //* If the security level is set to high
      if(($this->action == 'insert' && $data['new']['type'] == 'vhost') or ($web_config['set_folder_permissions_on_update'] == 'y' && $data['new']['type'] == 'vhost')) {
         $app->system->web_folder_protection($data['new']['document_root'],false);
         if($web_config['security_level'] == 20) {
            $this->_exec('chmod 751 '.escapeshellcmd($data['new']['document_root']));
@@ -673,6 +677,9 @@
            $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'].'/web'));
         }
      }
      //* Protect web folders
      $app->system->web_folder_protection($data['new']['document_root'],true);
      // Change the ownership of the error log to the owner of the website
      if(!@is_file($data['new']['document_root'].'/log/error.log')) exec('touch '.escapeshellcmd($data['new']['document_root']).'/log/error.log');
@@ -1217,7 +1224,9 @@
      if(!is_file($data['new']['document_root'].'/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) {
         if(trim($data['new']['stats_password']) != '') {
            $htp_file = 'admin:'.trim($data['new']['stats_password']);
            $app->system->web_folder_protection($data['new']['document_root'],false);
            file_put_contents($data['new']['document_root'].'/.htpasswd_stats',$htp_file);
            $app->system->web_folder_protection($data['new']['document_root'],true);
            chmod($data['new']['document_root'].'/.htpasswd_stats',0755);
            unset($htp_file);
         }
@@ -1281,6 +1290,8 @@
      $app->uses('getconf');
      $web_config = $app->getconf->get_server_config($conf['server_id'], 'web');
      $app->system->web_folder_protection($data['new']['document_root'],false);
      //* Check if this is a chrooted setup
      if($web_config['website_basedir'] != '' && @is_file($web_config['website_basedir'].'/etc/passwd')) {
         $apache_chrooted = true;