From d10d15da9b28dedcd03dbb599a3cd004dbb2c8b3 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Thu, 13 Mar 2014 11:58:56 -0400
Subject: [PATCH] Fix for last commit.
---
server/plugins-available/apache2_plugin.inc.php | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index fa3def7..dcbcdd9 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -2217,6 +2217,15 @@
$app->system->chown($new_folder_path.'.htaccess', $website['system_user']);
$app->system->chgrp($new_folder_path.'.htaccess', $website['system_group']);
$app->log('Created/modified file '.$new_folder_path.'.htaccess', LOGLEVEL_DEBUG);
+
+ //* Create empty .htpasswd file, if it does not exist
+ if(!is_file($folder_path.'.htpasswd')) {
+ $app->system->touch($new_folder_path.'.htpasswd');
+ $app->system->chmod($new_folder_path.'.htpasswd', 0750);
+ $app->system->chown($new_folder_path.'.htpasswd', $website['system_user']);
+ $app->system->chgrp($new_folder_path.'.htpasswd', $website['system_group']);
+ $app->log('Created file '.$new_folder_path.'.htpasswd', LOGLEVEL_DEBUG);
+ }
}
//* Remove .htaccess file
@@ -2671,8 +2680,8 @@
if(substr($ini_setting, 0, 1) == '#') continue;
if(substr($ini_setting, 0, 2) == '//') continue;
list($key, $value) = explode('=', $ini_setting, 2);
- if($value){
- $value = trim($value);
+ $value = trim($value);
+ if($value != ''){
$key = trim($key);
switch (strtolower($value)) {
case '0':
--
Gitblit v1.9.1