aboutsummaryrefslogtreecommitdiff
path: root/cgi/weabot.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/weabot.py')
-rwxr-xr-xcgi/weabot.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/cgi/weabot.py b/cgi/weabot.py
index 6d8b512..7e27ca7 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -225,8 +225,15 @@ class weabot(object):
self.output = renderTemplate('txt_newthread.html', {}, True)
elif path_split[1] == "mobilehome":
OpenDb()
- latest_age = getLastAge(Settings.HOME_LASTPOSTS)
- for threads in latest_age:
+ latest_age_ib = getLastAge(0, Settings.HOME_LASTPOSTS)
+ latest_age_bbs = getLastAge(1, Settings.HOME_LASTPOSTS)
+ for threads in latest_age_ib:
+ content = threads['url']
+ content = content.replace('/read/', '/')
+ content = content.replace('/res/', '/')
+ content = content.replace('.html', '')
+ threads['url'] = content
+ for threads in latest_age_bbs:
content = threads['url']
content = content.replace('/read/', '/')
content = content.replace('/res/', '/')
@@ -234,7 +241,7 @@ class weabot(object):
threads['url'] = content
caught = True
self.output = renderTemplate(
- 'latest.html', {'latest_age': latest_age}, True)
+ 'latest.html', {'latest_age_ib': latest_age_ib, 'latest_age_bbs': latest_age_bbs}, True)
elif path_split[1] == "mobilenewest":
OpenDb()
newthreads = getNewThreads(Settings.HOME_LASTPOSTS)
@@ -399,8 +406,10 @@ class weabot(object):
def make_post(self, ip, boarddir, parent, trap1, trap2, name, email, subject, message, file, file_original, spoil, oek_file, password, noimage, mobile):
_STARTTIME = time.clock() # Comment if not debug
- if hostIsBanned(ip):
- raise UserError, "Host en lista negra."
+ #if hostIsBanned(ip):
+ # raise UserError, "Sufijo de host en lista negra."
+ #if addressIsTor(ip):
+ # raise UserError, "Proxy prohibido."
# open database
OpenDb()
@@ -408,9 +417,9 @@ class weabot(object):
# set the board
board = setBoard(boarddir)
- if board["dir"] not in ["world", "bai"]:
- if addressIsProxy(ip) or addressIsBannedCountry(ip):
- raise UserError, "Proxy prohibido en esta sección."
+ #if board["dir"] not in ["world"]:
+ # if addressIsProxy(ip) or addressIsBannedCountry(ip) or not addressIsES(ip):
+ # raise UserError, "Proxy prohibido en esta sección."
# check length of fields
if len(name) > 50: