add requirement for mbstring-extension as we need to be multibyte-character-safe in generatePassword(); adjust special-character-default setting to be the same as on a fresh install; outsource version-definition to separate file; set version to 0.9.34-dev3
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -107,7 +107,7 @@ return array(
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_special_char',
|
||||
'type' => 'string',
|
||||
'default' => '!?<>§$%&+#=@',
|
||||
'default' => '!?<>§$%+#=@',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_regex' => array(
|
||||
|
||||
@@ -539,7 +539,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('panel', 'password_numeric', '0'),
|
||||
('panel', 'password_special_char_required', '0'),
|
||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||
('panel', 'version', '0.9.34-dev2');
|
||||
('panel', 'version', '0.9.34-dev3');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_tasks`;
|
||||
|
||||
@@ -903,6 +903,16 @@ class FroxlorInstall {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
// check for bstring-extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmbstring']);
|
||||
|
||||
if (!extension_loaded('mbstring')) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||
$_die = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
// check for bcmath extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpbcmath']);
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ $lng['requirements']['phpfilter'] = 'PHP filter-extension...';
|
||||
$lng['requirements']['phpposix'] = 'PHP posix-extension...';
|
||||
$lng['requirements']['phpbcmath'] = 'PHP bcmath-extension...';
|
||||
$lng['requirements']['phpcurl'] = 'PHP curl-extension...';
|
||||
$lng['requirements']['phpmbstring'] = 'PHP mbstring-extension...';
|
||||
$lng['requirements']['bcmathdescription'] = 'Traffic-calculation related functions will not work correctly!';
|
||||
$lng['requirements']['curldescription'] = 'Version-check and news-feed may not work correctly!';
|
||||
$lng['requirements']['openbasedir'] = 'open_basedir...';
|
||||
|
||||
@@ -32,6 +32,7 @@ $lng['requirements']['phpfilter'] = 'extension PHP filter ...';
|
||||
$lng['requirements']['phpposix'] = 'extension PHP posix ...';
|
||||
$lng['requirements']['phpbcmath'] = 'extension PHP bcmath ...';
|
||||
$lng['requirements']['phpcurl'] = 'extension PHP curl...';
|
||||
$lng['requirements']['phpmbstring'] = 'extension PHP mbstring...';
|
||||
$lng['requirements']['bcmathdescription'] = 'Les fonctions de calcul de traffic ne fonctionneront pas correctement!';
|
||||
$lng['requirements']['curldescription'] = 'Les vérifications de version et les flux d\'information peuvent ne pas fonctionner correctement!';
|
||||
$lng['requirements']['openbasedir'] = 'open_basedir...';
|
||||
|
||||
@@ -32,6 +32,7 @@ $lng['requirements']['phpfilter'] = 'PHP filter-Erweiterung...';
|
||||
$lng['requirements']['phpposix'] = 'PHP posix-Erweiterung...';
|
||||
$lng['requirements']['phpbcmath'] = 'PHP bcmath-Erweiterung...';
|
||||
$lng['requirements']['phpcurl'] = 'PHP curl-Erweiterung...';
|
||||
$lng['requirements']['phpmbstring'] = 'PHP mbstring-Erweiterung...';
|
||||
$lng['requirements']['bcmathdescription'] = 'Traffic-Berechnungs bezogene Funktionen stehen nicht vollständig zur Verfügung!';
|
||||
$lng['requirements']['curldescription'] = 'Versions-Prüfung und News-Feed stehen nicht vollständig zur Verfügung!';
|
||||
$lng['requirements']['openbasedir'] = 'open_basedir genutzt wird...';
|
||||
|
||||
@@ -2903,7 +2903,7 @@ if (isFroxlorVersion('0.9.33')) {
|
||||
|
||||
if (isFroxlorVersion('0.9.33.1')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.33.1 to 0.9.34-dev1");
|
||||
showUpdateStep("Updating from 0.9.33.1 to 0.9.34-dev1", false);
|
||||
|
||||
showUpdateStep("Updating table structure of domains");
|
||||
Database::query("ALTER TABLE `".TABLE_PANEL_DOMAINS."` MODIFY `parentdomainid` int(11) NOT NULL default '0'");
|
||||
@@ -2940,7 +2940,7 @@ if (isFroxlorVersion('0.9.33.1')) {
|
||||
|
||||
if (isFroxlorVersion('0.9.34-dev1')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.34-dev1 to 0.9.34-dev2");
|
||||
showUpdateStep("Updating from 0.9.34-dev1 to 0.9.34-dev2", false);
|
||||
|
||||
showUpdateStep("Adding new settings for apache-itk-mpm");
|
||||
Settings::AddNew("system.apacheitksupport", '0');
|
||||
@@ -2956,3 +2956,21 @@ if (isFroxlorVersion('0.9.34-dev1')) {
|
||||
updateToVersion('0.9.34-dev2');
|
||||
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.34-dev2')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.34-dev2 to 0.9.34-dev3", false);
|
||||
|
||||
$do_update = true;
|
||||
showUpdateStep("Checking for required PHP mbstring-extension");
|
||||
if (!extension_loaded('mbstring')) {
|
||||
$do_update = false;
|
||||
lastStepStatus(2, 'not installed');
|
||||
} else {
|
||||
lastStepStatus(0);
|
||||
}
|
||||
|
||||
if ($do_update) {
|
||||
updateToVersion('0.9.34-dev3');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,4 +686,18 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
|
||||
$question.= makeyesno('system_send_cron_errors', '1', '0', '0').'<br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.34-dev3')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now requires the PHP mbstring-extension as we need to be multibyte-character safe in some cases';
|
||||
$question = '<strong>PHP mbstring</strong> is currently: ';
|
||||
if (!extension_loaded('mbstring')) {
|
||||
$question .= '<span class="red">not installed/loaded</span>';
|
||||
$question .= '<br>Please install the PHP mbstring extension in order to finish the update';
|
||||
} else {
|
||||
$question .= '<span class="green">installed/loaded</span>';
|
||||
}
|
||||
$question .= '<br>';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,29 +18,48 @@
|
||||
/**
|
||||
* Generates a random password
|
||||
*/
|
||||
function generatePassword() {
|
||||
function generatePassword()
|
||||
{
|
||||
$alpha_lower = 'abcdefghijklmnopqrstuvwxyz';
|
||||
$alpha_upper = strtoupper($alpha_lower);
|
||||
$numeric = '0123456789';
|
||||
$special = Settings::Get('panel.password_special_char');
|
||||
$length = Settings::Get('panel.password_min_length') > 3 ? Settings::Get('panel.password_min_length') : 10;
|
||||
|
||||
$pw = str_shuffle($alpha_lower);
|
||||
$pw = special_shuffle($alpha_lower);
|
||||
$n = floor(($length) / 4);
|
||||
|
||||
if (Settings::Get('panel.password_alpha_upper')) {
|
||||
$pw .= substr(str_shuffle($alpha_upper), 0, $n);
|
||||
$pw .= mb_substr(special_shuffle($alpha_upper), 0, $n);
|
||||
}
|
||||
|
||||
if (Settings::Get('panel.password_numeric')) {
|
||||
$pw .= substr(str_shuffle($numeric), 0, $n);
|
||||
$pw .= mb_substr(special_shuffle($numeric), 0, $n);
|
||||
}
|
||||
|
||||
if (Settings::Get('panel.password_special_char_required')) {
|
||||
$pw .= substr(str_shuffle($special), 0, $n);
|
||||
$pw .= mb_substr(special_shuffle($special), 0, $n);
|
||||
}
|
||||
|
||||
$pw = substr($pw, -$length);
|
||||
$pw = mb_substr($pw, - $length);
|
||||
|
||||
return str_shuffle($pw);
|
||||
return special_shuffle($pw);
|
||||
}
|
||||
|
||||
/**
|
||||
* multibyte-character safe shuffle function
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function special_shuffle($str = null)
|
||||
{
|
||||
$len = mb_strlen($str);
|
||||
$sploded = array();
|
||||
while ($len -- > 0) {
|
||||
$sploded[] = mb_substr($str, $len, 1);
|
||||
}
|
||||
shuffle($sploded);
|
||||
return join('', $sploded);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,4 @@ define('TABLE_PANEL_DOMAINREDIRECTS', 'domain_redirect_codes');
|
||||
define('TABLE_PANEL_DOMAIN_SSL_SETTINGS', 'domain_ssl_settings');
|
||||
define('TABLE_DOMAINTOIP', 'panel_domaintoip');
|
||||
|
||||
// VERSION INFO
|
||||
$version = '0.9.34-dev2';
|
||||
$dbversion = '2';
|
||||
$branding = '';
|
||||
require dirname(__FILE__).'/version.inc.php';
|
||||
|
||||
25
lib/version.inc.php
Normal file
25
lib/version.inc.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package System
|
||||
*
|
||||
*/
|
||||
|
||||
// Main version variable
|
||||
$version = '0.9.34-dev3';
|
||||
|
||||
// Database version (unused, old stuff from SysCP)
|
||||
$dbversion = '2';
|
||||
|
||||
// Distribution branding-tag (used for Debian etc.)
|
||||
$branding = '';
|
||||
Reference in New Issue
Block a user