mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 22:36:12 +01:00
replace localhost with remote mysql in case of rds
This commit is contained in:
@@ -723,6 +723,11 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
||||
command = 'cp /usr/local/CyberCP/plogical/phpmyadminsignin.php /usr/local/CyberCP/public/phpmyadmin/phpmyadminsignin.php'
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
if self.remotemysql == 'ON':
|
||||
command = "sed -i 's|localhost|%s|g' /usr/local/CyberCP/public/phpmyadmin/phpmyadminsignin.php" % (self.mysqlhost)
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
|
||||
except BaseException as msg:
|
||||
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [download_install_phpmyadmin]")
|
||||
return 0
|
||||
|
||||
@@ -929,8 +929,13 @@ skip-name-resolve
|
||||
cursor.execute(
|
||||
"CREATE USER '" + user + "'@'%s' IDENTIFIED BY '" % (mysqlUtilities.LOCALHOST) + password + "'")
|
||||
|
||||
if mysqlUtilities.RDS == 0:
|
||||
cursor.execute(
|
||||
"GRANT ALL PRIVILEGES ON " + database + ".* TO '" + user + "'@'%s'" % (mysqlUtilities.LOCALHOST))
|
||||
else:
|
||||
cursor.execute(
|
||||
"GRANT INDEX, DROP, UPDATE, ALTER, CREATE, SELECT, INSERT, DELETE ON " + database + ".* TO '" + user + "'@'%s'" % (mysqlUtilities.LOCALHOST))
|
||||
|
||||
connection.close()
|
||||
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user