1

mostly works but need to figure out message locking in the database

database changed again, and scripts also
This commit is contained in:
ventilaar 2020-10-31 19:35:30 +01:00
parent bb29d6a2f3
commit 93a1aac507
17 changed files with 213 additions and 38 deletions

View File

@ -1 +1 @@
<mxfile host="Electron" modified="2020-10-20T11:00:03.872Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.6.2 Chrome/83.0.4103.122 Electron/9.2.0 Safari/537.36" etag="ZBDpQQ2WmE6KWBS7qbMe" version="13.6.2" type="device"><diagram id="JNM6W-7HF5Xyfk11UdC0" name="Page-1">7V1hc6I4GP41/dKZ3RFQ0I+tbbc3d53ZaXf29j5GSSW7QDiIVe/XX5AExURFFoJiZjqzJIRA8jxP8ubNa/bGGgfLLzGIvBfsQv/G7LnLG+vhxjQNa9Cj/6Q5qyxnaNhZxixGLiu0yXhD/0GWyZ6bzZELk0JBgrFPUFTMnOIwhFNSyANxjBfFYu/YL741AjMoZLxNgS/m/o1c4rFcwx5tbjxDNPPYq4emk90IAC/MWpJ4wMWLrSzr8cYaxxiT7CpYjqGfdh7vl+y5pz138w+LYUjKPLD42gtH0avtfl/N/3j9c3b3+hJ8Ggyzaj6AP2ctZl9LVrwLYOjepT1JU4+vOKS59x4JfJo06CV9e7z6QRM9nvgnTXwe8OTDcvvmw4qnloj84HXQ662naGrzUJrgzyQExKTwLd/wCwhX/NYT8v38Ze5WSuwr1n0JnsdTeKCDTIuRDsQzSA4UNFhB6BYIxbD4AnEAafNpgcWGRlwc3haBeF4MfUDQR5GGgLF5lleXv+ErRrRtZo8pb2Czepju+v1esYqs5eypbdrsVGQbxYqs0U5FWc8IFdGLrWZvstasPIWho99maAWmVWZ1gXYiXyVMrc7N/rAkN52+5mYT3HSMSxo9j3Fz71hanaGOWZKhtqEZ2gRD+85xhlLDJEovCZj4O/RceIjAtwisQV5QC4+zgxlqKTuo5UUACmHMnpli3wdRgtaVZSU85Lt/gRWeE/4antrPrQ8YE7g8yAV2N7eweB9z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ksNpBWR5v0V05VnNrq8WkxPFuWo5NyFEWCqx0JDZFR7cHEq+7chyVhqg9TAytPiXqk8UAq0Va9OH4tN0J7HD47wleoNZwscVRcS8eXfGtWbZZTg18zqq/1084OUEPhCXYe8Ympy2OfIJrjW34XZdjza5xeGwMPO0DVy3Uc3Gs2aJL/PYqNubtGh3ejYGjHd4t6bJ1t5otOrw77Vaza/Ry14CJPIiwvpPp88RpJ9PzawUn0+8cGn/0qPpD8bXbJ9VLy1lHkW7wXHpr5zh503E+D4qVlD2Zvr9zxL052llb1XcyvbQfZUb4+S1zj0SuHjmYnv+4I48tLulyrWOZu5+8epL+vajy/XQ+owmgRPhIFlXerTVuFeiOj+hqodOWtGKRtrDAlX6eJHDkGn/5Maiox6Zg0QEj7ehR5cJW+nliuEgmx2sSo6NscqTJzX+Gma0yNv+lqPX4Pw==</diagram></mxfile>
<mxfile host="Electron" modified="2020-10-31T16:41:46.595Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.6.2 Chrome/83.0.4103.122 Electron/9.2.0 Safari/537.36" etag="cq-ppZPf8VK1-7qTTUK_" version="13.6.2" type="device"><diagram id="JNM6W-7HF5Xyfk11UdC0" name="Page-1">7V1rc6o4GP41/dKZnpGLoB9ba093drvbac+cPftpJ0oqzAmEhVh1f/0GSVBMRHS5KGbG6ZAQArzP8+Ty5iW9MUb+8msEQvcFOxDd6D1neWM83ui6qVv0b5KxSjMGGsuYRZ6TZmmbjHfvX8gyeyx37jkwzhUkGCPihfnMKQ4COCW5PBBFeJEv9oFR/q4hmEEh430KkJj7p+cQl+Vq1nBz4hl6M5fdeqDb6Qkf8MLsTWIXOHixlWWMb4xRhDFJj/zlCKLEdtwu6XVPe85mDxbBgJS5YPHaC4bhm+V8X81/eft1dv/24t/1B2k1nwDN2RuzpyUrbgIYOPeJJWlq/IYDmvvgEh/RpEYP6d2j1Q+a6PHEX0niS58nH5fbJx9XPLX0yA9eBz3euoqmNhclCX5NT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OaWCGNCVRh7nRBgEbnPRH+FYcJKgDUL0G7bLWOLK5sITwHxYLfHopzhZ61CU6mwkYXKXtt+GVtcqryKmEf7AtYPucOgy7FVA64A3i8NJAPDnsTq2TSuerPLQm5Ua3h8a3haRycDu7ZFQU0WorMTXpX5yOKriq/STvOZNQufLNBGSbVOqRaEWEmhr61zFJ1ot1fizdZO86M1C88RX5sqZVapTFn0U7ONsnypt7tyPG2Rt1lMSmydoeRYhxxl4U+NtsS66Oh2Qex2V46nebmbxURT6mtEfbK4p2aRFn04iL53DDscd3iEF6gJXKZPQ+3vP8bm/XhyN3t91l9+X7zcKQFKBCgAVlqTx0U9NYq0KEAfrBCeeRcrwAMw7ef7GfWAljgq2QtHV3zbhlVSC3zMWL3Vj/ha+4rbwcOfu5y2Y0ajUz5LbPgE1zZbcL8ux7ZV4fCkNvDUGlTTQj0Xx7YlLkndXkVgjFXhglNt4KgFp5Z02bpb2xIXnDrt1rYqXGWqABN5EG91u+5mieN23eXH7e+6WxTxu73prrTcee1Ybuxslavb9pd+vpKyu+6aO9v36sOduVV1u+5KDSsbhHdsmqvz7zqyoMaSSx5VTHOL2Kw66dKddCF3z7gDKBG+lX7V0d05bqECzhg6NZJuWKQtTHClTywJ3Or8l1fnFbElfUQVsNWOHpuc2EqfWAzXSuXYWTG2Gq9Fk5t/9JXOMjb/Lc0Y/wc=</diagram></mxfile>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 262 KiB

View File

@ -7,7 +7,9 @@ CREATE TABLE moderators(
moderatorid serial PRIMARY KEY,
naam varchar(64) NOT NULL,
hash varchar(255),
maylogin boolean NOT NULL,
lastseen timestamp
);
CREATE TABLE twitterberichten(
@ -23,12 +25,10 @@ CREATE TABLE statuses(
CREATE TABLE berichten(
berichtid serial PRIMARY KEY,
bericht varchar(140) NOT NULL,
datumontvangen date NOT NULL,
tijdontvangen time NOT NULL,
datumontvangen timestamp NOT NULL,
naamposter varchar(32),
moderatorid int,
datumgekeurd date,
tijdgekeurd time,
datumgekeurd timestamp,
statusid int NOT NULL,
locatieid int NOT NULL,
twitterid bigint,
@ -39,7 +39,7 @@ CREATE TABLE berichten(
);
-- administrator:password
INSERT INTO moderators(naam, hash) VALUES ('administrator', 'a3eec2461d6637164d836db2c9f19795357c80c1420ccc13386839ae1104b53a');
INSERT INTO moderators(naam, hash, maylogin) VALUES ('administrator', 'a3eec2461d6637164d836db2c9f19795357c80c1420ccc13386839ae1104b53a', true);
INSERT INTO locaties(locatieid, naam) VALUES ('1', 'Utrecht Centraal');
INSERT INTO locaties(locatieid, naam) VALUES ('2', 'Amsterdam Centraal');
INSERT INTO locaties(locatieid, naam) VALUES ('3', 'Rotterdam Centraal');

View File

@ -1 +1 @@
<mxfile host="Electron" modified="2020-10-20T10:57:25.099Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.6.2 Chrome/83.0.4103.122 Electron/9.2.0 Safari/537.36" etag="BMyJVbrVZ4EPQjX7XkGy" version="13.6.2" type="device"><diagram id="JNM6W-7HF5Xyfk11UdC0" name="Page-1">7V1bc+I2FP41mWkfdgdfgceEJLudbDppkmmTvnQUrGDvGovKIkB/fWVbAhsJsFnfMJrJTJAsy9b5jj4dHUnHF8ZouvyCwcy9Rw70L/Ses7wwri90XTOsHv0X5aySnIFmJxkT7Dms0CbjyfsPskx232TuOTDMFCQI+cSbZTPHKAjgmGTyAMZokS32jvzsU2dgAoWMpzHwxdy/PIe4LFezh5sLX6E3cdmjB3o/uTAFvDBrSegCBy1SWcbNhTHCCJHk13Q5gn4kPC6X5L7bHVfXL4ZhQPLcsHjoBcPZo+38uZr/9ng3uXy8n36yBkk1H8CfsxaztyUrLgIYOJeRJGnq5hEFNPfKJVOfJjX6kz4dr15ooscTr1His8WT18v0xesVTy098sLroL9Td9HU5qYowe8JCcAk8y7P6B4EK37p1vP99cOcVEqUFRNfiOZ4DPcISDeY0gE8gWRPQY0VhE5GoRgWXy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uvr0cwmBUvcodDOuaPkLyRZ7tjwmSazUbgX3OAo8+/AAVi94AyX+Znb7yV9Q7farmzcbcELLA0yL6w+bCNNd90EfBejwSC6tDEFxGeG0j6KUiUoTe1PkKCkvdEMUW6cXWg696IVOKPacOmii7i0yQbv5gdMyoWmNeSr5ZKKADwycS4xjmd48JvJL4UIFgFcv6cRrJDZKTSx5vWRiTFIrnlp65CX1O3UXTW1uihL8nthPk3mXZ3QPghW/dOtFrWcPc1KppE3QmcCd+PFN42iOx3AfJSblCB8Ais5MUlDLAhfzPAx9QLyP7PvK4GdPeEDx2jjXLKOXdSDpQ/Mzj0DNa0maym7c6JFQl7nljNI17bO+VVciDqGuWCfXjZepKU1ihEi6OO3b7j1yYFTifw==</diagram></mxfile>
<mxfile host="Electron" modified="2020-10-31T16:43:03.934Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.6.2 Chrome/83.0.4103.122 Electron/9.2.0 Safari/537.36" etag="T7l8-jizCmwrtWpbLF4g" version="13.6.2" type="device"><diagram id="JNM6W-7HF5Xyfk11UdC0" name="Page-1">7V1bb+MoFP41lXYfZhRfkzy2aTsz6nTUbavddl9GNKaxdxyTxaRJ9tcvtiGxA0nt1Lc4SJVqMMb4fIePw+FAzozRdPkFg5l7ixzon+k9Z3lmXJ7pumZYPfovylklOQPNTjIm2HNYoU3Gg/cfZJnsucncc2CYKUgQ8ok3y2aOURDAMcnkAYzRIlvsFfnZt87ABAoZD2Pgi7l/eQ5xWa5mDzc3vkJv4rJXD/R+cmMKeGH2JaELHLRIZRlXZ8YII0SSq+lyBP1IeFwuyXPXO+6uG4ZhQPI8sLjrBcPZve38uZp/u7+ZnN/fTj9Zg6SaN+DP2Rez1pIVFwEMnPNIkjR1dY8CmnvhkqlPkxq9pG/Hqyea6PHEc5T4bPHk5TJ983LFU0uPPPE66HXqKZraPBQl+DMhAZhk2vKIbkGw4reuPd9fv8xJpURZMfGFaI7HcI+AdIMpHcATSPY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kRS/a5jDpU/Kk7O8Y7YhEkSMoOsO6s+vko6g0scIqR0n5Uhqi2Dp9KXLoRV9KQrGd7aBrZW+xCdr9n977KDStMU8lP+Yl4AMD5xzjWKZX94n8UrhQmeDVUzrxHImNUhNLXi6ZGJPUiqeWHnlKXaeeoqnNQ1GCPxP7aTJteUS3IFjxW9de9PXsZU4qJSLIYxfRHI/hPlJMyhHO9+/NTaAzgXl7peyMYp6HoQ+I9wYzrZXBz95wh+IVHq5ZRi/rQNKH5md+2DSvJfl29uBGj4S6zC1nlK5pn/WtuhL5CHXFOrn+eJma0iRGiKSL077t3iIHRiX+Bw==</diagram></mxfile>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 KiB

After

Width:  |  Height:  |  Size: 394 KiB

View File

@ -1 +1 @@
<mxfile host="Electron" modified="2020-10-20T10:58:22.189Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.6.2 Chrome/83.0.4103.122 Electron/9.2.0 Safari/537.36" etag="eqiQvSHtfg_PLV3qvBa5" version="13.6.2" type="device"><diagram id="JNM6W-7HF5Xyfk11UdC0" name="Page-1">7V1tc6o4FP41/dg78qp+bG17d7fb3dZ2tnc/ppIKt0hYiLXur98gCQqJiiwElcw4IwkhkPOcJzk5nJALYzT7+h6B0H1ADvQv9J7zdWHcXOi6Zlg98pfkLNOcgWanGdPIc2ihdcaz9y+kmfS66dxzYJwriBHysRfmMycoCOAE5/JAFKFFvtg78vN3DcEUchnPE+Dzua+eg12aq9nD9YlfoDd16a0Hej89MQOsMG1J7AIHLTayjNsLYxQhhNOj2dcI+onwmFzS6+62nM0eLIIBLnPB4rEXDMOx7fy1nP86vp9ejR9ml9YgreYT+HPaYvq0eMlEAAPnKpEkSd2OUUByr10880lSI4fk7tHyB0n0WOLvJPHNYsmbr82TN0uW+vLwD1YHOd64iqTWFyUJdk2MQYRzz/KCHkCwZKfuPN/PbuZspHhZUfHFaB5N4A4B6QZVOhBNId5RUKMFo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FJh9ZshWPU4241gvR8YYpsD0NgdSLwe/1SV2FjtTSj5rVZpQirJsL2xUtCCt0lrQn7WbotVktqkQqiKxPVoSVRtgd0ddC6JsaIS1BnMkuw+exW7OUjBk1sLcxCHUOQsVeKewVBU7L7bh5H8PqFVo4f/O92IUn6+vbT8xq7gO56Kg1TS0RUxRDLbdPFvgTvJ9OB3hZzSsgFRz7AHP3VL0C/eJSd1vgYusJpM6oU7/UD1j9rnrDEtp7GMNEWDc28tkik7Qwk6AvQ+JOzSfs8kRuDzzRMnpF1CaJusMbIIS+sZGRt1h3vrPsmDfArhY/KxdC0Xp6xV4J7BV5A+R23HxAbbJY5XzpWC0+ViomLOKuS3ON7HOh+6Sere+qX+zKhqknlKOam00uxURutoKhkq0D6tZ0Q6vRYGkMPmWwyKbqsUw3NN5g2bNgr2MTDq1GC6cxEA+IsVL8rZO/rU84NPHq+POlY7WALLmYlPhCt6JjE3QUvXSU2hPr/HstF8SuaBztVqhyxokjHkazr3grmjZLU9GnneQizbuEfNLuGCaRsV2n6gHeJxkAPgkXFZYfYVt06e1ZLrlnUQFbEMOWn5dlTR3hA0KhH+BH7XB/WWmNbHsWrPB5SnzFPV3KfF6xA1Wg048MOuXKk0zSFjx5wsfjHXnrrw2cuxevCpzWkZk0asVeO8SV6cITPh7vLUqJ2yUyDo5sFBV8+5eDo+RGZlming3ztm/wSHdAY8dldkBL21TYY2zvzmZiiVEBbe5sVtFganAfs2zfMjZqF1dgl93HzLTyszN9MPimW/m6Km9lRpLrbVDT4uvNZI3b/wA=</diagram></mxfile>
<mxfile host="Electron" modified="2020-10-31T16:43:41.405Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.6.2 Chrome/83.0.4103.122 Electron/9.2.0 Safari/537.36" etag="X0UP-HxUBg-bzk5Q34ap" version="13.6.2" type="device"><diagram id="JNM6W-7HF5Xyfk11UdC0" name="Page-1">7V1bc6M2FP41ecyOudp5zDrJtpumTZxMs33qKEY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ht212rmGj1nb2SJeo542f/mVTs0BZ+XebQlr3DlO2zV+QCYvLYPnulyGU6kqNXsqNWeK+9e2JK2aNXTCs/OtNHoy+6la+r8ukrNLk5uS0tvjn/zrj+BQ==</diagram></mxfile>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 KiB

After

Width:  |  Height:  |  Size: 254 KiB

View File

@ -10,12 +10,11 @@ locatieid = 1
def insertdatabase(bericht, naamposter):
time = datetime.datetime.utcnow().strftime("%H:%M:%S")
date = datetime.datetime.utcnow().strftime("%Y-%m-%d")
date = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
try:
QUERY = 'INSERT INTO berichten(bericht, datumontvangen, tijdontvangen, locatieid, naamposter, statusid) VALUES (%s, %s, %s, %s, %s, %s)'
DATA = (bericht, date, time, locatieid, naamposter, '1')
QUERY = 'INSERT INTO berichten(bericht, datumontvangen, locatieid, naamposter, statusid) VALUES (%s, %s, %s, %s, %s)'
DATA = (bericht, date, locatieid, naamposter, '1')
cur.execute(QUERY, DATA)
conn.commit()
return True

View File

@ -55,7 +55,7 @@ def newaccount():
"""
hashedpass = hashlib.sha256(password1.encode('UTF-8') + 'saltandpepper'.encode('UTF-8')).hexdigest()
try:
cur.execute("INSERT INTO moderators(naam, hash) VALUES (%s, %s)", (username, hashedpass))
cur.execute("INSERT INTO moderators(naam, hash, maylogin) VALUES (%s, %s, %s)", (username, hashedpass, 'true'))
conn.commit()
print('Account aangemaakt!')
return True
@ -113,9 +113,9 @@ def getmessage(moderatorid):
"""
vraagt de outste bericht op en zet het bericht gelijk op moderator lock(2)
returnt een tuple met de oudste bericht met de status 1(pending moderation)
de tuple ziet er alsvolgt uit: (berichtid int, berichtinhoud str, datum date, tijd time, naam str)
de tuple ziet er alsvolgt uit: (berichtid int, berichtinhoud str, datum date, naam str)
"""
cur.execute("SELECT berichtid, bericht, datumontvangen, tijdontvangen, naamposter FROM berichten WHERE statusid = 1 ORDER BY datumontvangen, tijdontvangen LIMIT 1")
cur.execute("SELECT berichtid, bericht, datumontvangen, naamposter FROM berichten WHERE statusid = 1 ORDER BY datumontvangen LIMIT 1")
gottuple = cur.fetchone()
@ -133,22 +133,20 @@ def unlockmessage(berichtid):
def acceptmessage(berichtid, moderatorid):
time = datetime.datetime.utcnow().strftime("%H:%M:%S")
date = datetime.datetime.utcnow().strftime("%Y-%m-%d")
date = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
QUERY = "UPDATE berichten SET statusid = 4, datumgekeurd = (%s), tijdgekeurd = (%s), moderatorid = (%s) WHERE berichtid = (%s)"
DATA = (date, time, moderatorid, berichtid)
QUERY = "UPDATE berichten SET statusid = 4, datumgekeurd = (%s), moderatorid = (%s) WHERE berichtid = (%s)"
DATA = (date, moderatorid, berichtid)
cur.execute(QUERY, DATA)
conn.commit()
return True
def rejectmessage(berichtid, moderatorid):
time = datetime.datetime.utcnow().strftime("%H:%M:%S")
date = datetime.datetime.utcnow().strftime("%Y-%m-%d")
date = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
QUERY = "UPDATE berichten SET statusid = 3, datumgekeurd = (%s), tijdgekeurd = (%s), moderatorid = (%s) WHERE berichtid = (%s)"
DATA = (date, time, moderatorid, berichtid)
QUERY = "UPDATE berichten SET statusid = 3, datumgekeurd = (%s), moderatorid = (%s) WHERE berichtid = (%s)"
DATA = (date, moderatorid, berichtid)
cur.execute(QUERY, DATA)
conn.commit()
return True
@ -174,7 +172,7 @@ def moderateloop(moderatorid):
print('Er zijn geen berichten meer om te weergeven, probeer het later opnieuw')
return True
print("Op " + str(bericht[2]) + " " + str(bericht[3]) + " heeft " + str(bericht[4]) + " een bericht achtergelaten")
print("Op " + str(bericht[2]) + " heeft " + str(bericht[3]) + " een bericht achtergelaten")
print(str(bericht[0]) + " " + str(bericht[1]))
while exitvar != True:
@ -295,6 +293,9 @@ def login():
elif hashedpass != sqlreturn[2]:
print('Wachtwoord onjuist')
return False
elif sqlreturn[3] != True:
print('account mag niet inloggen')
return False
menu(sqlreturn[0], sqlreturn[1])

View File

@ -20,6 +20,9 @@ def func_check_login(uname, pword):
elif hashedpass != sqlreturn[2]:
flash('Uw wachtwoord is fout')
return False
elif sqlreturn[3] != True:
flash('Dit account mag niet meer inloggen')
return False
else:
return True
@ -30,7 +33,6 @@ def func_listmoderators(limit, page):
countmoderators = cur.fetchone()
return (allmoderators, countmoderators)
def func_addmoderator(uname, pword, pword2):
username = uname.lower()
password = pword
@ -55,7 +57,7 @@ def func_addmoderator(uname, pword, pword2):
if sqlreturn == None:
hashedpass = hashlib.sha256(password.encode('UTF-8') + 'saltandpepper'.encode('UTF-8')).hexdigest()
cur.execute("INSERT INTO moderators(naam, hash) VALUES (%s, %s)", (username, hashedpass))
cur.execute("INSERT INTO moderators(naam, hash, maylogin) VALUES (%s, %s, 'true')", (username, hashedpass))
conn.commit()
flash('Account voor ' + username + ' aangemaakt!')
return True
@ -71,12 +73,47 @@ def func_removemoderator(moderatorid):
return True
except:
conn.rollback()
flash('Probleem met het verwijderen van account! Heeft de account berichten gemodereerd?')
return False
try:
cur.execute('UPDATE moderators SET maylogin = false WHERE moderatorid = (%s)', [moderatorid])
conn.commit()
flash('Account kan niet verwijdert worden, account mag niet meer inloggen')
return True
except:
conn.rollback()
flash('Probleem opgetreden bij het aanpassen van moderator account')
return False
def publish_twitter(berichtid):
def func_listberichten(limit, page):
cur.execute('SELECT berichten.berichtid, berichten.bericht, berichten.datumontvangen, berichten.naamposter, '
'berichten.datumgekeurd, locaties.naam, moderators.naam, statuses.status, berichten.twitterid '
'FROM berichten '
'LEFT OUTER JOIN statuses ON berichten.statusid = statuses.statusid '
'LEFT OUTER JOIN locaties ON berichten.locatieid = locaties.locatieid '
'LEFT OUTER JOIN moderators ON berichten.moderatorid = moderators.moderatorid '
'ORDER BY datumontvangen DESC LIMIT (%s) OFFSET (%s)', (limit, page))
allberichten = cur.fetchall()
cur.execute('SELECT COUNT(*) FROM berichten')
countberichten = cur.fetchone()
return (allberichten, countberichten)
def func_querybericht(berichtid):
cur.execute('SELECT berichten.berichtid, berichten.bericht, berichten.datumontvangen, berichten.naamposter, '
'berichten.datumgekeurd, locaties.naam, moderators.naam, statuses.status, berichten.twitterid '
'FROM berichten '
'LEFT OUTER JOIN statuses ON berichten.statusid = statuses.statusid '
'LEFT OUTER JOIN locaties ON berichten.locatieid = locaties.locatieid '
'LEFT OUTER JOIN moderators ON berichten.moderatorid = moderators.moderatorid '
'WHERE berichtid = (%s)', [berichtid])
return cur.fetchone()
def func_lockbericht(berichtid, moderatorid):
cur.execute('UPDATE berichten SET statusid = 2, moderatorid = (%s) WHERE berichtid = (%s)', (moderatorid, berichtid))
conn.commit()
return True
@app.route('/')
def root():
return render_template('root.html')
@ -88,7 +125,6 @@ def login():
session['username'] = request.form['uname']
return redirect(url_for('home'))
else:
flash('Er is een probleem bij het inloggen')
return render_template('login.html')
else:
if 'username' in session:
@ -118,9 +154,11 @@ def moderators():
page = maxitems * pagenum
moderators = func_listmoderators(maxitems, page)[0]
listreturn = func_listmoderators(maxitems, page)
moderators = listreturn[0]
moderatorcount = listreturn[1][0]
return render_template('moderators.html', moderators=moderators)
return render_template('moderators.html', moderators=moderators, moderatorcount=moderatorcount)
else:
flash('You are not logged in!')
return redirect(url_for('login'))
@ -147,5 +185,39 @@ def listmoderators():
flash('You are not logged in!')
return redirect(url_for('login'))
@app.route('/berichten')
def berichten():
if 'username' in session:
if request.args.get('maxitems'):
maxitems = int(request.args.get('maxitems'))
else:
maxitems = 10
if request.args.get('pagenum'):
pagenum = int(request.args.get('pagenum')) - 1
else:
pagenum = 0
page = maxitems * pagenum
listreturn = func_listberichten(maxitems, page)
berichten = listreturn[0]
berichtcount = listreturn[1][0]
return render_template('berichten.html', berichten=berichten, berichtcount=berichtcount)
else:
flash('You are not logged in!')
return redirect(url_for('login'))
@app.route('/bericht/<berichtid>')
def bericht(berichtid):
if 'username' in session:
bericht = func_querybericht(berichtid)
return render_template('bericht.html', bericht=bericht)
else:
flash('You are not logged in!')
return redirect(url_for('login'))
if __name__ == "__main__":
app.run('0.0.0.0', debug=True)

36
templates/bericht.html Normal file
View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"/>
</head>
<body>
{% include 'navbar_template.html' %}
{% include 'flash_template.html' %}
<h1>Bericht ID {{ berichtid }}</h1>
<table style="width:100%">
<tr>
<th>Bericht ID</th>
<th>Naam</th>
<th>Bericht inhoud</th>
<th>Geplaatst in</th>
<th>Ontvangen op</th>
<th>Status bericht</th>
<th>Gekeurd op</th>
<th>Moderator</th>
<th>Twitter ID</th>
</tr>
<tr>
<th>{{ bericht[0] }}</th>
<th>{{ bericht[3] }}</th>
<th>{{ bericht[1] }}</th>
<th>{{ bericht[5] }}</th>
<th>{{ bericht[2] }}</th>
<th>{{ bericht[7] }}</th>
<th>{{ bericht[4] }}</th>
<th>{{ bericht[6] }}</th>
<th>{{ bericht[8] }}</th>
</tr>
</body>
</html>

59
templates/berichten.html Normal file
View File

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Berichten</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"/>
</head>
<body>
{% include 'navbar_template.html' %}
{% include 'flash_template.html' %}
<h1>List of berichten</h1>
<p>Er zijn momenteel {{ berichtcount }} berichten in het systeem</p>
<table style="width:100%">
<tr>
<th>Bericht ID</th>
<th>Naam</th>
<th>Bericht inhoud</th>
<th>Geplaatst in</th>
<th>Ontvangen op</th>
<th>Status bericht</th>
<th>Gekeurd op</th>
<th>Moderator</th>
<th>Twitter ID</th>
</tr>
{% for row in berichten %}
<tr>
<th><a href="/bericht/{{ row[0] }}">{{ row[0] }}</a></th>
<th>{{ row[3] }}</th>
<th>{{ row[1] }}</th>
<th>{{ row[5] }}</th>
<th>{{ row[2] }}</th>
<th>{{ row[7] }}</th>
<th>{{ row[4] }}</th>
<th>{{ row[6] }}</th>
<th>{{ row[8] }}</th>
</tr>
{% endfor %}
</table>
<form>
<label for="maxitems">Max items in table:</label>
<select name="maxitems" id="maxitems">
<option value="10">10</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
<label for="pagenum">Table page:</label>
<select name="pagenum" id="pagenum">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<button type="submit">Refresh table</button>
</form>
</body>
</html>

View File

@ -3,11 +3,11 @@
<head>
<meta charset="UTF-8">
<title>Home</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"/>
</head>
<body>
{% include 'navbar_template.html' %}
{% include 'flash_template.html' %}
<h1>Hello {{ username }}</h1>
<p>Click <a href="login">here</a> to logout</p>
<p>Click <a href="moderators">here</a> to edit moderators in the system</p>
</body>
</html>

View File

@ -3,8 +3,10 @@
<head>
<meta charset="UTF-8">
<title>Login</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"/>
</head>
<body>
{% include 'navbar_template.html' %}
{% include 'flash_template.html' %}
<h1>Please login to access home page</h1>
<form method="POST">

View File

@ -9,11 +9,13 @@
{% include 'navbar_template.html' %}
{% include 'flash_template.html' %}
<h1>List of moderators</h1>
<table>
<p>Er zijn momenteel {{ moderatorcount }} moderators in het systeem</p>
<table style="width:100%">
<tr>
<th>Moderator ID</th>
<th>Username</th>
<th>Hashed Password</th>
<th>May login</th>
<th>Last seen</th>
</tr>
{% for row in moderators %}
@ -22,6 +24,7 @@
<th>{{ row[1] }}</th>
<th>{{ row[2] }}</th>
<th>{{ row[3] }}</th>
<th>{{ row[4] }}</th>
<th>
<form method="POST" action="/moderators/removemoderator">
<button type="submit" name="delete" value="{{ row[0] }}">Delete</button>

View File

@ -1,5 +1,7 @@
<ul>
<ul>
<li><a href="/home">Home</a></li>
<li><a href="/moderators">Moderators</a></li>
<li><a href="/berichten">Berichten</a></li>
<li><a href="/login" style="float:right;">Login/Logout</a></li>
</ul>

View File

@ -3,10 +3,11 @@
<head>
<meta charset="UTF-8">
<title>Root</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"/>
</head>
<body>
{% include 'navbar_template.html' %}
{% include 'flash_template.html' %}
<h1>Welcome to the index page!</h1>
<p>Click <a href="login">here</a> for the login page</p>
<p>Click <a href="home">here</a> for the home page</p>
</body>
</html>