|
|
@@ -176,7 +176,6 @@ class get_db_connect:
|
|
|
port = int(self.db_set['mysql_port']),
|
|
|
autocommit = True
|
|
|
)
|
|
|
- curs = self.conn.cursor()
|
|
|
|
|
|
try:
|
|
|
self.conn.select_db(self.db_set['name'])
|
|
|
@@ -187,6 +186,7 @@ class get_db_connect:
|
|
|
return self.conn
|
|
|
|
|
|
def __exit__(self, exc_type, exc_value, traceback):
|
|
|
+ self.conn.commit()
|
|
|
load_conn(self.conn_sub)
|
|
|
self.conn.close()
|
|
|
|
|
|
@@ -708,8 +708,6 @@ def set_init_always(ver_num):
|
|
|
if db_data:
|
|
|
global_wiki_set['wiki_access_password'] = db_data[0][0]
|
|
|
|
|
|
- conn.commit()
|
|
|
-
|
|
|
def set_init():
|
|
|
curs = conn.cursor()
|
|
|
|
|
|
@@ -739,8 +737,6 @@ def set_init():
|
|
|
['smtp_security', 'starttls']
|
|
|
]:
|
|
|
curs.execute(db_change("insert into other (name, data, coverage) values (?, ?, '')"), [i[0], i[1]])
|
|
|
-
|
|
|
- conn.commit()
|
|
|
|
|
|
# Func-simple
|
|
|
## Func-simple-without_DB
|
|
|
@@ -1708,7 +1704,6 @@ def admin_check(num = None, what = None, name = ''):
|
|
|
curs.execute(db_change(
|
|
|
"insert into re_admin (who, what, time) values (?, ?, ?)"
|
|
|
), [ip, what, time_data])
|
|
|
- conn.commit()
|
|
|
|
|
|
return 1
|
|
|
|
|
|
@@ -2027,7 +2022,6 @@ def ban_check(ip = None, tool = ''):
|
|
|
"update rb set ongoing = '' " + \
|
|
|
"where end < ? and end != '' and ongoing = '1'"
|
|
|
), [get_time()])
|
|
|
- conn.commit()
|
|
|
|
|
|
curs.execute(db_change("" + \
|
|
|
"select login, block from rb " + \
|
|
|
@@ -2288,8 +2282,6 @@ def do_add_thread(thread_code, thread_data, thread_top = '', thread_id = ''):
|
|
|
thread_code
|
|
|
])
|
|
|
|
|
|
- conn.commit()
|
|
|
-
|
|
|
def do_reload_recent_thread(topic_num, date, name = None, sub = None):
|
|
|
curs = conn.cursor()
|
|
|
|
|
|
@@ -2309,15 +2301,12 @@ def do_reload_recent_thread(topic_num, date, name = None, sub = None):
|
|
|
date
|
|
|
])
|
|
|
|
|
|
- conn.commit()
|
|
|
-
|
|
|
def add_alarm(who, context):
|
|
|
curs = conn.cursor()
|
|
|
|
|
|
curs.execute(db_change(
|
|
|
'insert into alarm (name, data, date) values (?, ?, ?)'
|
|
|
), [who, context, get_time()])
|
|
|
- conn.commit()
|
|
|
|
|
|
def add_user(user_name, user_pw, user_email = '', user_encode = ''):
|
|
|
curs = conn.cursor()
|
|
|
@@ -2360,8 +2349,6 @@ def add_user(user_name, user_pw, user_email = '', user_encode = ''):
|
|
|
user_name,
|
|
|
user_email
|
|
|
])
|
|
|
-
|
|
|
- conn.commit()
|
|
|
|
|
|
def ua_plus(u_id, u_ip, u_agent, time):
|
|
|
curs = conn.cursor()
|
|
|
@@ -2379,7 +2366,6 @@ def ua_plus(u_id, u_ip, u_agent, time):
|
|
|
u_agent,
|
|
|
time
|
|
|
])
|
|
|
- conn.commit()
|
|
|
|
|
|
def ban_insert(name, end, why, login, blocker, type_d = None):
|
|
|
curs = conn.cursor()
|
|
|
@@ -2433,8 +2419,6 @@ def ban_insert(name, end, why, login, blocker, type_d = None):
|
|
|
login
|
|
|
])
|
|
|
|
|
|
- conn.commit()
|
|
|
-
|
|
|
def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
|
|
|
curs = conn.cursor()
|
|
|
# 여기 좀 느린 듯
|
|
|
@@ -2538,8 +2522,6 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
|
|
|
def re_error(data):
|
|
|
curs = conn.cursor()
|
|
|
|
|
|
- conn.commit()
|
|
|
-
|
|
|
if data == '/ban':
|
|
|
if ban_check() == 1:
|
|
|
end = '<div id="opennamu_get_user_info">' + ip_check() + '</div>'
|