Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13b1503bf2 | ||
|
|
2980397545 | ||
|
|
5612720342 | ||
|
|
4d3fa6eca5 | ||
|
|
05b4c58aa8 | ||
|
|
f290497b64 | ||
|
|
b4dd35eed2 | ||
|
|
ec21e28000 |
@@ -17,7 +17,6 @@
|
|||||||
* @since 0.9.35
|
* @since 0.9.35
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
require './lib/init.php';
|
require './lib/init.php';
|
||||||
|
|
||||||
@@ -26,14 +25,13 @@ define('UPDATE_URI', "https://version.froxlor.org/Froxlor/legacy/" . $version);
|
|||||||
define('RELEASE_URI', "https://autoupdate.froxlor.org/froxlor-{version}.zip");
|
define('RELEASE_URI', "https://autoupdate.froxlor.org/froxlor-{version}.zip");
|
||||||
define('CHECKSUM_URI', "https://autoupdate.froxlor.org/froxlor-{version}.zip.sha256");
|
define('CHECKSUM_URI', "https://autoupdate.froxlor.org/froxlor-{version}.zip.sha256");
|
||||||
|
|
||||||
// check for allow_url_fopen
|
|
||||||
if (ini_get('allow_url_fopen') === false) {
|
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
// check for archive-stuff
|
// check for archive-stuff
|
||||||
if (! extension_loaded('zip')) {
|
if (! extension_loaded('zip')) {
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 2));
|
redirectTo($filename, array(
|
||||||
|
's' => $s,
|
||||||
|
'page' => 'error',
|
||||||
|
'errno' => 2
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// display initial version check
|
// display initial version check
|
||||||
@@ -43,58 +41,54 @@ if ($page == 'overview') {
|
|||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "checking auto-update");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "checking auto-update");
|
||||||
|
|
||||||
// check for new version
|
// check for new version
|
||||||
$latestversion = @file(UPDATE_URI);
|
$latestversion = HttpClient::urlGet(UPDATE_URI);
|
||||||
|
|
||||||
if (isset($latestversion[0])) {
|
$latestversion = explode('|', $latestversion);
|
||||||
$latestversion = explode('|', $latestversion[0]);
|
|
||||||
|
|
||||||
if (is_array($latestversion)
|
if (is_array($latestversion) && count($latestversion) >= 1) {
|
||||||
&& count($latestversion) >= 1
|
$_version = $latestversion[0];
|
||||||
) {
|
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
|
||||||
$_version = $latestversion[0];
|
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||||
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
|
|
||||||
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
|
||||||
|
|
||||||
// add the branding so debian guys are not gettings confused
|
// add the branding so debian guys are not gettings confused
|
||||||
// about their version-number
|
// about their version-number
|
||||||
$version_label = $_version.$branding;
|
$version_label = $_version . $branding;
|
||||||
$version_link = $_link;
|
$version_link = $_link;
|
||||||
$message_addinfo = $_message;
|
$message_addinfo = $_message;
|
||||||
|
|
||||||
// not numeric -> error-message
|
// not numeric -> error-message
|
||||||
if (!preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
|
if (! preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
|
||||||
// check for customized version to not output
|
// check for customized version to not output
|
||||||
// "There is a newer version of froxlor" besides the error-message
|
// "There is a newer version of froxlor" besides the error-message
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 3));
|
redirectTo($filename, array(
|
||||||
} elseif (version_compare2($version, $_version) == -1) {
|
's' => $s,
|
||||||
// there is a newer version - yay
|
'page' => 'error',
|
||||||
$isnewerversion = 1;
|
'errno' => 3
|
||||||
} else {
|
));
|
||||||
// nothing new
|
} elseif (version_compare2($version, $_version) == - 1) {
|
||||||
$isnewerversion = 0;
|
// there is a newer version - yay
|
||||||
}
|
$isnewerversion = 1;
|
||||||
|
} else {
|
||||||
|
// nothing new
|
||||||
|
$isnewerversion = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// anzeige über version-status mit ggfls. formular
|
// anzeige über version-status mit ggfls. formular
|
||||||
// zum update schritt #1 -> download
|
// zum update schritt #1 -> download
|
||||||
if ($isnewerversion == 1) {
|
if ($isnewerversion == 1) {
|
||||||
$text = 'There is a newer version available. Update to version <b>'.$_version.'</b> now?<br/>(Your current version is: '.$version.')';
|
$text = 'There is a newer version available. Update to version <b>' . $_version . '</b> now?<br/>(Your current version is: ' . $version . ')';
|
||||||
$hiddenparams = '<input type="hidden" name="newversion" value="'.$_version.'" />';
|
$hiddenparams = '<input type="hidden" name="newversion" value="' . $_version . '" />';
|
||||||
$yesfile = $filename.'?s='.$s.'&page=getdownload';
|
$yesfile = $filename . '?s=' . $s . '&page=getdownload';
|
||||||
eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";");
|
eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";");
|
||||||
exit;
|
exit();
|
||||||
}
|
} elseif ($isnewerversion == 0) {
|
||||||
elseif ($isnewerversion == 0) {
|
// all good
|
||||||
// all good
|
standard_success('noupdatesavail');
|
||||||
standard_success ('noupdatesavail');
|
} else {
|
||||||
} else {
|
standard_error('customized_version');
|
||||||
standard_error ('customized_version');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// error (something weird came from version.froxlor.org)
|
}// download the new archive
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 5));
|
|
||||||
}
|
|
||||||
// download the new archive
|
|
||||||
elseif ($page == 'getdownload') {
|
elseif ($page == 'getdownload') {
|
||||||
|
|
||||||
// retrieve the new version from the form
|
// retrieve the new version from the form
|
||||||
@@ -107,36 +101,35 @@ elseif ($page == 'getdownload') {
|
|||||||
$toLoad = str_replace('{version}', $newversion, RELEASE_URI);
|
$toLoad = str_replace('{version}', $newversion, RELEASE_URI);
|
||||||
$toCheck = str_replace('{version}', $newversion, CHECKSUM_URI);
|
$toCheck = str_replace('{version}', $newversion, CHECKSUM_URI);
|
||||||
|
|
||||||
// get archive data
|
|
||||||
$newArchive = @file_get_contents($toLoad);
|
|
||||||
|
|
||||||
// check for local destination folder
|
// check for local destination folder
|
||||||
if (!is_dir(FROXLOR_INSTALL_DIR.'/updates/')) {
|
if (! is_dir(FROXLOR_INSTALL_DIR . '/updates/')) {
|
||||||
mkdir(FROXLOR_INSTALL_DIR.'/updates/');
|
mkdir(FROXLOR_INSTALL_DIR . '/updates/');
|
||||||
}
|
}
|
||||||
|
|
||||||
// name archive
|
// name archive
|
||||||
$localArchive = FROXLOR_INSTALL_DIR.'/updates/'.basename($toLoad);
|
$localArchive = FROXLOR_INSTALL_DIR . '/updates/' . basename($toLoad);
|
||||||
|
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "Downloading ".$toLoad." to ".$localArchive);
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "Downloading " . $toLoad . " to " . $localArchive);
|
||||||
|
|
||||||
// remove old archive
|
// remove old archive
|
||||||
if (file_exists($localArchive)) {
|
if (file_exists($localArchive)) {
|
||||||
@unlink($localArchive);
|
@unlink($localArchive);
|
||||||
}
|
}
|
||||||
|
|
||||||
// store archive
|
// get archive data
|
||||||
$fh = fopen($localArchive, 'w');
|
try {
|
||||||
if (!fwrite($fh, $newArchive)) {
|
HttpClient::fileGet($toLoad, $localArchive);
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 4));
|
} catch (Exception $e) {
|
||||||
|
redirectTo($filename, array(
|
||||||
|
's' => $s,
|
||||||
|
'page' => 'error',
|
||||||
|
'errno' => 4
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// close file-handle
|
|
||||||
fclose($fh);
|
|
||||||
|
|
||||||
// validate the integrity of the downloaded file
|
// validate the integrity of the downloaded file
|
||||||
$_shouldsum = @file_get_contents($toCheck);
|
$_shouldsum = HttpClient::urlGet($toCheck);
|
||||||
if (!empty($_shouldsum)) {
|
if (! empty($_shouldsum)) {
|
||||||
$_t = explode(" ", $_shouldsum);
|
$_t = explode(" ", $_shouldsum);
|
||||||
$shouldsum = $_t[0];
|
$shouldsum = $_t[0];
|
||||||
} else {
|
} else {
|
||||||
@@ -145,58 +138,75 @@ elseif ($page == 'getdownload') {
|
|||||||
$filesum = hash_file('sha256', $localArchive);
|
$filesum = hash_file('sha256', $localArchive);
|
||||||
|
|
||||||
if ($filesum != $shouldsum) {
|
if ($filesum != $shouldsum) {
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 9));
|
redirectTo($filename, array(
|
||||||
|
's' => $s,
|
||||||
|
'page' => 'error',
|
||||||
|
'errno' => 9
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// to the next step
|
// to the next step
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'extract', 'archive' => basename($localArchive)));
|
redirectTo($filename, array(
|
||||||
|
's' => $s,
|
||||||
|
'page' => 'extract',
|
||||||
|
'archive' => basename($localArchive)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 6));
|
redirectTo($filename, array(
|
||||||
}
|
's' => $s,
|
||||||
// extract and install new version
|
'page' => 'error',
|
||||||
|
'errno' => 6
|
||||||
|
));
|
||||||
|
}// extract and install new version
|
||||||
elseif ($page == 'extract') {
|
elseif ($page == 'extract') {
|
||||||
|
|
||||||
$toExtract = isset($_GET['archive']) ? $_GET['archive'] : null;
|
$toExtract = isset($_GET['archive']) ? $_GET['archive'] : null;
|
||||||
$localArchive = FROXLOR_INSTALL_DIR.'/updates/'.$toExtract;
|
$localArchive = FROXLOR_INSTALL_DIR . '/updates/' . $toExtract;
|
||||||
|
|
||||||
if (isset($_POST['send'])
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
&& $_POST['send'] == 'send'
|
|
||||||
) {
|
|
||||||
// decompress from zip
|
// decompress from zip
|
||||||
$zip = new ZipArchive;
|
$zip = new ZipArchive();
|
||||||
$res = $zip->open($localArchive);
|
$res = $zip->open($localArchive);
|
||||||
if ($res === true) {
|
if ($res === true) {
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "Extracting ".$localArchive." to ".FROXLOR_INSTALL_DIR);
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "Extracting " . $localArchive . " to " . FROXLOR_INSTALL_DIR);
|
||||||
$zip->extractTo(FROXLOR_INSTALL_DIR);
|
$zip->extractTo(FROXLOR_INSTALL_DIR);
|
||||||
$zip->close();
|
$zip->close();
|
||||||
// success - remove unused archive
|
// success - remove unused archive
|
||||||
@unlink($localArchive);
|
@unlink($localArchive);
|
||||||
} else {
|
} else {
|
||||||
// error
|
// error
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 8));
|
redirectTo($filename, array(
|
||||||
|
's' => $s,
|
||||||
|
'page' => 'error',
|
||||||
|
'errno' => 8
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// redirect to update-page?
|
// redirect to update-page?
|
||||||
redirectTo('admin_updates.php', array('s' => $s));
|
redirectTo('admin_updates.php', array(
|
||||||
|
's' => $s
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($localArchive)) {
|
if (! file_exists($localArchive)) {
|
||||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 7));
|
redirectTo($filename, array(
|
||||||
|
's' => $s,
|
||||||
|
'page' => 'error',
|
||||||
|
'errno' => 7
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = 'Extract downloaded archive "'.$toExtract.'"?';
|
$text = 'Extract downloaded archive "' . $toExtract . '"?';
|
||||||
$hiddenparams = '';
|
$hiddenparams = '';
|
||||||
$yesfile = $filename.'?s='.$s.'&page=extract&archive='.$toExtract;
|
$yesfile = $filename . '?s=' . $s . '&page=extract&archive=' . $toExtract;
|
||||||
eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";");
|
eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
// display error
|
// display error
|
||||||
elseif ($page == 'error') {
|
elseif ($page == 'error') {
|
||||||
|
|
||||||
// retrieve error-number via url-parameter
|
// retrieve error-number via url-parameter
|
||||||
$errno = isset($_GET['errno']) ? (int)$_GET['errno'] : 0;
|
$errno = isset($_GET['errno']) ? (int) $_GET['errno'] : 0;
|
||||||
|
|
||||||
// 1 = no allow_url_fopen
|
|
||||||
// 2 = no Zlib
|
// 2 = no Zlib
|
||||||
// 3 = custom version detected
|
// 3 = custom version detected
|
||||||
// 4 = could not store archive to local hdd
|
// 4 = could not store archive to local hdd
|
||||||
@@ -205,5 +215,5 @@ elseif ($page == 'error') {
|
|||||||
// 7 = local archive does not exist
|
// 7 = local archive does not exist
|
||||||
// 8 = could not extract archive
|
// 8 = could not extract archive
|
||||||
// 9 = checksum mismatch
|
// 9 = checksum mismatch
|
||||||
standard_error ('autoupdate_'.$errno);
|
standard_error('autoupdate_' . $errno);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2209,12 +2209,19 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||||
");
|
");
|
||||||
|
$c_allowed_configs = getCustomerDetail($result['customerid'], 'allowed_phpconfigs');
|
||||||
|
if (!empty($c_allowed_configs)) {
|
||||||
|
$c_allowed_configs = json_decode($c_allowed_configs, true);
|
||||||
|
} else {
|
||||||
|
$c_allowed_configs = array();
|
||||||
|
}
|
||||||
|
|
||||||
while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
$disabled = !empty($c_allowed_configs) && !in_array($phpconfigs_row['id'], $c_allowed_configs);
|
||||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||||
$phpconfigs .= makeoption($phpconfigs_row['description'] . " [".$phpconfigs_row['interpreter']."]", $phpconfigs_row['id'], $result['phpsettingid'], true, true);
|
$phpconfigs .= makeoption($phpconfigs_row['description'] . " [".$phpconfigs_row['interpreter']."]", $phpconfigs_row['id'], $result['phpsettingid'], true, true, null, $disabled);
|
||||||
} else {
|
} else {
|
||||||
$phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true);
|
$phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true, null, $disabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2231,6 +2238,13 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
eval("echo \"" . getTemplate("domains/domains_edit") . "\";");
|
eval("echo \"" . getTemplate("domains/domains_edit") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} elseif ($action == 'jqGetCustomerPHPConfigs') {
|
||||||
|
|
||||||
|
$customerid = intval($_POST['customerid']);
|
||||||
|
$allowed_phpconfigs = getCustomerDetail($customerid, 'allowed_phpconfigs');
|
||||||
|
echo !empty($allowed_phpconfigs) ? $allowed_phpconfigs : json_encode(array());
|
||||||
|
exit;
|
||||||
|
|
||||||
} elseif ($action == 'import') {
|
} elseif ($action == 'import') {
|
||||||
|
|
||||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
|
|||||||
@@ -86,41 +86,31 @@ if ($page == 'overview') {
|
|||||||
|| (isset($lookfornewversion) && $lookfornewversion == 'yes')
|
|| (isset($lookfornewversion) && $lookfornewversion == 'yes')
|
||||||
) {
|
) {
|
||||||
$update_check_uri = 'http://version.froxlor.org/Froxlor/legacy/' . $version;
|
$update_check_uri = 'http://version.froxlor.org/Froxlor/legacy/' . $version;
|
||||||
|
$latestversion = HttpClient::urlGet($update_check_uri);
|
||||||
|
$latestversion = explode('|', $latestversion);
|
||||||
|
|
||||||
if (ini_get('allow_url_fopen')) {
|
if (is_array($latestversion)
|
||||||
$latestversion = @file($update_check_uri);
|
&& count($latestversion) >= 1
|
||||||
|
) {
|
||||||
|
$_version = $latestversion[0];
|
||||||
|
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
|
||||||
|
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||||
|
|
||||||
if (isset($latestversion[0])) {
|
// add the branding so debian guys are not gettings confused
|
||||||
$latestversion = explode('|', $latestversion[0]);
|
// about their version-number
|
||||||
|
$lookfornewversion_lable = $_version.$branding;
|
||||||
|
$lookfornewversion_link = $_link;
|
||||||
|
$lookfornewversion_addinfo = $_message;
|
||||||
|
|
||||||
if (is_array($latestversion)
|
// not numeric -> error-message
|
||||||
&& count($latestversion) >= 1
|
if (!preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
|
||||||
) {
|
// check for customized version to not output
|
||||||
$_version = $latestversion[0];
|
// "There is a newer version of froxlor" besides the error-message
|
||||||
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
|
$isnewerversion = 2;
|
||||||
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
} elseif (version_compare2($version, $_version) == -1) {
|
||||||
|
$isnewerversion = 1;
|
||||||
// add the branding so debian guys are not gettings confused
|
|
||||||
// about their version-number
|
|
||||||
$lookfornewversion_lable = $_version.$branding;
|
|
||||||
$lookfornewversion_link = $_link;
|
|
||||||
$lookfornewversion_addinfo = $_message;
|
|
||||||
|
|
||||||
// not numeric -> error-message
|
|
||||||
if (!preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
|
|
||||||
// check for customized version to not output
|
|
||||||
// "There is a newer version of froxlor" besides the error-message
|
|
||||||
$isnewerversion = 2;
|
|
||||||
} elseif (version_compare2($version, $_version) == -1) {
|
|
||||||
$isnewerversion = 1;
|
|
||||||
} else {
|
|
||||||
$isnewerversion = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
redirectTo($update_check_uri.'/pretty', NULL, false);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
redirectTo($update_check_uri.'/pretty', NULL, false);
|
$isnewerversion = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
redirectTo($update_check_uri.'/pretty', NULL, false);
|
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ if ($page == 'overview') {
|
|||||||
$fpmconfigs = '';
|
$fpmconfigs = '';
|
||||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$fpmconfigs .= makeoption($row['description'], $row['id'], $id, true, true);
|
$fpmconfigs .= makeoption($row['description'], $row['id'], $result['fpmsettingid'], true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
||||||
@@ -496,7 +496,7 @@ if ($page == 'overview') {
|
|||||||
// set default fpm daemon config for all php-config that use this config that is to be deleted
|
// set default fpm daemon config for all php-config that use this config that is to be deleted
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
||||||
`phpsettingid` = '1' WHERE `phpsettingid` = :id");
|
`fpmsettingid` = '1' WHERE `fpmsettingid` = :id");
|
||||||
Database::pexecute($upd_stmt, array(
|
Database::pexecute($upd_stmt, array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -686,7 +686,7 @@ opcache.interned_strings_buffer'),
|
|||||||
('panel', 'password_special_char_required', '0'),
|
('panel', 'password_special_char_required', '0'),
|
||||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||||
('panel', 'customer_hide_options', ''),
|
('panel', 'customer_hide_options', ''),
|
||||||
('panel', 'version', '0.9.39'),
|
('panel', 'version', '0.9.39.1'),
|
||||||
('panel', 'db_version', '201801260');
|
('panel', 'db_version', '201801260');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3880,3 +3880,9 @@ if (isFroxlorVersion('0.9.38.8')) {
|
|||||||
showUpdateStep("Updating from 0.9.38.8 to 0.9.39 final", false);
|
showUpdateStep("Updating from 0.9.38.8 to 0.9.39 final", false);
|
||||||
updateToVersion('0.9.39');
|
updateToVersion('0.9.39');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.39')) {
|
||||||
|
|
||||||
|
showUpdateStep("Updating from 0.9.39 to 0.9.39.1", false);
|
||||||
|
updateToVersion('0.9.39.1');
|
||||||
|
}
|
||||||
|
|||||||
72
lib/ajax.php
72
lib/ajax.php
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
// Load the user settings
|
// Load the user settings
|
||||||
define('FROXLOR_INSTALL_DIR', dirname(dirname(__FILE__)));
|
define('FROXLOR_INSTALL_DIR', dirname(dirname(__FILE__)));
|
||||||
if (!file_exists('./userdata.inc.php')) {
|
if (! file_exists('./userdata.inc.php')) {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
require './userdata.inc.php';
|
require './userdata.inc.php';
|
||||||
@@ -27,10 +27,11 @@ require './classes/database/class.Database.php';
|
|||||||
require './classes/settings/class.Settings.php';
|
require './classes/settings/class.Settings.php';
|
||||||
require './functions/validate/function.validate_ip.php';
|
require './functions/validate/function.validate_ip.php';
|
||||||
require './functions/validate/function.validateDomain.php';
|
require './functions/validate/function.validateDomain.php';
|
||||||
|
require './classes/cURL/class.HttpClient.php';
|
||||||
|
|
||||||
if(isset($_POST['action'])) {
|
if (isset($_POST['action'])) {
|
||||||
$action = $_POST['action'];
|
$action = $_POST['action'];
|
||||||
} elseif(isset($_GET['action'])) {
|
} elseif (isset($_GET['action'])) {
|
||||||
$action = $_GET['action'];
|
$action = $_GET['action'];
|
||||||
} else {
|
} else {
|
||||||
$action = "";
|
$action = "";
|
||||||
@@ -44,49 +45,29 @@ if ($action == "newsfeed") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists("simplexml_load_file") == false) {
|
if (function_exists("simplexml_load_file") == false) {
|
||||||
die();
|
outputItem("Newsfeed not available due to missing php-simplexml extension", "Please install the php-simplexml extension in order to view our newsfeed.");
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists('curl_version')) {
|
if (function_exists('curl_version')) {
|
||||||
$ch = curl_init();
|
$output = HttpClient::urlGet($feed);
|
||||||
curl_setopt($ch, CURLOPT_URL, $feed);
|
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Froxlor/'.$version);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
||||||
$output = curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
$news = simplexml_load_string(trim($output));
|
$news = simplexml_load_string(trim($output));
|
||||||
} else {
|
} else {
|
||||||
if (ini_get('allow_url_fopen')) {
|
outputItem("Newsfeed not available due to missing php-curl extension", "Please install the php-curl extension in order to view our newsfeed.");
|
||||||
ini_set('user_agent', 'Froxlor/'.$version);
|
exit();
|
||||||
$news = simplexml_load_file($feed, null, LIBXML_NOCDATA);
|
|
||||||
} else {
|
|
||||||
$news = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($news !== false) {
|
if ($news !== false) {
|
||||||
for ($i = 0; $i < 3; $i++) {
|
for ($i = 0; $i < 3; $i ++) {
|
||||||
$item = $news->channel->item[$i];
|
$item = $news->channel->item[$i];
|
||||||
|
|
||||||
$title = (string)$item->title;
|
$title = (string) $item->title;
|
||||||
$link = (string)$item->link;
|
$link = (string) $item->link;
|
||||||
$date = date("Y-m-d G:i", strtotime($item->pubDate));
|
$date = date("Y-m-d G:i", strtotime($item->pubDate));
|
||||||
$content = preg_replace("/[\r\n]+/", " ", strip_tags($item->description));
|
$content = preg_replace("/[\r\n]+/", " ", strip_tags($item->description));
|
||||||
$content = substr($content, 0, 150) . "...";
|
$content = substr($content, 0, 150) . "...";
|
||||||
|
|
||||||
echo "<li class=\"clearfix\">
|
outputItem($title, $content, $link, $date);
|
||||||
<div class=\"newsfeed-body clearfix\">
|
|
||||||
<div class=\"header\">
|
|
||||||
<strong class=\"primary-font\"><a href=\"{$link}\" target=\"_blank\">{$title}</a></strong>
|
|
||||||
<small class=\"pull-right text-muted\">
|
|
||||||
<i class=\"fa fa-clock-o fa-fw\"></i> {$date}
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
{$content}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</li>";
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "";
|
echo "";
|
||||||
@@ -94,3 +75,30 @@ if ($action == "newsfeed") {
|
|||||||
} else {
|
} else {
|
||||||
echo "No action set.";
|
echo "No action set.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function outputItem($title, $content, $link = null, $date = null)
|
||||||
|
{
|
||||||
|
echo "<li class=\"clearfix\">
|
||||||
|
<div class=\"newsfeed-body clearfix\">
|
||||||
|
<div class=\"header\">
|
||||||
|
<strong class=\"primary-font\">";
|
||||||
|
if (! empty($link)) {
|
||||||
|
echo "<a href=\"{$link}\" target=\"_blank\">";
|
||||||
|
}
|
||||||
|
echo $title;
|
||||||
|
if (! empty($link)) {
|
||||||
|
echo "</a>";
|
||||||
|
}
|
||||||
|
echo "</strong>";
|
||||||
|
if (! empty($date)) {
|
||||||
|
echo "<small class=\"pull-right text-muted\">
|
||||||
|
<i class=\"fa fa-clock-o fa-fw\"></i> {$date}
|
||||||
|
</small>";
|
||||||
|
}
|
||||||
|
echo "</div>
|
||||||
|
<p>
|
||||||
|
{$content}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</li>";
|
||||||
|
}
|
||||||
|
|||||||
60
lib/classes/cURL/class.HttpClient.php
Normal file
60
lib/classes/cURL/class.HttpClient.php
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class HttpClient
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes simple GET request
|
||||||
|
*
|
||||||
|
* @param string $url
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function urlGet($url)
|
||||||
|
{
|
||||||
|
include FROXLOR_INSTALL_DIR . '/lib/version.inc.php';
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Froxlor/' . $version);
|
||||||
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
$output = curl_exec($ch);
|
||||||
|
if ($output === false) {
|
||||||
|
$e = curl_error($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
throw new \Exception("Curl error: " . $e);
|
||||||
|
}
|
||||||
|
curl_close($ch);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Downloads and stores a file from an url
|
||||||
|
*
|
||||||
|
* @param string $url
|
||||||
|
* @param string $target
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function fileGet($url, $target)
|
||||||
|
{
|
||||||
|
include FROXLOR_INSTALL_DIR . '/lib/version.inc.php';
|
||||||
|
$fh = fopen($target, 'w');
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Froxlor/' . $version);
|
||||||
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
|
||||||
|
//give curl the file pointer so that it can write to it
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
curl_setopt($ch, CURLOPT_FILE, $fh);
|
||||||
|
$output = curl_exec($ch);
|
||||||
|
if ($output === false) {
|
||||||
|
$e = curl_error($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
throw new \Exception("Curl error: " . $e);
|
||||||
|
}
|
||||||
|
curl_close($ch);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -361,7 +361,7 @@ class phpinterface_fpm
|
|||||||
$config = makeCorrectFile($configdir . '/dummy.conf');
|
$config = makeCorrectFile($configdir . '/dummy.conf');
|
||||||
$dummy = "[dummy]
|
$dummy = "[dummy]
|
||||||
user = ".Settings::Get('system.httpuser')."
|
user = ".Settings::Get('system.httpuser')."
|
||||||
listen = /run/" . base64_encode($configdir) . "-fpm.sock
|
listen = /run/" . md5($configdir) . "-fpm.sock
|
||||||
pm = static
|
pm = static
|
||||||
pm.max_children = 1
|
pm.max_children = 1
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -216,9 +216,8 @@ class lescript
|
|||||||
// simple self check
|
// simple self check
|
||||||
if (Settings::Get('system.disable_le_selfcheck') == '0')
|
if (Settings::Get('system.disable_le_selfcheck') == '0')
|
||||||
{
|
{
|
||||||
$selfcheckContextOptions = array('http' => array('header' => "User-Agent: Froxlor/".$this->version));
|
$selfcheckpayload = HttpClient::urlGet($uri);
|
||||||
$selfcheckContext = stream_context_create($selfcheckContextOptions);
|
if ($payload !== trim($selfcheckpayload)) {
|
||||||
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
|
|
||||||
$errmsg = json_encode(error_get_last());
|
$errmsg = json_encode(error_get_last());
|
||||||
if ($errmsg != "null") {
|
if ($errmsg != "null") {
|
||||||
$errmsg = "; PHP error: " . $errmsg;
|
$errmsg = "; PHP error: " . $errmsg;
|
||||||
|
|||||||
@@ -233,13 +233,8 @@ class lescript_v2
|
|||||||
|
|
||||||
// simple self check
|
// simple self check
|
||||||
if (Settings::Get('system.disable_le_selfcheck') == '0') {
|
if (Settings::Get('system.disable_le_selfcheck') == '0') {
|
||||||
$selfcheckContextOptions = array(
|
$selfcheckpayload = HttpClient::urlGet($uri);
|
||||||
'http' => array(
|
if ($payload !== trim($selfcheckpayload)) {
|
||||||
'header' => "User-Agent: Froxlor/" . $this->version
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$selfcheckContext = stream_context_create($selfcheckContextOptions);
|
|
||||||
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
|
|
||||||
$errmsg = json_encode(error_get_last());
|
$errmsg = json_encode(error_get_last());
|
||||||
if ($errmsg != "null") {
|
if ($errmsg != "null") {
|
||||||
$errmsg = "; PHP error: " . $errmsg;
|
$errmsg = "; PHP error: " . $errmsg;
|
||||||
|
|||||||
@@ -4643,8 +4643,8 @@ aliases: files
|
|||||||
</commands>
|
</commands>
|
||||||
<file name="/etc/nsswitch.conf" backup="true">
|
<file name="/etc/nsswitch.conf" backup="true">
|
||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
|
||||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
# You should place extrausers at the end, so that it is queried after the other mechanisams
|
||||||
#
|
#
|
||||||
passwd: compat extrausers
|
passwd: compat extrausers
|
||||||
group: compat extrausers
|
group: compat extrausers
|
||||||
|
|||||||
@@ -1642,8 +1642,8 @@ aliases: files
|
|||||||
</commands>
|
</commands>
|
||||||
<file name="/etc/nsswitch.conf" backup="true">
|
<file name="/etc/nsswitch.conf" backup="true">
|
||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
|
||||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
# You should place extrausers at the end, so that it is queried after the other mechanisams
|
||||||
#
|
#
|
||||||
passwd: compat extrausers
|
passwd: compat extrausers
|
||||||
group: compat extrausers
|
group: compat extrausers
|
||||||
|
|||||||
@@ -4543,8 +4543,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
</commands>
|
</commands>
|
||||||
<file name="/etc/nsswitch.conf" backup="true">
|
<file name="/etc/nsswitch.conf" backup="true">
|
||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
|
||||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
# You should place extrausers at the end, so that it is queried after the other mechanisams
|
||||||
#
|
#
|
||||||
passwd: compat extrausers
|
passwd: compat extrausers
|
||||||
group: compat extrausers
|
group: compat extrausers
|
||||||
|
|||||||
@@ -1651,8 +1651,8 @@ aliases: files
|
|||||||
</commands>
|
</commands>
|
||||||
<file name="/etc/nsswitch.conf" backup="true">
|
<file name="/etc/nsswitch.conf" backup="true">
|
||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
|
||||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
# You should place extrausers at the end, so that it is queried after the other mechanisams
|
||||||
#
|
#
|
||||||
passwd: compat extrausers
|
passwd: compat extrausers
|
||||||
group: compat extrausers
|
group: compat extrausers
|
||||||
|
|||||||
@@ -5451,8 +5451,8 @@ aliases: files
|
|||||||
</commands>
|
</commands>
|
||||||
<file name="/etc/nsswitch.conf" backup="true">
|
<file name="/etc/nsswitch.conf" backup="true">
|
||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
|
||||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
# You should place extrausers at the end, so that it is queried after the other mechanisams
|
||||||
#
|
#
|
||||||
passwd: compat extrausers
|
passwd: compat extrausers
|
||||||
group: compat extrausers
|
group: compat extrausers
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function makeoption($title, $value, $selvalue = NULL, $title_trusted = false, $value_trusted = false, $id = NULL)
|
function makeoption($title, $value, $selvalue = NULL, $title_trusted = false, $value_trusted = false, $id = NULL, $disabled = false)
|
||||||
{
|
{
|
||||||
if($selvalue !== NULL
|
if($selvalue !== NULL
|
||||||
&& ((is_array($selvalue) && in_array($value, $selvalue)) || $value == $selvalue))
|
&& ((is_array($selvalue) && in_array($value, $selvalue)) || $value == $selvalue))
|
||||||
@@ -41,6 +41,10 @@ function makeoption($title, $value, $selvalue = NULL, $title_trusted = false, $v
|
|||||||
$selected = '';
|
$selected = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($disabled) {
|
||||||
|
$selected .= ' disabled="disabled"';
|
||||||
|
}
|
||||||
|
|
||||||
if(!$title_trusted)
|
if(!$title_trusted)
|
||||||
{
|
{
|
||||||
$title = htmlspecialchars($title);
|
$title = htmlspecialchars($title);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Main version variable
|
// Main version variable
|
||||||
$version = '0.9.39';
|
$version = '0.9.39.1';
|
||||||
|
|
||||||
// Database version (YYYYMMDDC where C is a daily counter)
|
// Database version (YYYYMMDDC where C is a daily counter)
|
||||||
$dbversion = '201801260';
|
$dbversion = '201801260';
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ $header
|
|||||||
{$title}
|
{$title}
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
|
<script type="text/javascript" src="templates/{$theme}/assets/js/domains.js"></script>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|
||||||
|
|||||||
52
templates/Sparkle/assets/js/domains.js
vendored
Normal file
52
templates/Sparkle/assets/js/domains.js
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
var getUrlParameter = function getUrlParameter(sParam) {
|
||||||
|
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||||
|
sURLVariables = sPageURL.split('&'),
|
||||||
|
sParameterName,
|
||||||
|
i;
|
||||||
|
|
||||||
|
for (i = 0; i < sURLVariables.length; i++) {
|
||||||
|
sParameterName = sURLVariables[i].split('=');
|
||||||
|
|
||||||
|
if (sParameterName[0] === sParam) {
|
||||||
|
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* disable unusable php-configuration by customer settings
|
||||||
|
*/
|
||||||
|
$('#customerid').change(function() {
|
||||||
|
var cid = $(this).val();
|
||||||
|
var sid = getUrlParameter('s');
|
||||||
|
var page = getUrlParameter('page');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "admin_domains.php?s="+sid+"&page="+page+"&action=jqGetCustomerPHPConfigs",
|
||||||
|
type: "POST",
|
||||||
|
data: {
|
||||||
|
customerid: cid
|
||||||
|
},
|
||||||
|
dataType: "json",
|
||||||
|
success: function(json) {
|
||||||
|
if (json.length > 0) {
|
||||||
|
$('#phpsettingid option').each(function() {
|
||||||
|
var pid = $(this).val();
|
||||||
|
$(this).attr("disabled", "disabled");
|
||||||
|
for (i in json) {
|
||||||
|
if (pid == json[i]) {
|
||||||
|
$(this).removeAttr("disabled");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(a, b) {
|
||||||
|
console.log(a, b);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user