فهرست منبع

코드 수정

2DU 8 سال پیش
والد
کامیت
ab7f72f8b6
2فایلهای تغییر یافته به همراه87 افزوده شده و 92 حذف شده
  1. 66 66
      app.py
  2. 21 26
      func.py

+ 66 - 66
app.py

@@ -83,7 +83,7 @@ def re_error(data):
         return(
             html_minify(
                 template('index', 
-                    imp = ['권한 오류', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['권한 오류', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data = end,
                     menu = 0
                 )
@@ -153,7 +153,7 @@ def re_error(data):
                 html_minify(
                     template(
                         'index', 
-                        imp = [title, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = [title, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = data,
                         menu = 0
                     )
@@ -274,7 +274,7 @@ def alarm():
     return(
             html_minify(
                 template('index', 
-                    imp = ['알림', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['알림', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data = da,
                     menu = [['user', '사용자']]
                 )
@@ -288,7 +288,7 @@ def edit_set(num = 0):
         return(
             html_minify(
                 template('index', 
-                    imp = ['설정 편집', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['설정 편집', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data = '<ul> \
                                 <li><a href="/edit_set/1">기본 설정</a></li> \
                                 <li><a href="/edit_set/2">문구 관련</a></li> \
@@ -329,7 +329,7 @@ def edit_set(num = 0):
                 return(
                     html_minify(
                         template('index', 
-                            imp = ['기본 설정', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                            imp = ['기본 설정', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                             data = '<form method="post"> \
                                         <span>위키 이름 (기본 : 무명위키)</span> \
                                         <br> \
@@ -395,7 +395,7 @@ def edit_set(num = 0):
                 return(
                     html_minify(
                         template('index', 
-                            imp = ['문구 관련', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                            imp = ['문구 관련', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                             data = '<form method="post"> \
                                         <span>가입 약관</span> \
                                         <br> \
@@ -431,7 +431,7 @@ def not_close_topic():
     return(
         html_minify(
             template('index', 
-                imp = ['열린 토론 목록', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['열린 토론 목록', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = div,
                 menu = [['manager', '관리자']]
             )
@@ -468,7 +468,7 @@ def acl_list():
     return(
         html_minify(
             template('index', 
-                imp = ['ACL 문서 목록', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['ACL 문서 목록', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = div,
                 menu = [['other', '기타']]
             )
@@ -507,7 +507,7 @@ def list_acl():
     return(
         html_minify(
             template('index',    
-                imp = ['ACL 목록', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['ACL 목록', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = re.sub('^<ul></ul><br>', '', div),
                 menu = [['manager', '관리자']]
             )
@@ -578,7 +578,7 @@ def admin_plus(name = None):
             return(
                 html_minify(
                     template('index', 
-                        imp = ['관리 그룹 추가', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['관리 그룹 추가', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post">' \
                                     + data + \
                                     '<div class="form-actions"> \
@@ -612,7 +612,7 @@ def admin_list():
     return(
         html_minify(
             template('index', 
-                imp = ['관리자 목록', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['관리자 목록', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = div,
                 menu = [['other', '기타']]
             )
@@ -733,7 +733,7 @@ def recent_changes(name = None, num = 1):
     return(
         html_minify(
             template('index', 
-                imp = [title, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), sub, 0],
+                imp = [title, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), sub, 0],
                 data = div,
                 menu = menu
             )
@@ -790,7 +790,7 @@ def user_log(num = 1):
     return(
         html_minify(
             template('index', 
-                imp = ['사용자 가입 기록', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['사용자 가입 기록', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = list_data,
                 menu = [['other', '기타']]
             )
@@ -826,7 +826,7 @@ def user_log(num = 1):
     return(
         html_minify(
             template('index', 
-                imp = ['관리자 권한 기록', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['관리자 권한 기록', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = list_data,
                 menu = [['other', '기타']]
             )
@@ -859,7 +859,7 @@ def give_log(num = 1):
     return(
         html_minify(
             template('index', 
-                imp = ['권한 목록', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['권한 목록', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = list_data,
                 menu = [['other', '기타']]
             )
@@ -914,7 +914,7 @@ def xref(name = None, num = 1):
     return(
         html_minify(
             template('index', 
-                imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (역링크)', 0],
+                imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (역링크)', 0],
                 data = div,
                 menu = [['w/' + url_pas(name), '문서']]
             )
@@ -975,7 +975,7 @@ def recent_discuss(tools = 'normal'):
     return(
         html_minify(
             template('index', 
-                imp = ['최근 토론내역', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), m_sub, 0],
+                imp = ['최근 토론내역', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), m_sub, 0],
                 data = div,
                 menu = 0
             )
@@ -1037,7 +1037,7 @@ def block_log(num = 1):
     return(
         html_minify(
             template('index', 
-                imp = ['차단 기록', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['차단 기록', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = div,
                 menu = [['other', '기타']]
             )
@@ -1153,7 +1153,7 @@ def history_view(name = None, num = 1):
         return(
             html_minify(
                 template('index', 
-                    imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (역사)', 0],
+                    imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (역사)', 0],
                     data = div,
                     menu = [['w/' + url_pas(name), '문서'], ['move_data/' + url_pas(name), '이동 기록']]
                 )
@@ -1241,7 +1241,7 @@ def deep_search(name = None, num = 1):
     return(
         html_minify(
             template('index', 
-                imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (검색)', 0],
+                imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (검색)', 0],
                 data = div,
                 menu = 0
             )
@@ -1285,7 +1285,7 @@ def raw_view(name = None, sub_t = None, num = None):
         return(
             html_minify(
                 template('index', 
-                    imp = [v_name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), sub, 0],
+                    imp = [v_name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), sub, 0],
                     data = p_data,
                     menu = menu
                 )
@@ -1350,7 +1350,7 @@ def revert(name = None, num = None):
             curs.execute("select title from history where title = ? and id = ?", [name, str(num)])
             rows = curs.fetchall()
             if(rows):
-                l_c = login_check()
+                l_c = custom(0)
                 if(l_c == 0):
                     plus = '<span>비 로그인 상태입니다. 비 로그인으로 작업 시 아이피가 역사에 기록됩니다.</span> \
                             <br> \
@@ -1361,7 +1361,7 @@ def revert(name = None, num = None):
                 return(
                     html_minify(
                         template('index', 
-                            imp = [name, wiki_set(1), wiki_set(3), l_c, custom_css(), custom_js(), ' (되돌리기)', 0],
+                            imp = [name, wiki_set(1), wiki_set(3), l_c, custom(1), custom(2), ' (되돌리기)', 0],
                             data =  plus + ' \
                                     <form method="post"> \
                                         <input placeholder="사유" style="width: 100%;" class="form-control input-sm" name="send" type="text"> \
@@ -1409,7 +1409,7 @@ def m_del():
             return(
                 html_minify(
                     template('index', 
-                        imp = ['많은 문서 삭제', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['많은 문서 삭제', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<span> \
                                     문서명 A \
                                     <br> \
@@ -1532,7 +1532,7 @@ def edit(name = None, num = None):
         return(
             html_minify(
                 template('index', 
-                    imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (수정)', 0],
+                    imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (수정)', 0],
                     data = '<form method="post" action="/edit/' + url_pas(name) + action + '"> \
                                 <textarea style="height: 80%;" name="content">' + data + '</textarea> \
                                 <textarea style="display: none; height: 80%;" name="otent">' + data + '</textarea> \
@@ -1572,7 +1572,7 @@ def preview(name = None, num = None):
     return(
         html_minify(
             template('index', 
-                imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (미리보기)', 0],
+                imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (미리보기)', 0],
                 data = '<form method="post" action="/edit/' + url_pas(name) + action + '"> \
                             <textarea style="height: 80%;" name="content">' + request.forms.content + '</textarea> \
                             <textarea style="display: none; height: 80%;" name="otent">' + request.forms.otent + '</textarea> \
@@ -1629,7 +1629,7 @@ def delete(name = None):
             if(can == 1):
                 return(re_error('/ban'))
             else:
-                l_c = login_check()
+                l_c = custom(0)
                 if(l_c == 0):
                     plus = '<span>비 로그인 상태입니다. 비 로그인으로 작업 시 아이피가 역사에 기록됩니다.</span><br><br>'
                 else:
@@ -1638,7 +1638,7 @@ def delete(name = None):
                 return(
                     html_minify(
                         template('index', 
-                            imp = [name, wiki_set(1), wiki_set(3), l_c, custom_css(), custom_js(), ' (삭제)', 0],
+                            imp = [name, wiki_set(1), wiki_set(3), l_c, custom(1), custom(2), ' (삭제)', 0],
                             data = '<form method="post"> \
                                         ' + plus + ' \
                                         <input placeholder="사유" style="width: 100%;" class="form-control input-sm" name="send" type="text"> \
@@ -1676,7 +1676,7 @@ def move_data(name = None, n = 1):
     return(
         html_minify(
             template('index', 
-                imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (이동)', 0],
+                imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (이동)', 0],
                 data = da,
                 menu = [['w/' + url_pas(name), '문서']]
             )
@@ -1727,7 +1727,7 @@ def move(name = None):
         
         return(redirect('/w/' + url_pas(request.forms.title)))
     else:
-        l_c = login_check()
+        l_c = custom(0)
         if(l_c == 0):
             plus = '<span>비 로그인 상태입니다. 비 로그인으로 작업 시 아이피가 역사에 기록됩니다.</span><br><br>'
         else:
@@ -1736,7 +1736,7 @@ def move(name = None):
         return(
             html_minify(
                 template('index', 
-                    imp = [name, wiki_set(1), wiki_set(3), l_c, custom_css(), custom_js(), ' (이동)', 0],
+                    imp = [name, wiki_set(1), wiki_set(3), l_c, custom(1), custom(2), ' (이동)', 0],
                     data = '<form method="post"> \
                                 ' + plus + ' \
                                 <input placeholder="문서명" class="form-control input-sm" value="' + name + '" name="title" type="text"> \
@@ -1757,7 +1757,7 @@ def other():
     return(
         html_minify(
             template('index', 
-                imp = ['기타 메뉴', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['기타 메뉴', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = namumark('', '[목차(없음)]\r\n' + \
                                     '== 기록 ==\r\n' + \
                                     ' * [[wiki:block_log|차단 기록]]\r\n' + \
@@ -1787,7 +1787,7 @@ def manager(num = 1):
         return(
             html_minify(
                 template('index', 
-                    imp = ['관리자 메뉴', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['관리자 메뉴', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data = namumark('', '[목차(없음)]\r\n' + \
                                         '== 목록 ==\r\n' + \
                                         ' * [[wiki:manager/2|문서 ACL]]\r\n' + \
@@ -1815,7 +1815,7 @@ def manager(num = 1):
             return(
                 html_minify(
                     template('index', 
-                        imp = ['ACL 이동', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['ACL 이동', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post"> \
                                     <input placeholder="문서명" name="name" type="text"> \
                                     <br> \
@@ -1833,7 +1833,7 @@ def manager(num = 1):
             return(
                 html_minify(
                     template('index', 
-                        imp = ['검사 이동', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['검사 이동', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post"> \
                                     <input placeholder="사용자명" name="name" type="text"> \
                                     <br> \
@@ -1851,7 +1851,7 @@ def manager(num = 1):
             return(
                 html_minify(
                     template('index', 
-                        imp = ['차단 이동', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['차단 이동', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post"> \
                                     <input placeholder="사용자명" name="name" type="text"> \
                                     <br> \
@@ -1869,7 +1869,7 @@ def manager(num = 1):
             return(
                 html_minify(
                     template('index', 
-                        imp = ['권한 이동', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['권한 이동', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post"> \
                                     <input placeholder="사용자명" name="name" type="text"> \
                                     <br> \
@@ -1887,7 +1887,7 @@ def manager(num = 1):
             return(
                 html_minify(
                     template('index', 
-                        imp = ['기록 이동', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['기록 이동', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post"> \
                                     <input placeholder="사용자명" name="name" type="text"> \
                                     <br> \
@@ -1905,7 +1905,7 @@ def manager(num = 1):
             return(
                 html_minify(
                     template('index', 
-                        imp = ['그룹 생성 이동', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['그룹 생성 이동', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post"> \
                                     <input placeholder="그룹명" name="name" type="text"> \
                                     <br> \
@@ -1923,7 +1923,7 @@ def manager(num = 1):
             return(
                 html_minify(
                     template('index', 
-                        imp = ['문서 출력 이동', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['문서 출력 이동', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post"> \
                                     <input placeholder="문서명" name="name" type="text"> \
                                     <br> \
@@ -1941,7 +1941,7 @@ def manager(num = 1):
             return(
                 html_minify(
                     template('index', 
-                        imp = ['검사 이동', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['검사 이동', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post"> \
                                     <input placeholder="사용자명" name="name" type="text"> \
                                     <br> \
@@ -2018,7 +2018,7 @@ def json_in():
             return(
                 html_minify(
                     template('index', 
-                        imp = ['문서 JSON 입력', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                        imp = ['문서 JSON 입력', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                         data = '<form method="post"> \
                                     <textarea style="height: 80%;" name="data"></textarea> \
                                     <br> \
@@ -2084,7 +2084,7 @@ def title_index(num = 1000, page = 1):
     return(
         html_minify(
             template('index', 
-                imp = ['모든 문서', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (' + str(num) + ')', 0],
+                imp = ['모든 문서', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (' + str(num) + ')', 0],
                 data = data,
                 menu = [['other', '기타']]
             )    
@@ -2253,7 +2253,7 @@ def topic_admin(name = None, sub = None, num = None):
     return(
         html_minify(
             template('index', 
-                imp = ['토론 관리', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (' + str(num) + '번)', 0],
+                imp = ['토론 관리', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (' + str(num) + '번)', 0],
                 data = '<ul>' + ban + '</ul>',
                 menu = [['topic/' + url_pas(name) + '/sub/' + url_pas(sub) + '#' + str(num), '토론']]
             )  
@@ -2436,7 +2436,7 @@ def topic(name = None, sub = None):
                 
             i += 1
 
-        l_c = login_check()
+        l_c = custom(0)
 
         if(ban != 1):
             data = '<a id="reload" href="javascript:void(0);" onclick="location.href.endsWith(\'#reload\') ?  location.reload(true) : location.href = \'#reload\'"> \
@@ -2459,7 +2459,7 @@ def topic(name = None, sub = None):
         return(
             html_minify(
                 template('index', 
-                    imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (토론)', 0],
+                    imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (토론)', 0],
                     data =  '<h2 style="margin-top: 0px;">' + sub + '</h2> \
                             <br> \
                             ' + div + ' \
@@ -2534,7 +2534,7 @@ def close_topic_list(name = None, tool = None):
         return(
             html_minify(
                 template('index', 
-                    imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (' + sub + ')', 0],
+                    imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (' + sub + ')', 0],
                     data =  '<form style="margin-top: 0px;" method="post"> \
                                 ' + div + plus + ' \
                             </form>',
@@ -2589,7 +2589,7 @@ def login():
         return(
             html_minify(
                 template('index',    
-                    imp = ['로그인', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['로그인', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data = '<form method="post"> \
                                 <input placeholder="아이디" name="id" type="text"> \
                                 <br> \
@@ -2646,7 +2646,7 @@ def change_password():
         return(
             html_minify(
                 template('index',    
-                    imp = ['비밀번호 변경', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['비밀번호 변경', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data = '<form method="post"> \
                                 <input placeholder="아이디" name="id" type="text"> \
                                 <br> \
@@ -2725,7 +2725,7 @@ def user_check(name = None, name2 = None):
         return(
             html_minify(
                 template('index',    
-                    imp = ['다중 검사', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['다중 검사', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data = c,
                     menu = [['manager', '관리자']]
                 )
@@ -2780,7 +2780,7 @@ def register():
         return(
             html_minify(
                 template('index',    
-                    imp = ['회원가입', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['회원가입', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data = '<form method="post"> \
                                 ' + p + ' \
                                 <input placeholder="아이디" name="id" type="text"> \
@@ -2896,7 +2896,7 @@ def user_ban(name = None):
             return(
                 html_minify(
                     template('index', 
-                        imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (' + now + ')', 0],
+                        imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (' + now + ')', 0],
                         data = '<form method="post"> \
                                     ' + data + ' \
                                     <button class="btn btn-primary" type="submit">' + now + '</button> \
@@ -2942,7 +2942,7 @@ def acl(name = None):
         return(
             html_minify(
                 template('index', 
-                    imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (SET)', 0],
+                    imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (SET)', 0],
                     data = '<span>현재 ACL : ' + now + '</span> \
                             <br> \
                             <br> \
@@ -2997,7 +2997,7 @@ def acl(name = None):
                 return(
                     html_minify(
                         template('index', 
-                            imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (ACL)', 0],
+                            imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (ACL)', 0],
                             data = '<span>현재 ACL : ' + now + '</span> \
                                     <br> \
                                     <br> \
@@ -3056,7 +3056,7 @@ def user_admin(name = None):
                 return(
                     html_minify(
                         template('index', 
-                            imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (권한 부여)', 0],
+                            imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (권한 부여)', 0],
                             data =  '<form method="post"> \
                                         <select name="select"> \
                                             ' + div + ' \
@@ -3102,7 +3102,7 @@ def diff_data(name = None, a = None, b = None):
             return(
                 html_minify(
                     template('index', 
-                        imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (비교)', 0],
+                        imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (비교)', 0],
                         data = result,
                         menu = [['history/' + url_pas(name), '역사']]
                     )
@@ -3128,7 +3128,7 @@ def down(name = None):
     return(
         html_minify(
             template('index', 
-                imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), ' (하위)', 0],
+                imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), ' (하위)', 0],
                 data = div,
                 menu = [['w/' + url_pas(name), '문서']]
             )
@@ -3290,7 +3290,7 @@ def read_view(name = None, num = None, redirect = None):
     return(
         html_minify(
             template('index', 
-                imp = [name, wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), sub + acl, r_date],
+                imp = [name, wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), sub + acl, r_date],
                 data = enddata + namumark(name, div, 0, 0, 0),
                 menu = menu
             )
@@ -3361,7 +3361,7 @@ def user_topic_list(name = None, num = 1):
     return(
         html_minify(
             template('index', 
-                imp = ['토론 기록', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), sub, 0],
+                imp = ['토론 기록', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), sub, 0],
                 data = div,
                 menu = [['other', '기타'], ['user', '사용자']]
             )
@@ -3429,7 +3429,7 @@ def upload():
         return(
             html_minify(
                 template('index', 
-                    imp = ['파일 올리기', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['파일 올리기', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data =  '<form method="post" enctype="multipart/form-data" accept-charset="utf8"> \
                                 <input type="file" name="f_data"> \
                                 <br> \
@@ -3470,7 +3470,7 @@ def user_info():
         
     ip = ip_pas(ip)
 
-    if(login_check() == 1):
+    if(custom(0) == 1):
         plus = ' * [[wiki:logout|로그아웃]]\r\n * [[wiki:change|비밀번호 변경]]'
     else:
         plus = ' * [[wiki:login|로그인]]'
@@ -3478,7 +3478,7 @@ def user_info():
     return(
         html_minify(
             template('index', 
-                imp = ['사용자 메뉴', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['사용자 메뉴', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data =  ip + '<br><br>' + namumark('',  '권한 상태 : ' + acl + '\r\n' + \
                                                         '[목차(없음)]\r\n' + \
                                                         '== 로그인 ==\r\n' + \
@@ -3513,7 +3513,7 @@ def view_log():
     return(
         html_minify(
             template('index', 
-                imp = ['지나온 문서', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['지나온 문서', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = data,
                 menu = [['user', '사용자']]
             )
@@ -3556,7 +3556,7 @@ def custom_css_view():
         return(
             html_minify(
                 template('index', 
-                    imp = ['사용자 CSS', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['사용자 CSS', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data =  start + ' \
                             <form method="post"> \
                                 <textarea rows="30" cols="100" name="content">'\
@@ -3608,7 +3608,7 @@ def custom_js_view():
         return(
             html_minify(
                 template('index', 
-                    imp = ['사용자 JS', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                    imp = ['사용자 JS', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                     data =  start + ' \
                             <form method="post"> \
                                 <textarea rows="30" cols="100" name="content">'\
@@ -3650,7 +3650,7 @@ def count_edit(name = None):
     return(
         html_minify(
             template('index', 
-                imp = ['기여 횟수', wiki_set(1), wiki_set(3), login_check(), custom_css(), custom_js(), 0, 0],
+                imp = ['기여 횟수', wiki_set(1), wiki_set(3), custom(0), custom(1), custom(2), 0, 0],
                 data = namumark("", "||<-2><:> " + that + " ||\r\n||<:> 기여 횟수 ||<:> " + str(data) + "||\r\n||<:> 토론 횟수 ||<:> " + str(t_data) + "||", 0, 0, 0),
                 menu = [['user', '사용자']]
             )

+ 21 - 26
func.py

@@ -105,17 +105,6 @@ def include_check(name, data):
                 curs.execute("delete from back where link = ?", [back_p[0]])
                 curs.execute("delete from cat where cat = ?", [back_p[0]])
                 namumark(back_p[0], data[0][0], 1, 0, 0)
-    
-def login_check():
-    session = request.environ.get('beaker.session')
-    if(session.get('Now') == 1):
-        curs.execute('select name from alarm limit 1')
-        if(curs.fetchall()):
-            return(2)
-        else:
-            return(1)
-    else:
-        return(0)
 
 def ip_pas(raw_ip):
     if(re.search("(\.|:)", raw_ip)):
@@ -132,23 +121,29 @@ def ip_pas(raw_ip):
 
     return(ip)
 
-def custom_css():
-    session = request.environ.get('beaker.session')
-    try:
-        data = format(session['Daydream'])
-    except:
-        data = ''
-
-    return(data)
-
-def custom_js():
+def custom(num):
     session = request.environ.get('beaker.session')
-    try:
-        data = format(session['AQUARIUM'])
-    except:
-        data = ''
+    if(num == 1):
+        try:
+            d = format(session['Daydream'])
+        except:
+            d = ''
+    elif(num == 2):
+        try:
+            d = format(session['AQUARIUM'])
+        except:
+            d = ''
+    else:
+        if(session.get('Now') == 1):
+            curs.execute('select name from alarm limit 1')
+            if(curs.fetchall()):
+                return(2)
+            else:
+                return(1)
+        else:
+            return(0)
 
-    return(data)
+    return(d)
 
 def acl_check(name):
     ip = ip_check()