Compare commits

...

8 Commits

Author SHA1 Message Date
Michael Kaufmann (d00p)
13b1503bf2 set version to 0.9.39.1 for maintenance release
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-10 16:06:57 +01:00
Michael Kaufmann (d00p)
2980397545 fix include path in lib/ajax.php
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-10 10:13:55 +01:00
Michael Kaufmann (d00p)
5612720342 only let admin select php-configs that the customer is allowed to use to avoid unwanted php-config changes when customer edits domain, refs #514
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-09 13:57:23 +01:00
Michael Kaufmann (d00p)
4d3fa6eca5 get rid of the need for allow_url_fopen
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-09 10:50:14 +01:00
Michael Kaufmann (d00p)
05b4c58aa8 fix updating wrong column when deleting a fpm configuration
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-09 09:20:46 +01:00
Michael Kaufmann (d00p)
f290497b64 fix selected phpfpm daemon when editing php-configuration, fixes #514
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-09 07:33:28 +01:00
Michael Kaufmann (d00p)
b4dd35eed2 correct description of nsswitch.conf file
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-08 07:35:06 +01:00
Michael Kaufmann (d00p)
ec21e28000 use md5() instead of base64_encode for dummy-fpm-socket name to avoid possible equal-sign in string which leads to an invalid socket, fixes #513
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-07 15:10:59 +01:00
20 changed files with 349 additions and 210 deletions

View File

@@ -17,7 +17,6 @@
* @since 0.9.35
*
*/
define('AREA', 'admin');
require './lib/init.php';
@@ -26,177 +25,188 @@ define('UPDATE_URI', "https://version.froxlor.org/Froxlor/legacy/" . $version);
define('RELEASE_URI', "https://autoupdate.froxlor.org/froxlor-{version}.zip");
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
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
if ($page == 'overview') {
// log our actions
$log->logAction(ADM_ACTION, LOG_NOTICE, "checking auto-update");
// check for new version
$latestversion = @file(UPDATE_URI);
if (isset($latestversion[0])) {
$latestversion = explode('|', $latestversion[0]);
if (is_array($latestversion)
&& 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');
// add the branding so debian guys are not gettings confused
// about their version-number
$version_label = $_version.$branding;
$version_link = $_link;
$message_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
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 3));
} elseif (version_compare2($version, $_version) == -1) {
// there is a newer version - yay
$isnewerversion = 1;
} else {
// nothing new
$isnewerversion = 0;
}
// anzeige über version-status mit ggfls. formular
// zum update schritt #1 -> download
if ($isnewerversion == 1) {
$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.'" />';
$yesfile = $filename.'?s='.$s.'&amp;page=getdownload';
eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";");
exit;
}
elseif ($isnewerversion == 0) {
// all good
standard_success ('noupdatesavail');
} else {
standard_error ('customized_version');
}
$latestversion = HttpClient::urlGet(UPDATE_URI);
$latestversion = explode('|', $latestversion);
if (is_array($latestversion) && 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');
// add the branding so debian guys are not gettings confused
// about their version-number
$version_label = $_version . $branding;
$version_link = $_link;
$message_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
redirectTo($filename, array(
's' => $s,
'page' => 'error',
'errno' => 3
));
} elseif (version_compare2($version, $_version) == - 1) {
// there is a newer version - yay
$isnewerversion = 1;
} else {
// nothing new
$isnewerversion = 0;
}
// anzeige über version-status mit ggfls. formular
// zum update schritt #1 -> download
if ($isnewerversion == 1) {
$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 . '" />';
$yesfile = $filename . '?s=' . $s . '&amp;page=getdownload';
eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";");
exit();
} elseif ($isnewerversion == 0) {
// all good
standard_success('noupdatesavail');
} else {
standard_error('customized_version');
}
}
// error (something weird came from version.froxlor.org)
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 5));
}
// download the new archive
}// download the new archive
elseif ($page == 'getdownload') {
// retrieve the new version from the form
$newversion = isset($_POST['newversion']) ? $_POST['newversion'] : null;
// valid?
if ($newversion !== null) {
// define files to get
$toLoad = str_replace('{version}', $newversion, RELEASE_URI);
$toCheck = str_replace('{version}', $newversion, CHECKSUM_URI);
// get archive data
$newArchive = @file_get_contents($toLoad);
// check for local destination folder
if (!is_dir(FROXLOR_INSTALL_DIR.'/updates/')) {
mkdir(FROXLOR_INSTALL_DIR.'/updates/');
if (! is_dir(FROXLOR_INSTALL_DIR . '/updates/')) {
mkdir(FROXLOR_INSTALL_DIR . '/updates/');
}
// name archive
$localArchive = FROXLOR_INSTALL_DIR.'/updates/'.basename($toLoad);
$log->logAction(ADM_ACTION, LOG_NOTICE, "Downloading ".$toLoad." to ".$localArchive);
$localArchive = FROXLOR_INSTALL_DIR . '/updates/' . basename($toLoad);
$log->logAction(ADM_ACTION, LOG_NOTICE, "Downloading " . $toLoad . " to " . $localArchive);
// remove old archive
if (file_exists($localArchive)) {
@unlink($localArchive);
}
// store archive
$fh = fopen($localArchive, 'w');
if (!fwrite($fh, $newArchive)) {
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 4));
// get archive data
try {
HttpClient::fileGet($toLoad, $localArchive);
} catch (Exception $e) {
redirectTo($filename, array(
's' => $s,
'page' => 'error',
'errno' => 4
));
}
// close file-handle
fclose($fh);
// validate the integrity of the downloaded file
$_shouldsum = @file_get_contents($toCheck);
if (!empty($_shouldsum)) {
$_shouldsum = HttpClient::urlGet($toCheck);
if (! empty($_shouldsum)) {
$_t = explode(" ", $_shouldsum);
$shouldsum = $_t[0];
} else {
$shouldsum = null;
}
$filesum = hash_file('sha256', $localArchive);
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
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));
}
// extract and install new version
redirectTo($filename, array(
's' => $s,
'page' => 'error',
'errno' => 6
));
}// extract and install new version
elseif ($page == 'extract') {
$toExtract = isset($_GET['archive']) ? $_GET['archive'] : null;
$localArchive = FROXLOR_INSTALL_DIR.'/updates/'.$toExtract;
if (isset($_POST['send'])
&& $_POST['send'] == 'send'
) {
$localArchive = FROXLOR_INSTALL_DIR . '/updates/' . $toExtract;
if (isset($_POST['send']) && $_POST['send'] == 'send') {
// decompress from zip
$zip = new ZipArchive;
$zip = new ZipArchive();
$res = $zip->open($localArchive);
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->close();
// success - remove unused archive
@unlink($localArchive);
} else {
// error
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 8));
redirectTo($filename, array(
's' => $s,
'page' => 'error',
'errno' => 8
));
}
// redirect to update-page?
redirectTo('admin_updates.php', array('s' => $s));
redirectTo('admin_updates.php', array(
's' => $s
));
}
if (!file_exists($localArchive)) {
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 7));
if (! file_exists($localArchive)) {
redirectTo($filename, array(
's' => $s,
'page' => 'error',
'errno' => 7
));
}
$text = 'Extract downloaded archive "'.$toExtract.'"?';
$text = 'Extract downloaded archive "' . $toExtract . '"?';
$hiddenparams = '';
$yesfile = $filename.'?s='.$s.'&amp;page=extract&amp;archive='.$toExtract;
$yesfile = $filename . '?s=' . $s . '&amp;page=extract&amp;archive=' . $toExtract;
eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";");
}
// display error
elseif ($page == 'error') {
// retrieve error-number via url-parameter
$errno = isset($_GET['errno']) ? (int)$_GET['errno'] : 0;
// 1 = no allow_url_fopen
$errno = isset($_GET['errno']) ? (int) $_GET['errno'] : 0;
// 2 = no Zlib
// 3 = custom version detected
// 4 = could not store archive to local hdd
@@ -205,5 +215,5 @@ elseif ($page == 'error') {
// 7 = local archive does not exist
// 8 = could not extract archive
// 9 = checksum mismatch
standard_error ('autoupdate_'.$errno);
standard_error('autoupdate_' . $errno);
}

View File

@@ -2209,12 +2209,19 @@ if ($page == 'domains' || $page == 'overview') {
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
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)) {
$disabled = !empty($c_allowed_configs) && !in_array($phpconfigs_row['id'], $c_allowed_configs);
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 {
$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") . "\";");
}
}
} 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') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {

View File

@@ -86,41 +86,31 @@ if ($page == 'overview') {
|| (isset($lookfornewversion) && $lookfornewversion == 'yes')
) {
$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')) {
$latestversion = @file($update_check_uri);
if (is_array($latestversion)
&& 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])) {
$latestversion = explode('|', $latestversion[0]);
// add the branding so debian guys are not gettings confused
// about their version-number
$lookfornewversion_lable = $_version.$branding;
$lookfornewversion_link = $_link;
$lookfornewversion_addinfo = $_message;
if (is_array($latestversion)
&& 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');
// 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);
}
// 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 {
redirectTo($update_check_uri.'/pretty', NULL, false);
$isnewerversion = 0;
}
} else {
redirectTo($update_check_uri.'/pretty', NULL, false);

View File

@@ -349,7 +349,7 @@ if ($page == 'overview') {
$fpmconfigs = '';
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
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';
@@ -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
$upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
`phpsettingid` = '1' WHERE `phpsettingid` = :id");
`fpmsettingid` = '1' WHERE `fpmsettingid` = :id");
Database::pexecute($upd_stmt, array(
'id' => $id
));

View File

@@ -686,7 +686,7 @@ opcache.interned_strings_buffer'),
('panel', 'password_special_char_required', '0'),
('panel', 'password_special_char', '!?<>§$%+#=@'),
('panel', 'customer_hide_options', ''),
('panel', 'version', '0.9.39'),
('panel', 'version', '0.9.39.1'),
('panel', 'db_version', '201801260');

View File

@@ -3880,3 +3880,9 @@ if (isFroxlorVersion('0.9.38.8')) {
showUpdateStep("Updating from 0.9.38.8 to 0.9.39 final", false);
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');
}

View File

@@ -18,7 +18,7 @@
// Load the user settings
define('FROXLOR_INSTALL_DIR', dirname(dirname(__FILE__)));
if (!file_exists('./userdata.inc.php')) {
if (! file_exists('./userdata.inc.php')) {
die();
}
require './userdata.inc.php';
@@ -27,10 +27,11 @@ require './classes/database/class.Database.php';
require './classes/settings/class.Settings.php';
require './functions/validate/function.validate_ip.php';
require './functions/validate/function.validateDomain.php';
require './classes/cURL/class.HttpClient.php';
if(isset($_POST['action'])) {
if (isset($_POST['action'])) {
$action = $_POST['action'];
} elseif(isset($_GET['action'])) {
} elseif (isset($_GET['action'])) {
$action = $_GET['action'];
} else {
$action = "";
@@ -42,51 +43,31 @@ if ($action == "newsfeed") {
} else {
$feed = "https://inside.froxlor.org/news/";
}
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')) {
$ch = curl_init();
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);
$output = HttpClient::urlGet($feed);
$news = simplexml_load_string(trim($output));
} else {
if (ini_get('allow_url_fopen')) {
ini_set('user_agent', 'Froxlor/'.$version);
$news = simplexml_load_file($feed, null, LIBXML_NOCDATA);
} else {
$news = false;
}
outputItem("Newsfeed not available due to missing php-curl extension", "Please install the php-curl extension in order to view our newsfeed.");
exit();
}
if ($news !== false) {
for ($i = 0; $i < 3; $i++) {
for ($i = 0; $i < 3; $i ++) {
$item = $news->channel->item[$i];
$title = (string)$item->title;
$link = (string)$item->link;
$title = (string) $item->title;
$link = (string) $item->link;
$date = date("Y-m-d G:i", strtotime($item->pubDate));
$content = preg_replace("/[\r\n]+/", " ", strip_tags($item->description));
$content = substr($content, 0, 150) . "...";
echo "<li class=\"clearfix\">
<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>";
outputItem($title, $content, $link, $date);
}
} else {
echo "";
@@ -94,3 +75,30 @@ if ($action == "newsfeed") {
} else {
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>";
}

View 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;
}
}

View File

@@ -361,7 +361,7 @@ class phpinterface_fpm
$config = makeCorrectFile($configdir . '/dummy.conf');
$dummy = "[dummy]
user = ".Settings::Get('system.httpuser')."
listen = /run/" . base64_encode($configdir) . "-fpm.sock
listen = /run/" . md5($configdir) . "-fpm.sock
pm = static
pm.max_children = 1
";

View File

@@ -216,9 +216,8 @@ class lescript
// simple self check
if (Settings::Get('system.disable_le_selfcheck') == '0')
{
$selfcheckContextOptions = array('http' => array('header' => "User-Agent: Froxlor/".$this->version));
$selfcheckContext = stream_context_create($selfcheckContextOptions);
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
$selfcheckpayload = HttpClient::urlGet($uri);
if ($payload !== trim($selfcheckpayload)) {
$errmsg = json_encode(error_get_last());
if ($errmsg != "null") {
$errmsg = "; PHP error: " . $errmsg;

View File

@@ -233,13 +233,8 @@ class lescript_v2
// simple self check
if (Settings::Get('system.disable_le_selfcheck') == '0') {
$selfcheckContextOptions = array(
'http' => array(
'header' => "User-Agent: Froxlor/" . $this->version
)
);
$selfcheckContext = stream_context_create($selfcheckContextOptions);
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
$selfcheckpayload = HttpClient::urlGet($uri);
if ($payload !== trim($selfcheckpayload)) {
$errmsg = json_encode(error_get_last());
if ($errmsg != "null") {
$errmsg = "; PHP error: " . $errmsg;

View File

@@ -4643,8 +4643,8 @@ aliases: files
</commands>
<file name="/etc/nsswitch.conf" backup="true">
<content><![CDATA[
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
# You should place mysql at the end, so that it is queried after the other mechanisams
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
# You should place extrausers at the end, so that it is queried after the other mechanisams
#
passwd: compat extrausers
group: compat extrausers

View File

@@ -1642,8 +1642,8 @@ aliases: files
</commands>
<file name="/etc/nsswitch.conf" backup="true">
<content><![CDATA[
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
# You should place mysql at the end, so that it is queried after the other mechanisams
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
# You should place extrausers at the end, so that it is queried after the other mechanisams
#
passwd: compat extrausers
group: compat extrausers

View File

@@ -4543,8 +4543,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
</commands>
<file name="/etc/nsswitch.conf" backup="true">
<content><![CDATA[
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
# You should place mysql at the end, so that it is queried after the other mechanisams
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
# You should place extrausers at the end, so that it is queried after the other mechanisams
#
passwd: compat extrausers
group: compat extrausers

View File

@@ -1651,8 +1651,8 @@ aliases: files
</commands>
<file name="/etc/nsswitch.conf" backup="true">
<content><![CDATA[
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
# You should place mysql at the end, so that it is queried after the other mechanisams
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
# You should place extrausers at the end, so that it is queried after the other mechanisams
#
passwd: compat extrausers
group: compat extrausers

View File

@@ -5451,8 +5451,8 @@ aliases: files
</commands>
<file name="/etc/nsswitch.conf" backup="true">
<content><![CDATA[
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
# You should place mysql at the end, so that it is queried after the other mechanisams
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
# You should place extrausers at the end, so that it is queried after the other mechanisams
#
passwd: compat extrausers
group: compat extrausers

View File

@@ -29,7 +29,7 @@
* @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
&& ((is_array($selvalue) && in_array($value, $selvalue)) || $value == $selvalue))
@@ -40,6 +40,10 @@ function makeoption($title, $value, $selvalue = NULL, $title_trusted = false, $v
{
$selected = '';
}
if ($disabled) {
$selected .= ' disabled="disabled"';
}
if(!$title_trusted)
{

View File

@@ -16,7 +16,7 @@
*/
// Main version variable
$version = '0.9.39';
$version = '0.9.39.1';
// Database version (YYYYMMDDC where C is a daily counter)
$dbversion = '201801260';

View File

@@ -6,6 +6,7 @@ $header
{$title}
</h2>
</header>
<script type="text/javascript" src="templates/{$theme}/assets/js/domains.js"></script>
<section>

52
templates/Sparkle/assets/js/domains.js vendored Normal file
View 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);
}
});
});
});