From a97e7d3697b16542fec58859a16df24a1e97fda2 Mon Sep 17 00:00:00 2001 From: "Andreas Burchert (scarya)" Date: Sun, 24 Apr 2011 01:26:17 +0200 Subject: [PATCH] Fixed htpasswd creation for nginx, fixes #722 Thanks to altmir. --- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index c6beba4c..2371e429 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -186,6 +186,7 @@ class nginx $this->nginx_data[$vhost_filename].= "\t".'access_log /var/log/nginx/access.log;' . "\n"; + $mypath = ''; if($row_ipsandports['vhostcontainer'] == '1') { $mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__)))); @@ -550,7 +551,7 @@ class nginx $x = 0; while($row_htpasswds = $this->db->fetch_array($result)) { - if(count($row_htpasswds['htpasswds']) > 0) + if(count($row_htpasswds) > 0) { $htpasswd_filename = makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $row_htpasswds['customerid'] . '-' . md5($row_htpasswds['path']) . '.htpasswd'); @@ -559,12 +560,9 @@ class nginx $this->htpasswds_data[$htpasswd_filename] = ''; } - foreach($row['htpasswds'] as $row_htpasswd) - { - $this->htpasswds_data[$htpasswd_filename].= $row_htpasswd['username'] . ':' . $row_htpasswd['password'] . "\n"; - } + $this->htpasswds_data[$htpasswd_filename].= $row_htpasswds['username'] . ':' . $row_htpasswds['password'] . "\n"; - $path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1)); + $path = makeCorrectDir(substr($row_htpasswds['path'], strlen($domain['documentroot']) - 1)); $returnval[$x]['path'] = $path; $returnval[$x]['root'] = makeCorrectDir($domain['documentroot']);