Kaynağa Gözat

중복 회원가입 신청 방지

https://github.com/openNAMU/openNAMU/issues/1931
잉여개발기 (SPDV) 2 yıl önce
ebeveyn
işleme
18f305259b

+ 2 - 1
lang/en-US.json

@@ -560,7 +560,7 @@
         "enter_html" : "Please enter HTML",
         "exp_edit_conflict" : "Editing conflict occurred",
         "same_ip_exist" : "Same IP exists",
-        "old_page_warring" : "This page is out of date.",
+        "" : "",
         "_comment_3.1_" : "Error",
             "update_error" : "Auto update is not supported.",
             "inter_error" : "Internal error.",
@@ -612,6 +612,7 @@
             "user_css_warning" : "If you have a problem using this, connect here.",
             "main_css_warning" : "If you have a problem using this, use the emergency tool.",
             "not_support_skin_warning" : "It does not work on skins that do not support this feature.",
+            "old_page_warring" : "This page is out of date.",
         "_comment_" : "Challenge",
             "challenge_title_register" : "Hello, World!",
             "challenge_info_register" : "Sign up",

+ 21 - 53
route/login_find_email_check.py

@@ -5,28 +5,24 @@ def login_find_email_check(tool):
     with get_db_connect() as conn:
         curs = conn.cursor()
         
-        if  flask.request.method == 'POST' or \
-            ('c_key' in flask.session and flask.session['c_key'] == 'email_pass'):
+        if flask.request.method == 'POST' or ('c_key' in flask.session and flask.session['c_key'] == 'email_pass'):
             re_set_list = ['c_id', 'c_pw', 'c_ans', 'c_que', 'c_key', 'c_type', 'c_email']
+
             ip = ip_check()
+            
             input_key = flask.request.form.get('key', '')
             user_agent = flask.request.headers.get('User-Agent', '')
         
-            if  'c_type' in flask.session and \
-                flask.session['c_type'] == 'pass_find' and \
-                flask.session['c_key'] == input_key:
-                curs.execute(db_change("update user_set set data = ? where name = 'pw' and id = ?"), [
-                    pw_encode(flask.session['c_key']), 
-                    flask.session['c_id']
-                ])
+            if 'c_type' in flask.session and flask.session['c_type'] == 'pass_find' and flask.session['c_key'] == input_key:
+                user_id = flask.session['c_id']
+                user_pw = flask.session['c_key']
+            
+                curs.execute(db_change("update user_set set data = ? where name = 'pw' and id = ?"), [pw_encode(user_pw), user_id])
                 
                 curs.execute(db_change('select data from user_set where name = "2fa" and id = ?'), [user_id])
                 if curs.fetchall():
                     curs.execute(db_change("update user_set set data = '' where name = '2fa' and id = ?"), [user_id])
         
-                user_id = flask.session['c_id']
-                user_pw = flask.session['c_key']
-        
                 for i in re_set_list:
                     flask.session.pop(i, None)
         
@@ -46,8 +42,7 @@ def login_find_email_check(tool):
                     '',
                     menu = [['user', load_lang('return')]]
                 ))
-            elif    'c_type' in flask.session and \
-                    (flask.session['c_key'] == input_key or flask.session['c_key'] == 'email_pass'):
+            elif 'c_type' in flask.session and (flask.session['c_key'] == input_key or flask.session['c_key'] == 'email_pass'):
                 curs.execute(db_change('select data from other where name = "encode"'))
                 db_data = curs.fetchall()
         
@@ -58,27 +53,21 @@ def login_find_email_check(tool):
                     curs.execute(db_change("select id from user_set limit 1"))
                     first = 1 if not curs.fetchall() else 0
         
-                    curs.execute(db_change("select id from user_set where id = ?"), [
-                        flask.session['c_id']
-                    ])
+                    curs.execute(db_change("select id from user_set where id = ?"), [flask.session['c_id']])
                     if curs.fetchall():
                         for i in re_set_list:
                             flask.session.pop(i, None)
         
-                        return re_error('/error/6')
+                        return re_error('/error/8')
                 
-                    curs.execute(db_change("select id from user_set where id = ? and name = 'application'"), [
-                        flask.session['c_id']
-                    ])
+                    curs.execute(db_change("select id from user_set where id = ? and name = 'application'"), [flask.session['c_id']])
                     if curs.fetchall():
                         for i in re_set_list:
                             flask.session.pop(i, None)
         
-                        return re_error('/error/6')
+                        return re_error('/error/8')
         
-                    curs.execute(db_change(
-                        'select data from other where name = "requires_approval"'
-                    ))
+                    curs.execute(db_change('select data from other where name = "requires_approval"'))
                     requires_approval = curs.fetchall()
                     if requires_approval and requires_approval[0][0] == 'on':
                         user_app_data = {}
@@ -92,13 +81,7 @@ def login_find_email_check(tool):
                         user_app_data['ua'] = user_agent
                         user_app_data['email'] = flask.session['c_email']
                         
-                        curs.execute(db_change(
-                            "insert into user_set (id, name, data) values (?, ?, ?)"
-                        ), [
-                            flask.session['c_id'],
-                            'application',
-                            json.dumps(user_app_data)
-                        ])
+                        curs.execute(db_change("insert into user_set (id, name, data) values (?, ?, ?)"), [flask.session['c_id'], 'application', json.dumps(user_app_data)])
                         conn.commit()
         
                         for i in re_set_list:
@@ -111,27 +94,12 @@ def login_find_email_check(tool):
                         else:
                             user_auth = 'owner'
                         
-                        curs.execute(db_change("insert into user_set (id, name, data) values (?, 'pw', ?)"), [
-                            flask.session['c_id'],
-                            flask.session['c_pw']
-                        ])
-                        curs.execute(db_change("insert into user_set (id, name, data) values (?, 'acl', ?)"), [
-                            flask.session['c_id'],
-                            user_auth
-                        ])
-                        curs.execute(db_change("insert into user_set (id, name, data) values (?, 'date', ?)"), [
-                            flask.session['c_id'],
-                            get_time()
-                        ])
-                        curs.execute(db_change("insert into user_set (id, name, data) values (?, 'encode', ?)"), [
-                            flask.session['c_id'],
-                            db_data[0][0]
-                        ])
-        
-                    curs.execute(db_change("insert into user_set (name, id, data) values ('email', ?, ?)"), [
-                        flask.session['c_id'],
-                        flask.session['c_email']
-                    ])
+                        curs.execute(db_change("insert into user_set (id, name, data) values (?, 'pw', ?)"), [flask.session['c_id'], flask.session['c_pw']])
+                        curs.execute(db_change("insert into user_set (id, name, data) values (?, 'acl', ?)"), [flask.session['c_id'], user_auth])
+                        curs.execute(db_change("insert into user_set (id, name, data) values (?, 'date', ?)"), [flask.session['c_id'], get_time()])
+                        curs.execute(db_change("insert into user_set (id, name, data) values (?, 'encode', ?)"), [flask.session['c_id'], db_data[0][0]])
+        
+                    curs.execute(db_change("insert into user_set (name, id, data) values ('email', ?, ?)"), [flask.session['c_id'], flask.session['c_email']])
                     ua_plus(flask.session['c_id'], ip, user_agent, get_time())
         
                     flask.session['id'] = flask.session['c_id']

+ 0 - 5
route/login_register.py

@@ -47,11 +47,6 @@ def login_register_2():
             if do_user_name_check(user_id) == 1:
                 return re_error('/error/8')
 
-            # 중복 확인
-            curs.execute(db_change("select id from user_set where id = ?"), [user_id])
-            if curs.fetchall():
-                return re_error('/error/6')
-
             if admin != 1:
                 # 이메일 필요시 /register/email로 발송
                 curs.execute(db_change('select data from other where name = "email_have"'))

+ 21 - 13
route/login_register_submit.py

@@ -4,24 +4,35 @@ def login_register_submit_2():
     with get_db_connect() as conn:
         curs = conn.cursor()
 
+        session_reset_list = ['submit_id', 'submit_pw', 'submit_email']
+
         if not 'submit_id' in flask.session:
+            for for_a in session_reset_list:
+                flask.session.pop(for_a, None)
+
             return redirect('/register')
 
         curs.execute(db_change('select data from other where name = "approval_question"'))
         sql_data = curs.fetchall()
         if not sql_data:
+            for for_a in session_reset_list:
+                flask.session.pop(for_a, None)
+
             return redirect('/register')
 
         data_que = sql_data[0][0]
 
+        if do_user_name_check(flask.session['submit_id']) == 1:
+            for for_a in session_reset_list:
+                flask.session.pop(for_a, None)
+        
+            return redirect('/register')
+
         if flask.request.method == 'POST':
             curs.execute(db_change('select data from other where name = "encode"'))
             data_encode = curs.fetchall()
             data_encode = data_encode[0][0]
 
-            user_ip = ip_check()
-            user_agent = flask.request.headers.get('User-Agent', '')
-
             user_app_data = {}
             user_app_data['id'] = flask.session['submit_id']
             user_app_data['pw'] = pw_encode(flask.session['submit_pw'])
@@ -34,19 +45,16 @@ def login_register_submit_2():
             else:
                 user_app_data['email'] = ''
 
-            curs.execute(db_change(
-                "insert into user_set (id, name, data) values (?, ?, ?)"
-            ), [
-                flask.session['submit_id'],
-                'application',
-                json.dumps(user_app_data)
-            ])
+            for for_a in session_reset_list:
+                flask.session.pop(for_a, None)
+
+            curs.execute(db_change("insert into user_set (id, name, data) values (?, ?, ?)"), [user_app_data['id'], 'application', json.dumps(user_app_data)])
             conn.commit()
-            
+
             for for_a in get_admin_list():
-                add_alarm(for_a, flask.session['submit_id'], '<a href="/app_submit">' + load_lang('new_application') + '</a>')
+                add_alarm(for_a, user_app_data['id'], '<a href="/app_submit">' + load_lang('new_application') + '</a>')
 
-            return redirect('/')
+            return re_error('/error/43')
         else:
             return easy_minify(flask.render_template(skin_check(),
                 imp = [load_lang('approval_question'), wiki_set(), wiki_custom(), wiki_css([0, 0])],

+ 9 - 38
route/recent_app_submit.py

@@ -12,9 +12,7 @@ def recent_app_submit_2():
             div += load_lang('approval_requirement_disabled')
 
         if flask.request.method == 'GET':
-            curs.execute(db_change(
-                'select data from user_set where name = "application"'
-            ))
+            curs.execute(db_change('select data from user_set where name = "application"'))
             db_data = curs.fetchall()
             if db_data:
                 div += '' + \
@@ -98,49 +96,22 @@ def recent_app_submit_2():
                 return re_error('/ban')
 
             if flask.request.form.get('approve', '') != '':
-                curs.execute(db_change(
-                    'select data from user_set where id = ? and name = "application"'
-                ), [
-                    flask.request.form.get('approve', '')
-                ])
+                curs.execute(db_change('select data from user_set where id = ? and name = "application"'), [flask.request.form.get('approve', '')])
                 application = curs.fetchall()
                 if not application:
                     return re_error('/error/26')
                 else:
                     application = json.loads(application[0][0])
 
-                add_user(
-                    application['id'], 
-                    application['pw'],
-                    application['email'],
-                    application['encode']
-                )
-
-                curs.execute(db_change(
-                    "insert into user_set (name, id, data) values ('approval_question', ?, ?)"
-                ), [
-                    application['id'], 
-                    application['question']
-                ])
-                curs.execute(db_change(
-                    "insert into user_set (name, id, data) values ('approval_question_answer', ?, ?)"
-                ), [
-                    application['id'], 
-                    application['answer']
-                ])
-
-                curs.execute(db_change(
-                    'delete from user_set where id = ? and name = "application"'
-                ), [
-                    application['id']
-                ])
+                add_user(application['id'], application['pw'], application['email'], application['encode'])
+
+                curs.execute(db_change("insert into user_set (name, id, data) values ('approval_question', ?, ?)"), [application['id'], application['question']])
+                curs.execute(db_change("insert into user_set (name, id, data) values ('approval_question_answer', ?, ?)"), [application['id'], application['answer']])
+
+                curs.execute(db_change('delete from user_set where id = ? and name = "application"'), [application['id']])
                 conn.commit()
             elif flask.request.form.get('decline', '') != '':
-                curs.execute(db_change(
-                    'delete from user_set where id = ? and name = "application"'
-                ), [
-                    flask.request.form.get('decline', '')
-                ])
+                curs.execute(db_change('delete from user_set where id = ? and name = "application"'), [flask.request.form.get('decline', '')])
                 conn.commit()
 
             return redirect('/app_submit')

+ 68 - 147
route/tool/func.py

@@ -358,27 +358,13 @@ def update(ver_num, set_data):
             curs.execute(db_change("select html from html_filter where kind = 'extension'"))
             if not curs.fetchall():
                 for i in ['jpg', 'jpeg', 'png', 'gif', 'webp']:
-                    curs.execute(db_change(
-                        "insert into html_filter (html, kind) values (?, 'extension')"
-                    ), [i])
+                    curs.execute(db_change("insert into html_filter (html, kind) values (?, 'extension')"), [i])
 
         if ver_num < 3170400:
             curs.execute(db_change("select title, sub, code from topic where id = '1'"))
             for i in curs.fetchall():
-                curs.execute(db_change(
-                    "update topic set code = ? where title = ? and sub = ?"
-                ), [
-                    i[2], 
-                    i[0], 
-                    i[1]
-                ])
-                curs.execute(db_change(
-                    "update rd set code = ? where title = ? and sub = ?"
-                ), [
-                    i[2], 
-                    i[0], 
-                    i[1]
-                ])
+                curs.execute(db_change("update topic set code = ? where title = ? and sub = ?"), [i[2], i[0], i[1]])
+                curs.execute(db_change("update rd set code = ? where title = ? and sub = ?"), [i[2], i[0], i[1]])
 
         if ver_num < 3171800:
             curs.execute(db_change("select data from other where name = 'recaptcha'"))
@@ -386,9 +372,7 @@ def update(ver_num, set_data):
             if change_rec and change_rec[0][0] != '':
                 new_rec = re.search(r'data-sitekey="([^"]+)"', change_rec[0][0])
                 if new_rec:
-                    curs.execute(db_change(
-                        "update other set data = ? where name = 'recaptcha'"
-                    ), [new_rec.group(1)])
+                    curs.execute(db_change("update other set data = ? where name = 'recaptcha'"), [new_rec.group(1)])
                 else:
                     curs.execute(db_change("update other set data = '' where name = 'recaptcha'"))
                     curs.execute(db_change("update other set data = '' where name = 'sec_re'"))
@@ -403,56 +387,24 @@ def update(ver_num, set_data):
         if ver_num < 3183603:
             curs.execute(db_change("select block from ban where band = 'O'"))
             for i in curs.fetchall():
-                curs.execute(db_change(
-                    "update ban set block = ?, band = 'regex' where block = ? and band = 'O'"
-                ), [
-                    '^' + i[0].replace('.', '\\.'),
-                    i[0]
-                ])
+                curs.execute(db_change("update ban set block = ?, band = 'regex' where block = ? and band = 'O'"), ['^' + i[0].replace('.', '\\.'), i[0]])
 
             curs.execute(db_change("select block from rb where band = 'O'"))
             for i in curs.fetchall():
-                curs.execute(db_change(
-                    "update rb set block = ?, band = 'regex' where block = ? and band = 'O'"
-                ), [
-                    '^' + i[0].replace('.', '\\.'),
-                    i[0]
-                ])
+                curs.execute(db_change("update rb set block = ?, band = 'regex' where block = ? and band = 'O'"), ['^' + i[0].replace('.', '\\.'), i[0]])
 
         if ver_num < 3190201:
             today_time = get_time()
 
             curs.execute(db_change("select block, end, why, band, login from ban"))
             for i in curs.fetchall():
-                curs.execute(db_change(
-                    "insert into rb (block, end, today, why, band, login, ongoing) " + \
-                    "values (?, ?, ?, ?, ?, ?, ?)"
-                ), [
-                    i[0],
-                    i[1],
-                    today_time,
-                    i[2],
-                    i[3],
-                    i[4],
-                    '1'
-                ])
+                curs.execute(db_change("insert into rb (block, end, today, why, band, login, ongoing) values (?, ?, ?, ?, ?, ?, ?)"), [i[0], i[1], today_time, i[2], i[3], i[4], '1'])
 
         if ver_num < 3191301:
-            curs.execute(db_change('' + \
-                'select id, title, date from history ' + \
-                'where not title like "user:%" ' + \
-                'order by date desc ' + \
-                'limit 50' + \
-            ''))
+            curs.execute(db_change('select id, title, date from history where not title like "user:%" order by date desc limit 50'))
             data_list = curs.fetchall()
             for get_data in data_list:
-                curs.execute(db_change(
-                    "insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"
-                ), [
-                    get_data[0], 
-                    get_data[1],
-                    get_data[2]
-                ])
+                curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"), [get_data[0], get_data[1], get_data[2]])
 
         if ver_num < 3202400:
             curs.execute(db_change("select data from other where name = 'update'"))
@@ -463,50 +415,24 @@ def update(ver_num, set_data):
         if ver_num < 3202600:
             curs.execute(db_change("select name, regex, sub from filter"))
             for i in curs.fetchall():
-                curs.execute(db_change(
-                    "insert into html_filter (html, kind, plus, plus_t) " + \
-                    "values (?, 'regex_filter', ?, ?)"
-                ), [
-                    i[0], 
-                    i[1],
-                    i[2]
-                ])
+                curs.execute(db_change("insert into html_filter (html, kind, plus, plus_t) values (?, 'regex_filter', ?, ?)"), [i[0], i[1], i[2]])
 
             curs.execute(db_change("select title, link, icon from inter"))
             for i in curs.fetchall():
-                curs.execute(db_change(
-                    "insert into html_filter (html, kind, plus, plus_t) " + \
-                    "values (?, 'inter_wiki', ?, ?)"), [
-                    i[0], 
-                    i[1],
-                    i[2]
-                ])
+                curs.execute(db_change("insert into html_filter (html, kind, plus, plus_t) values (?, 'inter_wiki', ?, ?)"), [i[0], i[1], i[2]])
 
         if ver_num < 3203400:
             curs.execute(db_change("select user, css from custom"))
             for i in curs.fetchall():
-                curs.execute(db_change(
-                    "insert into user_set (name, id, data) values ('custom_css', ?, ?)"
-                ), [
-                    re.sub(r' \(head\)$', '', i[0]), 
-                    i[1]
-                ])
+                curs.execute(db_change("insert into user_set (name, id, data) values ('custom_css', ?, ?)"), [re.sub(r' \(head\)$', '', i[0]), i[1]])
 
         if ver_num < 3205500:
             curs.execute(db_change("select title, decu, dis, view, why from acl"))
             for i in curs.fetchall():
-                curs.execute(db_change(
-                    "insert into acl (title, data, type) values (?, ?, ?)"
-                ), [i[0], i[1], 'decu'])
-                curs.execute(db_change(
-                    "insert into acl (title, data, type) values (?, ?, ?)"
-                ), [i[0], i[2], 'dis'])
-                curs.execute(db_change(
-                    "insert into acl (title, data, type) values (?, ?, ?)"
-                ), [i[0], i[3], 'view'])
-                curs.execute(db_change(
-                    "insert into acl (title, data, type) values (?, ?, ?)"
-                ), [i[0], i[4], 'why'])
+                curs.execute(db_change("insert into acl (title, data, type) values (?, ?, ?)"), [i[0], i[1], 'decu'])
+                curs.execute(db_change("insert into acl (title, data, type) values (?, ?, ?)"), [i[0], i[2], 'dis'])
+                curs.execute(db_change("insert into acl (title, data, type) values (?, ?, ?)"), [i[0], i[3], 'view'])
+                curs.execute(db_change("insert into acl (title, data, type) values (?, ?, ?)"), [i[0], i[4], 'why'])
 
         if ver_num < 3300101:
             # 캐시 초기화
@@ -514,33 +440,20 @@ def update(ver_num, set_data):
         
         if ver_num < 3300301:
             # regex_filter 오류 해결
-            curs.execute(db_change(
-                'delete from html_filter where kind = "regex_filter" and html is null'
-            ))
+            curs.execute(db_change('delete from html_filter where kind = "regex_filter" and html is null'))
             
         if ver_num < 3302302:
             # user이랑 user_set 테이블의 통합
             curs.execute(db_change('select id, pw, acl, date, encode from user'))
             for i in curs.fetchall():
-                curs.execute(db_change(
-                    "insert into user_set (name, id, data) values (?, ?, ?)"
-                ), ['pw', i[0], i[1]])
-                curs.execute(db_change(
-                    "insert into user_set (name, id, data) values (?, ?, ?)"
-                ), ['acl', i[0], i[2]])
-                curs.execute(db_change(
-                    "insert into user_set (name, id, data) values (?, ?, ?)"
-                ), ['date', i[0], i[3]])
-                curs.execute(db_change(
-                    "insert into user_set (name, id, data) values (?, ?, ?)"
-                ), ['encode', i[0], i[4]])
+                curs.execute(db_change("insert into user_set (name, id, data) values (?, ?, ?)"), ['pw', i[0], i[1]])
+                curs.execute(db_change("insert into user_set (name, id, data) values (?, ?, ?)"), ['acl', i[0], i[2]])
+                curs.execute(db_change("insert into user_set (name, id, data) values (?, ?, ?)"), ['date', i[0], i[3]])
+                curs.execute(db_change("insert into user_set (name, id, data) values (?, ?, ?)"), ['encode', i[0], i[4]])
                 
         if ver_num < 3400101:
             # user_set이랑 user_application 테이블의 통합
-            curs.execute(db_change('' + \
-                'select id, pw, date, encode, question, answer, ip, ua, email ' + \
-                'from user_application' + \
-            ''))
+            curs.execute(db_change('select id, pw, date, encode, question, answer, ip, ua, email from user_application'))
             for i in curs.fetchall():
                 sql_data = {}
                 sql_data['id'] = i[0]
@@ -553,14 +466,10 @@ def update(ver_num, set_data):
                 sql_data['ua'] = i[7]
                 sql_data['email'] = i[8]
                 
-                curs.execute(db_change(
-                    "insert into user_set (name, id, data) values (?, ?, ?)"
-                ), ['application', i[0], json.dumps(sql_data)])
+                curs.execute(db_change("insert into user_set (name, id, data) values (?, ?, ?)"), ['application', i[0], json.dumps(sql_data)])
         
         if ver_num < 3500105:
-            curs.execute(db_change(
-                'delete from acl where title like "file:%" and data = "admin" and type like "decu%"'
-            ))
+            curs.execute(db_change('delete from acl where title like "file:%" and data = "admin" and type like "decu%"'))
             
         if ver_num < 3500106:
             curs.execute(db_change("select data from other where name = 'domain'"))
@@ -570,15 +479,9 @@ def update(ver_num, set_data):
                 db_data = re.match(r'[^/]+\/\/([^/]+)', db_data)
                 if db_data:
                     db_data = db_data.group(1)
-                    curs.execute(db_change(
-                        "update other set data = ? where name = 'domain'"
-                    ), [
-                        db_data
-                    ])
+                    curs.execute(db_change("update other set data = ? where name = 'domain'"), [db_data])
                 else:
-                    curs.execute(db_change(
-                        "update other set data = '' where name = 'domain'"
-                    ))
+                    curs.execute(db_change("update other set data = '' where name = 'domain'"))
 
         if ver_num < 3500107:
             db_table_list = get_db_table_list()
@@ -642,9 +545,7 @@ def update(ver_num, set_data):
             curs.execute(db_change('select id from user_set where name = "email"'))
             for db_data in curs.fetchall():
                 if ip_or_user(db_data[0]) == 1:
-                    curs.execute(db_change(
-                        'delete from user_set where id = ? and name = "email"'
-                    ), [db_data[0]])
+                    curs.execute(db_change('delete from user_set where id = ? and name = "email"'), [db_data[0]])
 
         # create_data['history'] = ['id', 'title', 'data', 'date', 'ip', 'send', 'leng', 'hide', 'type']
         # create_data['rc'] = ['id', 'title', 'date', 'type']
@@ -666,18 +567,23 @@ def update(ver_num, set_data):
                 else:
                     user_alarm_count[db_data[0]] = 1
 
-                curs.execute(db_change(
-                    'insert into user_notice (id, name, data, date, readme) values (?, ?, ?, ?, "")'
-                ), [str(user_alarm_count[db_data[0]]), db_data[0], db_data[1], db_data[2]])
+                curs.execute(db_change('insert into user_notice (id, name, data, date, readme) values (?, ?, ?, ?, "")'), [str(user_alarm_count[db_data[0]]), db_data[0], db_data[1], db_data[2]])
 
         if ver_num < 3500372:
             # ID 글자 확인 호환용
-            curs.execute(db_change('insert into html_filter (html, kind, plus, plus_t) values (?, ?, ?, ?)'), [
-                r'(?:[^A-Za-zㄱ-힣0-9])',
-                'name',
-                '',
-                ''
-            ])
+            curs.execute(db_change('insert into html_filter (html, kind, plus, plus_t) values (?, ?, ?, ?)'), [r'(?:[^A-Za-zㄱ-힣0-9])', 'name', '', ''])
+
+        if ver_num < 3500373:
+            select_data = {}
+
+            curs.execute(db_change("select name, id, data from user_set where name = 'application'"))
+            for db_data in curs.fetchall():
+                select_data[db_data[1]] = db_data
+
+            curs.execute(db_change("delete from user_set where name = 'application'"))
+            
+            for db_data in select_data:
+                curs.execute(db_change("insert into user_set (id, name, data) values (?, ?, ?)"), [select_data[db_data][1], select_data[db_data][0], select_data[db_data][2]])
 
         conn.commit()
 
@@ -1719,6 +1625,15 @@ def do_user_name_check(user_name):
         if len(user_name) > 128:
             return 1
         
+        # 중복 확인
+        curs.execute(db_change("select id from user_set where name = 'user_name' and data = ?"), [user_name])
+        if curs.fetchall():
+            return 1
+        
+        curs.execute(db_change("select id from user_set where id = ?"), [user_name])
+        if curs.fetchall():
+            return 1
+        
         return 0
 
 def get_admin_auth_list(num = None):
@@ -2688,6 +2603,9 @@ def re_error(data):
                 menu = 0
             )), 401
         else:
+            title = load_lang('error')
+            sub_title = title
+
             num = int(number_check(data.replace('/error/', '')))
             if num == 1:
                 data = load_lang('no_login_error')
@@ -2699,10 +2617,12 @@ def re_error(data):
                 data = load_lang('no_admin_block_error')
             elif num == 5:
                 data = load_lang('error_skin_set')
-            elif num == 6:
-                data = load_lang('same_id_exist_error')
             elif num == 8:
-                data = load_lang('long_id_error') + '<br>' + load_lang('id_char_error') + ' <a href="/name_filter">(' + load_lang('id_filter_list') + ')</a>'
+                data = '' + \
+                    load_lang('long_id_error') + '<br>' + \
+                    load_lang('id_char_error') + ' <a href="/name_filter">(' + load_lang('id_filter_list') + ')</a><br>' + \
+                    load_lang('same_id_exist_error') + \
+                ''
             elif num == 9:
                 data = load_lang('file_exist_error')
             elif num == 10:
@@ -2788,6 +2708,11 @@ def re_error(data):
                 db_data = curs.fetchall()
                 db_data = '' if not db_data else db_data[0][0]
                 data = load_lang('fast_edit_error') + db_data
+            elif num == 43:
+                title = load_lang('application_submitted')
+                sub_title = title
+
+                data = load_lang('waiting_for_approval')
             else:
                 data = '???'
 
@@ -2795,12 +2720,8 @@ def re_error(data):
                 if flask.request.path != '/skin_set':
                     data += '<br>' + load_lang('error_skin_set_old') + ' <a href="/skin_set">(' + load_lang('go') + ')</a>'
 
-                title = load_lang('skin_set')
-                tool = [['change', load_lang('user_setting')], ['change/skin_set/main', load_lang('main_skin_set')]]
-                load_skin_set = ''
-            
                 return easy_minify(flask.render_template(skin_check(),
-                    imp = [title, wiki_set(), wiki_custom(), wiki_css([0, 0])],
+                    imp = [load_lang('skin_set'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
                     data = '' + \
                         '<div id="main_skin_set">' + \
                             '<h2>' + load_lang('error') + '</h2>' + \
@@ -2808,14 +2729,14 @@ def re_error(data):
                                 '<li>' + data + '</a></li>' + \
                             '</ul>' + \
                         '</div>' + \
-                        load_skin_set,
-                    menu = tool
+                    '',
+                    menu = [['change', load_lang('user_setting')], ['change/skin_set/main', load_lang('main_skin_set')]]
                 ))
             else:
                 return easy_minify(flask.render_template(skin_check(),
-                    imp = [load_lang('error'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
+                    imp = [title, wiki_set(), wiki_custom(), wiki_css([0, 0])],
                     data = '' + \
-                        '<h2>' + load_lang('error') + '</h2>' + \
+                        '<h2>' + sub_title + '</h2>' + \
                         '<ul class="opennamu_ul">' + \
                             '<li>' + data + '</li>' + \
                         '</ul>' + \

+ 7 - 11
route/user_setting_user_name.py

@@ -17,20 +17,16 @@ def user_setting_user_name(user_name = ''):
                 if do_user_name_check(auto_data[1]) == 1:
                     return re_error('/error/8')
 
-                curs.execute(db_change('select data from user_set where name = ? and data = ?'), [auto_data[0], auto_data[1]])
+                curs.execute(db_change('select data from user_set where name = ? and id = ?'), [auto_data[0], ip])
                 if curs.fetchall():
-                    return re_error('/error/6')
+                    curs.execute(db_change("update user_set set data = ? where name = ? and id = ?"), [auto_data[1], auto_data[0], ip])
                 else:
-                    curs.execute(db_change('select data from user_set where name = ? and id = ?'), [auto_data[0], ip])
-                    if curs.fetchall():
-                        curs.execute(db_change("update user_set set data = ? where name = ? and id = ?"), [auto_data[1], auto_data[0], ip])
-                    else:
-                        curs.execute(db_change("insert into user_set (name, id, data) values (?, ?, ?)"), [auto_data[0], ip, auto_data[1]])
+                    curs.execute(db_change("insert into user_set (name, id, data) values (?, ?, ?)"), [auto_data[0], ip, auto_data[1]])
 
-                    if user_name != '':
-                        return redirect('/change/user_name/' + url_pas(user_name))
-                    else:
-                        return redirect('/change/user_name')
+                if user_name != '':
+                    return redirect('/change/user_name/' + url_pas(user_name))
+                else:
+                    return redirect('/change/user_name')
             else:
                 user_name = ip
 

+ 2 - 2
version.json

@@ -1,7 +1,7 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.6-RC5-dev11",
-        "c_ver" : "3500372",
+        "r_ver" : "v3.4.6-RC5-dev12",
+        "c_ver" : "3500373",
         "s_ver" : "3500111"
     }
 }