From ab9b92112d37eedee85d5b04bb92c4d83aeb424e Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 13 Aug 2015 15:37:34 +0200 Subject: [PATCH] instead of env-variable, show ditro editor which is defined in the xml Signed-off-by: Michael Kaufmann (d00p) --- admin_configfiles.php | 2 ++ lib/classes/config/class.ConfigParser.php | 7 +++++++ lib/configfiles/gentoo.xml | 2 +- lib/configfiles/jessie.xml | 2 +- lib/configfiles/precise.xml | 2 +- lib/configfiles/rhel_centos.xml | 2 +- lib/configfiles/trusty.xml | 2 +- lib/configfiles/wheezy.xml | 2 +- lib/functions/validate/function.validatePasswordLogin.php | 7 +++++-- templates/Sparkle/admin/configfiles/configfiles_file.tpl | 2 +- 10 files changed, 21 insertions(+), 9 deletions(-) diff --git a/admin_configfiles.php b/admin_configfiles.php index 222f96cc..b1a13deb 100644 --- a/admin_configfiles.php +++ b/admin_configfiles.php @@ -115,6 +115,8 @@ if ($userinfo['change_serversettings'] == '1') { $configpage = ''; + $distro_editor = $configfiles->distributionEditor; + $commands_pre = ""; $commands_file = ""; $commands_post = ""; diff --git a/lib/classes/config/class.ConfigParser.php b/lib/classes/config/class.ConfigParser.php index 94d7fdf5..a294d56e 100644 --- a/lib/classes/config/class.ConfigParser.php +++ b/lib/classes/config/class.ConfigParser.php @@ -65,6 +65,12 @@ class ConfigParser { */ public $distributionVersion = ''; + /** + * Recommended editor + * @var string + */ + public $distributionEditor = '/bin/nano'; + /** * Show if this configuration is deprecated * @var bool @@ -106,6 +112,7 @@ class ConfigParser { case "name": $this->distributionName = (string)$value; break; case "version": $this->distributionVersion = (string)$value; break; case "codename": $this->distributionCodename = (string)$value; break; + case "defaulteditor": $this->distributionEditor = (string)$value; break; case "deprecated": (string)$value == 'true' ? $this->deprecated = true : $this->deprecated = false; break; } } diff --git a/lib/configfiles/gentoo.xml b/lib/configfiles/gentoo.xml index 908cb9ea..a3f0ca73 100644 --- a/lib/configfiles/gentoo.xml +++ b/lib/configfiles/gentoo.xml @@ -1,6 +1,6 @@ - + diff --git a/lib/configfiles/jessie.xml b/lib/configfiles/jessie.xml index 41151e00..035583ae 100644 --- a/lib/configfiles/jessie.xml +++ b/lib/configfiles/jessie.xml @@ -1,6 +1,6 @@ - + diff --git a/lib/configfiles/precise.xml b/lib/configfiles/precise.xml index 6eb0063f..adac5219 100644 --- a/lib/configfiles/precise.xml +++ b/lib/configfiles/precise.xml @@ -1,6 +1,6 @@ - + diff --git a/lib/configfiles/rhel_centos.xml b/lib/configfiles/rhel_centos.xml index b749d4dd..0703c781 100644 --- a/lib/configfiles/rhel_centos.xml +++ b/lib/configfiles/rhel_centos.xml @@ -1,6 +1,6 @@ - + diff --git a/lib/configfiles/trusty.xml b/lib/configfiles/trusty.xml index 43daf1f2..efde5809 100644 --- a/lib/configfiles/trusty.xml +++ b/lib/configfiles/trusty.xml @@ -1,6 +1,6 @@ - + diff --git a/lib/configfiles/wheezy.xml b/lib/configfiles/wheezy.xml index 893eedfd..05bd9ea4 100644 --- a/lib/configfiles/wheezy.xml +++ b/lib/configfiles/wheezy.xml @@ -1,6 +1,6 @@ - + diff --git a/lib/functions/validate/function.validatePasswordLogin.php b/lib/functions/validate/function.validatePasswordLogin.php index 599809ae..275d2bfb 100644 --- a/lib/functions/validate/function.validatePasswordLogin.php +++ b/lib/functions/validate/function.validatePasswordLogin.php @@ -32,6 +32,8 @@ */ function validatePasswordLogin($userinfo = null, $password = null, $table = 'panel_customers', $uid = 'customerid') { + global $version; + $systype = 3; // SHA256 if (Settings::Get('system.passwordcryptfunc') !== null) { $systype = (int)Settings::Get('system.passwordcryptfunc'); @@ -62,8 +64,9 @@ function validatePasswordLogin($userinfo = null, $password = null, $table = 'pan if ($pwd_hash == $pwd_check) { - // check for update of hash - if ($update_hash) { + // check for update of hash (only if our database is ready to handle the bigger string) + $is_ready = (version_compare2("0.9.33", $version) <= 0 ? true : false); + if ($update_hash && $is_ready) { $upd_stmt = Database::prepare(" UPDATE " . $table . " SET `password` = :newpasswd WHERE `" . $uid . "` = :uid "); diff --git a/templates/Sparkle/admin/configfiles/configfiles_file.tpl b/templates/Sparkle/admin/configfiles/configfiles_file.tpl index b627796f..57507d24 100644 --- a/templates/Sparkle/admin/configfiles/configfiles_file.tpl +++ b/templates/Sparkle/admin/configfiles/configfiles_file.tpl @@ -1,4 +1,4 @@
- +