2du 4 years ago
parent
commit
142fdaf4ef
4 changed files with 54 additions and 12 deletions
  1. 17 8
      app.py
  2. 1 1
      route/main_upload.py
  3. 27 0
      route/recent_history_send.py
  4. 9 3
      route/recent_history_tool.py

+ 17 - 8
app.py

@@ -130,28 +130,31 @@ create_data['history'] = ['id', 'title', 'data', 'date', 'ip', 'send', 'leng', '
 create_data['rc'] = ['id', 'title', 'date', 'type']
 create_data['rc'] = ['id', 'title', 'date', 'type']
 create_data['acl'] = ['title', 'data', 'type']
 create_data['acl'] = ['title', 'data', 'type']
 
 
-# 폐지 예정 (topic_set으로 통합)
+# 개편 예정 (data_link로 변경)
+create_data['back'] = ['title', 'link', 'type']
+
+# 폐지 예정 (topic_set으로 통합) [가장 시급]
 create_data['rd'] = ['title', 'sub', 'code', 'date', 'band', 'stop', 'agree', 'acl']
 create_data['rd'] = ['title', 'sub', 'code', 'date', 'band', 'stop', 'agree', 'acl']
 create_data['topic'] = ['id', 'data', 'date', 'ip', 'block', 'top', 'code']
 create_data['topic'] = ['id', 'data', 'date', 'ip', 'block', 'top', 'code']
 
 
 # 폐지 예정 (user_set으로 통합)
 # 폐지 예정 (user_set으로 통합)
 create_data['rb'] = ['block', 'end', 'today', 'blocker', 'why', 'band', 'login', 'ongoing']
 create_data['rb'] = ['block', 'end', 'today', 'blocker', 'why', 'band', 'login', 'ongoing']
+create_data['scan'] = ['user', 'title', 'type']
 
 
-create_data['back'] = ['title', 'link', 'type']
-
+# 개편 예정 (wiki_set과 wiki_filter과 wiki_vote으로 변경)
 create_data['other'] = ['name', 'data', 'coverage']
 create_data['other'] = ['name', 'data', 'coverage']
+create_data['html_filter'] = ['html', 'kind', 'plus', 'plus_t']
+create_data['vote'] = ['name', 'id', 'subject', 'data', 'user', 'type', 'acl']
 
 
+# 개편 예정 (auth_list와 auth_log로 변경)
 create_data['alist'] = ['name', 'acl']
 create_data['alist'] = ['name', 'acl']
 create_data['re_admin'] = ['who', 'what', 'time']
 create_data['re_admin'] = ['who', 'what', 'time']
 
 
+# 개편 예정 (user_notice와 user_agent로 변경)
 create_data['alarm'] = ['name', 'data', 'date']
 create_data['alarm'] = ['name', 'data', 'date']
 create_data['ua_d'] = ['name', 'ip', 'ua', 'today', 'sub']
 create_data['ua_d'] = ['name', 'ip', 'ua', 'today', 'sub']
-create_data['user_set'] = ['name', 'id', 'data']
-
-create_data['scan'] = ['user', 'title', 'type']
 
 
-create_data['html_filter'] = ['html', 'kind', 'plus', 'plus_t']
-create_data['vote'] = ['name', 'id', 'subject', 'data', 'user', 'type', 'acl']
+create_data['user_set'] = ['name', 'id', 'data']
 for create_table in create_data:
 for create_table in create_data:
     try:
     try:
         curs.execute(db_change('select test from ' + create_table + ' limit 1'))
         curs.execute(db_change('select test from ' + create_table + ' limit 1'))
@@ -450,6 +453,12 @@ def recent_history_delete(name = 'Test', rev = 1):
 def recent_history_hidden(name = 'Test', rev = 1):
 def recent_history_hidden(name = 'Test', rev = 1):
     return recent_history_hidden_2(conn, name, rev)
     return recent_history_hidden_2(conn, name, rev)
 
 
+'''
+@app.route('/history/send/<int(signed=True):rev>/<everything:name>')
+def recent_history_send(name = 'Test', rev = 1):
+    return recent_history_send_2(conn, name, rev)
+'''
+
 @app.route('/history/reset/<everything:name>', methods = ['POST', 'GET'])
 @app.route('/history/reset/<everything:name>', methods = ['POST', 'GET'])
 def recent_history_reset(name = 'Test'):
 def recent_history_reset(name = 'Test'):
     return recent_history_reset_2(conn, name)
     return recent_history_reset_2(conn, name)

+ 1 - 1
route/main_upload.py

@@ -137,7 +137,7 @@ def main_upload_2(conn):
         return easy_minify(flask.render_template(skin_check(),
         return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('upload'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
             imp = [load_lang('upload'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
             data = '''
             data = '''
-                <a href="/file_filter">(''' + load_lang('file_filter_list') + ''')</a>
+                <a href="/file_filter">(''' + load_lang('file_filter_list') + ''')</a> <a href="/extension_filter">(''' + load_lang('extension_filter_list') + ''')</a>
                 ''' + upload_help + '''
                 ''' + upload_help + '''
                 <hr class="main_hr">
                 <hr class="main_hr">
                 ''' + load_lang('max_file_size') + ''' : ''' + wiki_set(3) + '''MB
                 ''' + load_lang('max_file_size') + ''' : ''' + wiki_set(3) + '''MB

+ 27 - 0
route/recent_history_send.py

@@ -0,0 +1,27 @@
+from .tool.func import *
+
+def recent_record_send_2(conn, name):
+    curs = conn.cursor()
+
+    if admin_check() != 1:
+        return re_error('/error/3')
+
+    if flask.request.method == 'POST':
+        admin_check(None, 'record reset ' + name)
+
+        curs.execute(db_change("delete from history where ip = ?"), [name])
+        conn.commit()
+
+        return redirect('/record/' + url_pas(name))
+    else:
+        return easy_minify(flask.render_template(skin_check(),
+            imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('record_reset') + ')', 0])],
+            data = '''
+                <form method="post">
+                    <span>''' + load_lang('history_delete_warning') + '''</span>
+                    <hr class="main_hr">
+                    <button type="submit">''' + load_lang('record_reset') + '''</button>
+                </form>
+            ''',
+            menu = [['history/' + url_pas(name), load_lang('return')]]
+        ))

+ 9 - 3
route/recent_history_tool.py

@@ -19,8 +19,11 @@ def recent_history_tool_2(conn, name, rev):
         data += '<li><a href="/diff/' + url_pas(name) + '?first=' + str(rev - 1) + '&second=' + num + '">' + load_lang('compare') + '</a></li>'
         data += '<li><a href="/diff/' + url_pas(name) + '?first=' + str(rev - 1) + '&second=' + num + '">' + load_lang('compare') + '</a></li>'
 
 
     data += '<li><a href="/history/' + url_pas(name) + '">' + load_lang('history') + '</a></li>'
     data += '<li><a href="/history/' + url_pas(name) + '">' + load_lang('history') + '</a></li>'
-
+    data += '</ul>'
+    
     if admin_check(6) == 1:
     if admin_check(6) == 1:
+        data += '<h3>admin</h3>'
+        data += '<ul>'
         curs.execute(db_change('' + \
         curs.execute(db_change('' + \
             'select title from history ' + \
             'select title from history ' + \
             'where title = ? and id = ? and hide = "O"' + \
             'where title = ? and id = ? and hide = "O"' + \
@@ -32,11 +35,14 @@ def recent_history_tool_2(conn, name, rev):
             data += load_lang('hide')
             data += load_lang('hide')
             
             
         data += '</li>'
         data += '</li>'
+        data += '</ul>'
 
 
     if admin_check() == 1:
     if admin_check() == 1:
+        data += '<h3>owner</h3>'
+        data += '<ul>'
         data += '<li><a href="/history/delete/' + num + '/' + url_pas(name) + '">' + load_lang('history_delete') + '</li>'
         data += '<li><a href="/history/delete/' + num + '/' + url_pas(name) + '">' + load_lang('history_delete') + '</li>'
-
-    data += '</ul>'
+        data += '<li><a href="/history/send/' + num + '/' + url_pas(name) + '">' + load_lang('send_edit') + '</li>'
+        data += '</ul>'
 
 
     return easy_minify(flask.render_template(skin_check(),
     return easy_minify(flask.render_template(skin_check(),
         imp = [name, wiki_set(), wiki_custom(), wiki_css(['(r' + num + ')', 0])],
         imp = [name, wiki_set(), wiki_custom(), wiki_css(['(r' + num + ')', 0])],