aboutsummaryrefslogtreecommitdiff
path: root/cgi/weabot.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/weabot.py')
-rwxr-xr-xcgi/weabot.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/cgi/weabot.py b/cgi/weabot.py
index 0f59654..ec88cac 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -324,7 +324,8 @@ class weabot(object):
elif path_split[1] == "banned":
OpenDb()
packed_ip = self.environ["REMOTE_ADDR"]
- bans = FetchAll("SELECT * FROM `bans` WHERE `ip` = INET6_ATON('"+str(packed_ip)+"')")
+ bans = FetchAll(
+ "SELECT * FROM `bans` WHERE `ip` = INET6_ATON('"+str(packed_ip)+"')")
if bans:
for ban in bans:
if ban["boards"] != "":
@@ -377,6 +378,13 @@ class weabot(object):
except Exception, messagez:
self.output = "Error: " + \
str(messagez) + " : " + str(self.formdata)
+ elif path_split[1] == "mod":
+ import modapi
+ caught = True
+ self.headers = [("Content-Type", "application/json"), ("Access-Control-Allow-Origin", "*"), ("Access-Control-Allow-Methods",
+ "PUT, GET, POST, DELETE, OPTIONS"), ("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With")]
+ OpenDb()
+ modapi.api(self, path_split)
if not caught:
# Redirect the user back to the front page
self.output += '<html xmlns="http://www.w3.org/1999/xhtml"><body><meta http-equiv="refresh" content="0;url=%s" /><p>--&gt; --&gt; --&gt;</p></body></html>' % Settings.HOME_URL