|
@@ -4,11 +4,13 @@ def inter_wiki_add(tool, name = None):
|
|
|
with get_db_connect() as conn:
|
|
with get_db_connect() as conn:
|
|
|
curs = conn.cursor()
|
|
curs = conn.cursor()
|
|
|
|
|
|
|
|
- if not name:
|
|
|
|
|
- if tool == 'plus_edit_filter':
|
|
|
|
|
- return redirect('/manager/9')
|
|
|
|
|
|
|
+ if not name and tool == 'plus_edit_filter':
|
|
|
|
|
+ return redirect('/manager/9')
|
|
|
|
|
|
|
|
if flask.request.method == 'POST':
|
|
if flask.request.method == 'POST':
|
|
|
|
|
+ if admin_check() != 1:
|
|
|
|
|
+ return re_error('/error/3')
|
|
|
|
|
+
|
|
|
if tool == 'plus_inter_wiki':
|
|
if tool == 'plus_inter_wiki':
|
|
|
if name:
|
|
if name:
|
|
|
curs.execute(db_change("delete from html_filter where html = ? and kind = 'inter_wiki'"), [name])
|
|
curs.execute(db_change("delete from html_filter where html = ? and kind = 'inter_wiki'"), [name])
|
|
@@ -88,10 +90,11 @@ def inter_wiki_add(tool, name = None):
|
|
|
type_d
|
|
type_d
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
- curs.execute(db_change('insert into html_filter (html, kind, plus) values (?, ?, ?)'), [
|
|
|
|
|
|
|
+ curs.execute(db_change('insert into html_filter (html, kind, plus, plus_t) values (?, ?, ?, ?)'), [
|
|
|
flask.request.form.get('title', 'test'),
|
|
flask.request.form.get('title', 'test'),
|
|
|
type_d,
|
|
type_d,
|
|
|
- plus_d
|
|
|
|
|
|
|
+ plus_d,
|
|
|
|
|
+ ''
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
conn.commit()
|
|
conn.commit()
|
|
@@ -99,10 +102,7 @@ def inter_wiki_add(tool, name = None):
|
|
|
return redirect('/' + re.sub(r'^plus_', '', tool))
|
|
return redirect('/' + re.sub(r'^plus_', '', tool))
|
|
|
else:
|
|
else:
|
|
|
get_sub = 0
|
|
get_sub = 0
|
|
|
- if admin_check() != 1:
|
|
|
|
|
- stat = 'disabled'
|
|
|
|
|
- else:
|
|
|
|
|
- stat = ''
|
|
|
|
|
|
|
+ stat = 'disabled' if admin_check() != 1 else ''
|
|
|
|
|
|
|
|
if tool == 'plus_inter_wiki':
|
|
if tool == 'plus_inter_wiki':
|
|
|
if name:
|
|
if name:
|
|
@@ -163,9 +163,9 @@ def inter_wiki_add(tool, name = None):
|
|
|
form_data = '''
|
|
form_data = '''
|
|
|
<script>function insert_v(name, data) { document.getElementById(name).value = data; }</script>''' + insert_data + '''
|
|
<script>function insert_v(name, data) { document.getElementById(name).value = data; }</script>''' + insert_data + '''
|
|
|
<hr class="main_hr">
|
|
<hr class="main_hr">
|
|
|
- <input ''' + stat + ''' placeholder="''' + load_lang('second') + '''" id="second" name="second" type="text" value="''' + html.escape(time_data) + '''">
|
|
|
|
|
|
|
+ <input placeholder="''' + load_lang('second') + '''" id="second" name="second" type="text" value="''' + html.escape(time_data) + '''">
|
|
|
<hr class="main_hr">
|
|
<hr class="main_hr">
|
|
|
- <input ''' + stat + ''' placeholder="''' + load_lang('regex') + '''" name="content" value="''' + html.escape(textarea) + '''" type="text">
|
|
|
|
|
|
|
+ <input placeholder="''' + load_lang('regex') + '''" name="content" value="''' + html.escape(textarea) + '''" type="text">
|
|
|
'''
|
|
'''
|
|
|
elif tool == 'plus_name_filter':
|
|
elif tool == 'plus_name_filter':
|
|
|
title = load_lang('id_filter_add')
|
|
title = load_lang('id_filter_add')
|