mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-18 05:22:06 +01:00
fix: file creation user
This commit is contained in:
@@ -100,6 +100,8 @@ class phpUtilities:
|
||||
def savePHPConfigBasic(phpVers,allow_url_fopen,display_errors,file_uploads,allow_url_include,memory_limit,max_execution_time,upload_max_filesize,max_input_time,post_max_size):
|
||||
try:
|
||||
serverLevelPHPRestart = '/usr/local/lsws/admin/tmp/.lsphp_restart.txt'
|
||||
|
||||
|
||||
command = 'touch %s' % (serverLevelPHPRestart)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
|
||||
@@ -612,6 +612,10 @@ class vhost:
|
||||
|
||||
@staticmethod
|
||||
def changePHP(vhFile, phpVersion):
|
||||
|
||||
from pathlib import Path
|
||||
HomePath = Path("/home/%s" % (vhFile.split('/')[-2]))
|
||||
virtualHostUser = HomePath.owner()
|
||||
phpDetachUpdatePath = '/home/%s/.lsphp_restart.txt' % (vhFile.split('/')[-2])
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
try:
|
||||
@@ -636,12 +640,13 @@ class vhost:
|
||||
|
||||
writeDataToFile.close()
|
||||
|
||||
writeToFile = open(phpDetachUpdatePath, 'w')
|
||||
writeToFile.close()
|
||||
command = 'sudo -u %s touch %s' % (virtualHostUser, phpDetachUpdatePath)
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
|
||||
installUtilities.installUtilities.reStartLiteSpeed()
|
||||
try:
|
||||
os.remove(phpDetachUpdatePath)
|
||||
command = 'sudo -u %s rm -f %s' % (virtualHostUser, phpDetachUpdatePath)
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user