From 6a79332b4d87958c2211623d99b3f054dd6676d7 Mon Sep 17 00:00:00 2001 From: "usman@cyberpersons.com" Date: Tue, 9 May 2023 15:23:26 +0500 Subject: [PATCH] bug fix in ftp creation for ubuntu 20: https://community.cyberpanel.net/t/bug-ftp-create-account-error/42688 --- install/installCyberPanel.py | 2 +- plogical/ftpUtilities.py | 1 + plogical/processUtilities.py | 3 ++- plogical/upgrade.py | 6 ------ 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 067d1ee53..94c1c2d87 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -505,7 +505,7 @@ class InstallCyberPanel: install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - if get_Ubuntu_release() > 20: + if int(get_Ubuntu_release()) > 20: ### change mysql md5 to crypt command = "sed -i 's/MYSQLCrypt md5/MYSQLCrypt crypt/g' /etc/pure-ftpd/db/mysql.conf" diff --git a/plogical/ftpUtilities.py b/plogical/ftpUtilities.py index 7fd2bf23f..716b633ce 100755 --- a/plogical/ftpUtilities.py +++ b/plogical/ftpUtilities.py @@ -155,6 +155,7 @@ class FTPUtilities: admin = Administrator.objects.get(userName=owner) + if api == '0': userName = admin.userName + "_" + userName diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index 2f33bbb68..fae88ce84 100755 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -167,8 +167,9 @@ class ProcessUtilities(multi.Thread): distroPath = '/etc/lsb-release' if os.path.exists(distroPath): + ## this is check only - if open(distroPath, 'r').read().find('22.04'): + if open(distroPath, 'r').read().find('22.04') > -1: ProcessUtilities.ubuntu22Check = 1 if open(distroPath, 'r').read().find('20.04') > -1 or open(distroPath, 'r').read().find('22.04'): diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 5c4f60a8c..9cf23edbb 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1136,12 +1136,6 @@ CREATE TABLE `websiteFunctions_backupsv2` (`id` integer AUTO_INCREMENT NOT NULL if Upgrade.FindOperatingSytem() == Ubuntu22: - try: - cursor.execute( - 'ALTER TABLE `users` CHANGE `Password` `Password` VARCHAR(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL; ') - except: - pass - command = "sed -i 's/MYSQLCrypt md5/MYSQLCrypt crypt/g' /etc/pure-ftpd/db/mysql.conf" Upgrade.executioner(command, command, 1)