add new CUSTOMER_HOMEDIR replacer for php-configs, thx to rubberduck for the hint

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-11-29 09:37:18 +01:00
parent fd69fc22db
commit 29c754e700
12 changed files with 41 additions and 14 deletions

View File

@@ -153,7 +153,8 @@ class phpinterface_fcgid {
'OPEN_BASEDIR' => $openbasedir,
'OPEN_BASEDIR_C' => $openbasedirc,
'OPEN_BASEDIR_GLOBAL' => Settings::Get('system.phpappendopenbasedir'),
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot'])
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot']),
'CUSTOMER_HOMEDIR' => makeCorrectDir($this->_domain['customerroot'])
);
//insert a small header for the file

View File

@@ -229,7 +229,8 @@ class phpinterface_fpm
'OPEN_BASEDIR' => $openbasedir,
'OPEN_BASEDIR_C' => '',
'OPEN_BASEDIR_GLOBAL' => Settings::Get('system.phpappendopenbasedir'),
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot'])
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot']),
'CUSTOMER_HOMEDIR' => makeCorrectDir($this->_domain['customerroot'])
);
$phpini = replace_variables($phpconfig['phpsettings'], $php_ini_variables);

View File

@@ -967,7 +967,8 @@ $lng['admin']['phpconfig']['admin_email'] = 'Will be replaced with e-mail addres
$lng['admin']['phpconfig']['domain'] = 'Will be replaced with the domain.';
$lng['admin']['phpconfig']['customer'] = 'Will be replaced with the loginname of the customer who owns this domain.';
$lng['admin']['phpconfig']['admin'] = 'Will be replaced with the loginname of the admin who owns this domain.';
$lng['admin']['phpconfig']['docroot'] = 'Will be replaces with the customer\'s document-root.';
$lng['admin']['phpconfig']['docroot'] = 'Will be replaced with the domain\'s document-root.';
$lng['admin']['phpconfig']['homedir'] = 'Will be replaced with the customer\'s home-directory.';
$lng['login']['backtologin'] = 'Back to login';
$lng['serversettings']['mod_fcgid']['starter']['title'] = 'Processes per domain';
$lng['serversettings']['mod_fcgid']['starter']['description'] = 'How many processes should be started/allowed per domain? The value 0 is recommended cause PHP will then manage the amount of processes itself very efficiently.';

View File

@@ -961,7 +961,8 @@ $lng['admin']['phpconfig']['admin_email'] = 'Wird mit der E-Mail-Adresse des Adm
$lng['admin']['phpconfig']['domain'] = 'Wird mit der Domain ersetzt.';
$lng['admin']['phpconfig']['customer'] = 'Wird mit dem Loginnamen des Kunden ersetzt, dem die Domain gehört.';
$lng['admin']['phpconfig']['admin'] = 'Wird mit dem Loginnamen des Admins ersetzt, dem die Domain gehört.';
$lng['admin']['phpconfig']['docroot'] = 'Wird mit dem Heimatverzeichnis des Kunden ersetzt.';
$lng['admin']['phpconfig']['docroot'] = 'Wird mit dem Heimatverzeichnis der Domain ersetzt.';
$lng['admin']['phpconfig']['homedir'] = 'Wird mit dem Heimatverzeichnis des Kunden ersetzt.';
$lng['login']['backtologin'] = 'Zurück zum Login';
$lng['serversettings']['mod_fcgid']['starter']['title'] = 'Prozesse je Domain';
$lng['serversettings']['mod_fcgid']['starter']['description'] = 'Wieviele PHP-Prozesse pro Domain sollen gestartet/erlaubt werden. Der Wert 0 wird empfohlen, da PHP die Anzahl dann selbst effizient verwaltet.';

View File

@@ -262,7 +262,8 @@ class apache extends HttpConfigBase
'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
);
$php = new phpinterface($domain);
$phpconfig = $php->getPhpConfig(Settings::Get('system.mod_fcgid_defaultini_ownvhost'));
@@ -315,6 +316,7 @@ class apache extends HttpConfigBase
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath,
'customerroot' => $mypath,
'fpm_config_id' => isset($fpm_config['id']) ? $fpm_config['id'] : 1
);
@@ -389,7 +391,8 @@ class apache extends HttpConfigBase
'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
);
}
} // end of ssl-redirect check
@@ -398,7 +401,8 @@ class apache extends HttpConfigBase
$domain = array(
'domain' => Settings::Get('system.hostname'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
);
}
@@ -446,6 +450,7 @@ class apache extends HttpConfigBase
'adminid' => 1, /* first admin-user (superadmin) */
'loginname' => 'froxlor.panel',
'documentroot' => $mypath,
'customerroot' => $mypath,
'parentdomainid' => 0
);

View File

@@ -206,6 +206,7 @@ class apache_fcgid extends apache
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath,
'customerroot' => $mypath,
'fpm_config_id' => isset($fpm_config['id']) ? $fpm_config['id'] : 1
);

View File

@@ -162,7 +162,8 @@ class lighttpd extends HttpConfigBase
'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
);
$php = new phpinterface($domain);
@@ -185,7 +186,8 @@ class lighttpd extends HttpConfigBase
'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
);
}
} else {
@@ -193,7 +195,8 @@ class lighttpd extends HttpConfigBase
$domain = array(
'domain' => Settings::Get('system.hostname'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
);
}
@@ -219,6 +222,7 @@ class lighttpd extends HttpConfigBase
'adminid' => 1, /* first admin-user (superadmin) */
'loginname' => 'froxlor.panel',
'documentroot' => $mypath,
'customerroot' => $mypath,
'parentdomainid' => 0,
);

View File

@@ -126,7 +126,8 @@ class lighttpd_fcgid extends lighttpd
'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
);
// all the files and folders have to belong to the local user

View File

@@ -185,6 +185,7 @@ class nginx extends HttpConfigBase
'adminid' => 1, /* first admin-user (superadmin) */
'loginname' => 'froxlor.panel',
'documentroot' => $mypath,
'customerroot' => $mypath,
'parentdomainid' => 0
);
@@ -255,7 +256,8 @@ class nginx extends HttpConfigBase
$this->nginx_data[$vhost_filename] .= $this->processSpecialConfigTemplate($row_ipsandports['specialsettings'], array(
'domain' => Settings::Get('system.hostname'),
'loginname' => Settings::Get('phpfpm.vhost_httpuser'),
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
), $row_ipsandports['ip'], $row_ipsandports['port'], $row_ipsandports['ssl'] == '1') . "\n";
}
@@ -290,7 +292,8 @@ class nginx extends HttpConfigBase
'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
);
$php = new phpinterface($domain);

View File

@@ -75,7 +75,8 @@ class nginx_phpfpm extends nginx
'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
'documentroot' => $mypath,
'customerroot' => $mypath
);
// all the files and folders have to belong to the local user

View File

@@ -88,6 +88,10 @@ $header
<td><em>{DOCUMENT_ROOT}</em></td>
<td>{$lng['admin']['phpconfig']['docroot']}</td>
</tr>
<tr>
<td><em>{CUSTOMER_HOMEDIR}</em></td>
<td>{$lng['admin']['phpconfig']['homedir']}</td>
</tr>
</tbody>
</table>

View File

@@ -84,6 +84,10 @@ $header
<td><em>{DOCUMENT_ROOT}</em></td>
<td>{$lng['admin']['phpconfig']['docroot']}</td>
</tr>
<tr>
<td><em>{CUSTOMER_HOMEDIR}</em></td>
<td>{$lng['admin']['phpconfig']['homedir']}</td>
</tr>
</tbody>
</table>