2du пре 4 година
родитељ
комит
15e9e58ec4
3 измењених фајлова са 9 додато и 11 уклоњено
  1. 0 4
      app.py
  2. 8 7
      route/tool/func.py
  3. 1 0
      views/main_css/js/render_onmark.js

+ 0 - 4
app.py

@@ -121,11 +121,7 @@ create_data['data'] = ['title', 'data', 'type']
 create_data['history'] = ['id', 'title', 'data', 'date', 'ip', 'send', 'leng', 'hide', 'type']
 create_data['rc'] = ['id', 'title', 'date', 'type']
 create_data['rd'] = ['title', 'sub', 'code', 'date', 'band', 'stop', 'agree', 'acl']
-# 제거 완료
-# create_data['user'] = ['id', 'pw', 'acl', 'date', 'encode']
 create_data['user_set'] = ['name', 'id', 'data']
-# 제거 완료
-# create_data['user_application'] = ['id', 'pw', 'date', 'encode', 'question', 'answer', 'ip', 'ua', 'token', 'email']
 create_data['topic'] = ['id', 'data', 'date', 'ip', 'block', 'top', 'code']
 create_data['rb'] = ['block', 'end', 'today', 'blocker', 'why', 'band', 'login', 'ongoing']
 create_data['back'] = ['title', 'link', 'type']

+ 8 - 7
route/tool/func.py

@@ -1229,26 +1229,28 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
 
     return 1
 
-def ban_check(ip = None, tool = None):
+def ban_check(ip = None, tool = ''):
     ip = ip_check() if not ip else ip
+    tool = '' if not tool else tool
 
     if admin_check(None, None, ip) == 1:
         return 0
 
     curs.execute(db_change(
-        "update rb set ongoing = '' where end < ? and end != '' and ongoing = '1'"
+        "update rb set ongoing = '' " + \
+        "where end < ? and end != '' and ongoing = '1'"
     ), [get_time()])
     conn.commit()
 
     curs.execute(db_change("" + \
         "select login, block from rb " + \
-        "where ((end > ? and end != '') or end = '') and band = 'regex' and ongoing = '1'" + \
+        "where band = 'regex' and ongoing = '1'" + \
     ""), [get_time()])
     regex_d = curs.fetchall()
     for test_r in regex_d:
         g_regex = re.compile(test_r[1])
         if g_regex.search(ip):
-            if tool and tool == 'login':
+            if tool == 'login':
                 if test_r[0] != 'O':
                     return 1
             else:
@@ -1256,13 +1258,12 @@ def ban_check(ip = None, tool = None):
 
     curs.execute(db_change("" + \
         "select login from rb " + \
-        "where ((end > ? and end != '') or end = '') and block = ? and " + \
-            "band = '' and ongoing = '1'" + \
+        "where block = ? and band = '' and ongoing = '1'" + \
         "" + \
     ""), [get_time(), ip])
     ban_d = curs.fetchall()
     if ban_d:
-        if tool and tool == 'login':
+        if tool == 'login':
             if ban_d[0][0] != 'O':
                 return 1
         else:

+ 1 - 0
views/main_css/js/render_onmark.js

@@ -1,5 +1,6 @@
 // 인터위키
 // 표 캡션
+// wiki 버그?
 // Tool
 function do_url_change(data) {
     return encodeURIComponent(data);