|
@@ -633,35 +633,19 @@ def set_init():
|
|
|
curs.execute(db_change("select html from html_filter where kind = 'email'"))
|
|
curs.execute(db_change("select html from html_filter where kind = 'email'"))
|
|
|
if not curs.fetchall():
|
|
if not curs.fetchall():
|
|
|
for i in ['naver.com', 'gmail.com', 'daum.net', 'kakao.com']:
|
|
for i in ['naver.com', 'gmail.com', 'daum.net', 'kakao.com']:
|
|
|
- curs.execute(db_change(
|
|
|
|
|
- "insert into html_filter (html, kind, plus, plus_t) values (?, 'email', '', '')"
|
|
|
|
|
- ), [i])
|
|
|
|
|
|
|
+ curs.execute(db_change("insert into html_filter (html, kind, plus, plus_t) values (?, 'email', '', '')"), [i])
|
|
|
|
|
|
|
|
curs.execute(db_change("select html from html_filter where kind = 'extension'"))
|
|
curs.execute(db_change("select html from html_filter where kind = 'extension'"))
|
|
|
if not curs.fetchall():
|
|
if not curs.fetchall():
|
|
|
for i in ['jpg', 'jpeg', 'png', 'gif', 'webp']:
|
|
for i in ['jpg', 'jpeg', 'png', 'gif', 'webp']:
|
|
|
- curs.execute(db_change(
|
|
|
|
|
- "insert into html_filter (html, kind, plus, plus_t) values (?, 'extension', '', '')"
|
|
|
|
|
- ), [i])
|
|
|
|
|
|
|
+ curs.execute(db_change("insert into html_filter (html, kind, plus, plus_t) values (?, 'extension', '', '')"), [i])
|
|
|
|
|
|
|
|
- curs.execute(db_change(
|
|
|
|
|
- 'select data from other ' + \
|
|
|
|
|
- 'where name = "smtp_server" or name = "smtp_port" or name = "smtp_security"'
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ curs.execute(db_change('select data from other where name = "smtp_server" or name = "smtp_port" or name = "smtp_security"'))
|
|
|
if not curs.fetchall():
|
|
if not curs.fetchall():
|
|
|
- for i in [
|
|
|
|
|
- ['smtp_server', 'smtp.gmail.com'],
|
|
|
|
|
- ['smtp_port', '587'],
|
|
|
|
|
- ['smtp_security', 'starttls']
|
|
|
|
|
- ]:
|
|
|
|
|
|
|
+ for i in [['smtp_server', 'smtp.gmail.com'], ['smtp_port', '587'], ['smtp_security', 'starttls']]:
|
|
|
curs.execute(db_change("insert into other (name, data, coverage) values (?, ?, '')"), [i[0], i[1]])
|
|
curs.execute(db_change("insert into other (name, data, coverage) values (?, ?, '')"), [i[0], i[1]])
|
|
|
|
|
|
|
|
- curs.execute(db_change('insert into html_filter (html, kind, plus, plus_t) values (?, ?, ?, ?)'), [
|
|
|
|
|
- r'(?:[^A-Za-zㄱ-힣0-9])',
|
|
|
|
|
- 'name',
|
|
|
|
|
- '',
|
|
|
|
|
- ''
|
|
|
|
|
- ])
|
|
|
|
|
|
|
+ curs.execute(db_change('insert into html_filter (html, kind, plus, plus_t) values (?, ?, ?, ?)'), [r'(?:[^A-Za-zㄱ-힣0-9])', 'name', '', ''])
|
|
|
|
|
|
|
|
# Func-simple
|
|
# Func-simple
|
|
|
## Func-simple-without_DB
|
|
## Func-simple-without_DB
|
|
@@ -900,24 +884,15 @@ def pw_check(data, data2, type_d = 'no', id_d = ''):
|
|
|
curs.execute(db_change('select data from other where name = "encode"'))
|
|
curs.execute(db_change('select data from other where name = "encode"'))
|
|
|
db_data = curs.fetchall()
|
|
db_data = curs.fetchall()
|
|
|
load_set_data = db_data[0][0] if db_data and db_data[0][0] != '' else 'sha3'
|
|
load_set_data = db_data[0][0] if db_data and db_data[0][0] != '' else 'sha3'
|
|
|
- set_data = db_data[0][0] if db_data and db_data[0][0] != '' else 'sha3'
|
|
|
|
|
|
|
|
|
|
|
|
+ set_data = load_set_data
|
|
|
if type_d != 'no':
|
|
if type_d != 'no':
|
|
|
- if type_d == '':
|
|
|
|
|
- set_data = 'sha3'
|
|
|
|
|
- else:
|
|
|
|
|
- set_data = type_d
|
|
|
|
|
|
|
+ set_data = 'sha3' if type_d == '' else type_d
|
|
|
|
|
|
|
|
re_data = 1 if pw_encode(data, set_data) == data2 else 0
|
|
re_data = 1 if pw_encode(data, set_data) == data2 else 0
|
|
|
if load_set_data != set_data and re_data == 1 and id_d != '':
|
|
if load_set_data != set_data and re_data == 1 and id_d != '':
|
|
|
- curs.execute(db_change("update user_set set data = ? where id = ? and name = 'pw'"), [
|
|
|
|
|
- pw_encode(data),
|
|
|
|
|
- id_d
|
|
|
|
|
- ])
|
|
|
|
|
- curs.execute(db_change("update user_set set data = ? where id = ? and name = 'encode'"), [
|
|
|
|
|
- load_set_data,
|
|
|
|
|
- id_d
|
|
|
|
|
- ])
|
|
|
|
|
|
|
+ curs.execute(db_change("update user_set set data = ? where id = ? and name = 'pw'"), [pw_encode(data), id_d])
|
|
|
|
|
+ curs.execute(db_change("update user_set set data = ? where id = ? and name = 'encode'"), [load_set_data, id_d])
|
|
|
|
|
|
|
|
return re_data
|
|
return re_data
|
|
|
|
|
|
|
@@ -1026,7 +1001,7 @@ def wiki_css(data):
|
|
|
data_css = ''
|
|
data_css = ''
|
|
|
data_css_add = ''
|
|
data_css_add = ''
|
|
|
|
|
|
|
|
- data_css_ver = '185'
|
|
|
|
|
|
|
+ data_css_ver = '186'
|
|
|
data_css_ver = '.cache_v' + data_css_ver
|
|
data_css_ver = '.cache_v' + data_css_ver
|
|
|
|
|
|
|
|
if 'main_css' in global_wiki_set:
|
|
if 'main_css' in global_wiki_set:
|
|
@@ -1293,7 +1268,7 @@ def load_skin(data = '', set_n = 0, default = 0):
|
|
|
return skin_return_data
|
|
return skin_return_data
|
|
|
|
|
|
|
|
# Func-markup
|
|
# Func-markup
|
|
|
-def render_set(doc_name = '', doc_data = '', data_type = 'view', data_in = '', doc_acl = ''):
|
|
|
|
|
|
|
+def render_set(doc_name = '', doc_data = '', data_type = 'view', data_in = '', doc_acl = '', markup = ''):
|
|
|
with get_db_connect() as conn:
|
|
with get_db_connect() as conn:
|
|
|
curs = conn.cursor()
|
|
curs = conn.cursor()
|
|
|
|
|
|
|
@@ -1329,7 +1304,7 @@ def render_set(doc_name = '', doc_data = '', data_type = 'view', data_in = '', d
|
|
|
if db_data and db_data[0][0] != '':
|
|
if db_data and db_data[0][0] != '':
|
|
|
render_lang_data['category'] = db_data[0][0]
|
|
render_lang_data['category'] = db_data[0][0]
|
|
|
|
|
|
|
|
- get_class_render = class_do_render(conn, render_lang_data).do_render(doc_name, doc_data, data_type, data_in)
|
|
|
|
|
|
|
+ get_class_render = class_do_render(conn, render_lang_data, markup).do_render(doc_name, doc_data, data_type, data_in)
|
|
|
|
|
|
|
|
if 'include' in get_class_render[2]:
|
|
if 'include' in get_class_render[2]:
|
|
|
for_a = 0
|
|
for_a = 0
|
|
@@ -1344,7 +1319,7 @@ def render_set(doc_name = '', doc_data = '', data_type = 'view', data_in = '', d
|
|
|
if acl_result == 0:
|
|
if acl_result == 0:
|
|
|
include_regex = re.compile('<div id="' + include_data[0] + '"><\\/div>')
|
|
include_regex = re.compile('<div id="' + include_data[0] + '"><\\/div>')
|
|
|
if re.search(include_regex, get_class_render[0]):
|
|
if re.search(include_regex, get_class_render[0]):
|
|
|
- include_data_render = class_do_render(conn, render_lang_data).do_render(include_data[1], include_data[2], data_type, include_data[0] + data_in)
|
|
|
|
|
|
|
+ include_data_render = class_do_render(conn, render_lang_data, markup).do_render(include_data[1], include_data[2], data_type, include_data[0] + data_in)
|
|
|
if len(include_data) > 3:
|
|
if len(include_data) > 3:
|
|
|
include_data_render[0] = '<div id="' + include_data[0] + '" ' + include_data[3] + '>' + include_data_render[0] + '</div>'
|
|
include_data_render[0] = '<div id="' + include_data[0] + '" ' + include_data[3] + '>' + include_data_render[0] + '</div>'
|
|
|
else:
|
|
else:
|