func.py 23 KB

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