From 86702824cc02a49e1ac3cb6f7dbec1f0689f06a2 Mon Sep 17 00:00:00 2001
From: usmannasir <01-134132-158@student.bahria.edu.pk>
Date: Fri, 13 Jul 2018 21:45:40 +0500
Subject: [PATCH] Improved Joomla Installation process.
---
filemanager/templates/filemanager/index.html | 30 ++
install/composer.sh | 6 +
install/install.py | 18 +
mailServer/views.py | 2 +-
plogical/applicationInstaller.py | 211 +++++++++++-
plogical/virtualHostUtilities.py | 182 ++--------
static/websiteFunctions/websiteFunctions.js | 181 +++++++---
.../websiteFunctions/websiteFunctions.js | 181 +++++++---
.../websiteFunctions/installJoomla.html | 127 +++++++
.../templates/websiteFunctions/website.html | 4 +-
websiteFunctions/urls.py | 15 +-
websiteFunctions/views.py | 311 ++++++++++--------
12 files changed, 880 insertions(+), 388 deletions(-)
create mode 100644 install/composer.sh
create mode 100644 websiteFunctions/templates/websiteFunctions/installJoomla.html
diff --git a/filemanager/templates/filemanager/index.html b/filemanager/templates/filemanager/index.html
index fba76f066..faa9b4f30 100644
--- a/filemanager/templates/filemanager/index.html
+++ b/filemanager/templates/filemanager/index.html
@@ -572,6 +572,36 @@
+
+
+
diff --git a/install/composer.sh b/install/composer.sh
new file mode 100644
index 000000000..64ba9fc2e
--- /dev/null
+++ b/install/composer.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
+php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
+php composer-setup.php
+php -r "unlink('composer-setup.php');"
+cp composer.phar /usr/bin/composer
\ No newline at end of file
diff --git a/install/install.py b/install/install.py
index a14493fba..fc6f8df4a 100644
--- a/install/install.py
+++ b/install/install.py
@@ -2690,6 +2690,23 @@ milter_default_action = accept
logging.InstallLog.writeToFile(str(msg) + " [setupCLI]")
return 0
+ def setupPHPAndComposer(self):
+ try:
+ command = "cp /usr/local/lsws/lsphp71/bin/php /usr/bin/"
+ res = subprocess.call(shlex.split(command))
+
+ os.chdir(self.cwd)
+
+ command = "chmod +x composer.sh"
+ res = subprocess.call(shlex.split(command))
+
+ command = "./composer.sh"
+ res = subprocess.call(shlex.split(command))
+
+ except OSError, msg:
+ logging.InstallLog.writeToFile(str(msg) + " [setupPHPAndComposer]")
+ return 0
+
@staticmethod
def setupVirtualEnv():
try:
@@ -2884,6 +2901,7 @@ def main():
checks.modSecPreReqs()
checks.setupVirtualEnv()
+ checks.setupPHPAndComposer()
checks.installation_successfull()
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")
diff --git a/mailServer/views.py b/mailServer/views.py
index e74e89d9f..6630ebe71 100644
--- a/mailServer/views.py
+++ b/mailServer/views.py
@@ -396,7 +396,7 @@ def submitPasswordChange(request):
email = data['email']
password = data['password']
- emailDB = EUsers(email=email)
+ emailDB = EUsers.objects.get(email=email)
if admin.type != 1:
if emailDB.emailOwner.domainOwner.admin != admin:
diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py
index c1ba9b2a1..f4b189b76 100644
--- a/plogical/applicationInstaller.py
+++ b/plogical/applicationInstaller.py
@@ -29,6 +29,8 @@ class ApplicationInstaller(multi.Thread):
try:
if self.installApp == 'wordpress':
self.installWordPress()
+ elif self.installApp == 'joomla':
+ self.installJoomla()
except BaseException, msg:
logging.writeToFile( str(msg) + ' [ApplicationInstaller.run]')
@@ -49,7 +51,6 @@ class ApplicationInstaller(multi.Thread):
logging.writeToFile( str(msg) + ' [ApplicationInstaller.installWPCLI]')
-
def installWordPress(self):
try:
@@ -165,18 +166,30 @@ class ApplicationInstaller(multi.Thread):
if website.package.dataBases > website.databases_set.all().count():
pass
else:
- raise BaseException("Maximum database limit reached for this website.")
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines(
+ "Maximum database limit reached for this website." + " [404]")
+ statusFile.close()
+ return 0
if Databases.objects.filter(dbName=dbName).exists() or Databases.objects.filter(
dbUser=dbUser).exists():
- raise BaseException("This database or user is already taken.")
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines(
+ "This database or user is already taken." + " [404]")
+ statusFile.close()
+ return 0
result = mysqlUtilities.createDatabase(dbName, dbUser, dbPassword)
if result == 1:
pass
else:
- raise BaseException("Not able to create database.")
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines(
+ "Not able to create database." + " [404]")
+ statusFile.close()
+ return 0
db = Databases(website=website, dbName=dbName, dbUser=dbUser)
db.save()
@@ -225,8 +238,6 @@ class ApplicationInstaller(multi.Thread):
command = "sudo wp plugin activate litespeed-cache --allow-root --path=" + finalPath
subprocess.call(shlex.split(command))
-
-
##
@@ -279,3 +290,191 @@ class ApplicationInstaller(multi.Thread):
statusFile.writelines(str(msg) + " [404]")
statusFile.close()
return 0
+
+
+ def installJoomla(self):
+
+ try:
+
+ domainName = self.extraArgs['domainName']
+ finalPath = self.extraArgs['finalPath']
+ virtualHostUser = self.extraArgs['virtualHostUser']
+ dbName = self.extraArgs['dbName']
+ dbUser = self.extraArgs['dbUser']
+ dbPassword = self.extraArgs['dbPassword']
+ username = self.extraArgs['username']
+ password = self.extraArgs['password']
+ prefix = self.extraArgs['prefix']
+ sitename = self.extraArgs['sitename']
+ tempStatusPath = self.extraArgs['tempStatusPath']
+
+
+
+ FNULL = open(os.devnull, 'w')
+
+ if not os.path.exists(finalPath):
+ os.makedirs(finalPath)
+
+ ## checking for directories/files
+
+ dirFiles = os.listdir(finalPath)
+
+ if len(dirFiles) == 1:
+ if dirFiles[0] == ".well-known":
+ pass
+ else:
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines("Target directory should be empty before installation, otherwise data loss could occur." + " [404]")
+ statusFile.close()
+ return 0
+ elif len(dirFiles) == 0:
+ pass
+ else:
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines(
+ "Target directory should be empty before installation, otherwise data loss could occur." + " [404]")
+ statusFile.close()
+ return 0
+
+ ## Get Joomla
+
+ os.chdir(finalPath)
+
+ if not os.path.exists("staging.zip"):
+ command = 'wget --no-check-certificate https://github.com/joomla/joomla-cms/archive/staging.zip -P ' + finalPath
+ cmd = shlex.split(command)
+ res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
+ else:
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines("File already exists." + " [404]")
+ statusFile.close()
+ return 0
+
+ command = 'unzip ' + finalPath + 'staging.zip -d ' + finalPath
+ cmd = shlex.split(command)
+
+ res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
+ os.remove(finalPath + 'staging.zip')
+
+ command = 'cp -r ' + finalPath + 'joomla-cms-staging/. ' + finalPath
+ cmd = shlex.split(command)
+ res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
+
+ shutil.rmtree(finalPath + "joomla-cms-staging")
+ os.rename(finalPath + "installation/configuration.php-dist", finalPath + "configuration.php")
+ os.rename(finalPath + "robots.txt.dist", finalPath + "robots.txt")
+ os.rename(finalPath + "htaccess.txt", finalPath + ".htaccess")
+
+ ## edit config file
+
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines('Creating configuration files.,40')
+ statusFile.close()
+
+ configfile = finalPath + "configuration.php"
+
+ data = open(configfile, "r").readlines()
+
+ writeDataToFile = open(configfile, "w")
+
+ secret = randomPassword.generate_pass()
+
+ defDBName = " public $user = '" + dbName + "';" + "\n"
+ defDBUser = " public $db = '" + dbUser + "';" + "\n"
+ defDBPassword = " public $password = '" + dbPassword + "';" + "\n"
+ secretKey = " public $secret = '" + secret + "';" + "\n"
+ logPath = " public $log_path = '" + finalPath + "administrator/logs';" + "\n"
+ tmpPath = " public $tmp_path = '" + finalPath + "administrator/tmp';" + "\n"
+ dbprefix = " public $dbprefix = '" + prefix + "';" + "\n"
+ sitename = " public $sitename = '" + sitename + "';" + "\n"
+
+ for items in data:
+ if items.find("public $user ") > -1:
+ writeDataToFile.writelines(defDBUser)
+ elif items.find("public $password ") > -1:
+ writeDataToFile.writelines(defDBPassword)
+ elif items.find("public $db ") > -1:
+ writeDataToFile.writelines(defDBName)
+ elif items.find("public $log_path ") > -1:
+ writeDataToFile.writelines(logPath)
+ elif items.find("public $tmp_path ") > -1:
+ writeDataToFile.writelines(tmpPath)
+ elif items.find("public $secret ") > -1:
+ writeDataToFile.writelines(secretKey)
+ elif items.find("public $dbprefix ") > -1:
+ writeDataToFile.writelines(dbprefix)
+ elif items.find("public $sitename ") > -1:
+ writeDataToFile.writelines(sitename)
+ elif items.find("/*") > -1:
+ pass
+ elif items.find(" *") > -1:
+ pass
+ else:
+ writeDataToFile.writelines(items)
+
+ writeDataToFile.close()
+
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines('Creating default user..,70')
+ statusFile.close()
+
+ # Rename SQL db prefix
+
+ f1 = open(finalPath + 'installation/sql/mysql/joomla.sql', 'r')
+ f2 = open('installation/sql/mysql/joomlaInstall.sql', 'w')
+ for line in f1:
+ f2.write(line.replace('#__', prefix))
+ f1.close()
+ f2.close()
+
+ # Restore SQL
+ proc = subprocess.Popen(["mysql", "--user=%s" % dbUser, "--password=%s" % dbPassword, dbName],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+
+ usercreation = """INSERT INTO `%susers`
+ (`name`, `username`, `password`, `params`)
+ VALUES ('Administrator', '%s',
+ '%s', '');
+ INSERT INTO `%suser_usergroup_map` (`user_id`,`group_id`)
+ VALUES (LAST_INSERT_ID(),'8');""" % (prefix, username, password, prefix)
+
+ out, err = proc.communicate(
+ file(finalPath + 'installation/sql/mysql/joomlaInstall.sql').read() + "\n" + usercreation)
+
+ shutil.rmtree(finalPath + "installation")
+
+ command = "chown -R " + virtualHostUser + ":" + virtualHostUser + " " + "/home/" + domainName + "/public_html/"
+
+ cmd = shlex.split(command)
+
+ res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
+
+ vhost.addRewriteRules(domainName)
+
+ installUtilities.reStartLiteSpeed()
+
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines("Successfully Installed. [200]")
+ statusFile.close()
+ return 0
+
+ except BaseException, msg:
+ # remove the downloaded files
+ try:
+ shutil.rmtree(finalPath)
+ except:
+ logging.writeToFile("shutil.rmtree(finalPath)")
+
+ homeDir = "/home/" + domainName + "/public_html"
+
+ if not os.path.exists(homeDir):
+ FNULL = open(os.devnull, 'w')
+ os.mkdir(homeDir)
+ command = "chown -R " + virtualHostUser + ":" + virtualHostUser + " " + homeDir
+ cmd = shlex.split(command)
+ res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
+
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines(str(msg) + " [404]")
+ statusFile.close()
+ return 0
diff --git a/plogical/virtualHostUtilities.py b/plogical/virtualHostUtilities.py
index 04cf86d60..f85cc71a3 100644
--- a/plogical/virtualHostUtilities.py
+++ b/plogical/virtualHostUtilities.py
@@ -24,6 +24,7 @@ from plogical.mailUtilities import mailUtilities
import CyberCPLogFileWriter as logging
from dnsUtilities import DNS
from vhost import vhost
+from applicationInstaller import ApplicationInstaller
## If you want justice, you have come to the wrong place.
@@ -383,173 +384,28 @@ class virtualHostUtilities:
@staticmethod
def installJoomla(domainName, finalPath, virtualHostUser, dbName, dbUser, dbPassword, username, password, prefix,
- sitename):
-
+ sitename, tempStatusPath):
try:
- FNULL = open(os.devnull, 'w')
- if not os.path.exists(finalPath):
- os.makedirs(finalPath)
+ extraArgs = {}
+ extraArgs['domainName'] = domainName
+ extraArgs['finalPath'] = finalPath
+ extraArgs['virtualHostUser'] = virtualHostUser
+ extraArgs['dbName'] = dbName
+ extraArgs['dbUser'] = dbUser
+ extraArgs['dbPassword'] = dbPassword
+ extraArgs['username'] = username
+ extraArgs['password'] = password
+ extraArgs['prefix'] = prefix
+ extraArgs['sitename'] = sitename
+ extraArgs['tempStatusPath'] = tempStatusPath
- ## checking for directories/files
+ background = ApplicationInstaller('joomla', extraArgs)
+ background.start()
- dirFiles = os.listdir(finalPath)
-
- if len(dirFiles) == 1:
- if dirFiles[0] == ".well-known":
- pass
- else:
- print "0,Target directory should be empty before installation, otherwise data loss could occur."
- return
- elif len(dirFiles) == 0:
- pass
- else:
- print "0,Target directory should be empty before installation, otherwise data loss could occur."
- return
-
- ## Get Joomla
-
- os.chdir(finalPath)
-
- if not os.path.exists("staging.zip"):
- command = 'wget --no-check-certificate https://github.com/joomla/joomla-cms/archive/staging.zip -P ' + finalPath
- cmd = shlex.split(command)
- res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
- else:
- print "0,File already exists"
- return
-
- command = 'unzip ' + finalPath + 'staging.zip -d ' + finalPath
-
- cmd = shlex.split(command)
-
- res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
-
- os.remove(finalPath + 'staging.zip')
-
- command = 'cp -r ' + finalPath + 'joomla-cms-staging/. ' + finalPath
- cmd = shlex.split(command)
- res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
-
- shutil.rmtree(finalPath + "joomla-cms-staging")
- os.rename(finalPath + "installation/configuration.php-dist", finalPath + "configuration.php")
- os.rename(finalPath + "robots.txt.dist", finalPath + "robots.txt")
- os.rename(finalPath + "htaccess.txt", finalPath + ".htaccess")
-
- ## edit config file
-
- configfile = finalPath + "configuration.php"
-
- data = open(configfile, "r").readlines()
-
- writeDataToFile = open(configfile, "w")
-
- secret = randomPassword.generate_pass()
-
- defDBName = " public $user = '" + dbName + "';" + "\n"
- defDBUser = " public $db = '" + dbUser + "';" + "\n"
- defDBPassword = " public $password = '" + dbPassword + "';" + "\n"
- secretKey = " public $secret = '" + secret + "';" + "\n"
- logPath = " public $log_path = '" + finalPath + "administrator/logs';" + "\n"
- tmpPath = " public $tmp_path = '" + finalPath + "administrator/tmp';" + "\n"
- dbprefix = " public $dbprefix = '" + prefix + "';" + "\n"
- sitename = " public $sitename = '" + sitename + "';" + "\n"
-
- for items in data:
- if items.find("public $user ") > -1:
- writeDataToFile.writelines(defDBUser)
- elif items.find("public $password ") > -1:
- writeDataToFile.writelines(defDBPassword)
- elif items.find("public $db ") > -1:
- writeDataToFile.writelines(defDBName)
- elif items.find("public $log_path ") > -1:
- writeDataToFile.writelines(logPath)
- elif items.find("public $tmp_path ") > -1:
- writeDataToFile.writelines(tmpPath)
- elif items.find("public $secret ") > -1:
- writeDataToFile.writelines(secretKey)
- elif items.find("public $dbprefix ") > -1:
- writeDataToFile.writelines(dbprefix)
- elif items.find("public $sitename ") > -1:
- writeDataToFile.writelines(sitename)
- elif items.find("/*") > -1:
- pass
- elif items.find(" *") > -1:
- pass
- else:
- writeDataToFile.writelines(items)
-
- writeDataToFile.close()
-
- # Rename SQL db prefix
-
- f1 = open(finalPath + 'installation/sql/mysql/joomla.sql', 'r')
- f2 = open('installation/sql/mysql/joomlaInstall.sql', 'w')
- for line in f1:
- f2.write(line.replace('#__', prefix))
- f1.close()
- f2.close()
-
- # Restore SQL
- proc = subprocess.Popen(["mysql", "--user=%s" % dbUser, "--password=%s" % dbPassword, dbName],
- stdin=subprocess.PIPE, stdout=subprocess.PIPE)
-
- usercreation = """INSERT INTO `%susers`
- (`name`, `username`, `password`, `params`)
- VALUES ('Administrator', '%s',
- '%s', '');
- INSERT INTO `%suser_usergroup_map` (`user_id`,`group_id`)
- VALUES (LAST_INSERT_ID(),'8');""" % (prefix, username, password, prefix)
-
- out, err = proc.communicate(
- file(finalPath + 'installation/sql/mysql/joomlaInstall.sql').read() + "\n" + usercreation)
-
- shutil.rmtree(finalPath + "installation")
-
- htaccessCache = """
-
- RewriteEngine on
- CacheLookup on
- CacheDisable public /
- RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
- RewriteCond %{ORG_REQ_URI} !/administrator
- RewriteRule .* - [E=cache-control:max-age=120]
-
- """
-
- f = open(finalPath + '.htaccess', "a+")
- f.write(htaccessCache)
- f.close()
-
- command = "chown -R " + virtualHostUser + ":" + virtualHostUser + " " + "/home/" + domainName + "/public_html/"
-
- cmd = shlex.split(command)
-
- res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
-
- vhost.addRewriteRules(domainName)
-
- installUtilities.installUtilities.reStartLiteSpeed()
-
- print "1,None"
- return
except BaseException, msg:
- # remove the downloaded files
- try:
- shutil.rmtree(finalPath)
- except:
- logging.CyberCPLogFileWriter.writeToFile("shutil.rmtree(finalPath)")
-
- homeDir = "/home/" + domainName + "/public_html"
-
- if not os.path.exists(homeDir):
- FNULL = open(os.devnull, 'w')
- os.mkdir(homeDir)
- command = "chown -R " + virtualHostUser + ":" + virtualHostUser + " " + homeDir
- cmd = shlex.split(command)
- res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
- return
+ logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [installJoomla]')
@staticmethod
def issueSSLForHostName(virtualHost, path):
@@ -1139,6 +995,8 @@ def main():
parser.add_argument('--openBasedirValue', help='open_base dir protection value!')
+ parser.add_argument('--tempStatusPath', help='Temporary Status file path.')
+
args = parser.parse_args()
@@ -1186,7 +1044,7 @@ def main():
elif args.function == "installWordPress":
virtualHostUtilities.installWordPress(args.virtualHostName,args.path,args.virtualHostUser,args.dbName,args.dbUser,args.dbPassword)
elif args.function == "installJoomla":
- virtualHostUtilities.installJoomla(args.virtualHostName,args.path,args.virtualHostUser,args.dbName,args.dbUser,args.dbPassword,args.username,args.password,args.prefix,args.sitename)
+ virtualHostUtilities.installJoomla(args.virtualHostName,args.path,args.virtualHostUser,args.dbName,args.dbUser,args.dbPassword,args.username,args.password,args.prefix,args.sitename, args.tempStatusPath)
elif args.function == "issueSSLForHostName":
virtualHostUtilities.issueSSLForHostName(args.virtualHostName,args.path)
elif args.function == "issueSSLForMailServer":
diff --git a/static/websiteFunctions/websiteFunctions.js b/static/websiteFunctions/websiteFunctions.js
index fcfaa695a..8a4172522 100644
--- a/static/websiteFunctions/websiteFunctions.js
+++ b/static/websiteFunctions/websiteFunctions.js
@@ -457,6 +457,7 @@ app.controller('websitePages', function($scope,$http) {
$scope.fileManagerURL = "/filemanager/"+$("#domainNamePage").text();
$scope.wordPressInstallURL = $("#domainNamePage").text() + "/wordpressInstall";
+ $scope.joomlaInstallURL = $("#domainNamePage").text() + "/joomlaInstall";
$scope.domainAliasURL = "/websites/"+$("#domainNamePage").text()+"/domainAlias";
$scope.previewUrl = "/preview/"+$("#domainNamePage").text()+"/";
@@ -3870,9 +3871,6 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
$("#installProgress").css("width", "0%");
};
-
-
-
$scope.installWordPress = function(){
$scope.installationDetailsForm = true;
@@ -4036,28 +4034,148 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
}
+
+});
+
+
+app.controller('installJoomlaCTRL', function($scope, $http, $timeout) {
+
+ $scope.installationDetailsForm = false;
+ $scope.installationProgress = true;
+ $scope.installationFailed = true;
+ $scope.installationSuccessfull = true;
+ $scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = true;
+
+ $scope.databasePrefix = 'jm_'
+
+ var statusFile;
+ var domain = $("#domainNamePage").text();
+ var path;
+
+
+
+ $scope.goBack = function () {
+ $scope.installationDetailsForm = false;
+ $scope.installationProgress = true;
+ $scope.installationFailed = true;
+ $scope.installationSuccessfull = true;
+ $scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = true;
+ $("#installProgress").css("width", "0%");
+ };
+
+ function getInstallStatus(){
+
+ url = "/websites/installWordpressStatus";
+
+ var data = {
+ statusFile: statusFile,
+ domainName: domain
+ };
+
+ var config = {
+ headers : {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+
+
+ $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+
+
+ if(response.data.abort === 1){
+
+ if(response.data.installStatus === 1){
+
+ $scope.installationDetailsForm = true;
+ $scope.installationProgress = false;
+ $scope.installationFailed = true;
+ $scope.installationSuccessfull = false;
+ $scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = false;
+
+ if (typeof path !== 'undefined'){
+ $scope.installationURL = "http://"+domain+"/"+path;
+ }
+ else{
+ $scope.installationURL = domain;
+ }
+
+
+ $("#installProgress").css("width", "100%");
+ $scope.installPercentage = "100";
+ $scope.currentStatus = response.data.currentStatus;
+ $timeout.cancel();
+
+ }
+ else{
+
+ $scope.installationDetailsForm = true;
+ $scope.installationProgress = false;
+ $scope.installationFailed = false;
+ $scope.installationSuccessfull = true;
+ $scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = false;
+
+ $scope.errorMessage = response.data.error_message;
+
+ $("#installProgress").css("width", "0%");
+ $scope.installPercentage = "0";
+
+ }
+
+ }
+ else{
+ $("#installProgress").css("width", response.data.installationProgress + "%");
+ $scope.installPercentage = response.data.installationProgress;
+ $scope.currentStatus = response.data.currentStatus;
+
+ $timeout(getInstallStatus,1000);
+
+
+
+ }
+
+ }
+ function cantLoadInitialDatas(response) {
+
+ $scope.canNotFetch = true;
+ $scope.couldNotConnect = false;
+
+
+ }
+
+
+ }
+
$scope.installJoomla = function(){
-
- $scope.installationDetailsFormJoomla = false;
- $scope.applicationInstallerLoading = false;
+ $scope.installationDetailsForm = true;
+ $scope.installationProgress = false;
$scope.installationFailed = true;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = true;
+ $scope.wpInstallLoading = false;
+ $scope.goBackDisable = true;
+ $scope.currentStatus = "Starting installation..";
- var domain = $("#domainNamePage").text();
- var path = $scope.installPath;
- var sitename = $scope.sitename
- var username = $scope.username
- var password = $scope.password
- var prefix = $scope.prefix
+ path = $scope.installPath;
url = "/websites/installJoomla";
var home = "1";
- if (typeof path != 'undefined'){
+ if (typeof path !== 'undefined'){
home = "0";
}
@@ -4066,10 +4184,10 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
domain: domain,
home:home,
path:path,
- sitename:sitename,
- username:username,
- password:password,
- prefix:prefix,
+ sitename: $scope.blogTitle,
+ username: $scope.adminUser,
+ password: $scope.adminPassword,
+ prefix: $scope.databasePrefix
};
var config = {
@@ -4083,29 +4201,20 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
function ListInitialDatas(response) {
- if (response.data.installStatus == 1)
+ if (response.data.installStatus === 1)
{
- if (typeof path != 'undefined'){
- $scope.installationURL = "http://"+domain+"/"+path;
- }
- else{
- $scope.installationURL = domain;
- }
-
- $scope.installationDetailsFormJoomla = false;
- $scope.applicationInstallerLoading = true;
- $scope.installationFailed = true;
- $scope.installationSuccessfull = false;
- $scope.couldNotConnect = true;
-
+ statusFile = response.data.tempStatusPath;
+ getInstallStatus();
}
else{
- $scope.installationDetailsFormJoomla = false;
- $scope.applicationInstallerLoading = true;
+ $scope.installationDetailsForm = true;
+ $scope.installationProgress = false;
$scope.installationFailed = false;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = false;
$scope.errorMessage = response.data.error_message;
@@ -4115,11 +4224,7 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
}
function cantLoadInitialDatas(response) {
- $scope.installationDetailsFormJoomla = false;
- $scope.applicationInstallerLoading = true;
- $scope.installationFailed = true;
- $scope.installationSuccessfull = true;
- $scope.couldNotConnect = false;
+
}
diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js
index fcfaa695a..8a4172522 100644
--- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js
+++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js
@@ -457,6 +457,7 @@ app.controller('websitePages', function($scope,$http) {
$scope.fileManagerURL = "/filemanager/"+$("#domainNamePage").text();
$scope.wordPressInstallURL = $("#domainNamePage").text() + "/wordpressInstall";
+ $scope.joomlaInstallURL = $("#domainNamePage").text() + "/joomlaInstall";
$scope.domainAliasURL = "/websites/"+$("#domainNamePage").text()+"/domainAlias";
$scope.previewUrl = "/preview/"+$("#domainNamePage").text()+"/";
@@ -3870,9 +3871,6 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
$("#installProgress").css("width", "0%");
};
-
-
-
$scope.installWordPress = function(){
$scope.installationDetailsForm = true;
@@ -4036,28 +4034,148 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
}
+
+});
+
+
+app.controller('installJoomlaCTRL', function($scope, $http, $timeout) {
+
+ $scope.installationDetailsForm = false;
+ $scope.installationProgress = true;
+ $scope.installationFailed = true;
+ $scope.installationSuccessfull = true;
+ $scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = true;
+
+ $scope.databasePrefix = 'jm_'
+
+ var statusFile;
+ var domain = $("#domainNamePage").text();
+ var path;
+
+
+
+ $scope.goBack = function () {
+ $scope.installationDetailsForm = false;
+ $scope.installationProgress = true;
+ $scope.installationFailed = true;
+ $scope.installationSuccessfull = true;
+ $scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = true;
+ $("#installProgress").css("width", "0%");
+ };
+
+ function getInstallStatus(){
+
+ url = "/websites/installWordpressStatus";
+
+ var data = {
+ statusFile: statusFile,
+ domainName: domain
+ };
+
+ var config = {
+ headers : {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+
+
+ $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+
+
+ if(response.data.abort === 1){
+
+ if(response.data.installStatus === 1){
+
+ $scope.installationDetailsForm = true;
+ $scope.installationProgress = false;
+ $scope.installationFailed = true;
+ $scope.installationSuccessfull = false;
+ $scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = false;
+
+ if (typeof path !== 'undefined'){
+ $scope.installationURL = "http://"+domain+"/"+path;
+ }
+ else{
+ $scope.installationURL = domain;
+ }
+
+
+ $("#installProgress").css("width", "100%");
+ $scope.installPercentage = "100";
+ $scope.currentStatus = response.data.currentStatus;
+ $timeout.cancel();
+
+ }
+ else{
+
+ $scope.installationDetailsForm = true;
+ $scope.installationProgress = false;
+ $scope.installationFailed = false;
+ $scope.installationSuccessfull = true;
+ $scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = false;
+
+ $scope.errorMessage = response.data.error_message;
+
+ $("#installProgress").css("width", "0%");
+ $scope.installPercentage = "0";
+
+ }
+
+ }
+ else{
+ $("#installProgress").css("width", response.data.installationProgress + "%");
+ $scope.installPercentage = response.data.installationProgress;
+ $scope.currentStatus = response.data.currentStatus;
+
+ $timeout(getInstallStatus,1000);
+
+
+
+ }
+
+ }
+ function cantLoadInitialDatas(response) {
+
+ $scope.canNotFetch = true;
+ $scope.couldNotConnect = false;
+
+
+ }
+
+
+ }
+
$scope.installJoomla = function(){
-
- $scope.installationDetailsFormJoomla = false;
- $scope.applicationInstallerLoading = false;
+ $scope.installationDetailsForm = true;
+ $scope.installationProgress = false;
$scope.installationFailed = true;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = true;
+ $scope.wpInstallLoading = false;
+ $scope.goBackDisable = true;
+ $scope.currentStatus = "Starting installation..";
- var domain = $("#domainNamePage").text();
- var path = $scope.installPath;
- var sitename = $scope.sitename
- var username = $scope.username
- var password = $scope.password
- var prefix = $scope.prefix
+ path = $scope.installPath;
url = "/websites/installJoomla";
var home = "1";
- if (typeof path != 'undefined'){
+ if (typeof path !== 'undefined'){
home = "0";
}
@@ -4066,10 +4184,10 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
domain: domain,
home:home,
path:path,
- sitename:sitename,
- username:username,
- password:password,
- prefix:prefix,
+ sitename: $scope.blogTitle,
+ username: $scope.adminUser,
+ password: $scope.adminPassword,
+ prefix: $scope.databasePrefix
};
var config = {
@@ -4083,29 +4201,20 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
function ListInitialDatas(response) {
- if (response.data.installStatus == 1)
+ if (response.data.installStatus === 1)
{
- if (typeof path != 'undefined'){
- $scope.installationURL = "http://"+domain+"/"+path;
- }
- else{
- $scope.installationURL = domain;
- }
-
- $scope.installationDetailsFormJoomla = false;
- $scope.applicationInstallerLoading = true;
- $scope.installationFailed = true;
- $scope.installationSuccessfull = false;
- $scope.couldNotConnect = true;
-
+ statusFile = response.data.tempStatusPath;
+ getInstallStatus();
}
else{
- $scope.installationDetailsFormJoomla = false;
- $scope.applicationInstallerLoading = true;
+ $scope.installationDetailsForm = true;
+ $scope.installationProgress = false;
$scope.installationFailed = false;
$scope.installationSuccessfull = true;
$scope.couldNotConnect = true;
+ $scope.wpInstallLoading = true;
+ $scope.goBackDisable = false;
$scope.errorMessage = response.data.error_message;
@@ -4115,11 +4224,7 @@ app.controller('installWordPressCTRL', function($scope, $http, $timeout) {
}
function cantLoadInitialDatas(response) {
- $scope.installationDetailsFormJoomla = false;
- $scope.applicationInstallerLoading = true;
- $scope.installationFailed = true;
- $scope.installationSuccessfull = true;
- $scope.couldNotConnect = false;
+
}
diff --git a/websiteFunctions/templates/websiteFunctions/installJoomla.html b/websiteFunctions/templates/websiteFunctions/installJoomla.html
new file mode 100644
index 000000000..153795f0a
--- /dev/null
+++ b/websiteFunctions/templates/websiteFunctions/installJoomla.html
@@ -0,0 +1,127 @@
+{% extends "baseTemplate/index.html" %}
+{% load i18n %}
+{% block title %}{% trans "Install Joomla - CyberPanel" %}{% endblock %}
+{% block content %}
+
+{% load static %}
+{% get_current_language as LANGUAGE_CODE %}
+
+
+
+
+
{% trans "Install Joomla" %}
+
{% trans "One-click Joomla Install!" %}
+
+
+
+
+
+
+ {{ domainName }} - {% trans "Installation Details" %}
+
+
+
+
+
+
+
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/websiteFunctions/templates/websiteFunctions/website.html b/websiteFunctions/templates/websiteFunctions/website.html
index 34db89882..9ca46fa85 100644
--- a/websiteFunctions/templates/websiteFunctions/website.html
+++ b/websiteFunctions/templates/websiteFunctions/website.html
@@ -952,10 +952,10 @@
-
+
-
+
{% trans "Joomla" %}
diff --git a/websiteFunctions/urls.py b/websiteFunctions/urls.py
index 405bbb18e..6ef871236 100644
--- a/websiteFunctions/urls.py
+++ b/websiteFunctions/urls.py
@@ -28,10 +28,6 @@ urlpatterns = [
url(r'^(?P
([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=]{1}[\da-z\.-]+)*[\/\?]?)$', views.domain, name='domain'),
url(r'^getDataFromLogFile', views.getDataFromLogFile, name='getDataFromLogFile'),
url(r'^fetchErrorLogs', views.fetchErrorLogs, name='fetchErrorLogs'),
-
-
- url(r'^installWordpress$', views.installWordpress, name='installWordpress'),
- url(r'^installJoomla', views.installJoomla, name='installJoomla'),
url(r'^getDataFromConfigFile', views.getDataFromConfigFile, name='getDataFromConfigFile'),
@@ -79,7 +75,18 @@ urlpatterns = [
## Application Installer
url(r'^applicationInstaller$',views.applicationInstaller,name="applicationInstaller"),
+
+ ## WP Install
+
url(r'^(?P([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=]{1}[\da-z\.-]+)*[\/\?]?)/wordpressInstall$', views.wordpressInstall, name='wordpressInstall'),
url(r'^installWordpressStatus$',views.installWordpressStatus,name="installWordpressStatus"),
+ url(r'^installWordpress$', views.installWordpress, name='installWordpress'),
+
+
+ ## Joomla Install
+
+ url(r'^installJoomla$', views.installJoomla, name='installJoomla'),
+ url(r'^(?P([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=]{1}[\da-z\.-]+)*[\/\?]?)/joomlaInstall$', views.joomlaInstall, name='joomlaInstall'),
+
]
\ No newline at end of file
diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py
index 936f95150..a53b8843a 100644
--- a/websiteFunctions/views.py
+++ b/websiteFunctions/views.py
@@ -18,14 +18,12 @@ import plogical.randomPassword as randomPassword
import subprocess
import shlex
from databases.models import Databases
-from dns.models import Domains,Records
-import requests
import re
from random import randint
import hashlib
-from xml.etree import ElementTree
from plogical.mailUtilities import mailUtilities
from plogical.applicationInstaller import ApplicationInstaller
+import time
# Create your views here.
@@ -1062,139 +1060,6 @@ def fetchErrorLogs(request):
final_json = json.dumps({'logstatus': 0, 'error_message': str(msg)})
return HttpResponse(final_json)
-def installJoomla(request):
- try:
- val = request.session['userID']
-
- if request.method == 'POST':
- try:
- data = json.loads(request.body)
- domainName = data['domain']
- home = data['home']
-
- sitename = data['sitename']
- username = data['username']
- password = data['password']
- prefix = data['prefix']
-
- mailUtilities.checkHome()
-
- finalPath = ""
-
- if home == '0':
- path = data['path']
- finalPath = "/home/" + domainName + "/public_html/" + path + "/"
- else:
- finalPath = "/home/" + domainName + "/public_html/"
-
-
- if finalPath.find("..") > -1:
- data_ret = {'installStatus': 0,
- 'error_message': "Specified path must be inside virtual host home!"}
- json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
-
- admin = Administrator.objects.get(pk=val)
-
- try:
- website = ChildDomains.objects.get(domain=domainName)
- externalApp = website.master.externalApp
-
- if admin.type != 1:
- if website.master.admin != admin:
- data_ret = {'installStatus': 0,
- 'error_message': "You do not own this website!"}
- json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
- except:
- website = Websites.objects.get(domain=domainName)
- externalApp = website.externalApp
-
- if admin.type != 1:
- if website.admin != admin:
- data_ret = {'installStatus': 0,
- 'error_message': "You do not own this website!"}
- json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
-
-
- ## DB Creation
-
- dbName = randomPassword.generate_pass()
- dbUser = dbName
- dbPassword = randomPassword.generate_pass()
-
-
- ## DB Creation
-
- if website.package.dataBases > website.databases_set.all().count():
- pass
- else:
- data_ret = {'installStatus': 0, 'error_message': "0,Maximum database limit reached for this website."}
- json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
-
- if Databases.objects.filter(dbName=dbName).exists() or Databases.objects.filter(
- dbUser=dbUser).exists():
-
- data_ret = {'installStatus': 0,
- 'error_message': "0,This database or user is already taken."}
- json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
-
-
- result = mysqlUtilities.createDatabase(dbName, dbUser, dbPassword)
-
- if result == 1:
- pass
- else:
- data_ret = {'installStatus': 0,
- 'error_message': "0,Not able to create database."}
- json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
-
- db = Databases(website=website, dbName=dbName, dbUser=dbUser)
- db.save()
-
- ## Installation
- salt = randomPassword.generate_pass(32)
- #return salt
- password_hash = hashlib.md5(password + salt).hexdigest()
- password = password_hash + ":" + salt
-
-
- execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
-
- execPath = execPath + " installJoomla --virtualHostName " + domainName + " --virtualHostUser " + externalApp + " --path " + finalPath + " --dbName " + dbName + " --dbUser " + dbUser + " --dbPassword " + dbPassword + " --username " + username + " --password " + password +" --prefix " + prefix +" --sitename '" + sitename + "'"
-
- #return execPath
-
-
- output = subprocess.check_output(shlex.split(execPath))
-
- if output.find("1,None") > -1:
- data_ret = {"installStatus": 1}
- json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
- else:
- mysqlUtilities.deleteDatabase(dbName,dbUser)
- db = Databases.objects.get(dbName=dbName)
- db.delete()
- data_ret = {'installStatus': 0, 'error_message': output}
- json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
- ## Installation ends
-
- except BaseException, msg:
- data_ret = {'installStatus': 0, 'error_message': str(msg)}
- json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
-
- except KeyError, msg:
- status = {"installStatus":0,"error":str(msg)}
- logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[installJoomla]")
- return HttpResponse("Not Logged in as admin")
-
def getDataFromConfigFile(request):
try:
val = request.session['userID']
@@ -2400,6 +2265,8 @@ def installWordpress(request):
background = ApplicationInstaller('wordpress', extraArgs)
background.start()
+ time.sleep(2)
+
data_ret = {'installStatus': 1, 'error_message': 'None', 'tempStatusPath': extraArgs['tempStatusPath']}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@@ -2464,4 +2331,174 @@ def installWordpressStatus(request):
except KeyError, msg:
data_ret = {'abort': 1, 'installStatus': 0, 'installationProgress': "0", 'error_message': str(msg)}
json_data = json.dumps(data_ret)
- return HttpResponse(json_data)
\ No newline at end of file
+ return HttpResponse(json_data)
+
+
+
+def joomlaInstall(request, domain):
+ try:
+ val = request.session['userID']
+ admin = Administrator.objects.get(pk=val)
+ try:
+ if admin.type != 1:
+ website = Websites.objects.get(domain=domain)
+ if website.admin != admin:
+ raise BaseException('You do not own this website.')
+
+
+ return render(request, 'websiteFunctions/installJoomla.html', {'domainName' : domain})
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg))
+ return HttpResponse(str(msg))
+ except KeyError:
+ return redirect(loadLoginPage)
+
+
+def installJoomla(request):
+ try:
+ val = request.session['userID']
+
+ if request.method == 'POST':
+ try:
+ data = json.loads(request.body)
+ domainName = data['domain']
+ home = data['home']
+
+ sitename = data['sitename']
+ username = data['username']
+ password = data['password']
+ prefix = data['prefix']
+
+ mailUtilities.checkHome()
+
+ tempStatusPath = "/home/cyberpanel/" + str(randint(1000, 9999))
+
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines('Setting up paths,0')
+ statusFile.close()
+
+ finalPath = ""
+
+ if home == '0':
+ path = data['path']
+ finalPath = "/home/" + domainName + "/public_html/" + path + "/"
+ else:
+ finalPath = "/home/" + domainName + "/public_html/"
+
+
+ if finalPath.find("..") > -1:
+ data_ret = {'installStatus': 0,
+ 'error_message': "Specified path must be inside virtual host home!"}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+
+ ##
+
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines('Creating database..,10')
+ statusFile.close()
+
+ admin = Administrator.objects.get(pk=val)
+
+ try:
+ website = ChildDomains.objects.get(domain=domainName)
+ externalApp = website.master.externalApp
+
+ if admin.type != 1:
+ if website.master.admin != admin:
+ data_ret = {'installStatus': 0,
+ 'error_message': "You do not own this website!"}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+ except:
+ website = Websites.objects.get(domain=domainName)
+ externalApp = website.externalApp
+
+ if admin.type != 1:
+ if website.admin != admin:
+ data_ret = {'installStatus': 0,
+ 'error_message': "You do not own this website!"}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+
+ ## DB Creation
+
+ dbName = randomPassword.generate_pass()
+ dbUser = dbName
+ dbPassword = randomPassword.generate_pass()
+
+
+ ## DB Creation
+
+ if website.package.dataBases > website.databases_set.all().count():
+ pass
+ else:
+ data_ret = {'installStatus': 0, 'error_message': "0,Maximum database limit reached for this website."}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+ if Databases.objects.filter(dbName=dbName).exists() or Databases.objects.filter(
+ dbUser=dbUser).exists():
+
+ data_ret = {'installStatus': 0,
+ 'error_message': "0,This database or user is already taken."}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+
+ result = mysqlUtilities.createDatabase(dbName, dbUser, dbPassword)
+
+ if result == 1:
+ pass
+ else:
+ data_ret = {'installStatus': 0,
+ 'error_message': "0,Not able to create database."}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+ db = Databases(website=website, dbName=dbName, dbUser=dbUser)
+ db.save()
+
+ ## Installation
+ salt = randomPassword.generate_pass(32)
+ #return salt
+ password_hash = hashlib.md5(password + salt).hexdigest()
+ password = password_hash + ":" + salt
+
+ statusFile = open(tempStatusPath, 'w')
+ statusFile.writelines('Downloading Joomla Core..,20')
+ statusFile.close()
+
+
+ execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
+
+ execPath = execPath + " installJoomla --virtualHostName " + domainName + \
+ " --virtualHostUser " + externalApp + " --path " + finalPath + " --dbName " + dbName + \
+ " --dbUser " + dbUser + " --dbPassword " + dbPassword + " --username " + username + \
+ " --password " + password +" --prefix " + prefix + " --sitename '" + sitename + "'" \
+ + " --tempStatusPath " + tempStatusPath
+
+ #return execPath
+
+
+ output = subprocess.Popen(shlex.split(execPath))
+
+ data_ret = {"installStatus": 1, 'tempStatusPath': tempStatusPath}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+
+
+ ## Installation ends
+
+ except BaseException, msg:
+ data_ret = {'installStatus': 0, 'error_message': str(msg)}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+ except KeyError, msg:
+ status = {"installStatus":0,"error":str(msg)}
+ logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[installJoomla]")
+ return HttpResponse("Not Logged in as admin")
\ No newline at end of file