mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-05 11:50:50 +01:00
push changes
This commit is contained in:
1
examplePlugin/__init__.py
Normal file
1
examplePlugin/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
default_app_config = 'examplePlugin.apps.ExamplepluginConfig'
|
||||
6
examplePlugin/admin.py
Normal file
6
examplePlugin/admin.py
Normal 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
11
examplePlugin/apps.py
Normal 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
7
examplePlugin/meta.xml
Normal 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>
|
||||
0
examplePlugin/migrations/__init__.py
Normal file
0
examplePlugin/migrations/__init__.py
Normal file
6
examplePlugin/models.py
Normal file
6
examplePlugin/models.py
Normal 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
16
examplePlugin/signals.py
Normal 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
6
examplePlugin/tests.py
Normal 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
7
examplePlugin/urls.py
Normal 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
9
examplePlugin/views.py
Normal 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.')
|
||||
Reference in New Issue
Block a user