Skip to content

Commit 36633e7

Browse files
author
Till Brehm
committed
Changed .htpasswd path in ispconfig_htaccess.php script.
1 parent e020f74 commit 36633e7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

server/scripts/ispconfig_htaccess.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
*/
3030

3131

32-
$path = realpath(dirname(__FILE__)) . '/..';
33-
$iface_path = realpath(dirname(__FILE__)) . '/../../interface/web';
32+
$path = realpath(dirname(__FILE__) . '/..');
33+
$iface_path = realpath(dirname(__FILE__) . '/../../interface/web');
34+
$iface_base_path = realpath(dirname(__FILE__) . '/../../interface');
3435

3536
require $path . '/lib/mysql_clientdb.conf';
3637

@@ -55,13 +56,13 @@
5556

5657
if($cont == '') die('No users found' . "\n");
5758

58-
if(file_exists($iface_path . '/.htpasswd')) rename($iface_path . '/.htpasswd', $iface_path . '/.htpasswd.old');
59-
file_put_contents($iface_path . '/.htpasswd', $cont);
60-
chmod($iface_path . '/.htpasswd', 0644);
59+
if(file_exists($iface_base_path . '/.htpasswd')) rename($iface_base_path . '/.htpasswd', $iface_base_path . '/.htpasswd.old');
60+
file_put_contents($iface_base_path . '/.htpasswd', $cont);
61+
chmod($iface_base_path . '/.htpasswd', 0644);
6162

6263
$cont = 'AuthType Basic
6364
AuthName "Login"
64-
AuthUserFile ' . $iface_path . '/.htpasswd
65+
AuthUserFile ' . $iface_base_path . '/.htpasswd
6566
require valid-user';
6667

6768
if(file_exists($iface_path . '/.htaccess')) rename($iface_path . '/.htaccess', $iface_path . '/.htaccess.old');

0 commit comments

Comments
 (0)