From c69a8b67f9722a12385c5a330e70a7343c15fb05 Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 00:53:47 -0300
Subject: Mover hilos fix
---
cgi/manage.py | 5 ++++-
cgi/templates/banned.html | 30 ++++++++++--------------------
2 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index 44731ba..a8367a2 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -523,6 +523,7 @@ def manage(self, path_split):
# insert notice message
if 'msg' in self.formdata:
+ leavemsg = True
board = setBoard(oldboard)
if board['board_type'] == '1':
@@ -540,11 +541,13 @@ def manage(self, path_split):
notice_post["timestamp_formatted"] = "Hilo movido"
notice_post["bumped"] = oldbumped
notice_post.insert()
+ regenerateThreadPage(oldthread)
# regenerate
regenerateFrontPages()
+ board = setBoard(newboardid)
regenerateThreadPage(newthreadid)
- regenerateThreadPage(oldthread)
+
message += "done"
diff --git a/cgi/templates/banned.html b/cgi/templates/banned.html
index 72f2abe..f63dd41 100644
--- a/cgi/templates/banned.html
+++ b/cgi/templates/banned.html
@@ -3,14 +3,11 @@
- Acceso prohibido@B.a.I.
+ Acceso prohibido@Bienvenido a Internet
+
@@ -77,8 +67,8 @@
href="mailto:burocracia@bienvenidoainternet.org">contáctanos dando tu IP, razón y explicación de los
hechos.
- P.S: En muchos casos a pesar de que hayas sido expulsado del sitio se concede el acceso a la sección Meta
- ¡Gracias por usar Bienvenido a Internet BBS/IB!
+ P.S: En muchos casos a pesar de que hayas sido expulsado del sitio se concede el acceso a la sección Meta
+ ¡Gracias por usar Bienvenido a Internet BBS/IB!
--
cgit v1.2.1-18-gbd029
From ad189b5fe9381c20d943d9761c1336bca689e202 Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 01:06:18 -0300
Subject: Mover hilos fix 2
---
cgi/manage.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index a8367a2..6d09533 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -541,13 +541,13 @@ def manage(self, path_split):
notice_post["timestamp_formatted"] = "Hilo movido"
notice_post["bumped"] = oldbumped
notice_post.insert()
+ regenerateFrontPages()
regenerateThreadPage(oldthread)
# regenerate
regenerateFrontPages()
board = setBoard(newboardid)
regenerateThreadPage(newthreadid)
-
message += "done"
--
cgit v1.2.1-18-gbd029
From 3ac10b9e3feab82d98ae0d398994749edbd4185f Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 01:10:28 -0300
Subject: Mover hilos fix INTENTO 3
---
cgi/manage.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index 6d09533..81dcfe1 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -544,9 +544,9 @@ def manage(self, path_split):
regenerateFrontPages()
regenerateThreadPage(oldthread)
- # regenerate
- regenerateFrontPages()
+ # regenerate again (fix?)
board = setBoard(newboardid)
+ regenerateFrontPages()
regenerateThreadPage(newthreadid)
message += "done"
--
cgit v1.2.1-18-gbd029
From b46a78ff692bc922cb373f18dad4500891f1d641 Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 01:23:10 -0300
Subject: Mover hilos fix 4 Test 1
---
cgi/manage.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index 81dcfe1..ea7d0e3 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -421,6 +421,7 @@ def manage(self, path_split):
board = setBoard(oldboardid)
oldboard = board['dir']
oldboardsubject = board['subject']
+ oldboardname = board['anonymous']
# get old posts
posts = FetchAll("SELECT * FROM `posts` WHERE (`id` = {0} OR `parentid` = {0}) AND `boardid` = {1} ORDER BY id ASC".format(oldthread, board['id']))
@@ -460,17 +461,21 @@ def manage(self, path_split):
moved_thumbs.append(post['thumb'])
if is_op:
moved_cats.append(post['thumb'])
-
+
# fix subject if necessary
if post['subject'] and post['subject'] == oldboardsubject:
post['subject'] = board['subject']
-
+
+ # fix nameless posts
+ if post['name'] == oldboardname:
+ post['name'] = board['anonymous']
+
# insert new post and get its new ID
new_id = post.insert()
-
+
# save the reference (BBS = post number, IB = new ID)
refs[old_id] = num if board['board_type'] == '1' else new_id
-
+
# this was an OP
message += "newthread = %s parentid = %s
" % (newthreadid, p['parentid'])
if is_op:
--
cgit v1.2.1-18-gbd029
From 91cb8d7270b443229199d313f88bcd7175921aa3 Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 01:43:05 -0300
Subject: Mover hilos fix 4 Test 2
---
cgi/manage.py | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index ea7d0e3..a92bf01 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -466,10 +466,19 @@ def manage(self, path_split):
if post['subject'] and post['subject'] == oldboardsubject:
post['subject'] = board['subject']
- # fix nameless posts
+ # fix new default name
if post['name'] == oldboardname:
post['name'] = board['anonymous']
+ # fix date and (re)add post ID if necessary
+ post['timestamp_formatted'] = formatTimestamp(post['timestamp'])
+ if board["useid"] != '0':
+ if post["parentid"]:
+ t = parent_post["timestamp"]
+ else:
+ t = post["timestamp"]
+ post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, t, False, False, False, False, (board["countrycode"] in ['1', '2']))
+
# insert new post and get its new ID
new_id = post.insert()
@@ -1189,13 +1198,13 @@ def manage(self, path_split):
posts = FetchAll('SELECT * FROM `posts` WHERE `boardid` = %s' % board['id'])
self.output = "total: %d
" % len(posts)
for post in posts:
- new_timestamp_formatted = formatTimestamp(post['timestamp'])
- tim = 0
- if board["useid"] != '0':
- new_timestamp_formatted += ' ID:' + iphash(post['ip'], '', tim, '1', False, False, False, '0')
- self.output += "%s - %s
" % (post['id'], new_timestamp_formatted)
- query = "UPDATE `posts` SET timestamp_formatted = '%s' WHERE boardid = '%s' AND id = '%s'" % (new_timestamp_formatted, board['id'], post['id'])
- UpdateDb(query)
+ new_timestamp_formatted = formatTimestamp(post['timestamp'])
+ tim = 0
+ if board["useid"] != '0':
+ new_timestamp_formatted += ' ID:' + iphash(post['ip'], '', tim, '1', False, False, False, '0')
+ self.output += "%s - %s
" % (post['id'], new_timestamp_formatted)
+ query = "UPDATE `posts` SET timestamp_formatted = '%s' WHERE boardid = '%s' AND id = '%s'" % (new_timestamp_formatted, board['id'], post['id'])
+ UpdateDb(query)
return
elif path_split[2] == 'fixname':
board = setBoard(path_split[3])
--
cgit v1.2.1-18-gbd029
From c544af6fb482b703c3fe149bf5f9b3474b3b716a Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 01:44:04 -0300
Subject: Mover hilos fix 4 Test 3
---
cgi/manage.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index a92bf01..c58fc70 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -477,7 +477,7 @@ def manage(self, path_split):
t = parent_post["timestamp"]
else:
t = post["timestamp"]
- post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, t, False, False, False, False, (board["countrycode"] in ['1', '2']))
+ post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, t, board["useid"], False, False, False, False, (board["countrycode"] in ['1', '2']))
# insert new post and get its new ID
new_id = post.insert()
--
cgit v1.2.1-18-gbd029
From e5e72a395021f2db03dec51994bcb9c6350eea0d Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 01:45:33 -0300
Subject: Mover hilos fix 4 Test 4
---
cgi/manage.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index c58fc70..d018143 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -477,7 +477,7 @@ def manage(self, path_split):
t = parent_post["timestamp"]
else:
t = post["timestamp"]
- post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, t, board["useid"], False, False, False, False, (board["countrycode"] in ['1', '2']))
+ post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, t, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
# insert new post and get its new ID
new_id = post.insert()
--
cgit v1.2.1-18-gbd029
From 1bca19b22bc68e114d04616e9ce4268e5eb94335 Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 01:50:52 -0300
Subject: Mover hilos fix 4 Test 5
---
cgi/manage.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index d018143..af6a687 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -474,10 +474,10 @@ def manage(self, path_split):
post['timestamp_formatted'] = formatTimestamp(post['timestamp'])
if board["useid"] != '0':
if post["parentid"]:
- t = parent_post["timestamp"]
+ tym = parent_time
else:
- t = post["timestamp"]
- post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, t, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
+ tym = post["timestamp"]
+ post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, tym, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
# insert new post and get its new ID
new_id = post.insert()
@@ -494,6 +494,7 @@ def manage(self, path_split):
# BBS = new thread timestamp, IB = new thread ID
newthread = post['timestamp'] if board['board_type'] == '1' else new_id
+ parent_time = post['timestamp']
# log it
message += "%s -> %s
" % (old_id, new_id)
--
cgit v1.2.1-18-gbd029
From caadbc2788d32fdc4baf9cbd197c0fb5d495e580 Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 02:11:17 -0300
Subject: Mover hilos fix 4 Test 6
---
cgi/formatting.py | 12 ++++--------
cgi/manage.py | 1 +
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/cgi/formatting.py b/cgi/formatting.py
index d21bee2..6b2d8bc 100644
--- a/cgi/formatting.py
+++ b/cgi/formatting.py
@@ -121,11 +121,8 @@ def iphash(ip, post, t, useid, mobile, agent, cap_id, hide_end, has_countrycode)
id = '???'
else:
day = int((current_t + (Settings.TIME_ZONE*3600)) / 86400)
- word = ',' + str(day)
-
- # Make difference by thread
- word += ',' + str(t)
-
+ word = ',' + str(day) # IDs change every 24 hours
+ word += ',' + str(t) # IDs vary depending on thread
id = hide_data(ip + word, 6, "id", Settings.SECRET)
if hide_end:
@@ -164,9 +161,8 @@ def iphash(ip, post, t, useid, mobile, agent, cap_id, hide_end, has_countrycode)
if addressIsBanned(ip, ""):
id += '#'
- if (not has_countrycode and
- not addressIsTor(ip) and
- (addressIsProxy(ip) or not addressIsES(ip))):
+ elif (not has_countrycode and not addressIsTor(ip) and
+ (addressIsProxy(ip) or not addressIsES(ip))):
id += '!'
return id
diff --git a/cgi/manage.py b/cgi/manage.py
index af6a687..36217b9 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -477,6 +477,7 @@ def manage(self, path_split):
tym = parent_time
else:
tym = post["timestamp"]
+ message += "IP: "+post['ip']
post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, tym, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
# insert new post and get its new ID
--
cgit v1.2.1-18-gbd029
From 7e1d9532ef1ca39a52793bcd0d940a9ebd976879 Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 02:18:10 -0300
Subject: Mover hilos fix 4 Test 7
---
cgi/manage.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index 36217b9..7545c06 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -478,7 +478,7 @@ def manage(self, path_split):
else:
tym = post["timestamp"]
message += "IP: "+post['ip']
- post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, tym, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
+ post['timestamp_formatted'] += ' ID:' + iphash(inet_ntoa(post['ip']), post, tym, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
# insert new post and get its new ID
new_id = post.insert()
@@ -1705,7 +1705,10 @@ def manage(self, path_split):
if self.formdata['ip'] != '':
formatted_ip = str(inet_aton(self.formdata['ip']))
posts = FetchAll("SELECT posts.*, boards.dir, boards.board_type, boards.subject AS default_subject FROM `posts` JOIN `boards` ON boards.id = posts.boardid WHERE ip = '%s' ORDER BY posts.timestamp DESC" % _mysql.escape_string(formatted_ip))
- ip = self.formdata['ip']
+ if '.' in self.formdata['ip']:
+ ip = self.formdata['ip']
+ else:
+ ip = inet_ntoa(self.formdata['ip'])
template_filename = "ipshow.html"
template_values = {"mode": 1, "ip": ip, "host": getHost(ip), "country": getCountry(ip), "tor": addressIsTor(ip), "posts": posts}
logAction(staff_account['username'], "ipshow on {}".format(ip))
--
cgit v1.2.1-18-gbd029
From 9d70c2f51714c8b5c8d99ff224f8d46eee7ae202 Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 02:21:24 -0300
Subject: Mover hilos fix 4 Test 8
---
cgi/manage.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index 7545c06..667e4f5 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -478,7 +478,7 @@ def manage(self, path_split):
else:
tym = post["timestamp"]
message += "IP: "+post['ip']
- post['timestamp_formatted'] += ' ID:' + iphash(inet_ntoa(post['ip']), post, tym, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
+ post['timestamp_formatted'] += ' ID:' + iphash(inet_ntoa(long(post['ip'])), post, tym, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
# insert new post and get its new ID
new_id = post.insert()
@@ -1708,7 +1708,7 @@ def manage(self, path_split):
if '.' in self.formdata['ip']:
ip = self.formdata['ip']
else:
- ip = inet_ntoa(self.formdata['ip'])
+ ip = inet_ntoa(long(self.formdata['ip']))
template_filename = "ipshow.html"
template_values = {"mode": 1, "ip": ip, "host": getHost(ip), "country": getCountry(ip), "tor": addressIsTor(ip), "posts": posts}
logAction(staff_account['username'], "ipshow on {}".format(ip))
--
cgit v1.2.1-18-gbd029
From e516f607f3f44f89eaf71b1072f55001cec92321 Mon Sep 17 00:00:00 2001
From: TDavis
Date: Sat, 30 Mar 2019 02:24:06 -0300
Subject: Mover hilos fix 4 Test 9
---
cgi/manage.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/cgi/manage.py b/cgi/manage.py
index 667e4f5..71ed647 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -477,7 +477,6 @@ def manage(self, path_split):
tym = parent_time
else:
tym = post["timestamp"]
- message += "IP: "+post['ip']
post['timestamp_formatted'] += ' ID:' + iphash(inet_ntoa(long(post['ip'])), post, tym, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
# insert new post and get its new ID
--
cgit v1.2.1-18-gbd029