Commit 02c46817 by vuj

v0.1.0 <= umgeschrieben mit tornado framework srvcnf v0.5.x

1 parent 9bda41fb
Showing with 2220 additions and 1 deletions
web/ncauth/srvcnf.sqlite3
web/base/config.ini
srvcnf2.e4p
__pycache__
Mailkonten Verwaltung Mailkonten Verwaltung
Standard Passwort für sqlite erzeugen:
echo -n pwsrvcnfg2 | md5sum
50bacd4240eb2a66476f0d82e2e77516
zukünftig
openssl passwd -1 -salt abcdefg
Password:
...@@ -11,3 +16,10 @@ Mailkonten Verwaltung ...@@ -11,3 +16,10 @@ Mailkonten Verwaltung
benötigte Packete benötigte Packete
apt-get install python3 libapache2-mod-python python3-sql python3-mysql.connector python3-httplib2 python3-requests python3-tornado python3-urllib3 python3-chardet python3-numpy python3-pkg-resources python3-requests python3-six python3-bcrypt python3-subprocess apt-get install python3 libapache2-mod-python python3-sql python3-mysql.connector python3-httplib2 python3-requests python3-tornado python3-urllib3 python3-chardet python3-numpy python3-pkg-resources python3-requests python3-six python3-bcrypt python3-subprocess
*** Setup: config.ini und srvnc.sqlite3 einstellen und kopieren
cp srvcnf2/setup/config.ini srvcnf2/web/base/config.ini
cp srvcnf2/setup/srvcnf.sqlite3 /srvcnf2/web/ncauth/srvcnf.sqlite3
ln -s /var/www/srvcnf2/setup/srvcnf2_nc.coop.conf /etc/apache2/sites-available/
/var/www/srvcnf2/setup/srvcnf2.conf &
127.0.0.1 - - [16/Jan/2018:01:38:42 +0100] "GET / HTTP/1.1" 302 5868 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [16/Jan/2018:01:38:42 +0100] "GET /login?next=%2F HTTP/1.1" 200 1276 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [16/Jan/2018:01:38:42 +0100] "GET /static/style.css?v=89d0a3f308bee330f76c7c8601f0fa6d HTTP/1.1" 200 1931 "https://srvcnf2.nc.lc/login?next=%2F" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [16/Jan/2018:01:38:42 +0100] "GET /static/bootstrap.min.css?v=4616756c400b3383840fd35a80954a0f HTTP/1.1" 200 21146 "https://srvcnf2.nc.lc/login?next=%2F" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [16/Jan/2018:01:38:42 +0100] "GET /static/bootstrap.min.js?v=84e6e85d19e14564e7b84081d5a71b90 HTTP/1.1" 200 13611 "https://srvcnf2.nc.lc/login?next=%2F" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [16/Jan/2018:01:38:43 +0100] "GET /favicon.ico HTTP/1.1" 404 1165 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [16/Jan/2018:01:38:43 +0100] "GET /favicon.ico HTTP/1.1" 404 1165 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [16/Jan/2018:01:39:00 +0100] "GET /login?next=%2F HTTP/1.1" 200 1276 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [16/Jan/2018:01:41:20 +0100] "GET / HTTP/1.1" 503 674 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
127.0.0.1 - - [16/Jan/2018:01:41:33 +0100] "GET /setup HTTP/1.1" 503 674 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
[Tue Jan 16 01:30:24.591905 2018] [ssl:warn] [pid 7823] AH01909: srvcnf2.nc.lc:443:0 server certificate does NOT include an ID which matches the server name
[Tue Jan 16 01:30:24.631157 2018] [ssl:warn] [pid 7824] AH01909: srvcnf2.nc.lc:443:0 server certificate does NOT include an ID which matches the server name
[Tue Jan 16 01:38:29.617317 2018] [ssl:warn] [pid 22747] AH01909: srvcnf2.nc.lc:443:0 server certificate does NOT include an ID which matches the server name
[Tue Jan 16 01:38:29.651733 2018] [ssl:warn] [pid 22748] AH01909: srvcnf2.nc.lc:443:0 server certificate does NOT include an ID which matches the server name
[Tue Jan 16 01:41:20.448026 2018] [proxy:error] [pid 22751] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:6611 (127.0.0.1) failed
[Tue Jan 16 01:41:20.448061 2018] [proxy_http:error] [pid 22751] [client 127.0.0.1:38318] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Tue Jan 16 01:41:33.815333 2018] [proxy:error] [pid 22752] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:6611 (127.0.0.1) failed
[Tue Jan 16 01:41:33.815373 2018] [proxy_http:error] [pid 22752] [client 127.0.0.1:38322] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Dolphin]
Timestamp=2018,1,16,1,24,16
Version=4
[Settings]
HiddenFilesShown=true
[mysql]
host = localhost
database = maildb
user = mailuser
password =xxxxx
[sqlite3ncauth]
path =ncauth/srvcnf.sqlite3
[basics]
## salted pw
pwcrypt=new
## for md5 pw
#pwcrypt=old
No preview for this file type
exec /usr/bin/python3 /var/www/srvcnf2/web/srvcnf.py
<VirtualHost *:80>
# ServerAdmin webmaster@localhost
# ServerName srvcnf2.nc.lc
# ProxyPreserveHost On
# ProxyPass / http://127.0.0.1:6611/
# ProxyPassReverse / http://127.0.0.1:6611/
# ErrorLog /var/www/srvcnf2/logs/error.log
# LogLevel warn
# CustomLog /var/www/srvcnf2/logs/access.log combined
# ServerSignature Off
</VirtualHost>
<VirtualHost *:443>
SSLEngine On
ServerName srvcnf2.nc.lc
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:6611/
ProxyPassReverse / http://127.0.0.1:6611/
ErrorLog /var/www/srvcnf2/logs/error.log
LogLevel warn
CustomLog /var/www/srvcnf2/logs/access.log combined
ServerSignature Off
</VirtualHost>
[Dolphin]
Timestamp=2018,1,12,16,56,19
Version=4
ViewMode=1
File mode changed
[Dolphin]
Timestamp=2018,1,11,23,13,40
Version=4
ViewMode=1
File mode changed
#!/usr/bin/python3
# -*- coding: UTF-8 -*-# enable debugging
from mysql.connector import MySQLConnection, Error
from read_dbconfig import read_db_config
import tornado.ioloop
import tornado.web
import tornado.escape
import tornado
import os.path
import sys
from subprocess import Popen, PIPE
#from baseclasses.htmltools import htmltools
from ncauth.ncauth_base import ncauth_base
class base_about(ncauth_base):
def get(self):
self.redirect("/")
@tornado.web.authenticated
def post(self):
nav=all
subnav=all
content=all
msglvl=""
msg=False
module="about"
mainfnc="show"
loader =tornado. template.Loader(os.path.join(os.path.dirname(__file__), "../templates"))
navigation=loader.load("navigation.html").generate(nav=nav)
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
gitlastchange=self.gitlastchanges()
gitversions=self.gitversions()
maincontent=loader.load("content_"+module+"_"+mainfnc+".html").generate(gitlastchange=gitlastchange, gitversions=gitversions)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
def printabout(self):
#p = Popen("bash", stdout=PIPE, stdin=PIPE)
#p.stdin.write("git log \n")
#p.stdin.close()
# print(p.stdout.read())
#p1 = str(Popen(['git', 'log','-n10','--pretty=oneline'], stdout=PIPE) .communicate()[0])
#print('<div class="alert alert-info">')
self.gitversions()
#print('<br>')
self.gitlastchanges()
#print('</div>')
def gitlastchanges(self):
old_dir = os.getcwd()
os.chdir( os.path.join(os.path.dirname(__file__), "") )
os.chdir( '..')
p1 = str(Popen(['git', 'log','-n10','--pretty=format:"%ci %s"'], stdout=PIPE) .communicate()[0])
#p2 = Popen(['grep', '*'], stdin=p1.stdout, stdout=PIPE).communicate()[0]
# p1=str("<br />".join(p1.split("\n")))
thatLine = p1.replace('\\n', '<br />')
thatLine = thatLine.replace('b\'"', '<br>"')
print('<br>')
# h.crt_info_bx('letzte &Auml;nderungen:')
print(str(thatLine))
return thatLine
def gitversions(self):
#p = Popen("bash", stdout=PIPE, stdin=PIPE)
#p.stdin.write("git log \n")
#p.stdin.close()
# print(p.stdout.read())
#p1 = str(Popen(['git', 'log','-n10','--pretty=oneline'], stdout=PIPE) .communicate()[0])
os.chdir( os.path.join(os.path.dirname(__file__), "") )
os.chdir( '..')
p1 = Popen(['git', 'tag','-n'], stdout=PIPE)
p2 = str(Popen(['sort', '-V','-r'], stdin=p1.stdout, stdout=PIPE).communicate()[0])
# p1=str("<br />".join(p1.split("\n")))
thatLine = p2.replace('\\n', '<br />')
thatLine = thatLine.replace('b\'', '<br>')
print('<br>')
#h.crt_info_bx('Versionen:')
print(str(thatLine))
return thatLine
#!/usr/bin/python3
# -*- coding: UTF-8 -*-# enable debugging
from mysql.connector import MySQLConnection, Error
from read_dbconfig import read_db_config
import tornado.ioloop
import tornado.web
import tornado.escape
import tornado
import os.path
from ncauth.ncauth_base import ncauth_base
class mailcnf_alias(ncauth_base):
def get(self):
self.redirect("/")
@tornado.web.authenticated
def post(self):
nav=all
subnav=all
content=all
msglvl=""
msg=False
module= self.get_argument("module", None, False)
mainfnc= self.get_argument("mainfnc", None, False)
id= self.get_argument("id", None, False)
fnc= self.get_argument("fnc", None, False)
table= self.get_argument("table", None, False)
domain_id= self.get_argument("domain_id", None, False)
group_id= self.get_argument("group_id", None, False)
source= self.get_argument("source", None, False)
destination= self.get_argument("destination", None, False)
active= self.get_argument("active", None, False)
#self.write("Hello, "+str(module )+" "+str(mainfnc)+" id: "+str(id)+" fnc: "+str(fnc)+" "+str(table)+"<br>")
uid=0
ugroup=10
msg=""
loader =tornado. template.Loader(os.path.join(os.path.dirname(__file__), "../templates"))
navigation=loader.load("navigation.html").generate(nav=nav)
if fnc=="delete" and id :
msg=self.update_virtual_aliases_deleted(id);
msglvl="alert alert-danger"
if fnc=="undelete" and id :
msg=self.update_virtual_aliases_undelete(id);
msglvl="alert alert-danger"
if fnc=="submitnewalias" :
msg=self. insert_virtual_alias(domain_id,source,destination,active,group_id=0)
msg="alias angelegt"
msglvl="alert alert-success"
if fnc=="submitedit" :
self.update_virtual_aliases( id, domain_id,source,destination,active,group_id)
msg="alias aktualisert"
msglvl="alert alert-danger"
if fnc=="edit" and id :
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
lists=self.edit_virtual_aliases_by_id(id, uid)
print(lists)
maincontent=loader.load("content_"+module+"_"+mainfnc+"_"+fnc+".html").generate(content=content, lists=lists, uid=uid, ugroup=ugroup, domain_id=domain_id)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
elif fnc=="new":
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
maincontent=loader.load("content_"+module+"_"+mainfnc+"_"+fnc+".html").generate(content=content,uid=uid, ugroup=ugroup, domain_id=domain_id)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
else:
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
lists=self.print_virtual_domain_id('','',uid)
maincontent=loader.load("content_"+module+"_"+mainfnc+".html").generate(content=content, lists=lists)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
def getUsers(self):
self.write("Hello, ")
def update_virtual_aliases_undelete(self, id):
query = "UPDATE virtual_aliases SET deleted='0', active='1' WHERE id='"+str(id)+"'"
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
return "ID "+str(id)+" wiederhergestellt"
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def update_virtual_aliases_deleted(self, id):
query = "UPDATE virtual_aliases SET deleted='1', active='0' WHERE id='"+str(id)+"'"
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
return "ID "+str(id)+" deleted"
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def update_virtual_aliases(self,id, domain_id,source,destination,active,group_id):
query = "UPDATE virtual_aliases SET domain_id='"+str(domain_id)+"', source='"+str(source)+"', destination='"+str(destination)+"' ,active='"+str(active)+"' ,group_id='"+str(group_id)+"' WHERE id="+str(id)+" "
try:
#self.write(query)
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
#self.write(query)
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def insert_virtual_alias(self,domain_id,source,destination,active,group_id=0):
query = "INSERT INTO virtual_aliases(domain_id,source,destination,active,group_id) VALUE('"+str(domain_id)+"','"+str(source)+"','"+str(destination)+"','"+str(active)+"','"+str(group_id)+"');"
#self.write(query)
# args = (domain_id,password,email,sent_mail,active)
insert_id = ''
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
if cursor.lastrowid:
insert_id=str(cursor.lastrowid)
else:
print('mailcnf_domain')
conn.commit()
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
return insert_id
def print_virtual_domain_id(self, id='', gid='', uid='0'):
query = ''
delstring = ' '
dictdata =[]
if str(uid) !='0':
delstring = " and deleted='0' "
if id!='' and id != None:
query = " SELECT * FROM `virtual_aliases` WHERE `id`="+id+" "+delstring
elif str(gid) !='':
query = " SELECT * FROM `virtual_aliases` WHERE `group_id` in ("+gid+") "+delstring
else:
if str(uid) !='0':
query = " SELECT * FROM `virtual_aliases` WHERE deleted='0'"
else:
query = " SELECT * FROM `virtual_aliases`"
try:
print(query)
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
fields=cursor.fetchall()
counter = 0
for field in fields:
counter = counter + 1
field=field+(counter, )
dictdata.append(field)
except Error as error:
print(error)
finally:
conn.commit()
cursor.close()
conn.close()
return dictdata
def edit_virtual_aliases_by_id(self, id,uid):
query = " SELECT * FROM `virtual_aliases` WHERE `id`='"+str(id)+"'"
dictdata =[]
# self.write(query)
counter=0
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
fields=cursor.fetchall()
for field in fields:
counter = counter + 1
field=field+(counter, )
dictdata.append(field)
conn.commit()
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
return dictdata
#!/usr/bin/python3
# -*- coding: UTF-8 -*-# enable debugging
from mysql.connector import MySQLConnection, Error
from read_dbconfig import read_db_config
import tornado.ioloop
import tornado.web
import tornado.escape
import tornado
import os.path
from ncauth.ncauth_base import ncauth_base
class mailcnf_bcc(ncauth_base):
def get(self):
self.redirect("/")
@tornado.web.authenticated
def post(self):
nav=all
subnav=all
content=all
msglvl=""
msg=False
module= self.get_argument("module", None, False)
mainfnc= self.get_argument("mainfnc", None, False)
id= self.get_argument("id", None, False)
fnc= self.get_argument("fnc", None, False)
# table= self.get_argument("table", None, False)
domain_id= self.get_argument("domain_id", None, False)
group_id= self.get_argument("group_id", None, False)
source= self.get_argument("source", None, False)
destination= self.get_argument("destination", None, False)
active= self.get_argument("active", None, False)
#self.write("Hello, "+str(module )+" "+str(mainfnc)+" id: "+str(id)+" fnc: "+str(fnc)+" "+str(table)+"<br>")
uid=0
ugroup=10
msg=""
loader =tornado. template.Loader(os.path.join(os.path.dirname(__file__), "../templates"))
navigation=loader.load("navigation.html").generate(nav=nav)
if fnc=="delete" and id :
msg=self.update_virtual_bccs_deleted(id);
msglvl="alert alert-danger"
if fnc=="undelete" and id :
msg=self.update_virtual_bccs_undelete(id);
msglvl="alert alert-danger"
if fnc=="submitnewbcc" :
msg=self. insert_virtual_bcc(domain_id,source,destination,active,group_id=0)
msg="BCC angelegt"
msglvl="alert alert-success"
if fnc=="submitedit" :
self.update_virtual_bccs( id, domain_id,source,destination,active,group_id)
msg="BCC aktualisert"
msglvl="alert alert-danger"
if fnc=="edit" and id :
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
lists=self.edit_virtual_bccs_by_id(id, uid)
print(lists)
maincontent=loader.load("content_"+module+"_"+mainfnc+"_"+fnc+".html").generate(content=content, lists=lists, uid=uid, ugroup=ugroup, domain_id=domain_id)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
elif fnc=="new":
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
maincontent=loader.load("content_"+module+"_"+mainfnc+"_"+fnc+".html").generate(content=content,uid=uid, ugroup=ugroup, domain_id=domain_id)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
else:
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
lists=self.print_virtual_domain_id('','',uid)
maincontent=loader.load("content_"+module+"_"+mainfnc+".html").generate(content=content, lists=lists)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
def getUsers(self):
self.write("Hello, ")
def update_virtual_bccs_undelete(self, id):
query = "UPDATE virtual_recipients_bcc SET deleted='0', active='1' WHERE id='"+str(id)+"'"
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
return "ID "+str(id)+" wiederhergestellt"
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def update_virtual_bccs_deleted(self, id):
query = "UPDATE virtual_recipients_bcc SET deleted='1', active='0' WHERE id='"+str(id)+"'"
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
return "ID "+str(id)+" deleted"
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def update_virtual_bccs(self,id, domain_id,source,destination,active,group_id):
query = "UPDATE virtual_recipients_bcc SET domain_id='"+str(domain_id)+"' ,source='"+str(source)+"' ,destination='"+str(destination)+"' ,active='"+str(active)+"' ,group_id='"+str(group_id)+"' WHERE id="+str(id)+" "
try:
#self.write(query)
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
#self.write(query)
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def insert_virtual_bcc(self,domain_id,source,destination,active,group_id=0):
query = "INSERT INTO virtual_recipients_bcc(domain_id,source,destination,active,group_id) VALUE('"+str(domain_id)+"','"+str(source)+"','"+str(destination)+"','"+str(active)+"','"+str(group_id)+"');"
#self.write(query)
# args = (domain_id,password,email,sent_mail,active)
insert_id = ''
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
if cursor.lastrowid:
insert_id=str(cursor.lastrowid)
else:
print('mailcnf_domain')
conn.commit()
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
return insert_id
def print_virtual_domain_id(self, id='', gid='', uid='0'):
query = ''
delstring = ' '
dictdata =[]
if str(uid) !='0':
delstring = " and deleted='0' "
if id!='' and id != None:
query = " SELECT * FROM `virtual_recipients_bcc` WHERE `id`="+id+" "+delstring
elif str(gid) !='':
query = " SELECT * FROM `virtual_recipients_bcc` WHERE `group_id` in ("+gid+") "+delstring
else:
if str(uid) !='0':
query = " SELECT * FROM `virtual_recipients_bcc` WHERE deleted='0'"
else:
query = " SELECT * FROM `virtual_recipients_bcc`"
try:
print(query)
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
fields=cursor.fetchall()
counter = 0
for field in fields:
counter = counter + 1
field=field+(counter, )
dictdata.append(field)
except Error as error:
print(error)
finally:
conn.commit()
cursor.close()
conn.close()
return dictdata
def edit_virtual_bccs_by_id(self, id,uid):
query = " SELECT * FROM `virtual_recipients_bcc` WHERE `id`='"+str(id)+"'"
dictdata =[]
#self.write(query)
counter=0
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
fields=cursor.fetchall()
for field in fields:
counter = counter + 1
field=field+(counter, )
dictdata.append(field)
conn.commit()
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
return dictdata
#!/usr/bin/python3
# -*- coding: UTF-8 -*-# enable debugging
from mysql.connector import MySQLConnection, Error
from read_dbconfig import read_db_config
import tornado.ioloop
import tornado.web
import tornado.escape
import tornado
import os.path
from ncauth.ncauth_base import ncauth_base
class mailcnf_domain(ncauth_base):
def get(self):
self.redirect("/")
@tornado.web.authenticated
def post(self):
nav=all
subnav=all
content=all
msglvl=""
msg=False
module= self.get_argument("module", None, False)
mainfnc= self.get_argument("mainfnc", None, False)
mainid= self.get_argument("id", None, False)
fnc= self.get_argument("fnc", None, False)
# table= self.get_argument("table", None, False)
group_id= self.get_argument("group_id", None, False)
name= self.get_argument("name", None, False)
active= self.get_argument("active", None, False)
#self.write("Hello, "+str(module )+" "+str(mainfnc)+" id: "+str(mainid)+" fnc: "+str(fnc)+" "+str(table)+"<br>")
uid=0
ugroup=10
msg=""
loader =tornado. template.Loader(os.path.join(os.path.dirname(__file__), "../templates"))
navigation=loader.load("navigation.html").generate(nav=nav)
if fnc=="delete" and mainid :
msg=self.update_virtual_domains_deleted(mainid);
msglvl="alert alert-danger"
if fnc=="undelete" and mainid :
msg=self.update_virtual_domains_undelete(mainid);
msglvl="alert alert-danger"
if fnc=="submitnewdomain" :
msg=self. insert_virtual_domain(name,active,group_id=0)
msg="Domain angelegt"
msglvl="alert alert-success"
if fnc=="submitedit" :
self.update_virtual_domains( mainid,name,active,group_id)
msg="Domain aktualisert"
msglvl="alert alert-danger"
if fnc=="edit" and mainid :
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
lists=self.edit_virtual_domains_by_id(mainid, uid)
print(lists)
maincontent=loader.load("content_"+module+"_"+mainfnc+"_"+fnc+".html").generate(content=content, lists=lists, uid=uid, ugroup=ugroup)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
elif fnc=="new":
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
maincontent=loader.load("content_"+module+"_"+mainfnc+"_"+fnc+".html").generate(content=content,uid=uid, ugroup=ugroup)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
else:
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
lists=self.print_virtual_domain_id('','',uid)
maincontent=loader.load("content_"+module+"_"+mainfnc+".html").generate(content=content, lists=lists)
self.render('base.html', navigation=navigation, subnavigation=subnavigation, maincontent=maincontent, msg=msg, msglvl=msglvl)
def getUsers(self):
self.write("Hello, ")
def update_virtual_domains_undelete(self, id):
query = "UPDATE virtual_domains SET deleted='0', active='1' WHERE id='"+str(id)+"'"
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
return "ID "+str(id)+" wiederhergestellt"
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def update_virtual_domains_deleted(self, id):
query = "UPDATE virtual_domains SET deleted='1', active='0' WHERE id='"+str(id)+"'"
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
return "ID "+str(id)+" deleted"
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def update_virtual_domains(self, id,name,active,group_id):
query = "UPDATE virtual_domains SET name='"+str(name)+"' ,active='"+str(active)+"' ,group_id='"+str(group_id)+"' WHERE id="+str(id)+" "
try:
self.write(query)
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
conn.commit()
self.write(query)
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def insert_virtual_domain(self,name,active,group_id=0):
query = "INSERT INTO virtual_domains(name,active,group_id) VALUE('"+name+"','"+str(active)+"','"+str(group_id)+"');"
self.write(query)
# args = (domain_id,password,email,sent_mail,active)
insert_id = ''
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
if cursor.lastrowid:
insert_id=str(cursor.lastrowid)
else:
print('mailcnf_domain')
conn.commit()
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
return insert_id
def print_virtual_domain_id(self, id='', gid='', uid='0'):
query = ''
delstring = ' '
dictdata =[]
if str(uid) !='0':
delstring = " and deleted='0' "
if id!='' and id != None:
query = " SELECT * FROM `virtual_domains` WHERE `id`="+id+" "+delstring
elif str(gid) !='':
query = " SELECT * FROM `virtual_domains` WHERE `group_id` in ("+gid+") "+delstring
else:
if str(uid) !='0':
query = " SELECT * FROM `virtual_domains` WHERE deleted='0'"
else:
query = " SELECT * FROM `virtual_domains`"
try:
print(query)
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
fields=cursor.fetchall()
counter = 0
for field in fields:
counter = counter + 1
field=field+(counter, )
dictdata.append(field)
except Error as error:
print(error)
finally:
conn.commit()
cursor.close()
conn.close()
return dictdata
def edit_virtual_domains_by_id(self, id,uid):
query = " SELECT * FROM `virtual_domains` WHERE `id`='"+str(id)+"'"
dictdata =[]
# self.write(query)
counter=0
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
fields=cursor.fetchall()
for field in fields:
counter = counter + 1
field=field+(counter, )
dictdata.append(field)
conn.commit()
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
return dictdata
from mysql.connector import MySQLConnection, Error
from read_dbconfig import read_db_config
import sqlite3
#import hashlib
#import tornado.ioloop
#import tornado.web
##import tornado.escape
#import tornado
import os.path
class mailcnf_tools:
def getDomainNamebyGuid(self,guid):
if guid == 0:
query = " SELECT name FROM `virtual_domains` WHERE deleted='0' "
else:
query = " SELECT name FROM `virtual_domains` WHERE group_id in ( "+guid+" ) AND deleted='0' "
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
fields=cursor.fetchall()
combolist=[]
for field in fields:
combolist.append(str(field[0]))
combolist.sort()
return combolist
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
def get_domain_id_by_name(self,name):
id=0
query = " SELECT id FROM `virtual_domains` WHERE `name`='"+name+"' "
try:
db_config = read_db_config()
conn = MySQLConnection(**db_config)
cursor = conn.cursor()
cursor.execute(query)
fields=cursor.fetchall()
for field in fields:
id=field[0]
except Error as error:
print(error)
finally:
cursor.close()
conn.close()
return id
def get_user_groups_srvcnf(self):
dbpath =os.path.dirname(__file__)+ "/srvcnf.sqlite3"
self.write(dbpath)
# password=self.get_argument("password")
self.write(" - ")
self.db=sqlite3.connect(dbpath)
self.dbcursor=self.db.cursor()
#sql = ' SELECT _id,groupname FROM `srvgrps` ORDER BY `_id` ASC '
sql = ' SELECT _id FROM `srvgrps` ORDER BY `_id` ASC '
# password=''
combolist=[]
for field in self.dbcursor.execute(sql):
combolist.append(str(field[0]))
combolist.sort()
return combolist
# password= row[0] #String.valueOf(c.getInt(c.getColumnIndex("password")));
#return password
import tornado
class ncauth_base(tornado.web.RequestHandler):
def get_current_user(self):
return self.get_secure_cookie("user")
import sqlite3
import hashlib
#import cgi,os,sys,json
from ncauth.ncauth_base import ncauth_base
class ncauth_logout(ncauth_base):
# def __init__(self, *args, **kwargs):
# #self.write('test')
# self.db=sqlite3.connect("ncauth/srvcnf.sqlite3")
# #self.db=sqlite3.connect("srvcnf.sqlite3")
# self.dbcursor=self.db.cursor()
def get(self):
self.write('<html><body><form action="/logout" method="post" id="logout"> '
'<input id="signout-btn" class="btn btn-blue" type="submit" value="Sign out">'
'</form></body></html>')
def post(self):
#self.set_secure_cookie("user", self.get_argument("name"))
self.clear_cookie("user")
self.redirect("/login")
import tornado.escape
import ncauth.base
class ncauth_main(ncauth_base):
def get(self):
if not self.current_user:
self.redirect("/login")
return
name = tornado.escape.xhtml_escape(self.current_user)
self.write("Hallo, " + name)
import sqlite3
import hashlib
import tornado.template
import os.path
from ncauth.ncauth_base import ncauth_base
class ncauth_user(ncauth_base):
def get(self):
self.render('login.html')
# self.write('<html><body><form action="/login" method="post" id="login_form">'
# 'Name: <input type="text" name="name" id="username" value="">'
# 'PW: <input class="text-input" id="password" name="password" tabindex="2" type="password" value="">'
# '<input id="signin-btn" class="btn btn-blue" type="submit" value="Sign in">'
# '</form></body></html>')
def post(self):
self.set_secure_cookie("user", self.get_argument("name"))
pw=self.get_argument("password")
username=self.get_argument("name")
salt='xy4$rt'
#hashlib.sha512(pw.encode('utf-8') + salt.encode('utf-8')).hexdigest()
if hashlib.md5(pw.encode('utf-8')).hexdigest() == self.getuserpw(username):
self.set_secure_cookie("user", self.get_argument("name"))
self.set_secure_cookie("incorrect", "0")
self.write("Jo")
self.redirect("/")
else:
self.write("Hello, world"+self.get_argument("name")+' '+self.get_argument("password")+ ' /// '+hashlib.md5(pw.encode('utf-8')).hexdigest() +' vs. '+self.getuserpw(username))
self.set_secure_cookie("incorrect", "1")
self.redirect("/login")
def getuserpw(self,username):
dbpath =os.path.dirname(__file__)+ "/srvcnf.sqlite3"
self.write(dbpath)
# password=self.get_argument("password")
self.write(" - ")
self.db=sqlite3.connect(dbpath)
self.dbcursor=self.db.cursor()
sql = 'Select password from srvusers where username = "'+username+'"'
# password=''
for row in self.dbcursor.execute(sql):
password= row[0] #String.valueOf(c.getInt(c.getColumnIndex("password")));
return password
from configparser import ConfigParser
import os.path
def read_db_config(filename='base/config.ini', section='mysql'):
filename= os.path.join(os.path.dirname(__file__), "base/config.ini")
db = read_config(filename,section)
return db
def read_basic_config(filename='base/config.ini', section='basics'):
filename= os.path.join(os.path.dirname(__file__), "base/config.ini")
config = read_config(filename,section)
return config
def read_config(filename,section):
parser = ConfigParser()
parser.read(filename)
config = {}
if parser.has_section(section):
items = parser.items(section)
for item in items:
config[item[0]] = item[1]
else:
raise Exception('{0} not found in the {1} file'.format(section, filename))
return config
#!/usr/bin/python3
# -*- coding: UTF-8 -*-# enable debugging
import tornado.ioloop
import tornado.web
import tornado.escape
import tornado
import os.path
import tornado.options
from ncauth.ncauth_logout import ncauth_logout
from ncauth.ncauth_user import ncauth_user
from mailsrv.mailcnf_user import mailcnf_user
from mailsrv.mailcnf_domain import mailcnf_domain
from mailsrv.mailcnf_alias import mailcnf_alias
from mailsrv.mailcnf_bcc import mailcnf_bcc
from base.base_about import base_about
class srvcnf(tornado.web.RequestHandler):
def get_current_user(self):
return self.get_secure_cookie("user")
@tornado.web.authenticated
def get(self):
nav=all
loader =tornado. template.Loader(os.path.join(os.path.dirname(__file__), "templates"))
navigation=loader.load("navigation.html").generate(nav=nav)
self.render('base.html', navigation=navigation)
@tornado.web.authenticated
def post(self):
module= self.get_argument("module", None, False)
mainfnc= self.get_argument("mainfnc", None, False)
nav=all
subnav=all
loader =tornado. template.Loader(os.path.join(os.path.dirname(__file__), "templates"))
navigation=loader.load("navigation.html").generate(nav=nav)
subnavigation=loader.load("subnav_"+module+"_"+mainfnc+".html").generate(subnav=subnav)
self.render('base.html', navigation=navigation, subnavigation=subnavigation)
def make_app():
return tornado.web.Application(
handlers=[
(r"/", srvcnf),
(r"/login", ncauth_user),
(r"/logout", ncauth_logout),
(r"/mailcnf/user" , mailcnf_user),
(r"/mailcnf/domain" , mailcnf_domain),
(r"/mailcnf/alias" , mailcnf_alias),
(r"/mailcnf/bcc" , mailcnf_bcc),
(r"/base/about" , base_about),
],
login_url="/login",
logout_url="/logout",
template_path=os.path.join(os.path.dirname(__file__), "templates"),
static_path=os.path.join(os.path.dirname(__file__), "static"),
debug=True,
cookie_secret='ancsrvcnf2'
)
if __name__ == "__main__":
app = make_app()
app.listen(6611)
tornado.ioloop.IOLoop.current().start()
This diff could not be displayed because it is too large.
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #eee;
}
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
body {
padding-top: 50px;
background-color: #ccc;
padding-bottom: 20px;
}
.starter-template {
padding: 40px 15px;
text-align: center;
}
select{
margin:5px 5px;padding:5px 15px; background:#ccc; border:0 none;
cursor:pointer;
-webkit-border-radius: 5px;
border-radius: 5px;
}
\ No newline at end of file
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
/* background:transparent; */
background-color:gray;
}
body {
margin-top:50px;
/*margin-left:100px;
margin-right:100px;*/
width:100%;
margin: 0 auto;
line-height:1;
background-color:gray;
}
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
display:block;
}
nav ul {
list-style:none;
}
blockquote, q {
quotes:none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content:'';
content:none;
}
a {
margin:0;
padding:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
/* change colours to suit your needs */
ins {
background-color:#ff9;
color:#000;
text-decoration:none;
}
/* change colours to suit your needs */
mark {
background-color:#ff9;
color:#000;
font-style:italic;
font-weight:bold;
}
del {
text-decoration: line-through;
}
abbr[title], dfn[title] {
border-bottom:1px dotted;
cursor:help;
}
table {
border-collapse:collapse;
border-spacing:0;
}
/* change border colour to suit your needs */
hr {
display:block;
height:1px;
border:0;
border-top:1px solid #cccccc;
margin:1em 0;
padding:0;
}
input, select {
vertical-align:middle;
}
input[type=text] {padding:5px; border:2px solid #ccc;
-webkit-border-radius: 5px;
border-radius: 5px;
}
input[type=text]:focus {border-color:#333; }
input[type=submit] {margin:5px 5px;padding:5px 15px; background:#ccc; border:0 none;
cursor:pointer;
-webkit-border-radius: 5px;
border-radius: 5px; }
select{
margin:5px 5px;padding:5px 15px; background:#ccc; border:0 none;
cursor:pointer;
-webkit-border-radius: 5px;
border-radius: 5px;
}
table {
margin:15px 15px;
margin-left:auto;
margin-right:auto;
}
tr th{
background-color:#ccc; border:0 none;
}
td{
background-color:#ccc;
border-style: solid;
border-color:gray;
border-width:1px;
padding:4px;
}
form{
display:inline;
width: 33%;
}
h2{
text-align:center;
margin-left:auto;
margin-right:auto;
}
div.center{
text-align:center;
margin-left:auto;
margin-right:auto;
}
span.center{
text-align:center;
margin-left:auto;
margin-right:auto;
}
/*input:read-only {
background-color: yellow;
}
input:-moz-read-only {
background-color: yellow;
}
*/
.readonly{
background-color: lightgrey;
}
.passwd{
color:red;
font-weight:bold;
}
.ncauthbtn{
color: #F0FFFF;
background-color: #27408B;
}
input[type=submit].ncauthbtn{
background-color: #27408B;
}
.bsc{
/* background-color: #FDFDEF; */
/* background: #f5f5f5; */
border: 1px solid #FFF;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
box-shadow: 1px 2px 4px rgba(0,0,0,.4);
}
.status {
/* background: #eee; */
border: 4px solid white;
box-shadow: 0 0 1px rgba(0,0,0, .4);
}
.hard
{
/* background: #f5f5f5; */
border: 1px solid #DDD;
box-shadow: 3px 3px 0px rgba(0,0,0, .2);
font-size:1.1em;
padding:3px;
margin:6px;
}
.info{
background: #FDFDEF;
/* background: #f5f5f5; */
}
.success{
background: #8cff80;
}
.error{
background:rgb(255,0,0);
}
.container{
margin-right: auto;
margin-left: auto;
padding-right: 15px;
padding-left: 15px;
width: 100%;
}
/*input[value="Edit"]{
color:red;
}*/
*/
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="{{ static_url("bootstrap.min.css") }}" />
<link rel="stylesheet" href="{{ static_url("style.css") }}" >
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="{{ static_url("bootstrap.min.js") }}"></script>
<div class="container">
{% block navigation %}
{% raw navigation %}
{% end %}
{% try %}
{% if subnavigation %}
{% raw subnavigation %}
{% end %}
{% except %}
{% end %}
{% try %}
{% if msg %}
<div class="{{ msglvl }}">
<b> {{ msg }}</b>
</div>
{% end %}
{% except %}
{% end %}
{% try %}
{% if maincontent %}
{% block maincontent %}
{% raw maincontent %}
{% end %}
{% end %}
{% except %}
{% end %}
</div>
</body>
</html>
<div>
{{ gitlastchange }}
</div>
<div>
{{ gitversions }}
</div>
<div>
{% raw gitlastchange %}
</div>
<div>
{% raw gitversions %}
</div>
<table class="table table-hover" >
<thead>
<tr>
<th>#</th>
<th>ID</th>
<th>Domain ID</th>
<th>Source</th>
<th>Destination</th>
<th>Active</th>
<th>Deleted</th>
<th>Group Id</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for list in lists %}
<tr>
</tr>
<tr>
<td>{{ list[8] }} </td>
<td>{{ list[0] }} </td>
<td>{{ list[1] }} </td>
<td>{{ list[2] }} </td>
<td >{{ list[3] }} </td>
<td >{{ list[5] }}</td>
<td>{{ list[6] }}</td>
<td>{{ list[7] }}</td>
<td>
<form action="/mailcnf/alias" method="POST"><input type="hidden" size="70" name="table" value="virtual_aliases">
<input type="hidden" value="aliaslist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<input type="hidden" size="70" name="fnc" value="edit">
<input type="hidden" size="70" name="tableid" value={{ list[0] }} ">
<input type="hidden" size="70" name="id" value="{{ list[0] }}">
<button type="submit" class="btn btn-primary btn-block btn-xs">Edit </button>
</form>
<form action="/mailcnf/alias" method="POST">
<input type="hidden" size="70" name="table" value="virtual_aliases">
<input type="hidden" value="aliaslist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<input type="hidden" size="70" name="tableid" value="{{ list[0] }} ">
<input type="hidden" size="70" name="id" value="{{ list[0] }}">
{% if list[6] == 0 %}
<input type="hidden" size="70" name="fnc" value="delete">
<button type="submit" class="btn btn-danger btn-block btn-xs">Delete </button>
{% else %}
<input type="hidden" size="70" name="fnc" value="undelete">
<button type="submit" class="btn btn-danger btn-block btn-xs">UnDelete </button>
{% end %}
</form>
</td>
</tr>
{% end %}
</tbody>
</table>
<table border="0">
{% for list in lists %}
<form action="/mailcnf/alias" method="POST">
<tr>
<th>Name</th>
<th>Wert</th>
</tr>
<tr>
<td>Group ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="group_id" value="{{ list[7] }}">
{% else %}
<input type="text" size="70" name="group_id" value="{{ list[7] }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Domain ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="domain_id" value="{{ list[1] }}">
{% else %}
<input type="text" size="70" name="domain_id" value="{{ list[1] }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Source: </td>
<td><input type="text" size="70" name="source" value="{{ list[2] }}">
</tr>
<td>Destination: </td>
<td><input type="text" size="70" name="destination" value="{{ list[3] }}">
</tr>
<tr>
<td>Aktiv: </td>
<td><input type="checkbox" size="40" name="active" {% if list[5] == 1 %} value="1" checked {% else %} value="0" {% end %}></td>
</tr>
<input type="hidden" size="70" name="fnc" value="submitedit">
<input type="hidden" value="aliaslist" size="70" name="mainfnc" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" class="'">
<input type="hidden" value="{{ list[0] }}" size="70" name="id" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Sende</button>
<tr>
</form>
{% end %}
<table border="0">
<form action="/mailcnf/alias" method="POST">
<tr>
<th>Name</th>
<th>Wert</th>
</tr>
<tr>
<td>Group ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="group_id" value="{{ ugroup }}">
{% else %}
<input type="text" size="70" name="group_id" value="{{ ugroup }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Domain ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="domain_id" value="{{ domain_id }}">
{% else %}
<input type="text" size="70" name="domain_id" value="{{ domain_id }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Source: </td>
<td><input type="text" size="70" name="source" value="">
</tr>
<td>Destination: </td>
<td><input type="text" size="70" name="destination" value="">
</tr>
<tr>
<td>Aktiv: </td>
<td><input type="checkbox" size="40" name="active" value="1" checked></td>
</tr>
<input type="hidden" size="70" name="fnc" value="submitnewalias">
<input type="hidden" value="aliaslist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Sende</button>
<tr>
</form>
<table class="table table-hover" >
<thead>
<tr>
<th>#</th>
<th>ID</th>
<th>Domain ID</th>
<th>Source</th>
<th>Destination</th>
<th>Active</th>
<th>Deleted</th>
<th>Group Id</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for list in lists %}
<tr>
</tr>
<tr>
<td>{{ list[8] }} </td>
<td>{{ list[0] }} </td>
<td>{{ list[1] }} </td>
<td>{{ list[2] }} </td>
<td >{{ list[3] }} </td>
<td >{{ list[5] }}</td>
<td>{{ list[6] }}</td>
<td>{{ list[7] }}</td>
<td>
<form action="/mailcnf/bcc" method="POST"><input type="hidden" size="70" name="table" value="virtual_domains">
<input type="hidden" value="bcclist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<input type="hidden" size="70" name="fnc" value="edit">
<input type="hidden" size="70" name="tableid" value={{ list[0] }} ">
<input type="hidden" size="70" name="id" value="{{ list[0] }}">
<button type="submit" class="btn btn-primary btn-block btn-xs">Edit </button>
</form>
<form action="/mailcnf/bcc" method="POST">
<input type="hidden" size="70" name="table" value="virtual_domains">
<input type="hidden" value="bcclist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<input type="hidden" size="70" name="tableid" value="{{ list[0] }} ">
<input type="hidden" size="70" name="id" value="{{ list[0] }}">
{% if list[6] == 0 %}
<input type="hidden" size="70" name="fnc" value="delete">
<button type="submit" class="btn btn-danger btn-block btn-xs">Delete </button>
{% else %}
<input type="hidden" size="70" name="fnc" value="undelete">
<button type="submit" class="btn btn-danger btn-block btn-xs">UnDelete </button>
{% end %}
</form>
</td>
</tr>
{% end %}
</tbody>
</table>
<table border="0">
{% for list in lists %}
<form action="/mailcnf/bcc" method="POST">
<tr>
<th>Name</th>
<th>Wert</th>
</tr>
<tr>
<td>Group ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="group_id" value="{{ list[7] }}">
{% else %}
<input type="text" size="70" name="group_id" value="{{ list[7] }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Domain ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="domain_id" value="{{ list[1] }}">
{% else %}
<input type="text" size="70" name="domain_id" value="{{ list[1] }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Source: </td>
<td><input type="text" size="70" name="source" value="{{ list[2] }}">
</tr>
<td>Destination: </td>
<td><input type="text" size="70" name="destination" value="{{ list[3] }}">
</tr>
<tr>
<td>Aktiv: </td>
<td><input type="checkbox" size="40" name="active" {% if list[5] == 1 %} value="1" checked {% else %} value="0" {% end %}></td>
</tr>
<input type="hidden" size="70" name="fnc" value="submitedit">
<input type="hidden" value="bcclist" size="70" name="mainfnc" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" class="'">
<input type="hidden" value="{{ list[0] }}" size="70" name="id" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Sende</button>
<tr>
</form>
{% end %}
<table border="0">
<form action="/mailcnf/bcc" method="POST">
<tr>
<th>Name</th>
<th>Wert</th>
</tr>
<tr>
<td>Group ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="group_id" value="{{ ugroup }}">
{% else %}
<input type="text" size="70" name="group_id" value="{{ ugroup }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Domain ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="domain_id" value="{{ domain_id }}">
{% else %}
<input type="text" size="70" name="domain_id" value="{{ domain_id }}" readonly>
{% end %}
</td>
</tr>
<tr>
<tr>
<td>Source: </td>
<td><input type="text" size="70" name="source" value="">
</tr>
<td>Destination: </td>
<td><input type="text" size="70" name="destination" value="">
</tr>
<tr>
<td>Aktiv: </td>
<td><input type="checkbox" size="40" name="active" value="1" checked></td>
</tr>
<input type="hidden" size="70" name="fnc" value="submitnewbcc">
<input type="hidden" value="bcclist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Sende</button>
<tr>
</form>
<table class="table table-hover" >
<thead>
<tr>
<th>#</th>
<th>ID</th>
<th>Name</th>
<th>Active</th>
<th>Deleted</th>
<th>Group Id</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for list in lists %}
<tr>
</tr>
<tr>
<td>{{ list[8] }} </td>
<td>{{ list[0] }} </td>
<td>{{ list[1] }} </td>
<td >{{ list[5] }}</td>
<td>{{ list[6] }}</td>
<td>{{ list[7] }}</td>
<td>
<form action="/mailcnf/domain" method="POST"><input type="hidden" size="70" name="table" value="virtual_domains">
<input type="hidden" value="domainlist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<input type="hidden" size="70" name="fnc" value="edit">
<input type="hidden" size="70" name="tableid" value={{ list[0] }} ">
<input type="hidden" size="70" name="id" value="{{ list[0] }}">
<button type="submit" class="btn btn-primary btn-block btn-xs">Edit </button>
</form>
<form action="/mailcnf/domain" method="POST">
<input type="hidden" size="70" name="table" value="virtual_domains">
<input type="hidden" value="domainlist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<input type="hidden" size="70" name="tableid" value="{{ list[0] }} ">
<input type="hidden" size="70" name="id" value="{{ list[0] }}">
{% if list[6] == 0 %}
<input type="hidden" size="70" name="fnc" value="delete">
<button type="submit" class="btn btn-danger btn-block btn-xs">Delete </button>
{% else %}
<input type="hidden" size="70" name="fnc" value="undelete">
<button type="submit" class="btn btn-danger btn-block btn-xs">UnDelete </button>
{% end %}
</form>
</td>
</tr>
{% end %}
</tbody>
</table>
<table border="0">
{% for list in lists %}
<form action="/mailcnf/domain" method="POST">
<tr>
<th>Name</th>
<th>Wert</th>
</tr>
<tr>
<td>Group ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="group_id" value="{{ list[7] }}">
{% else %}
<input type="text" size="70" name="group_id" value="{{ list[7] }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Name: </td>
<td><input type="text" size="40" name="name" value="{{ list[1] }}">
</tr>
<tr>
<td>Aktiv: </td>
<td><input type="checkbox" size="40" name="active" {% if list[5] == 1 %} value="1" checked {% else %} value="0" {% end %}></td>
</tr>
<input type="hidden" size="70" name="fnc" value="submitedit">
<input type="hidden" value="domainlist" size="70" name="mainfnc" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" class="'">
<input type="hidden" value="{{ list[0] }}" size="70" name="id" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Sende</button>
<tr>
</form>
{% end %}
<table border="0">
<form action="/mailcnf/domain" method="POST">
<tr>
<th>Name</th>
<th>Wert</th>
</tr>
<tr>
<td>Group ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="group_id" value="{{ ugroup }}">
{% else %}
<input type="text" size="70" name="group_id" value="{{ ugroup }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Name: </td>
<td><input type="text" size="70" name="name" value="">
</tr>
<tr>
<td>Aktiv: </td>
<td><input type="checkbox" size="40" name="active" value="1" checked></td>
</tr>
<input type="hidden" size="70" name="fnc" value="submitnewdomain">
<input type="hidden" value="domainlist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Sende</button>
<tr>
</form>
<table class="table table-hover" >
<thead>
<tr>
<th>#</th>
<th>ID</th>
<th>Domain_id</th>
<th>Group_id</th>
<th>Email</th>
<th>Sent_Mail</th>
<th>Quota</th>
<th>Active</th>
<th>Deleted</th>
<th>ACTIONS</th>
</tr>
</thead>
<tbody>
{% for list in lists %}
<tr>
</tr>
<tr>
<td>{{ list[11] }} </td>
<td>{{ list[0] }} </td>
<td>{{ list[1] }} </td>
<td>{{ list[2] }} </td>
<td >{{ list[5] }}</td>
<td>{{ list[6] }}</td>
<td>{{ list[7] }}</td>
<td>{{ list[9] }}</td>
<td>{{ list[10] }}</td>
<td>
<form action="/mailcnf/user" method="POST"><input type="hidden" size="70" name="table" value="virtual_users">
<input type="hidden" value="userlist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<input type="hidden" size="70" name="fnc" value="edit">
<input type="hidden" size="70" name="tableid" value={{ list[0] }} ">
<input type="hidden" size="70" name="id" value="{{ list[0] }}">
<button type="submit" class="btn btn-primary btn-block btn-xs">Edit </button>
</form>
<form action="/mailcnf/user" method="POST">
<input type="hidden" size="70" name="table" value="virtual_users">
<input type="hidden" value="userlist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<input type="hidden" size="70" name="tableid" value="{{ list[0] }} ">
<input type="hidden" size="70" name="id" value="{{ list[0] }}">
{% if list[10] == 0 %}
<input type="hidden" size="70" name="fnc" value="delete">
<button type="submit" class="btn btn-danger btn-block btn-xs">Delete </button>
{% else %}
<input type="hidden" size="70" name="fnc" value="undelete">
<button type="submit" class="btn btn-danger btn-block btn-xs">UnDelete </button>
{% end %}
</form>
<form action="/mailcnf/user" method="POST">
<input type="hidden" size="70" name="table" value="virtual_users">
<input type="hidden" value="userlist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<input type="hidden" size="70" name="fnc" value="changepw">
<input type="hidden" size="70" name="tableid" value="{{ list[0] }}">
<input type="hidden" size="70" name="id" value="{{ list[0] }}">
<button type="submit" class="btn btn-warning passwd btn-block btn-xs">&Auml;ndere Passwort </button>
</form>
</td>
</tr>
{% end %}
</tbody>
</table>
<table border="0">
<form action="/mailcnf/user" method="POST">
<tr>
<th>Name</th>
<th>Wert</th>
</tr>
<tr>
<td>Neues Passwort:</td>
<td><input type="password" size="70" name="pw1" value=""></td>
</tr>
<tr>
<td>Neues Passwort 2:</td>
<td><input type="password" size="70" name="pw2" value=""></td>
</tr>
<input type="hidden" size="70" name="fnc" value="submitnewpw">
<input type="hidden" value="userlist" size="70" name="mainfnc" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" class="'">
<input type="hidden" value="{{ mainid }}" size="70" name="id" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Sende</button>
<tr>
</form>
<table border="0">
{% for list in lists %}
<form action="/mailcnf/user" method="POST">
<tr>
<th>Name</th>
<th>Wert</th>
</tr>
<tr>
<td>Domain_id:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="domain_id" value="{{ list[1] }}">
{% else %}
<input type="text" size="70" name="domain_id" value="{{ list[1] }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Group ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="group_id" value="{{ list[2] }}">
{% else %}
<input type="text" size="70" name="group_id" value="{{ list[2] }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Quota:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="quota" value="{{ list[7] }}">
{% else %}
<input type="text" size="70" name="quota" value="{{ list[7] }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Email: </td>
<td><input type="text" size="40" name="email" value="{{ list[5] }}">
</tr>
<tr>
<td>Sent Mail:</td>
<td><input type="checkbox" size="40" name="sent_mail" {% if list[6] == 1 %} value="1" checked {% else %} value="0" {% end %} ></td>
</tr>
<tr>
<td>Aktiv: </td>
<td><input type="checkbox" size="40" name="active" {% if list[9] == 1 %} value="1" checked {% else %} value="0" {% end %}></td>
</tr>
<input type="hidden" size="70" name="fnc" value="submitedit">
<input type="hidden" value="userlist" size="70" name="mainfnc" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" class="'">
<input type="hidden" value="{{ list[0] }}" size="70" name="id" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Sende</button>
<tr>
</form>
{% end %}
<table border="0">
<form action="/mailcnf/user" method="POST">
<tr>
<th>Name</th>
<th>Wert</th>
</tr>
<tr>
<td>Group ID:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="group_id" value="{{ ugroup }}">
{% else %}
<input type="text" size="70" name="group_id" value="{{ ugroup }}" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Quota:</td>
<td>
{% if uid== 0 %}
<input type="text" size="70" name="quota" value="0">
{% else %}
<input type="text" size="70" name="quota" value="0" readonly>
{% end %}
</td>
</tr>
<tr>
<td>Email: </td>
<td><input type="text" size="40" name="email" value="">@
<select name="domaintld" size="1">
{% for entry in combolist %}
<option>{{ escape(entry) }}</option>
{% end %}
</select>
<!--<input type="text" size="30" name="domaintld" value="">-->
</tr>
<tr>
<td>Sent Mail:</td>
<td><input type="checkbox" size="40" name="sent_mail" value="1" checked></td>
</tr>
<tr>
<td>Aktiv: </td>
<td><input type="checkbox" size="40" name="active" value="1" checked></td>
</tr>
<tr>
<td>Neues Passwort:</td>
<td><input type="password" size="70" name="pw1" value=""></td>
</tr>
<tr>
'<td>Neues Passwort 2:</td>
<td><input type="password" size="70" name="pw2" value=""></td>
</tr>
<input type="hidden" size="70" name="fnc" value="submitnewuser">
<input type="hidden" value="userlist" size="70" name="mainfnc" id="" class="'">
<input type="hidden" value="mailcnf" size="70" name="module" id="" class="'">
<button type="submit" class="btn btn-info btn-block btn-xs">Sende</button>
<tr>
</form>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="{{ static_url("bootstrap.min.css") }}" />
<link rel="stylesheet" href="{{ static_url("style.css") }}" >
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="{{ static_url("bootstrap.min.js") }}"></script>
<div class="container">
<div class="left">
</div>
<div class="middle">
<form method="POST" action="/login">
<div class="form-signin">
<h2 class="form-signin-heading">nc mail anmelden:</h2>
<label for="inputEmail" class="sr-only""> login: </label>
<input type="text" name="name" id="inputText" class="form-control" placeholder="name" required autofocus>
<label for="inputPassword" class="sr-only""> password: </label>
<input type=password name="password" id="inputPassword" class="form-control" placeholder="Password" required>
<br>
<button class="btn btn-lg btn-primary btn-block" type="submit" value="Connect">Anmelden</button>
</div>
</form>
</div>
</div>
</body>
</html>
<navigation>
<div>
<form action="/base/about" method="POST">
<input type="hidden" size="70" name="module" value="mailcnf">
<input type="hidden" size="70" name="mainfnc" value="bcclist">
<button type="submit" class="btn btn-success">About</button>
</form>
</div>
<form action="/mailcnf/user" method="POST">
<input type="hidden" size="70" name="module" value="mailcnf">
<input type="hidden" size="70" name="mainfnc" value="userlist">
<button type="submit" class="btn btn-success">Konfiguriere Emails f&uuml;r Benutzer </button>
</form>
<form action="/mailcnf/domain" method="POST">
<input type="hidden" size="70" name="module" value="mailcnf">
<input type="hidden" size="70" name="mainfnc" value="domainlist">
<button type="submit" class="btn btn-success">Konfiguriere Domains</button>
</form>
<form action="/mailcnf/alias" method="POST">
<input type="hidden" size="70" name="module" value="mailcnf">
<input type="hidden" size="70" name="mainfnc" value="aliaslist">
<button type="submit" class="btn btn-success">Konfiguriere Aliase</button>
</form>
<form action="/mailcnf/bcc" method="POST">
<input type="hidden" size="70" name="module" value="mailcnf">
<input type="hidden" size="70" name="mainfnc" value="bcclist">
<button type="submit" class="btn btn-success">Konfiguriere BCC</button>
</form>
<form action="/logout" method="post" id="logout">
<input id="signout-btn" class="btn btn-blue" type="submit" value="Sign out">
</form>
</navigation>
<div>
<form action="/mailcnf/alias" method="POST">
<input type="hidden" size="70" name="module" value="mailcnf">
<input type="hidden" size="70" name="mainfnc" value="aliaslist">
<input type="hidden" size="70" name="fnc" value="new">
<button type="submit" class="btn btn-success">neuer Alias </button>
</form>
</div>
<div>
<form action="/mailcnf/bcc" method="POST">
<input type="hidden" size="70" name="module" value="mailcnf">
<input type="hidden" size="70" name="mainfnc" value="bcclist">
<input type="hidden" size="70" name="fnc" value="new">
<button type="submit" class="btn btn-success">neuer BCC </button>
</form>
</div>
<div>
<form action="/mailcnf/domain" method="POST">
<input type="hidden" size="70" name="module" value="mailcnf">
<input type="hidden" size="70" name="mainfnc" value="domainlist">
<input type="hidden" size="70" name="fnc" value="new">
<button type="submit" class="btn btn-success">neuer Domains </button>
</form>
</div>
<div>
<form action="/mailcnf/user" method="POST">
<input type="hidden" size="70" name="module" value="mailcnf">
<input type="hidden" size="70" name="mainfnc" value="userlist">
<input type="hidden" size="70" name="fnc" value="new">
<button type="submit" class="btn btn-success">neuerBenutzer </button>
</form>
</div>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!