Alpha first commit

This commit is contained in:
root
2017-12-19 23:39:22 +00:00
commit 0f53680f31
7 changed files with 217 additions and 0 deletions

30
index.py Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/python3.5
# DEBUG
import cgitb
cgitb.enable()
# IMPORT DES MODULES
import configparser
import os
from functions.headfoot import printheader,printfooter
# IMPORT DE LA CONFIGURATION
config = configparser.ConfigParser()
config.read('config.conf')
DOMAIN = config.get('general','domain')
PROTO = config.get('general','proto')
# AFFICHAGE DES ENTETES
printheader()
# BODY
print('<a href="http://', DOMAIN , '/new.py">Nouveau VHOST</a>', "<br>" , sep='' )
for i in os.listdir("/etc/apache2/sites-available"):
if os.path.isfile("/etc/apache2/sites-enabled/" + i):
print('<a href="', PROTO , '://', DOMAIN, '/file.py?file=',i, '">', i ,'</a> is enable!<br>', sep='')
else:
print('<a href="', PROTO , '://', DOMAIN, '/file.py?file=',i, '">', i ,'</a> is disable!<br>', sep='')
# AFFICHAGE DES FOOTERS
printfooter()