mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
This commit is contained in:
@@ -499,7 +499,7 @@ app.controller('listChildDomainsMain', function ($scope, $http, $timeout) {
|
|||||||
patternAdded: $scope.patternAdded
|
patternAdded: $scope.patternAdded
|
||||||
};
|
};
|
||||||
|
|
||||||
dataurl = "/websites/searchWebsites";
|
dataurl = "/websites/searchChilds";
|
||||||
|
|
||||||
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
|
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ app.controller('listChildDomainsMain', function ($scope, $http, $timeout) {
|
|||||||
patternAdded: $scope.patternAdded
|
patternAdded: $scope.patternAdded
|
||||||
};
|
};
|
||||||
|
|
||||||
dataurl = "/websites/searchWebsites";
|
dataurl = "/websites/searchChilds";
|
||||||
|
|
||||||
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
|
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ urlpatterns = [
|
|||||||
url(r'^fetchDomains$', views.fetchDomains, name='submitDomainCreation'),
|
url(r'^fetchDomains$', views.fetchDomains, name='submitDomainCreation'),
|
||||||
url(r'^changePHP$', views.changePHP, name='changePHP'),
|
url(r'^changePHP$', views.changePHP, name='changePHP'),
|
||||||
url(r'^submitDomainDeletion$', views.submitDomainDeletion, name='submitDomainDeletion'),
|
url(r'^submitDomainDeletion$', views.submitDomainDeletion, name='submitDomainDeletion'),
|
||||||
|
url(r'^searchChilds$', views.searchChilds, name='searchChilds'),
|
||||||
# crons
|
# crons
|
||||||
|
|
||||||
url(r'^listCron$',views.listCron,name="listCron"),
|
url(r'^listCron$',views.listCron,name="listCron"),
|
||||||
|
|||||||
@@ -125,6 +125,14 @@ def searchWebsites(request):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
def searchChilds(request):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
wm = WebsiteManager()
|
||||||
|
return wm.searchChilds(userID, json.loads(request.body))
|
||||||
|
except KeyError:
|
||||||
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def getFurtherAccounts(request):
|
def getFurtherAccounts(request):
|
||||||
try:
|
try:
|
||||||
userID = request.session['userID']
|
userID = request.session['userID']
|
||||||
|
|||||||
@@ -358,6 +358,27 @@ class WebsiteManager:
|
|||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
def searchChilds(self, userID=None, data=None):
|
||||||
|
try:
|
||||||
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
|
websites = ACLManager.findWebsiteObjects(currentACL, userID)
|
||||||
|
childDomains = []
|
||||||
|
|
||||||
|
for web in websites:
|
||||||
|
for child in web.childdomains_set.filter(domain__istartswith=data['patternAdded']):
|
||||||
|
childDomains.append(child)
|
||||||
|
|
||||||
|
json_data = self.findChildsListJson(childDomains)
|
||||||
|
|
||||||
|
final_dic = {'status': 1, 'listWebSiteStatus': 1, 'error_message': "None", "data": json_data}
|
||||||
|
final_json = json.dumps(final_dic)
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
except BaseException as msg:
|
||||||
|
dic = {'status': 1, 'listWebSiteStatus': 0, 'error_message': str(msg)}
|
||||||
|
json_data = json.dumps(dic)
|
||||||
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
def getFurtherAccounts(self, userID=None, data=None):
|
def getFurtherAccounts(self, userID=None, data=None):
|
||||||
try:
|
try:
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
@@ -373,7 +394,6 @@ class WebsiteManager:
|
|||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
def fetchWebsitesList(self, userID=None, data=None):
|
def fetchWebsitesList(self, userID=None, data=None):
|
||||||
try:
|
try:
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|||||||
Reference in New Issue
Block a user