push changes

This commit is contained in:
Michael Ramsey
2019-10-08 10:53:02 -04:00
parent 0695e9c9d0
commit bd71b39d31
1802 changed files with 170876 additions and 50904 deletions

View File

@@ -0,0 +1 @@
default_app_config = 'examplePlugin.apps.ExamplepluginConfig'

6
examplePlugin/admin.py Normal file
View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
# Register your models here.

11
examplePlugin/apps.py Normal file
View File

@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ExamplepluginConfig(AppConfig):
name = 'examplePlugin'
def ready(self):
import signals

7
examplePlugin/meta.xml Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<cyberpanelPluginConfig>
<name>examplePlugin</name>
<type>plugin</type>
<description>This is an example plugin</description>
<version>0</version>
</cyberpanelPluginConfig>

View File

6
examplePlugin/models.py Normal file
View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# Create your models here.

16
examplePlugin/signals.py Normal file
View File

@@ -0,0 +1,16 @@
from django.dispatch import receiver
from django.http import HttpResponse
from websiteFunctions.signals import postWebsiteDeletion
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
# This plugin respond to an event after CyberPanel core finished deleting a website.
# Original request object is passed, body can be accessed with request.body.
# If any Event handler returns a response object, CyberPanel will stop further processing and returns your response to browser.
# To continue processing just return 200 from your events handlers.
@receiver(postWebsiteDeletion)
def rcvr(sender, **kwargs):
request = kwargs['request']
logging.writeToFile('Hello World from Example Plugin.')
return HttpResponse('Hello World from Example Plugin.')

6
examplePlugin/tests.py Normal file
View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
# Create your tests here.

7
examplePlugin/urls.py Normal file
View File

@@ -0,0 +1,7 @@
from django.conf.urls import url
import views
urlpatterns = [
url(r'^$', views.examplePlugin, name='examplePlugin'),
]

9
examplePlugin/views.py Normal file
View File

@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render, HttpResponse
# Create your views here.
def examplePlugin(request):
return HttpResponse('This is homepage of an example plugin.')