2
0

func.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. import flask
  2. import json
  3. import sqlite3
  4. import hashlib
  5. import requests
  6. import re
  7. import html
  8. import os
  9. from set_mark.tool import *
  10. from mark import *
  11. json_data = open(os.path.join('language', 'en-US.json'), 'rt', encoding='utf-8').read()
  12. else_lang = json.loads(json_data)
  13. def load_conn(data):
  14. global conn
  15. global curs
  16. conn = data
  17. curs = conn.cursor()
  18. load_conn2(data)
  19. def easy_minify(data):
  20. data = re.sub('\n +<', '\n<', data)
  21. return data
  22. def captcha_get():
  23. data = ''
  24. if custom()[2] == 0:
  25. curs.execute('select data from other where name = "recaptcha"')
  26. recaptcha = curs.fetchall()
  27. if recaptcha and recaptcha[0][0] != '':
  28. curs.execute('select data from other where name = "sec_re"')
  29. sec_re = curs.fetchall()
  30. if sec_re and sec_re[0][0] != '':
  31. data += recaptcha[0][0] + '<hr>'
  32. return data
  33. def update():
  34. # v3.0.5 사용자 문서, 파일 문서, 분류 문서 영어화
  35. try:
  36. all_rep = [['사용자:', 'user:'], ['파일:', 'file:'], ['분류:', 'category:']]
  37. all_rep2 = ['data', 'history', 'acl', 'topic', 'back']
  38. test = 0
  39. for i in range(3):
  40. for j in range(6):
  41. if not j == 5:
  42. curs.execute('select title from ' + all_rep2[j] + ' where title like ?', [all_rep[i][0] + '%'])
  43. else:
  44. curs.execute('select link from back where link like ?', [all_rep[i][0] + '%'])
  45. user_rep = curs.fetchall()
  46. for user_rep2 in user_rep:
  47. test = 1
  48. first = re.sub('^' + all_rep[i][0], all_rep[i][1], user_rep2[0])
  49. if j == 0:
  50. curs.execute("update data set title = ? where title = ?", [first, user_rep2[0]])
  51. elif j == 1:
  52. curs.execute("update history set title = ? where title = ?", [first, user_rep2[0]])
  53. elif j == 2:
  54. curs.execute("update acl set title = ? where title = ?", [first, user_rep2[0]])
  55. elif j == 3:
  56. curs.execute("update topic set title = ? where title = ?", [first, user_rep2[0]])
  57. elif j == 4:
  58. curs.execute("update back set title = ? where title = ?", [first, user_rep2[0]])
  59. elif j == 5:
  60. curs.execute("update back set link = ? where link = ?", [first, user_rep2[0]])
  61. if test == 1:
  62. print('사용자 to user, 파일 to file, 분류 to category')
  63. except:
  64. pass
  65. # v3.0.6 사용자 설정 분리
  66. try:
  67. curs.execute("alter table user drop email")
  68. curs.execute("alter table user drop skin")
  69. except:
  70. pass
  71. def captcha_post(re_data, num = 1):
  72. if num == 1:
  73. if custom()[2] == 0 and captcha_get() != '':
  74. curs.execute('select data from other where name = "sec_re"')
  75. sec_re = curs.fetchall()
  76. if sec_re and sec_re[0][0] != '':
  77. data = requests.get('https://www.google.com/recaptcha/api/siteverify', params = { 'secret' : sec_re, 'response' : re_data })
  78. if not data:
  79. return 0
  80. else:
  81. json_data = data.json()
  82. if data.status_code == 200 and json_data['success'] == True:
  83. return 0
  84. else:
  85. return 1
  86. else:
  87. return 0
  88. else:
  89. return 0
  90. else:
  91. pass
  92. def load_lang(data, num = 0):
  93. global lang
  94. if num == 1:
  95. try:
  96. if lang:
  97. pass
  98. except:
  99. curs.execute("select data from other where name = 'language'")
  100. rep_data = curs.fetchall()
  101. json_data = open(os.path.join('language', rep_data[0][0] + '.json'), 'rt', encoding='utf-8').read()
  102. lang = json.loads(json_data)
  103. if data in lang:
  104. return lang[data]
  105. else:
  106. if data in else_lang:
  107. return else_lang[data]
  108. else:
  109. return data + ' (missing)'
  110. else:
  111. curs.execute('select data from user_set where name = "lang" and id = ?', [ip_check()])
  112. rep_data = curs.fetchall()
  113. if rep_data:
  114. try:
  115. json_data = open(os.path.join('language', rep_data[0][0] + '.json'), 'rt', encoding='utf-8').read()
  116. lang = json.loads(json_data)
  117. except:
  118. return load_lang(data, 1)
  119. if data in lang:
  120. return lang[data]
  121. else:
  122. return load_lang(data, 1)
  123. else:
  124. return load_lang(data, 1)
  125. def ip_or_user(data):
  126. if re.search('(\.|:)', data):
  127. return 1
  128. else:
  129. return 0
  130. def edit_help_button():
  131. # https://stackoverflow.com/questions/11076975/insert-text-into-textarea-at-cursor-position-javascript
  132. js_data = '''
  133. <script>
  134. function insertAtCursor(myField, myValue) {
  135. if (document.selection) {
  136. document.getElementById(myField).focus();
  137. sel = document.selection.createRange();
  138. sel.text = myValue;
  139. } else if (document.getElementById(myField).selectionStart || document.getElementById(myField).selectionStart == '0') {
  140. var startPos = document.getElementById(myField).selectionStart;
  141. var endPos = document.getElementById(myField).selectionEnd;
  142. document.getElementById(myField).value = document.getElementById(myField).value.substring(0, startPos) + myValue + document.getElementById(myField).value.substring(endPos, document.getElementById(myField).value.length);
  143. } else {
  144. document.getElementById(myField).value += myValue;
  145. }
  146. }
  147. </script>
  148. '''
  149. insert_list = [['[[|]]', 'link'], ['[()]', 'macro'], ['{{{#!}}}', 'middle'], ['||<>||', 'table']]
  150. data = ''
  151. for insert_data in insert_list:
  152. data += '<a href="javascript:void(0);" onclick="insertAtCursor(\'content\', \'' + insert_data[0] + '\');">(' + insert_data[1] + ')</a>'
  153. return [js_data, data + '<hr>']
  154. def ip_warring():
  155. if custom()[2] == 0:
  156. curs.execute('select data from other where name = "no_login_warring"')
  157. data = curs.fetchall()
  158. if data and data[0][0] != '':
  159. text_data = '<span>' + data[0][0] + '</span><hr>'
  160. else:
  161. text_data = '<span>' + load_lang('no_login_warring') + '</span><hr>'
  162. else:
  163. text_data = ''
  164. return text_data
  165. def skin_check():
  166. curs.execute('select data from other where name = "skin"')
  167. skin_exist = curs.fetchall()
  168. if skin_exist and skin_exist[0][0] != '':
  169. if os.path.exists(os.path.abspath('./views/' + skin_exist[0][0] + '/index.html')) == 1:
  170. skin = './views/' + skin_exist[0][0] + '/'
  171. curs.execute('select data from user_set where name = "skin" and id = ?', [ip_check()])
  172. skin_exist = curs.fetchall()
  173. if skin_exist and skin_exist[0][0] != '':
  174. if os.path.exists(os.path.abspath('./views/' + skin_exist[0][0] + '/index.html')) == 1:
  175. skin = './views/' + skin_exist[0][0] + '/'
  176. return skin + 'index.html'
  177. def next_fix(link, num, page, end = 50):
  178. list_data = ''
  179. if num == 1:
  180. if len(page) == end:
  181. list_data += '<hr><a href="' + link + str(num + 1) + '">(' + load_lang('next') + ')</a>'
  182. elif len(page) != end:
  183. list_data += '<hr><a href="' + link + str(num - 1) + '">(' + load_lang('previous') + ')</a>'
  184. else:
  185. list_data += '<hr><a href="' + link + str(num - 1) + '">(' + load_lang('previous') + ')</a> <a href="' + link + str(num + 1) + '">(' + load_lang('next') + ')</a>'
  186. return list_data
  187. def other2(data):
  188. return data + ['']
  189. def wiki_set(num = 1):
  190. if num == 1:
  191. data_list = []
  192. curs.execute('select data from other where name = ?', ['name'])
  193. db_data = curs.fetchall()
  194. if db_data and db_data[0][0] != '':
  195. data_list += [db_data[0][0]]
  196. else:
  197. data_list += ['wiki']
  198. curs.execute('select data from other where name = "license"')
  199. db_data = curs.fetchall()
  200. if db_data and db_data[0][0] != '':
  201. data_list += [db_data[0][0]]
  202. else:
  203. data_list += ['CC 0']
  204. data_list += ['', '']
  205. curs.execute('select data from other where name = "logo"')
  206. db_data = curs.fetchall()
  207. if db_data and db_data[0][0] != '':
  208. data_list += [db_data[0][0]]
  209. else:
  210. data_list += [data_list[0]]
  211. curs.execute("select data from other where name = 'head'")
  212. db_data = curs.fetchall()
  213. if db_data and db_data[0][0] != '':
  214. data_list += [db_data[0][0]]
  215. else:
  216. data_list += ['']
  217. return data_list
  218. if num == 2:
  219. var_data = 'FrontPage'
  220. curs.execute('select data from other where name = "frontpage"')
  221. elif num == 3:
  222. var_data = '2'
  223. curs.execute('select data from other where name = "upload"')
  224. db_data = curs.fetchall()
  225. if db_data and db_data[0][0] != '':
  226. return db_data[0][0]
  227. else:
  228. return var_data
  229. def diff(seqm):
  230. output = []
  231. for opcode, a0, a1, b0, b1 in seqm.get_opcodes():
  232. if opcode == 'equal':
  233. output += [seqm.a[a0:a1]]
  234. elif opcode == 'insert':
  235. output += ["<span style='background:#CFC;'>" + seqm.b[b0:b1] + "</span>"]
  236. elif opcode == 'delete':
  237. output += ["<span style='background:#FDD;'>" + seqm.a[a0:a1] + "</span>"]
  238. elif opcode == 'replace':
  239. output += ["<span style='background:#FDD;'>" + seqm.a[a0:a1] + "</span>"]
  240. output += ["<span style='background:#CFC;'>" + seqm.b[b0:b1] + "</span>"]
  241. return ''.join(output)
  242. def admin_check(num, what):
  243. ip = ip_check()
  244. curs.execute("select acl from user where id = ?", [ip])
  245. user = curs.fetchall()
  246. if user:
  247. reset = 0
  248. while 1:
  249. if num == 1 and reset == 0:
  250. check = 'ban'
  251. elif num == 3 and reset == 0:
  252. check = 'toron'
  253. elif num == 4 and reset == 0:
  254. check = 'check'
  255. elif num == 5 and reset == 0:
  256. check = 'acl'
  257. elif num == 6 and reset == 0:
  258. check = 'hidel'
  259. elif num == 7 and reset == 0:
  260. check = 'give'
  261. else:
  262. check = 'owner'
  263. curs.execute('select name from alist where name = ? and acl = ?', [user[0][0], check])
  264. if curs.fetchall():
  265. if what:
  266. curs.execute("insert into re_admin (who, what, time) values (?, ?, ?)", [ip, what, get_time()])
  267. conn.commit()
  268. return 1
  269. else:
  270. if reset == 0:
  271. reset = 1
  272. else:
  273. break
  274. def ip_pas(raw_ip):
  275. hide = 0
  276. if re.search("(\.|:)", raw_ip):
  277. if not re.search("^" + load_lang('tool', 1) + ":", raw_ip):
  278. curs.execute("select data from other where name = 'ip_view'")
  279. data = curs.fetchall()
  280. if data and data[0][0] != '':
  281. ip = '<span style="font-size: 75%;">' + hashlib.md5(bytes(raw_ip, 'utf-8')).hexdigest() + '</span>'
  282. if not admin_check('ban', None):
  283. hide = 1
  284. else:
  285. ip = raw_ip
  286. else:
  287. ip = raw_ip
  288. hide = 1
  289. else:
  290. curs.execute("select title from data where title = ?", ['user:' + raw_ip])
  291. if curs.fetchall():
  292. ip = '<a href="/w/' + url_pas('user:' + raw_ip) + '">' + raw_ip + '</a>'
  293. else:
  294. ip = '<a id="not_thing" href="/w/' + url_pas('user:' + raw_ip) + '">' + raw_ip + '</a>'
  295. if hide == 0:
  296. ip += ' <a href="/record/' + url_pas(raw_ip) + '">(' + load_lang('record') + ')</a>'
  297. return ip
  298. def custom():
  299. if 'MyMaiToNight' in flask.session:
  300. user_head = flask.session['MyMaiToNight']
  301. else:
  302. user_head = ''
  303. if 'Now' in flask.session and flask.session['Now'] == 1:
  304. curs.execute('select name from alarm where name = ? limit 1', [ip_check()])
  305. if curs.fetchall():
  306. user_icon = 2
  307. else:
  308. user_icon = 1
  309. else:
  310. user_icon = 0
  311. if user_icon != 0:
  312. curs.execute('select data from user_set where name = "email" and id = ?', [ip_check()])
  313. data = curs.fetchall()
  314. if data:
  315. email = data[0][0]
  316. else:
  317. email = ''
  318. else:
  319. email = ''
  320. if user_icon != 0:
  321. user_name = ip_check()
  322. else:
  323. user_name = load_lang('user')
  324. return ['', '', user_icon, user_head, email, user_name]
  325. def load_skin(data = ''):
  326. div2 = ''
  327. if data == '':
  328. ip = ip_check()
  329. curs.execute('select data from user_set where name = "skin" and id = ?', [ip])
  330. data = curs.fetchall()
  331. for skin_data in os.listdir(os.path.abspath('views')):
  332. if not skin_data == 'main_css':
  333. if not data:
  334. curs.execute('select data from other where name = "skin"')
  335. sql_data = curs.fetchall()
  336. if sql_data and sql_data[0][0] == skin_data:
  337. div2 = '<option value="' + skin_data + '">' + skin_data + '</option>' + div2
  338. else:
  339. div2 += '<option value="' + skin_data + '">' + skin_data + '</option>'
  340. elif data[0][0] == skin_data:
  341. div2 = '<option value="' + skin_data + '">' + skin_data + '</option>' + div2
  342. else:
  343. div2 += '<option value="' + skin_data + '">' + skin_data + '</option>'
  344. else:
  345. for skin_data in os.listdir(os.path.abspath('views')):
  346. if not skin_data == 'main_css':
  347. if data == skin_data:
  348. div2 = '<option value="' + skin_data + '">' + skin_data + '</option>' + div2
  349. else:
  350. div2 += '<option value="' + skin_data + '">' + skin_data + '</option>'
  351. return div2
  352. def acl_check(name):
  353. ip = ip_check()
  354. if ban_check() == 1:
  355. return 1
  356. acl_c = re.search("^user:([^/]*)", name)
  357. if acl_c:
  358. acl_n = acl_c.groups()
  359. if admin_check(5, None) == 1:
  360. return 0
  361. curs.execute("select dec from acl where title = ?", ['user:' + acl_n[0]])
  362. acl_data = curs.fetchall()
  363. if acl_data:
  364. if acl_data[0][0] == 'all':
  365. return 0
  366. if acl_data[0][0] == 'user' and not re.search("(\.|:)", ip):
  367. return 0
  368. if ip != acl_n[0] or re.search("(\.|:)", ip):
  369. return 1
  370. if ip == acl_n[0] and not re.search("(\.|:)", ip) and not re.search("(\.|:)", acl_n[0]):
  371. return 0
  372. else:
  373. return 1
  374. file_c = re.search("^file:(.*)", name)
  375. if file_c and admin_check(5, 'edit (' + name + ')') != 1:
  376. return 1
  377. curs.execute("select acl from user where id = ?", [ip])
  378. user_data = curs.fetchall()
  379. curs.execute("select dec from acl where title = ?", [name])
  380. acl_data = curs.fetchall()
  381. if acl_data:
  382. if acl_data[0][0] == 'user':
  383. if not user_data:
  384. return 1
  385. if acl_data[0][0] == 'admin':
  386. if not user_data:
  387. return 1
  388. if not admin_check(5, 'edit (' + name + ')') == 1:
  389. return 1
  390. curs.execute('select data from other where name = "edit"')
  391. set_data = curs.fetchall()
  392. if set_data:
  393. if set_data[0][0] == 'user':
  394. if not user_data:
  395. return 1
  396. if set_data[0][0] == 'admin':
  397. if not user_data:
  398. return 1
  399. if not admin_check(5, None) == 1:
  400. return 1
  401. return 0
  402. def ban_check(ip = None, tool = None):
  403. if not ip:
  404. ip = ip_check()
  405. band = re.search("^([0-9]{1,3}\.[0-9]{1,3})", ip)
  406. if band:
  407. band_it = band.groups()[0]
  408. else:
  409. band_it = '-'
  410. curs.execute("select end, login from ban where block = ?", [band_it])
  411. band_d = curs.fetchall()
  412. curs.execute("select end, login from ban where block = ?", [ip])
  413. ban_d = curs.fetchall()
  414. data = band_d or ban_d
  415. if data and (data[0][0] == '' or data[0][0] > get_time()):
  416. if tool and tool == 'login':
  417. if data[0][1] == 'O':
  418. return 0
  419. return 1
  420. return 0
  421. def topic_check(name, sub):
  422. ip = ip_check()
  423. if ban_check() == 1:
  424. return 1
  425. curs.execute("select acl from user where id = ?", [ip])
  426. user_data = curs.fetchall()
  427. curs.execute("select dis from acl where title = ?", [name])
  428. acl_data = curs.fetchall()
  429. if acl_data:
  430. if acl_data[0][0] == 'user':
  431. if not user_data:
  432. return 1
  433. if acl_data[0][0] == 'admin':
  434. if not user_data:
  435. return 1
  436. if not admin_check(3, 'topic (' + name + ')') == 1:
  437. return 1
  438. curs.execute("select title from stop where title = ? and sub = ?", [name, sub])
  439. if curs.fetchall():
  440. if not admin_check(3, 'topic (' + name + ')') == 1:
  441. return 1
  442. return 0
  443. def ban_insert(name, end, why, login, blocker):
  444. now_time = get_time()
  445. if re.search("^([0-9]{1,3}\.[0-9]{1,3})$", name):
  446. band = 'O'
  447. else:
  448. band = ''
  449. curs.execute("select block from ban where block = ?", [name])
  450. if curs.fetchall():
  451. curs.execute("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)", [name, load_lang('release', 1), now_time, blocker, '', band])
  452. curs.execute("delete from ban where block = ?", [name])
  453. else:
  454. if login != '':
  455. login = 'O'
  456. else:
  457. login = ''
  458. if end != '0':
  459. time = datetime.datetime.now()
  460. plus = datetime.timedelta(seconds = int(end))
  461. r_time = (time + plus).strftime("%Y-%m-%d %H:%M:%S")
  462. else:
  463. r_time = ''
  464. curs.execute("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)", [name, r_time, now_time, blocker, why, band])
  465. curs.execute("insert into ban (block, end, why, band, login) values (?, ?, ?, ?, ?)", [name, r_time, why, band, login])
  466. conn.commit()
  467. def rd_plus(title, sub, date):
  468. curs.execute("select title from rd where title = ? and sub = ?", [title, sub])
  469. if curs.fetchall():
  470. curs.execute("update rd set date = ? where title = ? and sub = ?", [date, title, sub])
  471. else:
  472. curs.execute("insert into rd (title, sub, date) values (?, ?, ?)", [title, sub, date])
  473. def history_plus(title, data, date, ip, send, leng):
  474. curs.execute("select id from history where title = ? order by id + 0 desc limit 1", [title])
  475. id_data = curs.fetchall()
  476. if id_data:
  477. curs.execute("insert into history (id, title, data, date, ip, send, leng) values (?, ?, ?, ?, ?, ?, ?)", [str(int(id_data[0][0]) + 1), title, data, date, ip, send, leng])
  478. else:
  479. curs.execute("insert into history (id, title, data, date, ip, send, leng) values ('1', ?, ?, ?, ?, ?, ?)", [title, data, date, ip, send + ' (' + load_lang('new', 1) + ' ' + load_lang('document', 1) + ')', leng])
  480. def leng_check(first, second):
  481. if first < second:
  482. all_plus = '+' + str(second - first)
  483. elif second < first:
  484. all_plus = '-' + str(first - second)
  485. else:
  486. all_plus = '0'
  487. return all_plus
  488. def redirect(data):
  489. return flask.redirect(data)
  490. def re_error(data):
  491. if data == '/ban':
  492. ip = ip_check()
  493. end = '<li>' + load_lang('why') + ' : ' + load_lang('authority_error') + '</li>'
  494. if ban_check() == 1:
  495. curs.execute("select end, why from ban where block = ?", [ip])
  496. end_data = curs.fetchall()
  497. if not end_data:
  498. match = re.search("^([0-9]{1,3}\.[0-9]{1,3})", ip)
  499. if match:
  500. curs.execute("select end, why from ban where block = ?", [match.groups()[0]])
  501. end_data = curs.fetchall()
  502. if end_data:
  503. end = '<li>' + load_lang('state') + ' : ' + load_lang('ban') + '</li><li>'
  504. if end_data[0][0]:
  505. now = int(re.sub('(\-| |:)', '', get_time()))
  506. day = int(re.sub('(\-| |:)', '', end_data[0][0]))
  507. if now >= day:
  508. curs.execute("delete from ban where block = ?", [ip])
  509. conn.commit()
  510. end += '<script>location.reload();</script>'
  511. else:
  512. end += 'end : ' + end_data[0][0]
  513. else:
  514. end += load_lang('limitless')
  515. end += '</li>'
  516. if end_data[0][1] != '':
  517. end += '<li>' + load_lang('why') + ' : ' + end_data[0][1] + '</li>'
  518. return easy_minify(flask.render_template(skin_check(),
  519. imp = ['error', wiki_set(1), custom(), other2([0, 0])],
  520. data = '<h2>error</h2><ul>' + end + '</ul>',
  521. menu = 0
  522. ))
  523. else:
  524. error_data = re.search('\/error\/([0-9]+)', data)
  525. if error_data:
  526. num = int(error_data.groups()[0])
  527. if num == 1:
  528. data = load_lang('no_login_error')
  529. elif num == 2:
  530. data = load_lang('no_exist_user_error')
  531. elif num == 3:
  532. data = load_lang('authority_error')
  533. elif num == 4:
  534. data = load_lang('no_admin_block_error')
  535. elif num == 5:
  536. data = load_lang('skin_error')
  537. elif num == 6:
  538. data = load_lang('same_id_exist_error')
  539. elif num == 7:
  540. data = load_lang('long_id_error')
  541. elif num == 8:
  542. data = load_lang('id_char_error')
  543. elif num == 9:
  544. data = load_lang('file_exist_error')
  545. elif num == 10:
  546. data = load_lang('password_error')
  547. elif num == 13:
  548. data = load_lang('recaptcha_error')
  549. elif num == 14:
  550. data = load_lang('file_extension_error')
  551. elif num == 15:
  552. data = load_lang('edit_record_error')
  553. elif num == 16:
  554. data = load_lang('same_file_error')
  555. elif num == 17:
  556. data = load_lang('file_capacity_error') + ' ' + wiki_set(3)
  557. elif num == 19:
  558. data = load_lang('decument_exist_error')
  559. elif num == 20:
  560. data = load_lang('password_diffrent_error')
  561. elif num == 21:
  562. data = load_lang('edit_filter_error')
  563. elif num == 22:
  564. data = load_lang('file_name_error')
  565. else:
  566. data = '???'
  567. return easy_minify(flask.render_template(skin_check(),
  568. imp = ['error', wiki_set(1), custom(), other2([0, 0])],
  569. data = '<h2>error</h2><ul><li>' + data + '</li></ul>',
  570. menu = 0
  571. ))
  572. else:
  573. return redirect('/')