Kaynağa Gözat

이메일, 키 찾기 문구 설정 기능

Surplus_Up (2DU) 7 yıl önce
ebeveyn
işleme
6aca0736b8

+ 4 - 1
language/en-US.json

@@ -157,7 +157,7 @@
         "50_edit_acl" : "Only members with 50 or more all document edits",
         "all_acl" : "All Users",
         "encryption_method" : "Encryption method",
-        "check_key" : "Check Authentication Key",
+        "check_key" : "Check authentication key",
         "reset_user_ok" : "Check Success",
         "name_or_ip_or_regex" : "ID or IP or Regex",
         "ban_period" : "Period to block",
@@ -223,6 +223,9 @@
                 "register_text" : "Terms of sign-up",
                 "non_login_alert" : "Non-login alert",
                 "edit_bottom_text" : "Editing textarea bottom notice",
+                "Check authentication key" : "Check authentication key notice",
+                "email_title" : "Email subject",
+                "email_text" : "Email content",
             "_comment_2.2.4_" : "Google",
                 "recaptcha" : "reCAPTCHA",
                 "google_imap" : "Google IMAP",

+ 4 - 1
language/ko-KR.json

@@ -219,10 +219,13 @@
                 "email_required" : "이메일 필요",
                 "google_imap_required" : "Google IMAP 설정 필요",
                 "update_branch" : "업데이트를 가져올 브랜치",
-            "_comment_2.2.3_" : "문자열",
+            "_comment_2.2.3_" : "문",
                 "register_text" : "회원가입 정책",
                 "non_login_alert" : "비로그인 알림",
                 "edit_bottom_text" : "편집창 하단 문구",
+                "check_key_text" : "인증키 검사 문구",
+                "email_title" : "이메일 제목",
+                "email_text" : "이메일 내용",
             "_comment_2.2.4_" : "Google",
                 "recaptcha" : "reCAPTCHA",
                 "google_imap" : "Google IMAP",

+ 32 - 12
route/login_check_key.py

@@ -11,19 +11,37 @@ def login_check_key_2(conn, tool):
 
                 curs.execute("select id from user limit 1")
                 if not curs.fetchall():
-                    curs.execute("insert into user (id, pw, acl, date, encode) values (?, ?, 'owner', ?, ?)", [flask.session['c_id'], flask.session['c_pw'], get_time(), db_data[0][0]])
+                    curs.execute("insert into user (id, pw, acl, date, encode) values (?, ?, 'owner', ?, ?)", [
+                        flask.session['c_id'], 
+                        flask.session['c_pw'], 
+                        get_time(), 
+                        db_data[0][0]
+                    ])
 
                     first = 1
                 else:
-                    curs.execute("insert into user (id, pw, acl, date, encode) values (?, ?, 'user', ?, ?)", [flask.session['c_id'], flask.session['c_pw'], get_time(), db_data[0][0]])
+                    curs.execute("insert into user (id, pw, acl, date, encode) values (?, ?, 'user', ?, ?)", [
+                        flask.session['c_id'], 
+                        flask.session['c_pw'], 
+                        get_time(), 
+                        db_data[0][0]
+                    ])
 
                     first = 0
 
                 ip = ip_check()
                 agent = flask.request.headers.get('User-Agent')
 
-                curs.execute("insert into user_set (name, id, data) values ('email', ?, ?)", [flask.session['c_id'], flask.session['c_email']])
-                curs.execute("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')", [flask.session['c_id'], ip, agent, get_time()])
+                curs.execute("insert into user_set (name, id, data) values ('email', ?, ?)", [
+                    flask.session['c_id'], 
+                    flask.session['c_email']
+                ])
+                curs.execute("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')", [
+                    flask.session['c_id'], 
+                    ip, 
+                    agent, 
+                    get_time()]
+                )
 
                 flask.session['state'] = 1
                 flask.session['id'] = flask.session['c_id']
@@ -60,22 +78,24 @@ def login_check_key_2(conn, tool):
 
                 return easy_minify(flask.render_template(skin_check(),    
                     imp = [load_lang('reset_user_ok'), wiki_set(), custom(), other2([0, 0])],
-                    data =  '''
-                        ''' + load_lang('id') + '''
-                        <hr class=\"main_hr\">
-                        ''' + load_lang('id') + ' : ' + d_id + '''
-                        <br>
-                        ''' + load_lang('password') + ' : ' + pw + '''
-                    ''',
+                    data = load_lang('id') + ' : ' + d_id + '<br>' + load_lang('password') + ' : ' + pw,
                     menu = [['user', load_lang('return')]]
                 ))
             else:
                 return redirect('/pass_find')
     else:
+        curs.execute('select data from other where name = "check_key_text"')
+        sql_d = curs.fetchall()
+        if sql_d and sql_d[0][0] != '':
+            b_text = sql_d[0][0] + '<hr class=\"main_hr\">'
+        else:
+            b_text = ''
+
         return easy_minify(flask.render_template(skin_check(),    
-            imp = [load_lang('key_check'), wiki_set(), custom(), other2([0, 0])],
+            imp = [load_lang('check_key'), wiki_set(), custom(), other2([0, 0])],
             data =  '''
                 <form method="post">
+                    ''' + b_text + '''
                     <input placeholder="''' + load_lang('key') + '''" name="key" type="text">
                     <hr class=\"main_hr\">
                     <button type="submit">''' + load_lang('save') + '''</button>

+ 15 - 1
route/login_need_email.py

@@ -21,7 +21,21 @@ def login_need_email_2(conn, tool):
 
                             return redirect('/register')
                         else:
-                            send_email(flask.request.form.get('email', ''), wiki_set()[0] + '\'s Key', 'Key : ' + flask.session['c_key'])
+                            curs.execute('select data from other where name = "email_title"')
+                            sql_d = curs.fetchall()
+                            if sql_d and sql_d[0][0] != '':
+                                t_text = html.escape(sql_d[0][0])
+                            else:
+                                t_text = wiki_set()[0] + '\'s Key'
+
+                            curs.execute('select data from other where name = "email_text"')
+                            sql_d = curs.fetchall()
+                            if sql_d and sql_d[0][0] != '':
+                                i_text = html.escape(sql_d[0][0]) + '\n\nKey : ' + flask.session['c_key']
+                            else:
+                                i_text = 'Key : ' + flask.session['c_key']
+
+                            send_email(flask.request.form.get('email', ''), t_text, i_text)
                             flask.session['c_email'] = flask.request.form.get('email', '')
 
                             return redirect('/check_key')

+ 13 - 1
route/setting.py

@@ -192,7 +192,7 @@ def setting_2(conn, num):
 
             return redirect('/setting/2')
         else:
-            n_list = ['', '', '']
+            n_list = ['', '', '', '', '', '']
             d_list = []
             
             x = 0
@@ -227,6 +227,18 @@ def setting_2(conn, num):
                             <hr class=\"main_hr\">
                             <input type="text" name="edit_bottom_text" value="''' + html.escape(d_list[2]) + '''">
                             <hr class=\"main_hr\">
+                            <span>''' + load_lang('check_key_text') + ''' (HTML)</span>
+                            <hr class=\"main_hr\">
+                            <input type="text" name="check_key_text" value="''' + html.escape(d_list[3]) + '''">
+                            <hr class=\"main_hr\">
+                            <span>''' + load_lang('email_title') + '''</span>
+                            <hr class=\"main_hr\">
+                            <input type="text" name="email_title" value="''' + html.escape(d_list[4]) + '''">
+                            <hr class=\"main_hr\">
+                            <span>''' + load_lang('email_text') + '''</span>
+                            <hr class=\"main_hr\">
+                            <input type="text" name="email_text" value="''' + html.escape(d_list[5]) + '''">
+                            <hr class=\"main_hr\">
                             <button id="save" type="submit">''' + load_lang('save') + '''</button>
                         </form>
                         ''',

+ 1 - 1
route/tool/func.py

@@ -194,7 +194,7 @@ def update():
     except:
         pass
 
-    # Start : Data Migration Code
+    # Start : Data migration code
     app_var = json.loads(open(os.path.abspath('./data/app_variables.json'), encoding='utf-8').read())
 
     if os.path.exists('image'):