'
for footnote_search in footnote_search_data:
footnote_count_str = str(footnote_count)
if footnote_count != 1:
footnote_data += ' '
footnote_data += '(' + footnote_count_str + ') ' + footnote_search
data = re.sub(footnote_regex, '(' + footnote_count_str + ')', data, 1)
footnote_count += 1
if footnote_data != '':
footnote_data += '
'
data = toc_data + data + footnote_data
return data
# Func-request
def send_email(who, title, data):
curs = conn.cursor()
try:
curs.execute(db_change('' + \
'select name, data from other ' + \
'where name = "smtp_email" or name = "smtp_pass" or name = "smtp_server" or name = "smtp_port" or name = "smtp_security"' + \
''))
rep_data = curs.fetchall()
smtp_email = ''
smtp_pass = ''
smtp_server = ''
smtp_security = ''
smtp_port = ''
smtp = ''
for i in rep_data:
if i[0] == 'smtp_email':
smtp_email = i[1]
elif i[0] == 'smtp_pass':
smtp_pass = i[1]
elif i[0] == 'smtp_server':
smtp_server = i[1]
elif i[0] == 'smtp_security':
smtp_security = i[1]
elif i[0] == 'smtp_port':
smtp_port = i[1]
smtp_port = int(smtp_port)
if smtp_security == 'plain':
smtp = smtplib.SMTP(smtp_server, smtp_port)
elif smtp_security == 'starttls':
smtp = smtplib.SMTP(smtp_server, smtp_port)
smtp.starttls()
else:
# if smtp_security == 'tls':
smtp = smtplib.SMTP_SSL(smtp_server, smtp_port)
smtp.login(smtp_email, smtp_pass)
domain = load_domain()
wiki_name = wiki_set()[0]
msg = email.mime.text.MIMEText(data)
msg['Subject'] = title
msg['From'] = 'openNAMU '
msg['To'] = who
smtp.sendmail('openNAMU@' + domain, who, msg.as_string())
smtp.quit()
return 1
except Exception as e:
print('----')
print('Error : email send error')
print(e)
return 0
def captcha_get():
curs = conn.cursor()
data = ''
if ip_or_user() != 0:
curs.execute(db_change('select data from other where name = "recaptcha"'))
recaptcha = curs.fetchall()
curs.execute(db_change('select data from other where name = "sec_re"'))
sec_re = curs.fetchall()
curs.execute(db_change('select data from other where name = "recaptcha_ver"'))
rec_ver = curs.fetchall()
if recaptcha and recaptcha[0][0] != '' and sec_re and sec_re[0][0] != '':
if not rec_ver or rec_ver[0][0] == '':
data += '' + \
'' + \
'' + \
'' + \
''
elif rec_ver[0][0] == 'v3':
data += '' + \
'' + \
'' + \
'' + \
''
else:
data += '''
'''
return data
def captcha_post(re_data, num = 1):
curs = conn.cursor()
if num == 1 and ip_or_user() != 0:
curs.execute(db_change('select data from other where name = "sec_re"'))
sec_re = curs.fetchall()
curs.execute(db_change('select data from other where name = "recaptcha_ver"'))
rec_ver = curs.fetchall()
if captcha_get() != '':
if not rec_ver or rec_ver[0][0] in ('', 'v3'):
data = requests.get(
'https://www.google.com/recaptcha/api/siteverify' + \
'?secret=' + sec_re[0][0] + '&response=' + re_data
)
if data.status_code == 200:
json_data = json.loads(data.text)
if json_data['success'] != True:
return 1
else:
data = requests.get(
'https://hcaptcha.com/siteverify' + \
'?secret=' + sec_re[0][0] + '&response=' + re_data
)
if data.status_code == 200:
json_data = json.loads(data.text)
if json_data['success'] != True:
return 1
return 0
# Func-user
def admin_check(num = None, what = None, name = ''):
curs = conn.cursor()
ip = ip_check() if name == '' else name
time_data = get_time()
pass_ok = 0
if ip_or_user(ip) == 0:
curs.execute(db_change(
"select data from user_set where id = ? and name = 'acl'"
), [ip])
user_auth = curs.fetchall()
if user_auth:
user_auth = user_auth[0][0]
check = {
0 : 'owner',
1 : 'ban',
2 : 'nothing',
3 : 'toron',
4 : 'check',
5 : 'acl',
6 : 'hidel',
7 : 'give'
}
if not num:
check = check[0]
elif num == 'all':
check = [check[i] for i in check]
else:
check = check[num]
curs.execute(db_change(
'select name from alist where name = ? and acl = "owner"'
), [user_auth])
if curs.fetchall():
pass_ok = 1
else:
if num == 'all':
curs.execute(db_change(
'select name from alist where name = ?'
), [user_auth])
else:
curs.execute(db_change(
'select name from alist where name = ? and acl = ?'
), [user_auth, check])
if curs.fetchall():
pass_ok = 1
if pass_ok == 1:
if what:
curs.execute(db_change(
"insert into re_admin (who, what, time) values (?, ?, ?)"
), [ip, what, time_data])
conn.commit()
return 1
return 0
def acl_check(name = 'test', tool = '', topic_num = '1'):
curs = conn.cursor()
ip = ip_check()
get_ban = ban_check()
if tool == '' and name:
if acl_check(name, 'render') == 1:
return 1
user_page = re.search(r"^user:((?:(?!\/).)*)", name)
if user_page:
user_page = user_page.group(1)
if admin_check(5) == 1:
return 0
if get_ban == 1:
return 1
curs.execute(db_change(
"select data from acl where title = ? and type = 'decu'"
), [name])
acl_data = curs.fetchall()
if acl_data:
if acl_data[0][0] == 'all':
return 0
elif acl_data[0][0] == 'user' and not ip_or_user(ip) == 1:
return 0
if ip == user_page and not ip_or_user(ip) == 1:
return 0
return 1
elif tool == 'document_edit' or tool == 'document_move' or tool == 'document_delete':
if acl_check(name, '') == 1:
return 1
elif tool == 'topic':
curs.execute(db_change("select title from rd where code = ?"), [topic_num])
name = curs.fetchall()
name = name[0][0] if name else 'test'
if tool in ['topic']:
end = 3
elif tool in ['render', 'vote', '']:
end = 2
else:
end = 1
for i in range(0, end):
if tool == '':
if i == 0:
curs.execute(db_change(
"select data from acl where title = ? and type = 'decu'"
), [name])
'''
elif i == 1:
curs.execute(db_change(
"select plus from html_filter where kind = 'document'"
))
'''
else:
curs.execute(db_change(
'select data from other where name = "edit"'
))
num = 5
elif tool == 'document_move':
curs.execute(db_change(
"select data from acl where title = ? and type = 'document_move_acl'"
), [name])
num = 5
elif tool == 'document_edit':
curs.execute(db_change(
"select data from acl where title = ? and type = 'document_edit_acl'"
), [name])
num = 5
elif tool == 'document_delete':
curs.execute(db_change(
"select data from acl where title = ? and type = 'document_delete_acl'"
), [name])
num = 5
elif tool == 'topic':
if i == 0:
curs.execute(db_change(
"select acl from rd where code = ?"
), [topic_num])
elif i == 1:
curs.execute(db_change(
"select data from acl where title = ? and type = 'dis'"
), [name])
else:
curs.execute(db_change(
'select data from other where name = "discussion"'
))
num = 3
elif tool == 'topic_view':
curs.execute(db_change("select set_data from topic_set where thread_code = ? and set_name = 'thread_view_acl'"), [
topic_num
])
num = 3
elif tool == 'upload':
curs.execute(db_change(
"select data from other where name = 'upload_acl'"
))
num = 5
elif tool == 'many_upload':
curs.execute(db_change(
"select data from other where name = 'many_upload_acl'"
))
num = 5
elif tool == 'vote':
if i == 0:
curs.execute(db_change(
'select acl from vote where id = ? and user = ""'
), [topic_num])
else:
curs.execute(db_change(
'select data from other where name = "vote_acl"'
))
num = None
else:
# tool == 'render'
if i == 0:
curs.execute(db_change(
"select data from acl where title = ? and type = 'view'"
), [name])
else:
curs.execute(db_change("select data from other where name = 'all_view_acl'"))
num = 5
acl_data = curs.fetchall()
if not acl_data:
acl_data = [['normal']]
elif acl_data and acl_data[0][0] == '':
acl_data = [['normal']]
except_ban_tool_list = ['render', 'topic_view']
if acl_data[0][0] != 'normal':
if not acl_data[0][0] in ['ban', 'ban_admin'] and not tool in except_ban_tool_list:
if get_ban == 1:
return 1
if acl_data[0][0] in ['all', 'ban']:
return 0
elif acl_data[0][0] == 'user':
if ip_or_user(ip) != 1:
return 0
elif acl_data[0][0] == 'admin':
if ip_or_user(ip) != 1:
if admin_check(num) == 1:
return 0
elif acl_data[0][0] == '50_edit':
if ip_or_user(ip) != 1:
if admin_check(num) == 1:
return 0
else:
curs.execute(db_change(
"select count(*) from history where ip = ?"
), [ip])
count = curs.fetchall()
count = count[0][0] if count else 0
if count >= 50:
return 0
elif acl_data[0][0] == 'before':
if ip_or_user(ip) != 1:
if admin_check(num) == 1:
return 0
curs.execute(db_change(
"select ip from history where title = ? and ip = ?"
), [name, ip])
if curs.fetchall():
return 0
elif acl_data[0][0] == '30_day':
if ip_or_user(ip) != 1:
if admin_check(num) == 1:
return 0
else:
curs.execute(db_change(
"select data from user_set where id = ? and name = 'date'"
), [ip])
user_date = curs.fetchall()[0][0]
time_1 = datetime.datetime.strptime(
user_date,
'%Y-%m-%d %H:%M:%S'
) + datetime.timedelta(days = 30)
time_2 = datetime.datetime.strptime(
get_time(),
'%Y-%m-%d %H:%M:%S'
)
if time_2 > time_1:
return 0
elif acl_data[0][0] == 'email':
if ip_or_user(ip) != 1:
if admin_check(num) == 1:
return 0
else:
curs.execute(db_change(
"select data from user_set where id = ? and name = 'email'"
), [ip])
if curs.fetchall():
return 0
elif acl_data[0][0] == 'owner':
if admin_check() == 1:
return 0
elif acl_data[0][0] == 'ban_admin':
if admin_check(1) == 1 or get_ban == 1:
return 0
elif acl_data[0][0] == 'not_all':
return 1
return 1
elif i == (end - 1):
if not tool in except_ban_tool_list:
if get_ban == 1:
return 1
if tool == 'topic':
curs.execute(db_change(
"select title from rd where code = ? and stop != ''"
), [topic_num])
if curs.fetchall():
if admin_check(3, 'topic (code ' + topic_num + ')') == 1:
return 0
else:
return 1
else:
return 0
else:
return 0
return 1
def ban_check(ip = None, tool = ''):
curs = conn.cursor()
ip = ip_check() if not ip else ip
tool = '' if not tool else tool
if admin_check(None, None, ip) == 1:
return 0
curs.execute(db_change(
"update rb set ongoing = '' " + \
"where end < ? and end != '' and ongoing = '1'"
), [get_time()])
conn.commit()
curs.execute(db_change("" + \
"select login, block from rb " + \
"where band = 'regex' and ongoing = '1'" + \
""))
regex_d = curs.fetchall()
for test_r in regex_d:
g_regex = re.compile(test_r[1])
if g_regex.search(ip):
if tool == 'login':
if test_r[0] != 'O':
return 1
else:
return 1
curs.execute(db_change("" + \
"select login from rb " + \
"where block = ? and band = '' and ongoing = '1'" + \
"" + \
""), [ip])
ban_d = curs.fetchall()
if ban_d:
if tool == 'login':
if ban_d[0][0] != 'O':
return 1
else:
return 1
return 0
def ip_pas(raw_ip, type_data = 0):
curs = conn.cursor()
end_ip = {}
return_data = 0
if type(raw_ip) != type([]):
get_ip = [raw_ip]
return_data = 1
else:
get_ip = raw_ip
curs.execute(db_change("select data from other where name = 'ip_view'"))
ip_view = curs.fetchall()
ip_view = ip_view[0][0] if ip_view else ''
ip_view = '' if admin_check(1) == 1 else ip_view
get_ip = list(set(get_ip))
for raw_ip in get_ip:
change_ip = 0
if re.search(r'^Add:', raw_ip):
is_this_ip = 1
ip = raw_ip
else:
is_this_ip = ip_or_user(raw_ip)
if is_this_ip != 0 and ip_view != '':
ip = ipaddress.ip_address(raw_ip)
if type(ip) == ipaddress.IPv6Address:
ip = ip.exploded
ip = re.sub(r':([^:]*):([^:]*)$', ':*:*', ip)
else:
ip = ip.exploded
ip = re.sub(r'\.([^.]*)\.([^.]*)$', '.*.*', ip)
change_ip = 1
else:
ip = raw_ip
if type_data == 0 and change_ip == 0:
if is_this_ip == 0:
ip = '' + raw_ip + ''
if admin_check('all', None, raw_ip) == 1:
ip = '' + ip + ''
curs.execute(db_change('select data from user_set where name = "user_title" and id = ?'), [raw_ip])
db_data = curs.fetchall()
if db_data:
ip = db_data[0][0] + ip
if ban_check(raw_ip) == 1:
ip = '' + ip + ''
if ban_check(raw_ip, 'login') == 1:
ip = '' + ip + ''
ip = ip + ' (' + load_lang('tool') + ')'
end_ip[raw_ip] = ip
if return_data == 1:
return end_ip[raw_ip]
else:
return end_ip
# Func-edit
def get_edit_text_bottom():
curs = conn.cursor()
b_text = ''
curs.execute(db_change('select data from other where name = "edit_bottom_text"'))
db_data= curs.fetchall()
if db_data and db_data[0][0] != '':
b_text = '' + \
db_data[0][0] + \
'' + \
''
return b_text
def get_edit_text_bottom_check_box():
curs = conn.cursor()
cccb_text = ''
curs.execute(db_change('select data from other where name = "copyright_checkbox_text"'))
sql_d = curs.fetchall()
if sql_d and sql_d[0][0] != '':
cccb_text = '' + \
' ' + sql_d[0][0] + \
'' + \
''
return cccb_text
def do_edit_text_bottom_check_box_check(data):
curs = conn.cursor()
curs.execute(db_change('select data from other where name = "copyright_checkbox_text"'))
db_data = curs.fetchall()
if db_data and db_data[0][0] != '':
if data != 'yes':
return 1
return 0
def do_edit_send_check(data):
curs = conn.cursor()
curs.execute(db_change('select data from other where name = "edit_bottom_compulsion"'))
db_data = curs.fetchall()
if db_data and db_data[0][0] != '' and data == '':
return 1
return 0
def do_edit_slow_check():
curs = conn.cursor()
curs.execute(db_change("select data from other where name = 'slow_edit'"))
slow_edit = curs.fetchall()
if slow_edit and slow_edit[0][0] != '' and admin_check(5) != 1:
slow_edit = int(number_check(slow_edit[0][0]))
curs.execute(db_change(
"select date from history where ip = ? order by date desc limit 1"
), [ip_check()])
last_edit_data = curs.fetchall()
if last_edit_data:
last_edit_data = int(re.sub(' |:|-', '', last_edit_data[0][0]))
now_edit_data = int((
datetime.datetime.now() - datetime.timedelta(seconds = slow_edit)
).strftime("%Y%m%d%H%M%S"))
if last_edit_data > now_edit_data:
return 1
return 0
def do_edit_filter(data):
curs = conn.cursor()
if admin_check(1) != 1:
curs.execute(db_change(
"select plus, plus_t from html_filter where kind = 'regex_filter' and plus != ''"
))
for data_list in curs.fetchall():
match = re.compile(data_list[0], re.I)
if match.search(data):
ban_insert(
ip_check(),
'0' if data_list[1] == 'X' else data_list[1],
'edit filter',
None,
'tool:edit filter'
)
return 1
return 0
def do_title_length_check(name, check_type = 'document'):
curs = conn.cursor()
if check_type == 'topic':
curs.execute(db_change('select data from other where name = "title_topic_max_length"'))
db_data = curs.fetchall()
if db_data and db_data[0][0] != '':
db_data = int(number_check(db_data[0][0]))
if len(name) > db_data:
return 1
else:
curs.execute(db_change('select data from other where name = "title_max_length"'))
db_data = curs.fetchall()
if db_data and db_data[0][0] != '':
db_data = int(number_check(db_data[0][0]))
if len(name) > db_data:
return 1
return 0
# Func-insert
def do_add_thread(thread_code, thread_data, thread_top = '', thread_id = ''):
curs = conn.cursor()
if thread_id == '':
curs.execute(db_change("select id from topic where code = ? order by id + 0 desc limit 1"), [thread_code])
db_data = curs.fetchall()
if db_data:
thread_id = str(int(db_data[0][0]) + 1)
else:
thread_id = '1'
curs.execute(db_change("insert into topic (id, data, date, ip, block, top, code) values (?, ?, ?, ?, ?, '', ?)"), [
thread_id,
thread_data,
get_time(),
ip_check(),
thread_top,
thread_code
])
conn.commit()
def do_reload_recent_thread(topic_num, date, name = None, sub = None):
curs = conn.cursor()
curs.execute(db_change("select code from rd where code = ?"), [topic_num])
if curs.fetchall():
curs.execute(db_change("update rd set date = ? where code = ?"), [
date,
topic_num
])
else:
curs.execute(db_change(
"insert into rd (title, sub, code, date, band, stop, agree, acl) values (?, ?, ?, ?, '', '', '', '')"
), [
name,
sub,
topic_num,
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()
if user_encode == '':
user_pw_hash = pw_encode(user_pw)
curs.execute(db_change('select data from other where name = "encode"'))
data_encode = curs.fetchall()
data_encode = data_encode[0][0]
else:
user_pw_hash = user_pw
data_encode = user_encode
curs.execute(db_change("select id from user_set limit 1"))
if not curs.fetchall():
user_auth = 'owner'
else:
user_auth = 'user'
curs.execute(db_change("insert into user_set (id, name, data) values (?, 'pw', ?)"), [
user_name,
user_pw_hash
])
curs.execute(db_change("insert into user_set (id, name, data) values (?, 'acl', ?)"), [
user_name,
user_auth
])
curs.execute(db_change("insert into user_set (id, name, data) values (?, 'date', ?)"), [
user_name,
get_time()
])
curs.execute(db_change("insert into user_set (id, name, data) values (?, 'encode', ?)"), [
user_name,
data_encode
])
if user_email != '':
curs.execute(db_change("insert into user_set (name, id, data) values ('email', ?, ?)"), [
user_name,
user_email
])
conn.commit()
def ua_plus(u_id, u_ip, u_agent, time):
curs = conn.cursor()
curs.execute(db_change("select data from other where name = 'ua_get'"))
rep_data = curs.fetchall()
if rep_data and rep_data[0][0] != '':
pass
else:
curs.execute(db_change(
"insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"
), [
u_id,
u_ip,
u_agent,
time
])
conn.commit()
def ban_insert(name, end, why, login, blocker, type_d = None):
curs = conn.cursor()
now_time = get_time()
band = type_d if type_d else ''
curs.execute(db_change(
"update rb set ongoing = '' where end < ? and end != '' and ongoing = '1'"
), [now_time])
curs.execute(db_change("" + \
"select block from rb " + \
"where ((end > ? and end != '') or end = '') and block = ? and " + \
"band = ? and ongoing = '1'" + \
""), [now_time, name, band])
if curs.fetchall():
curs.execute(db_change(
"insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)"
), [
name,
'release',
now_time,
blocker,
'',
band
])
curs.execute(db_change(
"update rb set ongoing = '' where block = ? and band = ? and ongoing = '1'"
), [name, band])
else:
login = 'O' if login != '' else ''
if end != '0':
end = int(number_check(end))
time = datetime.datetime.now()
plus = datetime.timedelta(seconds = end)
r_time = (time + plus).strftime("%Y-%m-%d %H:%M:%S")
else:
r_time = ''
curs.execute(db_change(
"insert into rb (block, end, today, blocker, why, band, ongoing, login) " + \
"values (?, ?, ?, ?, ?, ?, '1', ?)"
), [
name,
r_time,
now_time,
blocker,
why,
band,
login
])
conn.commit()
def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
curs = conn.cursor()
curs.execute(db_change('select data from other where name = "history_recording_off"'))
db_data = curs.fetchall()
if db_data and db_data[0][0] != '':
return 0
if mode == 'add':
curs.execute(db_change(
"select id from history where title = ? order by id + 0 asc limit 1"
), [title])
id_data = curs.fetchall()
id_data = str(int(id_data[0][0]) - 1) if id_data else '0'
else:
curs.execute(db_change(
"select id from history where title = ? order by id + 0 desc limit 1"
), [title])
id_data = curs.fetchall()
id_data = str(int(id_data[0][0]) + 1) if id_data else '1'
mode = mode if not re.search('^user:', title) else 'user'
send = re.sub(r'\(|\)|<|>', '', send)
send = send[:128] if len(send) > 128 else send
send = send + ' (' + t_check + ')' if t_check != '' else send
if mode != 'add' and mode != 'user':
curs.execute(db_change("select count(*) from rc where type = 'normal'"))
if curs.fetchall()[0][0] >= 200:
curs.execute(db_change(
"select id, title from rc where type = 'normal' order by date asc limit 1"
))
rc_data = curs.fetchall()
if rc_data:
curs.execute(db_change(
'delete from rc where id = ? and title = ? and type = "normal"'
), [
rc_data[0][0],
rc_data[0][1]
])
curs.execute(db_change(
"insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"
), [
id_data,
title,
date
])
if mode != 'add':
curs.execute(db_change("select count(*) from rc where type = ?"), [mode])
if curs.fetchall()[0][0] >= 200:
curs.execute(db_change(
"select id, title from rc where type = ? order by date asc limit 1"
), [mode])
rc_data = curs.fetchall()
if rc_data:
curs.execute(db_change(
'delete from rc where id = ? and title = ? and type = ?'
), [
rc_data[0][0],
rc_data[0][1],
mode
])
curs.execute(db_change(
"insert into rc (id, title, date, type) values (?, ?, ?, ?)"
), [
id_data,
title,
date,
mode
])
curs.execute(db_change(
"insert into history (id, title, data, date, ip, send, leng, hide, type) " + \
"values (?, ?, ?, ?, ?, ?, ?, '', ?)"
), [
id_data,
title,
data,
date,
ip,
send,
leng,
mode
])
# Func-error
def re_error(data):
curs = conn.cursor()
conn.commit()
if data == '/ban':
if ban_check() == 1:
end = '
' + end,
menu = 0
)), 401
else:
num = int(number_check(data.replace('/error/', '')))
if num == 1:
data = load_lang('no_login_error')
elif num == 2:
data = load_lang('no_exist_user_error')
elif num == 3:
data = load_lang('authority_error')
elif num == 4:
data = load_lang('no_admin_block_error')
elif num == 5:
data = load_lang('error_skin_set')
elif num == 6:
data = load_lang('same_id_exist_error')
elif num == 7:
data = load_lang('long_id_error')
elif num == 8:
data = load_lang('id_char_error') + ' (' + load_lang('id_filter_list') + ')'
elif num == 9:
data = load_lang('file_exist_error')
elif num == 10:
data = load_lang('password_error')
elif num == 11:
data = load_lang('topic_long_error')
elif num == 12:
data = load_lang('email_error')
elif num == 13:
data = load_lang('recaptcha_error')
elif num == 14:
data = load_lang('file_extension_error') + ' (' + load_lang('extension_filter_list') + ')'
elif num == 15:
data = load_lang('edit_record_error')
elif num == 16:
data = load_lang('same_file_error')
elif num == 17:
curs.execute(db_change('select data from other where name = "upload"'))
db_data = curs.fetchall()
file_max = int(number_check(db_data[0][0])) if db_data and db_data[0][0] != '' else '2'
data = load_lang('file_capacity_error') + file_max
elif num == 18:
data = load_lang('email_send_error')
elif num == 19:
data = load_lang('move_error')
elif num == 20:
data = load_lang('password_diffrent_error')
elif num == 21:
data = load_lang('edit_filter_error')
elif num == 22:
data = load_lang('file_name_error')
elif num == 23:
data = load_lang('regex_error')
elif num == 24:
curs.execute(db_change("select data from other where name = 'slow_edit'"))
db_data = curs.fetchall()
db_data = '' if not db_data else db_data[0][0]
data = load_lang('fast_edit_error') + db_data
elif num == 25:
data = load_lang('too_many_dec_error')
elif num == 26:
data = load_lang('application_not_found')
elif num == 27:
data = load_lang("invalid_password_error")
elif num == 28:
data = load_lang('watchlist_overflow_error')
elif num == 29:
data = load_lang('copyright_disagreed')
elif num == 30:
data = load_lang('ie_wrong_callback')
elif num == 33:
data = load_lang('restart_fail_error')
elif num == 34:
data = load_lang("update_error") + ' (Github)'
elif num == 35:
data = load_lang('same_email_error')
elif num == 36:
data = load_lang('input_email_error')
elif num == 37:
data = load_lang('error_edit_send_request')
elif num == 38:
curs.execute(db_change("select data from other where name = 'title_max_length'"))
db_data = curs.fetchall()
db_data = '' if not db_data else db_data[0][0]
data = load_lang('error_title_length_too_long') + db_data
elif num == 39:
curs.execute(db_change("select data from other where name = 'title_topic_max_length'"))
db_data = curs.fetchall()
db_data = '' if not db_data else db_data[0][0]
data = load_lang('error_title_length_too_long') + db_data
elif num == 40:
curs.execute(db_change("select data from other where name = 'password_min_length'"))
db_data = curs.fetchall()
if db_data and db_data[0][0] != '':
password_min_length = db_data[0][0]
else:
password_min_length = ''
data = load_lang('error_password_length_too_short') + password_min_length
else:
data = '???'
if num == 5:
if flask.request.path != '/skin_set':
data += ' ' + load_lang('error_skin_set_old') + ' (' + load_lang('go') + ')'
title = load_lang('skin_set')
tool = [['change', load_lang('user_setting')], ['change/skin_set/main', load_lang('main_skin_set')]]
load_skin_set = ''
return easy_minify(flask.render_template(skin_check(),
imp = [title, wiki_set(), wiki_custom(), wiki_css([0, 0])],
data = '' + \
'