mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
FIX #563
This commit is contained in:
parent
7082bef10b
commit
29d362aea3
@ -68,19 +68,10 @@ function loadServerSettings (serverType, usageType) {
|
||||
defaultVhostTemplate += ' }\r\n';
|
||||
|
||||
defaultVhostTemplate += ' location ~ \.php$ {\r\n';
|
||||
defaultVhostTemplate += ' # fastcgi_split_path_info ^(.+\.php)(/.+)$;\r\n';
|
||||
defaultVhostTemplate += ' # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini\r\n';
|
||||
defaultVhostTemplate += ' #\r\n';
|
||||
defaultVhostTemplate += ' # With php5-cgi alone:\r\n';
|
||||
defaultVhostTemplate += ' # fastcgi_pass 127.0.0.1:9000;\r\n';
|
||||
defaultVhostTemplate += ' # With php5-fpm:\r\n';
|
||||
defaultVhostTemplate += ' fastcgi_pass unix:/var/run/php5-fpm.sock;\r\n';
|
||||
defaultVhostTemplate += ' # With php7-fpm:\r\n';
|
||||
defaultVhostTemplate += ' # fastcgi_pass unix:/var/run/php7.0-fpm.sock;\r\n';
|
||||
defaultVhostTemplate += ' fastcgi_pass unix:/var/run/php-fpm-%user%.sock;\r\n';
|
||||
defaultVhostTemplate += ' include fastcgi.conf;\r\n';
|
||||
defaultVhostTemplate += ' fastcgi_index index.php;\r\n';
|
||||
defaultVhostTemplate += ' include fastcgi_params;\r\n';
|
||||
defaultVhostTemplate += ' fastcgi_param PHP_VALUE "open_basedir=%vhostpath%/%user%/%htdocs%/%path%:%vhostpath%/%user%/tmp\nsession.save_path=%vhostpath%/%user%/sessions\nupload_tmp_dir=%vhostpath%/%user%/tmp\nallow_url_fopen=Off\nallow_url_include=Off\n%phpConfiguration%";\r\n';
|
||||
defaultVhostTemplate += ' }\r\n';
|
||||
|
||||
} else {
|
||||
@ -170,4 +161,15 @@ function loadServerSettings (serverType, usageType) {
|
||||
|
||||
document.getElementById("inputHttpdCmd").value = defaultRestartCMD;
|
||||
document.getElementById("inputVhostTemplate").value = defaultVhostTemplate;
|
||||
|
||||
showHideFPM(Boolean((serverType == 'N' || serverType == 'L') && usageType == 'W'));
|
||||
}
|
||||
|
||||
function showHideFPM(bVisible) {
|
||||
|
||||
if (bVisible === true) {
|
||||
$(".fpmSupport").show();
|
||||
} else {
|
||||
$(".fpmSupport").hide();
|
||||
}
|
||||
}
|
@ -11,6 +11,9 @@
|
||||
<error_password_not_match>FTP Passwörter stimmen nicht überein</error_password_not_match>
|
||||
<error_password_not_set>FTP Passwort unzulässig, nicht angegeben, oder Wiederholung nicht angegeben.</error_password_not_set>
|
||||
<fdlInfo>FastDL Info</fdlInfo>
|
||||
<fpmCmd>PHP FPM Start/Reload Befehl</fpmCmd>
|
||||
<fpmConfigPath>PHP FPM Config Pfad</fpmConfigPath>
|
||||
<fpmTemplate>PHP FPM Template</fpmTemplate>
|
||||
<ftpIP>FTP Adresse</ftpIP>
|
||||
<ftpPassword>FTP Passwort</ftpPassword>
|
||||
<ftpPasswordChanged>FTP Passwort geändert</ftpPasswordChanged>
|
||||
@ -36,6 +39,7 @@
|
||||
<optional>(optional)</optional>
|
||||
<other>Andere</other>
|
||||
<overbookPercent>Überbuchen um</overbookPercent>
|
||||
<ownFPM>Eigenes PHP FPM Template</ownFPM>
|
||||
<ownVhost>Eigenes Vhosttemplate</ownVhost>
|
||||
<path>Pfad</path>
|
||||
<pathCorrected>Pfad von %pathGiven% zu %pathConverted% zur Domain %domain% korrigiert</pathCorrected>
|
||||
@ -50,6 +54,7 @@
|
||||
<usageType>Vhostgebrauch</usageType>
|
||||
<userGroup>Webserver Gruppe</userGroup>
|
||||
<userAddCmd>Hinzufügen Befehl</userAddCmd>
|
||||
<useDefaultFPM>Benutze Standard PHP FPM Template</useDefaultFPM>
|
||||
<userDelCmd>Löschen Befehl</userDelCmd>
|
||||
<userModCmd>Bearbeiten Befehl</userModCmd>
|
||||
<vhostConfigPath>Vhost Config Speicherpfad</vhostConfigPath>
|
||||
|
@ -11,6 +11,9 @@
|
||||
<error_password_not_match>FTP passwords does not match</error_password_not_match>
|
||||
<error_password_not_set>FTP password not allowed, not set, or not repeated.</error_password_not_set>
|
||||
<fdlInfo>FastDL Info</fdlInfo>
|
||||
<fpmCmd>PHP FPM Start/Reload Command</fpmCmd>
|
||||
<fpmConfigPath>PHP FPM Config Path</fpmConfigPath>
|
||||
<fpmTemplate>PHP FPM Template</fpmTemplate>
|
||||
<ftpIP>FTP Address</ftpIP>
|
||||
<ftpPassword>FTP Password</ftpPassword>
|
||||
<ftpPasswordChanged>Change FTP Password</ftpPasswordChanged>
|
||||
@ -36,6 +39,7 @@
|
||||
<optional>(optional)</optional>
|
||||
<other>Other</other>
|
||||
<overbookPercent>Overbook</overbookPercent>
|
||||
<ownFPM>Own PHP FPM Template</ownFPM>
|
||||
<ownVhost>Own Vhost Template</ownVhost>
|
||||
<path>Path</path>
|
||||
<pathCorrected>Path belonging to domain %domain% corrected from %pathGiven% to %pathConverted%</pathCorrected>
|
||||
|
@ -122,6 +122,33 @@ $vhostStoragePath = ($ui->startparameter('vhostStoragePath', 'post')) ? $ui->sta
|
||||
$vhostConfigPath = ($ui->startparameter('vhostConfigPath', 'post')) ? $ui->startparameter('vhostConfigPath', 'post') : '/home/YourMasterUser/sites-enabled/';
|
||||
$vhostTemplate = $ui->escaped('vhostTemplate', 'post');
|
||||
|
||||
$fpmTemplate = $ui->escaped('fpmTemplate', 'post');
|
||||
$fpmConfigPath = ($ui->startparameter('fpmConfigPath', 'post')) ? $ui->startparameter('fpmConfigPath', 'post') : '/home/YourMasterUser/fpm-pool.d/';
|
||||
$fpmCmd = ($ui->startparameter('fpmCmd', 'post')) ? $ui->startparameter('fpmCmd', 'post') : 'sudo /etc/init.d/php5-fpm restart';
|
||||
|
||||
if (!$fpmTemplate or strlen($fpmTemplate) < 2) {
|
||||
$fpmTemplate = '[%user%]
|
||||
user = %user%
|
||||
group = %group%
|
||||
listen = /var/run/php-fpm-%user%.sock
|
||||
pm = dynamic
|
||||
pm.max_children = 3
|
||||
pm.start_servers = 1
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 2
|
||||
pm.max_requests = 200
|
||||
|
||||
access.log = %vhostpath%/%user%/logs/access-fpm.log
|
||||
|
||||
php_admin_value[error_log] = %vhostpath%/%user%/logs/error-fpm.log
|
||||
php_admin_value[open_basedir] = %vhostpath%/%user%/%htdocs%:%vhostpath%/%user%/tmp:%vhostpath%/%user%/sessions
|
||||
php_admin_value[upload_tmp_dir] = %vhostpath%/%user%/tmp
|
||||
php_admin_value[session.save_path] = %vhostpath%/%user%/sessions
|
||||
php_admin_value[allow_url_fopen] = Off
|
||||
php_admin_value[allow_url_include] = Off
|
||||
%phpConfiguration%';
|
||||
}
|
||||
|
||||
if (!$phpConfiguration or strlen($phpConfiguration) < 2 or !@parse_ini_string($phpConfiguration, true)) {
|
||||
$phpConfiguration = '[Upload Filesize]
|
||||
php_admin_value upload_max_size 1M = 1MB
|
||||
@ -155,7 +182,8 @@ if (!$vhostTemplate or strlen($vhostTemplate) < 2) {
|
||||
listen 80;
|
||||
server_name www.%domain%;
|
||||
return 301 $scheme://%domain%$request_uri;
|
||||
}';
|
||||
}
|
||||
';
|
||||
|
||||
if ($usageType == 'F') {
|
||||
|
||||
@ -210,7 +238,8 @@ allow_url_include=Off
|
||||
$vhostTemplate = '<VirtualHost *:80>
|
||||
ServerName www.%domain%
|
||||
ServerName Redirect 301 / http://%domain%/
|
||||
</VirtualHost>';
|
||||
</VirtualHost>
|
||||
';
|
||||
|
||||
if ($usageType == 'F') {
|
||||
|
||||
@ -302,6 +331,7 @@ if ($ui->w('action',4, 'post') and !token(true)) {
|
||||
if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
|
||||
$htmlExtraInformation['js'][] = '<script src="js/default/httpd_default_values.js" type="text/javascript"></script>';
|
||||
$htmlExtraInformation['js'][] = '<script type="text/javascript">$(window).load(function() { showHideFPM(Boolean($("#inputUsageType").val() == "W" && ["N","L"].indexOf($("#inputServerType").val()) !== -1)); });</script>';
|
||||
|
||||
// Form is submitted
|
||||
if (count($errors) == 0 and ($ui->st('action', 'post') == 'md' or $ui->st('action', 'post') == 'ad')) {
|
||||
@ -322,6 +352,10 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
$errors['publickey'] = $dedicatedLanguage->keyuse;
|
||||
}
|
||||
|
||||
if ($publickey != 'Y' and !$pass) {
|
||||
$errors['pass'] = $dedicatedLanguage->ssh_pass;
|
||||
}
|
||||
|
||||
if (!$ftpPort) {
|
||||
$errors['ftpPort'] = $sprache->ftpPort;
|
||||
}
|
||||
@ -335,18 +369,18 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
$errors['port'] = $dedicatedLanguage->ssh_port;
|
||||
|
||||
} else {
|
||||
|
||||
$errors['user'] = $dedicatedLanguage->ssh_user;
|
||||
$errors['publickey'] = $dedicatedLanguage->keyuse;
|
||||
|
||||
if ($publickey == 'N') {
|
||||
$errors['pass'] = $dedicatedLanguage->ssh_pass;
|
||||
|
||||
} else if (!$ui->active('publickey', 'post') == 'B') {
|
||||
} else if ($ui->active('publickey', 'post') == 'B') {
|
||||
$errors['pass'] = $dedicatedLanguage->ssh_pass;
|
||||
$errors['keyname'] = $dedicatedLanguage->keyname;
|
||||
|
||||
$errors['publickey'] = $dedicatedLanguage->keyuse;
|
||||
} else {
|
||||
$errors['keyname'] = $dedicatedLanguage->keyname;
|
||||
$errors['publickey'] = $dedicatedLanguage->keyuse;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -372,8 +406,8 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
// Make the inserts or updates define the log entry and get the affected rows from insert
|
||||
if ($ui->st('action', 'post') == 'ad') {
|
||||
|
||||
$query = $sql->prepare("INSERT INTO `webMaster` (`externalID`,`active`,`ip`,`port`,`user`,`pass`,`publickey`,`keyname`,`ftpIP`,`ftpPort`,`maxVhost`,`maxHDD`,`hddOverbook`,`overbookPercent`,`defaultdns`,`httpdCmd`,`serverType`,`dirHttpd`,`dirLogs`,`vhostStoragePath`,`vhostConfigPath`,`vhostTemplate`,`quotaActive`,`quotaCmd`,`repquotaCmd`,`description`,`userGroup`,`userAddCmd`,`userModCmd`,`userDelCmd`,`usageType`,`phpConfiguration`,`blocksize`,`inodeBlockRatio`,`resellerID`) VALUES (:externalID,:active,:ip,:port,AES_ENCRYPT(:user,:aeskey),AES_ENCRYPT(:pass,:aeskey),:publickey,:keyname,:ftpIP,:ftpPort,:maxVhost,:maxHDD,:hddOverbook,:overbookPercent,:defaultdns,:httpdCmd,:serverType,:dirHttpd,:dirLogs,:vhostStoragePath,:vhostConfigPath,:vhostTemplate,:quotaActive,:quotaCmd,:repquotaCmd,:description,:userGroup,:userAddCmd,:userModCmd,:userDelCmd,:usageType,:phpConfiguration,:blocksize,:inodeBlockRatio,:resellerID)");
|
||||
$query->execute(array(':externalID' => $externalID, ':active' => $active, ':ip' => $ip, ':port' => $port, ':aeskey' => $aeskey, ':user' => $user, ':pass' => $pass, ':publickey' => $publickey, ':keyname' => $keyname, ':ftpIP' => $ftpIP, ':ftpPort' => $ftpPort, ':maxVhost' => $maxVhost, ':maxHDD' => $maxHDD, ':hddOverbook' => $hddOverbook, ':overbookPercent' => $overbookPercent, ':defaultdns' => $defaultdns, ':httpdCmd' => $httpdCmd, ':serverType' => $serverType, ':dirHttpd' => $dirHttpd, ':dirLogs' => $dirLogs, ':vhostStoragePath' => $vhostStoragePath, ':vhostConfigPath' => $vhostConfigPath, ':vhostTemplate' => $vhostTemplate, ':quotaActive' => $quotaActive, ':quotaCmd' => $quotaCmd, ':repquotaCmd' => $repquotaCmd, ':description' => $description, ':userGroup' => $userGroup, ':userAddCmd' => $userAddCmd, ':userModCmd' => $userModCmd, ':userDelCmd' => $userDelCmd, ':usageType' => $usageType, ':phpConfiguration' => $phpConfiguration, ':blocksize' => $blocksize, ':inodeBlockRatio' => $inodeBlockRatio, ':resellerID' => $resellerLockupID));
|
||||
$query = $sql->prepare("INSERT INTO `webMaster` (`externalID`,`active`,`ip`,`port`,`user`,`pass`,`publickey`,`keyname`,`ftpIP`,`ftpPort`,`maxVhost`,`maxHDD`,`hddOverbook`,`overbookPercent`,`defaultdns`,`httpdCmd`,`serverType`,`dirHttpd`,`dirLogs`,`vhostStoragePath`,`vhostConfigPath`,`vhostTemplate`,`quotaActive`,`quotaCmd`,`repquotaCmd`,`description`,`userGroup`,`userAddCmd`,`userModCmd`,`userDelCmd`,`usageType`,`phpConfiguration`,`blocksize`,`inodeBlockRatio`,`fpmTemplate`,`fpmConfigPath`,`fpmCmd`,`resellerID`) VALUES (:externalID,:active,:ip,:port,AES_ENCRYPT(:user,:aeskey),AES_ENCRYPT(:pass,:aeskey),:publickey,:keyname,:ftpIP,:ftpPort,:maxVhost,:maxHDD,:hddOverbook,:overbookPercent,:defaultdns,:httpdCmd,:serverType,:dirHttpd,:dirLogs,:vhostStoragePath,:vhostConfigPath,:vhostTemplate,:quotaActive,:quotaCmd,:repquotaCmd,:description,:userGroup,:userAddCmd,:userModCmd,:userDelCmd,:usageType,:phpConfiguration,:blocksize,:inodeBlockRatio,:fpmTemplate,:fpmConfigPath,:fpmCmd,:resellerID)");
|
||||
$query->execute(array(':externalID' => $externalID, ':active' => $active, ':ip' => $ip, ':port' => $port, ':aeskey' => $aeskey, ':user' => $user, ':pass' => $pass, ':publickey' => $publickey, ':keyname' => $keyname, ':ftpIP' => $ftpIP, ':ftpPort' => $ftpPort, ':maxVhost' => $maxVhost, ':maxHDD' => $maxHDD, ':hddOverbook' => $hddOverbook, ':overbookPercent' => $overbookPercent, ':defaultdns' => $defaultdns, ':httpdCmd' => $httpdCmd, ':serverType' => $serverType, ':dirHttpd' => $dirHttpd, ':dirLogs' => $dirLogs, ':vhostStoragePath' => $vhostStoragePath, ':vhostConfigPath' => $vhostConfigPath, ':vhostTemplate' => $vhostTemplate, ':quotaActive' => $quotaActive, ':quotaCmd' => $quotaCmd, ':repquotaCmd' => $repquotaCmd, ':description' => $description, ':userGroup' => $userGroup, ':userAddCmd' => $userAddCmd, ':userModCmd' => $userModCmd, ':userDelCmd' => $userDelCmd, ':usageType' => $usageType, ':phpConfiguration' => $phpConfiguration, ':blocksize' => $blocksize, ':inodeBlockRatio' => $inodeBlockRatio, ':fpmTemplate' => $fpmTemplate, ':fpmConfigPath' => $fpmConfigPath, ':fpmCmd' => $fpmCmd, ':resellerID' => $resellerLockupID));
|
||||
|
||||
$rowCount = $query->rowCount();
|
||||
$loguseraction = '%add% %webmaster% ' . $ip;
|
||||
@ -401,8 +435,8 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
$query->execute(array($active, $id, $resellerLockupID));
|
||||
}
|
||||
|
||||
$query = $sql->prepare("UPDATE `webMaster` SET `externalID`=:externalID,`active`=:active,`ip`=:ip,`port`=:port,`user`=AES_ENCRYPT(:user,:aeskey),`pass`=AES_ENCRYPT(:pass,:aeskey),`publickey`=:publickey,`keyname`=:keyname,`ftpIP`=:ftpIP,`ftpPort`=:ftpPort,`maxVhost`=:maxVhost,`maxHDD`=:maxHDD,`hddOverbook`=:hddOverbook,`overbookPercent`=:overbookPercent,`defaultdns`=:defaultdns,`httpdCmd`=:httpdCmd,`serverType`=:serverType,`dirHttpd`=:dirHttpd,`dirLogs`=:dirLogs,`vhostStoragePath`=:vhostStoragePath,`vhostConfigPath`=:vhostConfigPath,`vhostTemplate`=:vhostTemplate,`quotaActive`=:quotaActive,`quotaCmd`=:quotaCmd,`repquotaCmd`=:repquotaCmd,`description`=:description,`userGroup`=:userGroup,`userAddCmd`=:userAddCmd,`userModCmd`=:userModCmd,`userDelCmd`=:userDelCmd,`usageType`=:usageType,`phpConfiguration`=:phpConfiguration,`blocksize`=:blocksize,`inodeBlockRatio`=:inodeBlockRatio WHERE `webMasterID`=:id AND `resellerID`=:resellerID LIMIT 1");
|
||||
$query->execute(array(':externalID' => $externalID, ':active' => $active, ':ip' => $ip, ':port' => $port, ':aeskey' => $aeskey, ':user' => $user, ':pass' => $pass, ':publickey' => $publickey, ':keyname' => $keyname, ':ftpIP' => $ftpIP, ':ftpPort' => $ftpPort, ':maxVhost' => $maxVhost, ':maxHDD' => $maxHDD, ':hddOverbook' => $hddOverbook, ':overbookPercent' => $overbookPercent, ':defaultdns' => $defaultdns, ':httpdCmd' => $httpdCmd, ':serverType' => $serverType, ':dirHttpd' => $dirHttpd, ':dirLogs' => $dirLogs, ':vhostStoragePath' => $vhostStoragePath, ':vhostConfigPath' => $vhostConfigPath, ':vhostTemplate' => $vhostTemplate, ':quotaActive' => $quotaActive, ':quotaCmd' => $quotaCmd, ':repquotaCmd' => $repquotaCmd, ':description' => $description, ':userGroup' => $userGroup, ':userAddCmd' => $userAddCmd, ':userModCmd' => $userModCmd, ':userDelCmd' => $userDelCmd, ':usageType' => $usageType, ':phpConfiguration' => $phpConfiguration, ':blocksize' => $blocksize, ':inodeBlockRatio' => $inodeBlockRatio, ':id' => $id, ':resellerID' => $resellerLockupID));
|
||||
$query = $sql->prepare("UPDATE `webMaster` SET `externalID`=:externalID,`active`=:active,`ip`=:ip,`port`=:port,`user`=AES_ENCRYPT(:user,:aeskey),`pass`=AES_ENCRYPT(:pass,:aeskey),`publickey`=:publickey,`keyname`=:keyname,`ftpIP`=:ftpIP,`ftpPort`=:ftpPort,`maxVhost`=:maxVhost,`maxHDD`=:maxHDD,`hddOverbook`=:hddOverbook,`overbookPercent`=:overbookPercent,`defaultdns`=:defaultdns,`httpdCmd`=:httpdCmd,`serverType`=:serverType,`dirHttpd`=:dirHttpd,`dirLogs`=:dirLogs,`vhostStoragePath`=:vhostStoragePath,`vhostConfigPath`=:vhostConfigPath,`vhostTemplate`=:vhostTemplate,`quotaActive`=:quotaActive,`quotaCmd`=:quotaCmd,`repquotaCmd`=:repquotaCmd,`description`=:description,`userGroup`=:userGroup,`userAddCmd`=:userAddCmd,`userModCmd`=:userModCmd,`userDelCmd`=:userDelCmd,`usageType`=:usageType,`phpConfiguration`=:phpConfiguration,`blocksize`=:blocksize,`inodeBlockRatio`=:inodeBlockRatio,`fpmTemplate`=:fpmTemplate,`fpmConfigPath`=:fpmConfigPath,`fpmCmd`=:fpmCmd WHERE `webMasterID`=:id AND `resellerID`=:resellerID LIMIT 1");
|
||||
$query->execute(array(':externalID' => $externalID, ':active' => $active, ':ip' => $ip, ':port' => $port, ':aeskey' => $aeskey, ':user' => $user, ':pass' => $pass, ':publickey' => $publickey, ':keyname' => $keyname, ':ftpIP' => $ftpIP, ':ftpPort' => $ftpPort, ':maxVhost' => $maxVhost, ':maxHDD' => $maxHDD, ':hddOverbook' => $hddOverbook, ':overbookPercent' => $overbookPercent, ':defaultdns' => $defaultdns, ':httpdCmd' => $httpdCmd, ':serverType' => $serverType, ':dirHttpd' => $dirHttpd, ':dirLogs' => $dirLogs, ':vhostStoragePath' => $vhostStoragePath, ':vhostConfigPath' => $vhostConfigPath, ':vhostTemplate' => $vhostTemplate, ':quotaActive' => $quotaActive, ':quotaCmd' => $quotaCmd, ':repquotaCmd' => $repquotaCmd, ':description' => $description, ':userGroup' => $userGroup, ':userAddCmd' => $userAddCmd, ':userModCmd' => $userModCmd, ':userDelCmd' => $userDelCmd, ':usageType' => $usageType, ':phpConfiguration' => $phpConfiguration, ':blocksize' => $blocksize, ':inodeBlockRatio' => $inodeBlockRatio, ':fpmTemplate' => $fpmTemplate, ':fpmConfigPath' => $fpmConfigPath, ':fpmCmd' => $fpmCmd, ':id' => $id, ':resellerID' => $resellerLockupID));
|
||||
|
||||
$rowCount = $query->rowCount();
|
||||
$loguseraction = '%mod% %webmaster% ' . $ip;
|
||||
@ -471,6 +505,9 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
$userAddCmd = $row['userAddCmd'];
|
||||
$userModCmd = $row['userModCmd'];
|
||||
$userDelCmd = $row['userDelCmd'];
|
||||
$fpmTemplate = $row['fpmTemplate'];
|
||||
$fpmConfigPath = $row['fpmConfigPath'];
|
||||
$fpmCmd = $row['fpmCmd'];
|
||||
$vhostStoragePath = $row['vhostStoragePath'];
|
||||
$vhostConfigPath = $row['vhostConfigPath'];
|
||||
$vhostTemplate = $row['vhostTemplate'];
|
||||
|
@ -72,6 +72,8 @@ $vhostTemplate = $ui->escaped('vhostTemplate', 'post');
|
||||
$description = $ui->names('description', 255, 'post');
|
||||
$defaultDomain = $ui->domain('defaultDomain', 'post');
|
||||
$ownVhost = ($ui->active('ownVhost', 'post')) ? $ui->active('ownVhost', 'post') : 'N';
|
||||
$ownFPM = ($ui->active('ownFPM', 'post')) ? $ui->active('ownFPM', 'post') : 'N';
|
||||
$fpmTemplate = $ui->escaped('fpmTemplate', 'post');
|
||||
|
||||
// CSFR protection with hidden tokens. If token(true) returns false, we likely have an attack
|
||||
if ($ui->w('action',4, 'post') and !token(true)) {
|
||||
@ -255,8 +257,8 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
// Make the inserts or updates define the log entry and get the affected rows from insert
|
||||
if ($ui->st('action', 'post') == 'ad') {
|
||||
|
||||
$query = $sql->prepare("INSERT INTO `webVhost` (`webMasterID`,`userID`,`active`,`hdd`,`ftpPassword`,`phpConfiguration`,`description`,`externalID`,`resellerID`) VALUES (?,?,?,?,AES_ENCRYPT(?,?),?,?,?,?)");
|
||||
$query->execute(array($webMasterID, $userID, $active, $hdd, $ftpPassword, $aeskey, $phpConfiguration, $description, $externalID, $resellerLockupID));
|
||||
$query = $sql->prepare("INSERT INTO `webVhost` (`webMasterID`,`userID`,`active`,`hdd`,`ftpPassword`,`phpConfiguration`,`description`,`ownFPM`,`fpmConfiguration`,`externalID`,`resellerID`) VALUES (?,?,?,?,AES_ENCRYPT(?,?),?,?,?,?,?,?)");
|
||||
$query->execute(array($webMasterID, $userID, $active, $hdd, $ftpPassword, $aeskey, $phpConfiguration, $description, $ownFPM, $fpmTemplate, $externalID, $resellerLockupID));
|
||||
|
||||
$id = (int) $sql->lastInsertId();
|
||||
|
||||
@ -272,8 +274,8 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
|
||||
$ftpUser = 'web-' . $id;
|
||||
|
||||
$query = $sql->prepare("UPDATE `webVhost` SET `active`=?,`hdd`=?,`ftpPassword`=AES_ENCRYPT(?,?),`phpConfiguration`=?,`description`=?,`externalID`=? WHERE `webVhostID`=? AND `resellerID`=? LIMIT 1");
|
||||
$query->execute(array($active, $hdd, $ftpPassword, $aeskey, $phpConfiguration, $description, $externalID, $id, $resellerLockupID));
|
||||
$query = $sql->prepare("UPDATE `webVhost` SET `active`=?,`hdd`=?,`ftpPassword`=AES_ENCRYPT(?,?),`phpConfiguration`=?,`description`=?,`ownFPM`=?,`fpmConfiguration`=?,`externalID`=? WHERE `webVhostID`=? AND `resellerID`=? LIMIT 1");
|
||||
$query->execute(array($active, $hdd, $ftpPassword, $aeskey, $phpConfiguration, $description, $ownFPM, $fpmTemplate, $externalID, $id, $resellerLockupID));
|
||||
|
||||
// Needs to be set for domain inserts
|
||||
$userID = $oldUserID;
|
||||
|
@ -53,12 +53,14 @@ $totalVhosts = 0;
|
||||
$maxHDD = 1000;
|
||||
$quotaActive = 'N';
|
||||
$ownVhost = 'N';
|
||||
$ownFPM = 'N';
|
||||
$fpmTemplate = '';
|
||||
$usageType = 'F';
|
||||
$dns = array();
|
||||
$phpConfigurationMaster = array();
|
||||
$phpConfigurationVhost = new stdClass();
|
||||
|
||||
$query = $sql->prepare("SELECT m.`vhostTemplate`,m.`maxVhost`,m.`maxHDD`,m.`quotaActive`,m.`defaultdns`,m.`usageType`,m.`phpConfiguration`,(SELECT COUNT(v.`webVhostID`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`) AS `totalVhosts`,(SELECT SUM(v.`hdd`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`) AS `totalHDD` FROM `webMaster` AS m WHERE m.`webMasterID`=? AND m.`resellerID`=? LIMIT 1");
|
||||
$query = $sql->prepare("SELECT m.`vhostTemplate`,m.`fpmTemplate`,m.`serverType`,m.`maxVhost`,m.`maxHDD`,m.`quotaActive`,m.`defaultdns`,m.`usageType`,m.`phpConfiguration`,(SELECT COUNT(v.`webVhostID`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`) AS `totalVhosts`,(SELECT SUM(v.`hdd`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`) AS `totalHDD` FROM `webMaster` AS m WHERE m.`webMasterID`=? AND m.`resellerID`=? LIMIT 1");
|
||||
$query->execute(array($ui->id('id', 10, 'get'), $resellerLockupID));
|
||||
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
$vhostTemplate = $row['vhostTemplate'];
|
||||
@ -67,18 +69,26 @@ while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
$totalVhosts = (int) $row['totalVhosts'];
|
||||
$leftHDD = (int) $row['maxHDD'] - $row['totalHDD'];
|
||||
$quotaActive = $row['quotaActive'];
|
||||
$serverType = $row['serverType'];
|
||||
$usageType = $row['usageType'];
|
||||
$fpmTemplate = $row['fpmTemplate'];
|
||||
$phpConfigurationMaster = @parse_ini_string($row['phpConfiguration'], true, INI_SCANNER_RAW);
|
||||
}
|
||||
|
||||
// Edit mode will provide the webhost ID
|
||||
if ($ui->id('serverID', 10, 'get')) {
|
||||
|
||||
$query = $sql->prepare("SELECT `hdd`,`phpConfiguration` FROM `webVhost` WHERE `webVhostID`=? AND `resellerID`=? LIMIT 1");
|
||||
$query = $sql->prepare("SELECT `hdd`,`phpConfiguration`,`ownFPM`,`fpmConfiguration` FROM `webVhost` WHERE `webVhostID`=? AND `resellerID`=? LIMIT 1");
|
||||
$query->execute(array($ui->id('serverID', 10, 'get'), $resellerLockupID));
|
||||
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$hdd = $row['hdd'];
|
||||
$phpConfigurationVhost = @json_decode($row['phpConfiguration']);
|
||||
$ownFPM = $row['ownFPM'];
|
||||
|
||||
if ($ownFPM == 'Y') {
|
||||
$fpmTemplate = $row['fpmConfiguration'];
|
||||
}
|
||||
}
|
||||
|
||||
$query = $sql->prepare("SELECT `domain`,`path`,`ownVhost`,`vhostTemplate` FROM `webVhostDomain` WHERE `webVhostID`=? AND `resellerID`=? ORDER BY `domain`");
|
||||
|
@ -62,6 +62,9 @@ $defined['webMaster'] = array(
|
||||
'vhostStoragePath' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'vhostConfigPath' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'vhostTemplate' => array("Type"=>"text","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'fpmConfigPath' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'fpmTemplate' => array("Type"=>"text","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'fpmCmd' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'dirHttpd' => array("Type"=>"text","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'dirLogs' => array("Type"=>"text","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'quotaActive' => array("Type"=>"enum('Y','N')","Null"=>"YES","Key"=>"","Default"=>"Y","Extra"=>""),
|
||||
|
@ -49,6 +49,8 @@ $defined['webVhost'] = array(
|
||||
'ftpUser' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'ftpPassword' => array("Type"=>"blob","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'phpConfiguration' => array("Type"=>"text","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'ownFPM' => array("Type"=>"enum('Y','N')","Null"=>"YES","Key"=>"","Default"=>"N","Extra"=>""),
|
||||
'fpmConfiguration' => array("Type"=>"text","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'description' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'externalID' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"0","Extra"=>""),
|
||||
'resellerID' => array("Type"=>"int(10) unsigned","Null"=>"NO","Key"=>"MUL","Default"=>"0","Extra"=>"")
|
||||
|
@ -89,6 +89,10 @@ class HttpdManagement {
|
||||
$this->hostData['dirHttpd'] = $row['dirHttpd'];
|
||||
$this->hostData['dirLogs'] = $row['dirLogs'];
|
||||
$this->hostData['usageType'] = $row['usageType'];
|
||||
$this->hostData['serverType'] = $row['serverType'];
|
||||
$this->hostData['fpmConfigPath'] = $row['fpmConfigPath'];
|
||||
$this->hostData['fpmTemplate'] = $row['fpmTemplate'];
|
||||
$this->hostData['fpmCmd'] = $row['fpmCmd'];
|
||||
$this->hostData['skelDir'] = $this->removeNotNeededSlashes($this->hostData['vhostStoragePath'] . '/' . $this->hostData['user'] . '/skel/');
|
||||
|
||||
if ($row['quotaActive'] == 'Y') {
|
||||
@ -131,11 +135,38 @@ class HttpdManagement {
|
||||
return str_replace(array('//', '///'), '/', $value);
|
||||
}
|
||||
|
||||
private function replacePHPConfiguration($phpConfigurationVhost, $templateFileContentTemp, $asIni = false) {
|
||||
|
||||
if ($phpConfigurationVhost and $this->hostData['usageType'] == 'W') {
|
||||
|
||||
preg_match('/(\s{1,}%phpConfiguration%)/', $templateFileContentTemp, $matches);
|
||||
$match = array_shift($matches);
|
||||
$whiteSpace = str_replace('%phpConfiguration%', '', $match);
|
||||
|
||||
$phpOptions = '';
|
||||
|
||||
foreach ($phpConfigurationVhost as $phpOption) {
|
||||
if ($asIni) {
|
||||
$phpOptions .= str_replace(' ', '] = ', str_replace('php_admin_flag ', 'php_admin_value[', str_replace('php_admin_value ', 'php_admin_value[', $phpOption))) . "\r\n";
|
||||
} else {
|
||||
$phpOptions .= $whiteSpace . $phpOption;
|
||||
}
|
||||
}
|
||||
|
||||
$templateFileContentTemp = str_replace('%phpConfiguration%', $phpOptions, $templateFileContentTemp);
|
||||
|
||||
} else {
|
||||
$templateFileContentTemp = str_replace('%phpConfiguration%', '', $templateFileContentTemp);
|
||||
}
|
||||
|
||||
return $templateFileContentTemp;
|
||||
}
|
||||
|
||||
private function getVhostData ($vhostID) {
|
||||
|
||||
if ($this->vhostData == false) {
|
||||
|
||||
$query = $this->sql->prepare("SELECT v.`active`,v.`userID`,v.`description`,v.`hdd`,v.`ftpUser`,v.`phpConfiguration`,v.`defaultDomain`,AES_DECRYPT(v.`ftpPassword`,?) AS `decryptedFTPPass`,u.`mail` FROM `webVhost` AS v INNER JOIN `userdata` AS u ON u.`id`=v.`userID` WHERE v.`webVhostID`=? AND v.`resellerID`=? LIMIT 1");
|
||||
$query = $this->sql->prepare("SELECT v.`active`,v.`userID`,v.`description`,v.`hdd`,v.`ftpUser`,v.`phpConfiguration`,v.`defaultDomain`,v.`ownFPM`,v.`fpmConfiguration`,AES_DECRYPT(v.`ftpPassword`,?) AS `decryptedFTPPass`,u.`mail` FROM `webVhost` AS v INNER JOIN `userdata` AS u ON u.`id`=v.`userID` WHERE v.`webVhostID`=? AND v.`resellerID`=? LIMIT 1");
|
||||
$query->execute(array($this->aeskey, $vhostID, $this->resellerID));
|
||||
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
@ -152,6 +183,15 @@ class HttpdManagement {
|
||||
$phpConfigurationVhost = @json_decode($row['phpConfiguration']);
|
||||
$this->vhostData['dns'] = array();
|
||||
|
||||
if (($this->hostData['serverType'] == 'N' or $this->hostData['serverType'] == 'L') and $this->hostData['usageType'] == 'W') {
|
||||
|
||||
$this->vhostData['fpmConfigPath'] = $this->removeNotNeededSlashes($this->hostData['fpmConfigPath'] . '/' . $this->vhostData['ftpUser']) . '.conf';
|
||||
$this->vhostData['fpmFileContent'] = "; DO NOT EDIT DIRECTLY!\r\n; This file is autogenerated by easy-wi.com.\r\n; Date and time of generation was " . date('Y-m-d H:i:s') . "\r\n\r\n";
|
||||
|
||||
$fpmTemplate = $this->replacePHPConfiguration($phpConfigurationVhost, ($row['ownFPM'] == 'Y') ? $row['fpmConfiguration'] : $this->hostData['fpmTemplate'], true);
|
||||
$this->vhostData['fpmFileContent'] .= str_replace(array('%user%', '%group%', '%vhostpath%', '%email%', '%htdocs%', '%logDir%'), array($row['ftpUser'], $this->hostData['userGroup'], $this->hostData['vhostStoragePath'], $row['mail'], $this->hostData['dirHttpd'], $this->hostData['dirLogs']), $fpmTemplate) . "\r\n";
|
||||
}
|
||||
|
||||
// Workaround for migrations and other admin is breaking something faults
|
||||
$query2 = $this->sql->prepare("SELECT 1 FROM `webVhostDomain` WHERE `webVhostID`=? LIMIT 1");
|
||||
$query2->execute(array($vhostID));
|
||||
@ -175,26 +215,7 @@ class HttpdManagement {
|
||||
|
||||
$this->vhostData['dns'][] = $row2['domain'];
|
||||
|
||||
$templateFileContentTemp = ($row2['ownVhost'] == 'Y') ? $row2['vhostTemplate'] : $this->hostData['vhostTemplate'];
|
||||
|
||||
if ($phpConfigurationVhost and $this->hostData['usageType'] == 'W') {
|
||||
|
||||
preg_match('/(\s{1,}%phpConfiguration%)/', $templateFileContentTemp, $matches);
|
||||
$match = array_shift($matches);
|
||||
$whiteSpace = str_replace('%phpConfiguration%', '', $match);
|
||||
|
||||
$phpOptions = '';
|
||||
|
||||
foreach ($phpConfigurationVhost as $phpOption) {
|
||||
$phpOptions .= $whiteSpace . $phpOption;
|
||||
}
|
||||
|
||||
$templateFileContentTemp = str_replace('%phpConfiguration%', $phpOptions, $templateFileContentTemp);
|
||||
|
||||
} else {
|
||||
$templateFileContentTemp = str_replace('%phpConfiguration%', '', $templateFileContentTemp);
|
||||
}
|
||||
|
||||
$templateFileContentTemp = $this->replacePHPConfiguration($phpConfigurationVhost, ($row2['ownVhost'] == 'Y') ? $row2['vhostTemplate'] : $this->hostData['vhostTemplate']);
|
||||
$templateFileContentTemp = str_replace(array('%user%', '%group%', '%vhostpath%', '%email%', '%htdocs%', '%logDir%'), array($row['ftpUser'], $this->hostData['userGroup'], $this->hostData['vhostStoragePath'], $row['mail'], $this->hostData['dirHttpd'], $this->hostData['dirLogs']), $templateFileContentTemp) . "\r\n";
|
||||
$templateFileContentTemp = str_replace(array('%path%', '%url%', '%domain%'), array($row2['path'], $row2['domain'], $row2['domain']), $templateFileContentTemp) . "\r\n";
|
||||
|
||||
@ -252,7 +273,12 @@ class HttpdManagement {
|
||||
}
|
||||
|
||||
if ($this->sftpObject != false) {
|
||||
|
||||
$this->sftpObject->put($this->vhostData['vhostConfigFile'], $this->vhostData['templateFileContent']);
|
||||
|
||||
if ($this->vhostData['fpmFileContent'] != '') {
|
||||
$this->sftpObject->put($this->vhostData['fpmConfigPath'], $this->vhostData['fpmFileContent']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -263,6 +289,10 @@ class HttpdManagement {
|
||||
|
||||
if ($this->sftpObject != false) {
|
||||
$this->sftpObject->delete($this->vhostData['vhostConfigFile'], true);
|
||||
|
||||
if ($this->vhostData['fpmFileContent'] != '') {
|
||||
$this->sftpObject->delete($this->vhostData['fpmConfigPath']);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->ssh2Object != false and $fullRemove == true) {
|
||||
@ -290,7 +320,6 @@ class HttpdManagement {
|
||||
$cmd = 'p() { ' . str_replace('%cmd%', '-p `perl -e \'print crypt("' . $password . '","Sa")\'` ' . $this->vhostData['ftpUser'], $this->hostData['userModCmd']) . ' > /dev/null 2>&1; }; p&';
|
||||
|
||||
$this->ssh2Object->exec($cmd);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -371,8 +400,12 @@ class HttpdManagement {
|
||||
if ($this->ssh2Object != false) {
|
||||
|
||||
$cmd = 'r() { ' . $this->hostData['httpdCmd'] . ' > /dev/null 2>&1; }; r&';
|
||||
|
||||
$this->ssh2Object->exec($cmd);
|
||||
|
||||
if (($this->hostData['serverType'] == 'N' or $this->hostData['serverType'] == 'L') and $this->hostData['usageType'] == 'W') {
|
||||
$cmd = 'f() { ' . $this->hostData['fpmCmd'] . ' > /dev/null 2>&1; }; f&';
|
||||
$this->ssh2Object->exec($cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,19 @@
|
||||
<div class="controls"><input class="form-control" id="inputExternalID" type="text" name="externalID" value="<?php echo $externalID;?>" maxlength="255"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputServerType"><?php echo $sprache->serverType;?></label>
|
||||
<div class="controls">
|
||||
<select class="form-control" id="inputServerType" name="serverType" onchange="loadServerSettings(this.value, $('#inputUsageType').val());">
|
||||
<option value="N">Nginx</option>
|
||||
<option value="L" <?php if ($serverType=='L') echo 'selected="selected"';?>>Lighttpd</option>
|
||||
<option value="H" <?php if ($serverType=='H') echo 'selected="selected"'; ?>>Hiawatha</option>
|
||||
<option value="A" <?php if ($serverType=='A') echo 'selected="selected"'; ?>>Apache</option>
|
||||
<option value="O" <?php if ($serverType=='O') echo 'selected="selected"'; ?>><?php echo $sprache->other;?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputUsageType"><?php echo $sprache->usageType;?></label>
|
||||
<div class="controls">
|
||||
@ -176,19 +189,6 @@
|
||||
<div class="controls"><input class="form-control" id="inputuserDelCmd" type="text" name="userDelCmd" value="<?php echo $userDelCmd;?>" required></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group<?php if(isset($errors['publickey'])) echo ' error';?>">
|
||||
<label for="inputServerType"><?php echo $sprache->serverType;?></label>
|
||||
<div class="controls">
|
||||
<select class="form-control" id="inputServerType" name="serverType" onchange="loadServerSettings(this.value, $('#inputUsageType').val());">
|
||||
<option value="N">Nginx</option>
|
||||
<option value="L" <?php if ($serverType=='L') echo 'selected="selected"';?>>Lighttpd</option>
|
||||
<option value="H" <?php if ($serverType=='H') echo 'selected="selected"'; ?>>Hiawatha</option>
|
||||
<option value="A" <?php if ($serverType=='A') echo 'selected="selected"'; ?>>Apache</option>
|
||||
<option value="O" <?php if ($serverType=='O') echo 'selected="selected"'; ?>><?php echo $sprache->other;?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputDirHttpd"><?php echo $sprache->dirHttpd;?></label>
|
||||
<div class="controls"><input class="form-control" id="inputDirHttpd" type="text" name="dirHttpd" value="<?php echo $dirHttpd;?>"></div>
|
||||
@ -221,6 +221,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group fpmSupport">
|
||||
<label for="inputFpmCmd"><?php echo $sprache->fpmCmd;?></label>
|
||||
<div class="controls"><input class="form-control" id="inputFpmCmd" type="text" name="fpmCmd" value="<?php echo $fpmCmd;?>" required></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group fpmSupport">
|
||||
<label for="inputFpmConfigPath"><?php echo $sprache->fpmConfigPath;?></label>
|
||||
<div class="controls"><input class="form-control" id="inputFpmConfigPath" type="text" name="fpmConfigPath" value="<?php echo $fpmConfigPath;?>" required></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group fpmSupport">
|
||||
<label for="inputFpmTemplate"><?php echo $sprache->fpmTemplate;?></label>
|
||||
<div class="controls">
|
||||
<textarea class="form-control" id="inputFpmTemplate" name="fpmTemplate" rows="10" required><?php echo $fpmTemplate;?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputQuotaActive"><?php echo $sprache->quotaActive;?></label>
|
||||
<div class="controls">
|
||||
|
@ -39,6 +39,19 @@
|
||||
<div class="controls"><input class="form-control" id="inputExternalID" class="span11" type="text" name="externalID" value="<?php echo $externalID;?>" maxlength="255"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputServerType"><?php echo $sprache->serverType;?></label>
|
||||
<div class="controls">
|
||||
<select class="form-control" id="inputServerType" class="span11" name="serverType" onchange="loadServerSettings(this.value, $('#inputUsageType').val());">
|
||||
<option value="N">Nginx</option>
|
||||
<option value="L" <?php if ($serverType=='L') echo 'selected="selected"';?>>Lighttpd</option>
|
||||
<option value="H" <?php if ($serverType=='H') echo 'selected="selected"'; ?>>Hiawatha</option>
|
||||
<option value="A" <?php if ($serverType=='A') echo 'selected="selected"'; ?>>Apache</option>
|
||||
<option value="O" <?php if ($serverType=='O') echo 'selected="selected"'; ?>><?php echo $sprache->other;?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputUsageType"><?php echo $sprache->usageType;?></label>
|
||||
<div class="controls">
|
||||
@ -177,19 +190,6 @@
|
||||
<div class="controls"><input class="form-control" id="inputuserDelCmd" class="span11" type="text" name="userDelCmd" value="<?php echo $userDelCmd;?>" required></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group<?php if(isset($errors['publickey'])) echo ' error';?>">
|
||||
<label for="inputServerType"><?php echo $sprache->serverType;?></label>
|
||||
<div class="controls">
|
||||
<select class="form-control" id="inputServerType" class="span11" name="serverType" onchange="loadServerSettings(this.value, $('#inputUsageType').val());">
|
||||
<option value="N">Nginx</option>
|
||||
<option value="L" <?php if ($serverType=='L') echo 'selected="selected"';?>>Lighttpd</option>
|
||||
<option value="H" <?php if ($serverType=='H') echo 'selected="selected"'; ?>>Hiawatha</option>
|
||||
<option value="A" <?php if ($serverType=='A') echo 'selected="selected"'; ?>>Apache</option>
|
||||
<option value="O" <?php if ($serverType=='O') echo 'selected="selected"'; ?>><?php echo $sprache->other;?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputDirHttpd"><?php echo $sprache->dirHttpd;?></label>
|
||||
<div class="controls"><input class="form-control" id="inputDirHttpd" class="span11" type="text" name="dirHttpd" value="<?php echo $dirHttpd;?>"></div>
|
||||
@ -222,6 +222,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group fpmSupport">
|
||||
<label for="inputFpmCmd"><?php echo $sprache->fpmCmd;?></label>
|
||||
<div class="controls"><input class="form-control" id="inputFpmCmd" type="text" name="fpmCmd" value="<?php echo $fpmCmd;?>" required></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group fpmSupport">
|
||||
<label for="inputFpmConfigPath"><?php echo $sprache->fpmConfigPath;?></label>
|
||||
<div class="controls"><input class="form-control" id="inputFpmConfigPath" type="text" name="fpmConfigPath" value="<?php echo $fpmConfigPath;?>" required></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group fpmSupport">
|
||||
<label for="inputFpmTemplate"><?php echo $sprache->fpmTemplate;?></label>
|
||||
<div class="controls">
|
||||
<textarea class="form-control" id="inputFpmTemplate" name="fpmTemplate" rows="10" required><?php echo $fpmTemplate;?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputQuotaActive"><?php echo $sprache->quotaActive;?></label>
|
||||
<div class="controls">
|
||||
|
@ -25,6 +25,26 @@
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($usageType == 'W') { ?>
|
||||
|
||||
<?php if ($serverType == 'N' or $serverType == 'L') { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputOwnFPM"><?php echo $sprache->ownFPM;?></label>
|
||||
<select class="form-control" id="inputOwnFPM" name="ownFPM" onchange="SwitchShowHideRows(this.value,'switch', 1);">
|
||||
<option value="N"><?php echo $gsprache->no;?></option>
|
||||
<option value="Y" <?php if($ownFPM=='Y') echo 'selected="selected"';?>><?php echo $gsprache->yes;?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="Y switch form-group<?php if($ownFPM=='N') echo ' display_none';?>">
|
||||
<label for="inputFpmTemplate"><?php echo $sprache->fpmTemplate;?></label>
|
||||
<div class="controls">
|
||||
<textarea class="form-control" id="inputFpmTemplate" name="fpmTemplate" rows="10"><?php echo $fpmTemplate;?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php foreach($phpConfigurationMaster as $groupName => $array) { ?>
|
||||
<div class="form-group">
|
||||
<label for="input<?php echo str_replace(' ', '', $groupName);?>"><?php echo $groupName;?></label>
|
||||
@ -78,9 +98,8 @@
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
SwitchShowHideRows('init_ready');
|
||||
SwitchShowHideRows('init_ready');
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
Loading…
x
Reference in New Issue
Block a user