Surplus_Up (2DU) hace 7 años
padre
commit
2593429ee7
Se han modificado 10 ficheros con 321 adiciones y 135 borrados
  1. 8 4
      app.py
  2. 2 0
      language/en-US.json
  3. 2 0
      language/ko-KR.json
  4. 47 38
      route/login_check_key.py
  5. 31 22
      route/login_need_email.py
  6. 49 0
      route/login_pw_change.py
  7. 78 68
      route/setting.py
  8. 4 2
      route/tool/func.py
  9. 99 0
      route/user_setting.py
  10. 1 1
      version.json

+ 8 - 4
app.py

@@ -472,8 +472,12 @@ def login_oauth(platform = None, func = None):
     return login_oauth_2(conn, platform, func)
                 
 @app.route('/change', methods=['POST', 'GET'])
-def login_change_password():
-    return login_change_password_2(conn, server_init)
+def user_setting():
+    return user_setting_2(conn, server_init)
+    
+@app.route('/pw_change', methods=['POST', 'GET'])
+def login_pw_change():
+    return login_pw_change_2(conn)
 
 @app.route('/check/<name>')
 def give_user_check(name = None):
@@ -483,11 +487,11 @@ def give_user_check(name = None):
 def login_register():
     return login_register_2(conn)
 
-@app.route('/<regex("need_email|pass_find"):tool>', methods=['POST', 'GET'])
+@app.route('/<regex("need_email|pass_find|email_change"):tool>', methods=['POST', 'GET'])
 def login_need_email(tool = 'pass_find'):
     return login_need_email_2(conn, tool)
 
-@app.route('/<regex("check_key|check_pass_key"):tool>', methods=['POST', 'GET'])
+@app.route('/<regex("check_key|check_pass_key|email_replace"):tool>', methods=['POST', 'GET'])
 def login_check_key(tool = 'check_pass_key'):
     return login_check_key_2(conn, tool)
            

+ 2 - 0
language/en-US.json

@@ -87,6 +87,7 @@
         "start" : "Start",
         "pass" : "Passing",
         "file_name" : "File name",
+        "send" : "Send",
         "_comment_1.1_" : "Time",
             "second" : "Second(s)",
             "hour" : "Hour(s)",
@@ -184,6 +185,7 @@
         "edit_button_strike" : "Strike",
         "edit_button_big" : "Big",
         "edit_button_paragraph" : "Paragraph",
+        "password_change" : "Password change",
         "_comment_2.1_" : "Filter",
             "_comment_2.1.1_" : "List",
                 "interwiki_list" : "Interwiki(s) list",

+ 2 - 0
language/ko-KR.json

@@ -87,6 +87,7 @@
         "start" : "시작",
         "pass" : "넘기기",
         "file_name" : "파일명",
+        "send" : "전송",
         "_comment_1.1_" : "시간",
             "second" : "초",
             "hour" : "시간",
@@ -184,6 +185,7 @@
         "edit_button_strike" : "취소선",
         "edit_button_big" : "크게",
         "edit_button_paragraph" : "문단",
+        "password_change" : "비밀번호 변경",
         "_comment_2.1_" : "필터",
             "_comment_2.1.1_" : "목록",
                 "interwiki_list" : "인터위키 목록",

+ 47 - 38
route/login_check_key.py

@@ -4,51 +4,58 @@ def login_check_key_2(conn, tool):
     curs = conn.cursor()
 
     if flask.request.method == 'POST':
-        if tool == 'check_key':
+        if tool == ('check_key' or 'email_replace'):
+            ip = ip_check()
+            
             if 'c_id' in flask.session and flask.session['c_key'] == flask.request.form.get('key', None):
                 curs.execute('select data from other where name = "encode"')
                 db_data = curs.fetchall()
-
-                curs.execute("select id from user limit 1")
-                if not curs.fetchall():
-                    curs.execute("insert into user (id, pw, acl, date, encode) values (?, ?, 'owner', ?, ?)", [
+                
+                if tool == 'check_key':
+                    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]
+                        ])
+    
+                        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]
+                        ])
+    
+                        first = 0
+    
+                    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_pw'], 
-                        get_time(), 
-                        db_data[0][0]
+                        flask.session['c_email']
                     ])
-
-                    first = 1
-                else:
-                    curs.execute("insert into user (id, pw, acl, date, encode) values (?, ?, 'user', ?, ?)", [
+                    curs.execute("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')", [
                         flask.session['c_id'], 
-                        flask.session['c_pw'], 
-                        get_time(), 
-                        db_data[0][0]
+                        ip, 
+                        agent, 
+                        get_time()
                     ])
-
+    
+                    flask.session['state'] = 1
+                    flask.session['id'] = flask.session['c_id']
+                    flask.session['head'] = ''
+                            
+                    conn.commit()
+                else:
+                    curs.execute('delete from user_set where name = "email" and id = ?', [ip])
+                    curs.execute('insert into user_set (name, id, data) values ("email", ?, ?)', [ip, flask.session['c_email']])
+                    
                     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()]
-                )
-
-                flask.session['state'] = 1
-                flask.session['id'] = flask.session['c_id']
-                flask.session['head'] = ''
-                        
-                conn.commit()
-                
+                          
                 flask.session.pop('c_id', None)
                 flask.session.pop('c_pw', None)
                 flask.session.pop('c_key', None)
@@ -64,11 +71,13 @@ def login_check_key_2(conn, tool):
                 flask.session.pop('c_key', None)
                 flask.session.pop('c_email', None)
 
-                return redirect('/register')
+                return redirect('/user')
         else:
             if 'c_id' in flask.session and flask.session['c_key'] == flask.request.form.get('key', None):
                 hashed = pw_encode(flask.session['c_key'])
+
                 curs.execute("update user set pw = ? where id = ?", [hashed, flask.session['c_id']])
+                conn.commit()
 
                 d_id = flask.session['c_id']
                 pw = flask.session['c_key']

+ 31 - 22
route/login_need_email.py

@@ -4,7 +4,12 @@ def login_need_email_2(conn, tool):
     curs = conn.cursor()
 
     if flask.request.method == 'POST':
-        if tool == 'need_email':
+        if tool == ('need_email' or 'email_change'):
+            if tool == 'email_change':
+                flask.session['c_key'] = ''.join(random.choice("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") for i in range(16))
+                flask.session['c_id'] = flask.request.form.get('id', '')
+                flask.session['c_pw'] = ''
+            
             if 'c_id' in flask.session:
                 main_email = ['naver.com', 'gmail.com', 'daum.net', 'hanmail.net', 'hanmail2.net']
                 data = re.search('@([^@]+)$', flask.request.form.get('email', ''))
@@ -18,15 +23,16 @@ def login_need_email_2(conn, tool):
                             flask.session.pop('c_id', None)
                             flask.session.pop('c_pw', None)
                             flask.session.pop('c_key', None)
-
-                            return redirect('/register')
+                            
+                            # user 대신 오류 화면 보여주게 수정 필요
+                            return redirect('/user')
                         else:
                             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'
+                                t_text = wiki_set()[0] + ' key'
 
                             curs.execute('select data from other where name = "email_text"')
                             sql_d = curs.fetchall()
@@ -37,10 +43,13 @@ def login_need_email_2(conn, tool):
 
                             send_email(flask.request.form.get('email', ''), t_text, i_text)
                             flask.session['c_email'] = flask.request.form.get('email', '')
-
-                            return redirect('/check_key')
-
-            return redirect('/register')
+                  
+                            if tool == 'email_change':
+                                return redirect('/email_replace')
+                            else:
+                                return redirect('/check_key')
+            else:
+                return redirect('/register')
         else:
             curs.execute("select id from user_set where id = ? and name = 'email' and data = ?", [
                 flask.request.form.get('id', ''),
@@ -55,7 +64,7 @@ def login_need_email_2(conn, tool):
                 if sql_d and sql_d[0][0] != '':
                     t_text = html.escape(sql_d[0][0])
                 else:
-                    t_text = wiki_set()[0] + '\'s Key'
+                    t_text = wiki_set()[0] + ' key'
 
                 curs.execute('select data from other where name = "email_text"')
                 sql_d = curs.fetchall()
@@ -65,13 +74,13 @@ def login_need_email_2(conn, tool):
                     i_text = 'Key : ' + flask.session['c_key']
 
                 send_email(flask.request.form.get('email', ''), t_text, i_text)
-
+                
                 return redirect('/check_pass_key')
             else:
                 return re_error('/error/12')
     else:
-        if tool == 'need_email':
-            curs.execute('select data from other where name = "email_insert_text"')
+        if tool == 'pass_find':
+            curs.execute('select data from other where name = "password_search_text"')
             sql_d = curs.fetchall()
             if sql_d and sql_d[0][0] != '':
                 b_text = sql_d[0][0] + '<hr class=\"main_hr\">'
@@ -79,12 +88,11 @@ def login_need_email_2(conn, tool):
                 b_text = ''
 
             return easy_minify(flask.render_template(skin_check(),    
-                imp = [load_lang('email'), wiki_set(), custom(), other2([0, 0])],
-                data =  '''
-                        <a href="/email_filter">(''' + load_lang('email_filter_list') + ''')</a>
-                        <hr class=\"main_hr\">
-                        ''' + b_text + '''
+                imp = [load_lang('password_search'), wiki_set(), custom(), other2([0, 0])],
+                data =  b_text + '''
                         <form method="post">
+                            <input placeholder="''' + load_lang('id') + '''" name="id" type="text">
+                            <hr class=\"main_hr\">
                             <input placeholder="''' + load_lang('email') + '''" name="email" type="text">
                             <hr class=\"main_hr\">
                             <button type="submit">''' + load_lang('save') + '''</button>
@@ -93,7 +101,7 @@ def login_need_email_2(conn, tool):
                 menu = [['user', load_lang('return')]]
             ))
         else:
-            curs.execute('select data from other where name = "password_search_text"')
+            curs.execute('select data from other where name = "email_insert_text"')
             sql_d = curs.fetchall()
             if sql_d and sql_d[0][0] != '':
                 b_text = sql_d[0][0] + '<hr class=\"main_hr\">'
@@ -101,11 +109,12 @@ def login_need_email_2(conn, tool):
                 b_text = ''
 
             return easy_minify(flask.render_template(skin_check(),    
-                imp = [load_lang('password_search'), wiki_set(), custom(), other2([0, 0])],
-                data =  b_text + '''
+                imp = [load_lang('email'), wiki_set(), custom(), other2([0, 0])],
+                data =  '''
+                        <a href="/email_filter">(''' + load_lang('email_filter_list') + ''')</a>
+                        <hr class=\"main_hr\">
+                        ''' + b_text + '''
                         <form method="post">
-                            <input placeholder="''' + load_lang('id') + '''" name="id" type="text">
-                            <hr class=\"main_hr\">
                             <input placeholder="''' + load_lang('email') + '''" name="email" type="text">
                             <hr class=\"main_hr\">
                             <button type="submit">''' + load_lang('save') + '''</button>

+ 49 - 0
route/login_pw_change.py

@@ -0,0 +1,49 @@
+from .tool.func import *
+
+def login_pw_change_2(conn):
+    curs = conn.cursor()
+    
+    if ban_check() == 1:
+        return re_error('/ban')
+
+    if custom()[2] == 0:
+        return redirect('/login')
+
+    if flask.request.method == 'POST':
+        if flask.request.form.get('pw4', None) and flask.request.form.get('pw2', None):
+            if flask.request.form.get('pw2', None) != flask.request.form.get('pw3', None):
+                return re_error('/error/20')
+
+            curs.execute("select pw, encode from user where id = ?", [flask.session['id']])
+            user = curs.fetchall()
+            if not user:
+                return re_error('/error/2')
+               
+            pw_check_d = pw_check(
+                flask.request.form.get('pw4', ''), 
+                user[0][0],
+                user[0][1],
+                flask.request.form.get('id', None)
+            )
+            if pw_check_d != 1:
+                return re_error('/error/10')
+
+            hashed = pw_encode(flask.request.form.get('pw2', None))
+                
+            curs.execute("update user set pw = ? where id = ?", [hashed, ip_check()])
+    else:
+        return easy_minify(flask.render_template(skin_check(), 
+            imp = [load_lang('password_change'), wiki_set(), custom(), other2([0, 0])],
+            data = '''
+                <form method="post">
+                    <input placeholder="''' + load_lang('now_password') + '''" name="pw4" type="password">
+                    <hr class=\"main_hr\">
+                    <input placeholder="''' + load_lang('new_password') + '''" name="pw2" type="password">
+                    <hr class=\"main_hr\">
+                    <input placeholder="''' + load_lang('password_confirm') + '''" name="pw3" type="password">
+                    <hr class=\"main_hr\">
+                    <button type="submit">''' + load_lang('restart') + '''</button>
+                </form>
+            ''',
+            menu = [['change', load_lang('return')]]
+        ))

+ 78 - 68
route/setting.py

@@ -111,77 +111,87 @@ def setting_2(conn, num):
 
             return easy_minify(flask.render_template(skin_check(), 
                 imp = [load_lang('main_setting'), wiki_set(), custom(), other2([0, 0])],
-                data =  '''
-                        <form method="post">
-                            <span>''' + load_lang('wiki_name') + '''</span>
-                            <hr class=\"main_hr\">
-                            <input type="text" name="name" value="''' + html.escape(d_list[0]) + '''">
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('wiki_logo') + ''' (HTML)</span>
-                            <hr class=\"main_hr\">
-                            <input type="text" name="logo" value="''' + html.escape(d_list[1]) + '''">
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('main_page') + '''</span>
-                            <hr class=\"main_hr\">
-                            <input type="text" name="frontpage" value="''' + html.escape(d_list[2]) + '''">
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('bottom_text') + ''' (HTML)</span>
-                            <hr class=\"main_hr\">
-                            <input type="text" name="license" value="''' + html.escape(d_list[3]) + '''">
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('max_file_size') + ''' [MB]</span>
-                            <hr class=\"main_hr\">
-                            <input type="text" name="upload" value="''' + html.escape(d_list[4]) + '''">
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('backup_interval') + ' [' + load_lang('hour') + '''] (off : 0) {restart}</span>
-                            <hr class=\"main_hr\">
-                            <input type="text" name="back_up" value="''' + html.escape(d_list[9]) + '''">
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('wiki_skin') + '''</span>
-                            <hr class=\"main_hr\">
-                            <select name="skin">''' + div2 + '''</select>
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('default_acl') + '''</span>
-                            <hr class=\"main_hr\">
-                            <select name="edit">''' + div + '''</select>
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('default_discussion_acl') + '''</span>
-                            <hr class=\"main_hr\">
-                            <select name="discussion">''' + div4 + '''</select>
-                            <hr class=\"main_hr\">
-                            <input type="checkbox" name="reg" ''' + ch_1 + '''> ''' + load_lang('no_register') + '''
-                            <hr class=\"main_hr\">
-                            <input type="checkbox" name="ip_view" ''' + ch_2 + '''> ''' + load_lang('hide_ip') + '''
-                            <hr class=\"main_hr\">
-                            <input type="checkbox" name="email_have" ''' + ch_3 + '''> ''' + load_lang('email_required') + ''' {<a href="/setting/5">''' + load_lang('google_imap_required') + '''</a>}
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('wiki_host') + '''</span>
-                            <hr class=\"main_hr\">
-                            <input type="text" name="host" value="''' + html.escape(d_list[16]) + '''">
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('wiki_port') + '''</span>
-                            <hr class=\"main_hr\">
-                            <input type="text" name="port" value="''' + html.escape(d_list[10]) + '''">
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('wiki_secret_key') + '''</span>
-                            <hr class=\"main_hr\">
-                            <input type="password" name="key" value="''' + html.escape(d_list[11]) + '''">
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('update_branch') + '''</span>
-                            <hr class=\"main_hr\">
-                            <select name="update">''' + div3 + '''</select>
-                            <hr class=\"main_hr\">
-                            <span>''' + load_lang('encryption_method') + '''</span>
-                            <hr class=\"main_hr\">
-                            <select name="encode">''' + div5 + '''</select>
-                            <hr class=\"main_hr\">
-                            <button id="save" type="submit">''' + load_lang('save') + '''</button>
-                        </form>
-                        ''',
+                data = '''
+                    <form method="post">
+                        <span>''' + load_lang('wiki_name') + '''</span>
+                        <hr class=\"main_hr\">
+                        <input type="text" name="name" value="''' + html.escape(d_list[0]) + '''">
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('wiki_logo') + ''' (HTML)</span>
+                        <hr class=\"main_hr\">
+                        <input type="text" name="logo" value="''' + html.escape(d_list[1]) + '''">
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('main_page') + '''</span>
+                        <hr class=\"main_hr\">
+                        <input type="text" name="frontpage" value="''' + html.escape(d_list[2]) + '''">
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('bottom_text') + ''' (HTML)</span>
+                        <hr class=\"main_hr\">
+                        <input type="text" name="license" value="''' + html.escape(d_list[3]) + '''">
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('max_file_size') + ''' [MB]</span>
+                        <hr class=\"main_hr\">
+                        <input type="text" name="upload" value="''' + html.escape(d_list[4]) + '''">
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('backup_interval') + ' [' + load_lang('hour') + '''] (off : 0) {restart}</span>
+                        <hr class=\"main_hr\">
+                        <input type="text" name="back_up" value="''' + html.escape(d_list[9]) + '''">
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('wiki_skin') + '''</span>
+                        <hr class=\"main_hr\">
+                        <select name="skin">''' + div2 + '''</select>
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('default_acl') + '''</span>
+                        <hr class=\"main_hr\">
+                        <select name="edit">''' + div + '''</select>
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('default_discussion_acl') + '''</span>
+                        <hr class=\"main_hr\">
+                        <select name="discussion">''' + div4 + '''</select>
+                        <hr class=\"main_hr\">
+                        <input type="checkbox" name="reg" ''' + ch_1 + '''> ''' + load_lang('no_register') + '''
+                        <hr class=\"main_hr\">
+                        <input type="checkbox" name="ip_view" ''' + ch_2 + '''> ''' + load_lang('hide_ip') + '''
+                        <hr class=\"main_hr\">
+                        <input type="checkbox" name="email_have" ''' + ch_3 + '''> ''' + load_lang('email_required') + ''' {<a href="/setting/5">''' + load_lang('google_imap_required') + '''</a>}
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('wiki_host') + '''</span>
+                        <hr class=\"main_hr\">
+                        <input type="text" name="host" value="''' + html.escape(d_list[16]) + '''">
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('wiki_port') + '''</span>
+                        <hr class=\"main_hr\">
+                        <input type="text" name="port" value="''' + html.escape(d_list[10]) + '''">
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('wiki_secret_key') + '''</span>
+                        <hr class=\"main_hr\">
+                        <input type="password" name="key" value="''' + html.escape(d_list[11]) + '''">
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('update_branch') + '''</span>
+                        <hr class=\"main_hr\">
+                        <select name="update">''' + div3 + '''</select>
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('encryption_method') + '''</span>
+                        <hr class=\"main_hr\">
+                        <select name="encode">''' + div5 + '''</select>
+                        <hr class=\"main_hr\">
+                        <button id="save" type="submit">''' + load_lang('save') + '''</button>
+                    </form>
+                ''',
                 menu = [['setting', load_lang('return')]]
             ))
     elif num == 2:
-        i_list = ['contract', 'no_login_warring', 'edit_bottom_text']
+        i_list = [
+            'contract', 
+            'no_login_warring', 
+            'edit_bottom_text',
+            'check_key_text',
+            'email_title',
+            'email_text',
+            'email_insert_text',
+            'password_search_text',
+            'reset_user_text'
+        ]
         if flask.request.method == 'POST':
             for i in i_list:
                 curs.execute("update other set data = ? where name = ?", [flask.request.form.get(i, ''), i])

+ 4 - 2
route/tool/func.py

@@ -44,11 +44,13 @@ for i in range(0, 2):
                 ok = os.system('python3 -m pip install --user -r requirements.txt')
                 if ok == 0:
                     os.execl(sys.executable, sys.executable, *sys.argv)
+                    print('----')
                 else:
                     raise
             elif platform.system() == 'Windows':
                 ok = os.system('python -m pip install --user -r requirements.txt')
                 if ok == 0:
+                    print('----')
                     os.execl(sys.executable, sys.executable, *sys.argv)
                 else:
                     raise
@@ -855,7 +857,7 @@ def ban_check(ip = None, tool = None):
     band_d = curs.fetchall()
     if band_d:
         if tool and tool == 'login':
-            if data[0][0] != 'O':
+            if band_d[0][0] != 'O':
                 return 1
         else:
             return 1
@@ -864,7 +866,7 @@ def ban_check(ip = None, tool = None):
     ban_d = curs.fetchall()
     if ban_d:
         if tool and tool == 'login':
-            if data[0][0] != 'O':
+            if ban_d[0][0] != 'O':
                 return 1
         else:
             return 1

+ 99 - 0
route/user_setting.py

@@ -0,0 +1,99 @@
+from .tool.func import *
+
+def user_setting_2(conn, server_init):
+    curs = conn.cursor()
+
+    support_language = server_init.server_set_var['language']['list']
+
+    if ban_check() == 1:
+        return re_error('/ban')
+
+    if custom()[2] == 0:
+        return redirect('/login')
+
+    ip = ip_check()
+    user_state = flask.request.args.get('user', 'ip')
+    
+    if user_state == 'ip':
+        if flask.request.method == 'POST':    
+            auto_list = ['email', 'skin', 'lang']
+
+            for auto_data in auto_list:
+                if flask.request.form.get(auto_data, '') != '':
+                    curs.execute('select data from user_set where name = ? and id = ?', [auto_data, ip])
+                    if curs.fetchall():
+                        curs.execute("update user_set set data = ? where name = ? and id = ?", [flask.request.form.get(auto_data, ''), auto_data, ip])
+                    else:
+                        curs.execute("insert into user_set (name, id, data) values (?, ?, ?)", [auto_data, ip, flask.request.form.get(auto_data, '')])
+
+            conn.commit()
+            
+            return redirect('/change')
+        else:        
+            curs.execute('select data from user_set where name = "email" and id = ?', [ip])
+            data = curs.fetchall()
+            if data:
+                email = data[0][0]
+            else:
+                email = ''
+
+            div2 = load_skin()
+            div3 = ''
+
+            curs.execute('select data from user_set where name = "lang" and id = ?', [flask.session['id']])
+            data = curs.fetchall()
+            if not data:
+                curs.execute('select data from other where name = "language"')
+                data = curs.fetchall()
+                if not data:
+                    data = [['en-US']]
+
+            for lang_data in support_language:
+                if data and data[0][0] == lang_data:
+                    div3 = '<option value="' + lang_data + '">' + lang_data + '</option>' + div3
+                else:
+                    div3 += '<option value="' + lang_data + '">' + lang_data + '</option>'
+
+            oauth_provider = load_oauth('_README')['support']
+            oauth_content = '<ul>'
+            for i in range(len(oauth_provider)):
+                curs.execute('select name, picture from oauth_conn where wiki_id = ? and provider = ?', [flask.session['id'], oauth_provider[i]])
+                oauth_data = curs.fetchall()
+                if len(oauth_data) == 1:
+                    oauth_content += '<li>{} - {}</li>'.format(oauth_provider[i].capitalize(), load_lang('connection') + ' : <img src="{}" width="17px" height="17px">{}'.format(oauth_data[0][1], oauth_data[0][0]))
+                else:
+                    oauth_content += '<li>{} - {}</li>'.format(oauth_provider[i].capitalize(), load_lang('connection') + ' : <a href="/oauth/{}/init">{}</a>'.format(oauth_provider[i], load_lang('connect')))
+            
+            oauth_content += '</ul>'
+
+            http_warring = '<hr class=\"main_hr\"><span>' + load_lang('http_warring') + '</span>'
+
+            return easy_minify(flask.render_template(skin_check(),    
+                imp = [load_lang('user_setting'), wiki_set(), custom(), other2([0, 0])],
+                data = '''
+                    <form method="post">
+                        <span>''' + load_lang('id') + ''' : ''' + ip + '''</span>
+                        <hr class=\"main_hr\">
+                        <a href="/pw_change">(''' + load_lang('password_change') + ''')</a>
+                        <hr class=\"main_hr\">
+                        <a href="/email_change">(e_ch)</a>
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('skin') + '''</span>
+                        <hr class=\"main_hr\">
+                        <select name="skin">''' + div2 + '''</select>
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('language') + '''</span>
+                        <hr class=\"main_hr\">
+                        <select name="lang">''' + div3 + '''</select>
+                        <hr class=\"main_hr\">
+                        <span>''' + load_lang('oauth_connection') + '''</span>
+                        ''' + oauth_content + '''
+                        <hr class=\"main_hr\">
+                        <button type="submit">''' + load_lang('save') + '''</button>
+                        ''' + http_warring + '''
+                    </form>
+                ''',
+                menu = [['user', load_lang('return')]]
+            ))
+    else:
+        pass

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.1-master-02",
+        "r_ver" : "v3.1.1-master-04",
         "c_ver" : "400001",
         "s_ver" : "2"
     }, "stable" : {