ソースを参照

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

잉여개발기 (SPDV) 2 年 前
コミット
fce60991ae
5 ファイル変更26 行追加6 行削除
  1. 11 0
      app.py
  2. 1 1
      lang/en-US.json
  3. 1 1
      lang/ko-KR.json
  4. 12 3
      route/main_setting_main.py
  5. 1 1
      version.json

+ 11 - 0
app.py

@@ -295,6 +295,17 @@ def do_every_day():
             if time_today > time_db:
                 curs.execute(db_change("delete from acl where title = ? and type = ?"), [for_a[0], for_a[1]])
                 curs.execute(db_change("delete from data_set where doc_name = ? and doc_rev = ? and set_name = 'acl_date'"), [for_a[0], for_a[1]])
+                
+        # ua 관리
+        curs.execute(db_change('select data from other where name = "ua_expiration_date"'))
+        db_data = curs.fetchall()
+        if db_data and db_data[0][0] != '':
+            time_db = int(number_check(db_data[0][0]))
+            
+            time_calc = datetime.date.today() - datetime.timedelta(days = time_db)
+            time_calc = time_calc.strftime('%Y-%m-%d %H:%M:%S')
+            
+            curs.execute(db_change("delete from ua_d where today < ?"), [time_calc])
 
         # 사이트맵 생성 관리
         curs.execute(db_change('select data from other where name = "sitemap_auto_make"'))

+ 1 - 1
lang/en-US.json

@@ -381,7 +381,7 @@
                 "requires_approval" : "Requires approval for register",
                 "approval_question": "Registeration questions",
                 "backup_where" : "Backup location",
-                "ua_get_off" : "Turn off members information collection",
+                "ua_get_off" : "Turn off UA collection",
                 "edit_bottom_compulsion" : "Edit reason required",
                 "edit_bottom_compulsion_acl" : "Edit reason required excluded target ACL",
                 "enable_comment_function" : "Using the comment function",

+ 1 - 1
lang/ko-KR.json

@@ -383,7 +383,7 @@
     "input_email_error": "입력 값에 문제가 있습니다.",
     "short_page": "짧은 문서 목록",
     "long_page": "긴 문서 목록",
-    "ua_get_off": "가입자 정보 수집 끄기",
+    "ua_get_off": "UA 수집 끄기",
     "ext_api_req_set": "외부 API 필요 설정",
     "oauth": "OAuth",
     "basic_set": "기본 설정",

+ 12 - 3
route/main_setting_main.py

@@ -42,7 +42,8 @@ def main_setting_main(db_set):
             38 : ['slow_thread', ''],
             39 : ['edit_timeout', '5'],
             40 : ['document_content_max_length', ''],
-            41 : ['backup_count', '']
+            41 : ['backup_count', ''],
+            42 : ['ua_expiration_date', '']
         }
 
         if flask.request.method == 'POST':
@@ -160,6 +161,7 @@ def main_setting_main(db_set):
                         
                         <input type="checkbox" name="wiki_access_password_need" ''' + check_box_div[8] + '''> ''' + load_lang('set_wiki_access_password_need') + ''' (''' + load_lang('restart_required') + ''')
                         <hr class="main_hr">
+                        
                         <span>''' + load_lang('set_wiki_access_password') + '''</span> (''' + load_lang('restart_required') + ''')
                         <hr class="main_hr">
                         <input type="password" name="wiki_access_password" value="''' + html.escape(d_list[32]) + '''">
@@ -196,12 +198,19 @@ def main_setting_main(db_set):
                         <input type="checkbox" name="requires_approval" ''' + check_box_div[3] + '''> ''' + load_lang('requires_approval') + '''
                         <hr class="main_hr">
 
+                        <span>''' + load_lang('password_min_length') + '''</span> (''' + load_lang('off') + ''' : ''' + load_lang('empty') + ''')
+                        <hr class="main_hr">
+                        <input name="password_min_length" value="''' + html.escape(d_list[30]) + '''">
+
+                        <h3>''' + load_lang('ua') + '''</h3>
+                        
                         <input type="checkbox" name="ua_get" ''' + check_box_div[4] + '''> ''' + load_lang('ua_get_off') + '''
                         <hr class="main_hr">
                         
-                        <span>''' + load_lang('password_min_length') + '''</span> (''' + load_lang('off') + ''' : ''' + load_lang('empty') + ''')
+                        <span>''' + load_lang('ua_expiration_date') + '''</span> (''' + load_lang('day') + ''') (''' + load_lang('off') + ''' : ''' + load_lang('empty') + ''')
+                        <hr class="main_hr">
+                        <input name="ua_expiration_date" value="''' + html.escape(d_list[42]) + '''">
                         <hr class="main_hr">
-                        <input name="password_min_length" value="''' + html.escape(d_list[30]) + '''">
                         
                         <h2>''' + load_lang('server_set') + '''</h2>
 

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.6-RC5-dev75",
+        "r_ver" : "v3.4.6-RC5-dev76",
         "c_ver" : "3500373",
         "s_ver" : "3500112"
     }