Преглед изворни кода

https://github.com/openNAMU/openNAMU/issues/1583

잉여개발기 (SPDV) пре 2 година
родитељ
комит
33b195da45
2 измењених фајлова са 7 додато и 2 уклоњено
  1. 6 1
      route/give_auth.py
  2. 1 1
      version.json

+ 6 - 1
route/give_auth.py

@@ -4,6 +4,7 @@ def give_auth(name):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
+        ip = ip_check()
         owner_auth = admin_check()
         admin_auth = admin_check(7)
 
@@ -19,7 +20,7 @@ def give_auth(name):
             if curs.fetchall():
                 return re_error('/error/3')
 
-            if ip_check() == name:
+            if ip == name:
                 return re_error('/error/3')
 
         if flask.request.method == 'POST':
@@ -40,6 +41,10 @@ def give_auth(name):
             time_limit = flask.request.form.get('date', '')
             if re.search(r'^[0-9]{4}-[0-9]{2}-[0-9]{2}$', time_limit):
                 curs.execute(db_change("insert into user_set (id, name, data) values (?, 'auth_date', ?)"), [name, time_limit])
+            else:
+                time_limit = ''
+
+            add_alarm(name, ip, 'Auth change to ' + select_data + (' (' + time_limit + ')' if time_limit != '' else ''))
 
             conn.commit()
 

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.5.0-dev4",
+        "r_ver" : "v3.5.0-dev5",
         "c_ver" : "3500374",
         "s_ver" : "3500113"
     }