Surplus_Up (2DU) hace 7 años
padre
commit
a30aee4ea0
Se han modificado 2 ficheros con 12 adiciones y 2 borrados
  1. 1 2
      app.py
  2. 11 0
      func.py

+ 1 - 2
app.py

@@ -3205,8 +3205,7 @@ def read_view(name = None):
         if test and test[0][0] != 'user':
             acl = ' (' + load_lang('admin') + ')'
         else:
-            curs.execute("select block from ban where block = ?", [g[0]])
-            if curs.fetchall():
+            if ban_check(g[0]) == 1:
                 sub += ' (' + load_lang('ban') + ')'
             else:
                 acl = ''

+ 11 - 0
func.py

@@ -202,6 +202,17 @@ def ip_warring():
         text_data = ''
 
     return text_data
+    
+def ban_check(data):
+    curs.execute("select end from ban where block = ?", [data])
+    data = curs.fetchall()
+    if data:
+        if data[0][0] > get_time():
+            return 1
+        else:
+            return 0
+    else:
+        return 0
 
 def skin_check():
     skin = './views/acme/'