Bladeren bron

코드 수정

2DU 8 jaren geleden
bovenliggende
commit
89a7175dc7
3 gewijzigde bestanden met toevoegingen van 24 en 36 verwijderingen
  1. 2 0
      app.py
  2. 12 23
      func.py
  3. 10 13
      views/acme/css/bootstrap-reset.css

+ 2 - 0
app.py

@@ -1526,6 +1526,7 @@ def preview(name = None, num = None):
 
     ip = ip_check()
     can = acl_check(conn, name)
+    captcha = captcha_get(conn)
     
     if(can == 1):
         return(re_error(conn, '/ban'))
@@ -1545,6 +1546,7 @@ def preview(name = None, num = None):
                     <textarea rows="25" name="content">' + html.escape(request.forms.content) + '</textarea> \
                     <textarea style="display: none;" name="otent">' + html.escape(request.forms.otent) + '</textarea><br><br> \
                     <input placeholder="사유" name="send" type="text"><br><br> \
+                    ' + captcha + ' \
                     <button id="preview" class="btn btn-primary" type="submit">저장</button> \
                     <button id="preview" class="btn" type="submit" formaction="/preview/' + url_pas(name) + action + '">미리보기</button> \
                 </form><br><br>' + enddata,

+ 12 - 23
func.py

@@ -28,7 +28,7 @@ def captcha_get(conn):
     curs = conn.cursor()
 
     data = ''
-    if(re.search('\.|:', ip_check()) and session.get('Awaken') != 1):
+    if(re.search('\.|:', ip_check()) and session.get('Awaken') and session.get('Awaken') != 1):
         curs.execute('select data from other where name = "recaptcha"')
         recaptcha = curs.fetchall()
         if(recaptcha and recaptcha[0][0] != ''):
@@ -39,7 +39,7 @@ def captcha_get(conn):
 def captcha_post(conn, num = 1):
     session = request.environ.get('beaker.session')
     if(num == 1):
-        if(re.search('\.|:', ip_check()) and session.get('Awaken') != 1 and captcha_get(conn) != ''):
+        if(re.search('\.|:', ip_check()) and session.get('Awaken') and session.get('Awaken') != 1 and captcha_get(conn) != ''):
             return(1)
         else:
             return(0)
@@ -369,7 +369,6 @@ def re_error(conn, data):
                 if(m):
                     curs.execute("select end, why from ban where block = ? and band = 'O'", [m.groups()[0]])
                     d = curs.fetchall()
-
             if(d):
                 if(d[0][0]):
                     end = d[0][0] + ' 까지 차단 상태 입니다. / 사유 : ' + d[0][1]                
@@ -392,17 +391,12 @@ def re_error(conn, data):
                         end = '차단이 풀렸습니다. 다시 시도 해 보세요.'
                 else:
                     end = '영구 차단 상태 입니다. / 사유 : ' + d[0][1]
-            
 
-        return(
-            html_minify(
-                template('index', 
-                    imp = ['권한 오류', wiki_set(conn, 1), custom(conn), other2([0, 0])],
-                    data = end,
-                    menu = 0
-                )
-            )
-        )
+        return(html_minify(template('index', 
+            imp = ['권한 오류', wiki_set(conn, 1), custom(conn), other2([0, 0])],
+            data = end,
+            menu = 0
+        )))
 
     d = re.search('\/error\/([0-9]+)', data)
     if(d):
@@ -469,16 +463,11 @@ def re_error(conn, data):
             data = '재 확인이랑 비밀번호가 다릅니다.'
 
         if(title):
-            return(
-                html_minify(
-                    template(
-                        'index', 
-                        imp = [title, wiki_set(conn, 1), custom(conn), other2([0, 0])],
-                        data = data,
-                        menu = 0
-                    )
-                )
-            )
+            return(html_minify(template('index', 
+                imp = [title, wiki_set(conn, 1), custom(conn), other2([0, 0])],
+                data = data,
+                menu = 0
+            )))
         else:
             return(redirect('/'))
     else:

+ 10 - 13
views/acme/css/bootstrap-reset.css

@@ -336,10 +336,6 @@ div.scroll-buttons a.scroll-button {
     box-sizing: border-box;
 }
 
-blockquote {
-    margin: 10px 0 10px;
-}
-
 img {
     max-width: 100%;
     height: auto;
@@ -557,16 +553,17 @@ iframe {
 }
 
 blockquote {
-    padding:1em calc(2em + 25px) 1em 1em;
-    margin:1em 0em 0em;
-    background:#eeeeee;
-    display:table;
-    border:2px dashed #ccc;
-    border-left:5px solid #2C3E50;
+    padding: 1em calc(2em + 25px) 1em 1em;
+    margin: 1em 0em 0em;
+    background: #eeeeee;
+    display: block;
+    border: 2px dashed #ccc;
+    border-left: 5px solid #2C3E50;
     background-image: url('/views/acme/img/quote.png');
-    background-position:calc(100% - 10px) 10px;
-    background-repeat:no-repeat;
-    background-size:25px;
+    background-position: calc(100% - 10px) 10px;
+    background-repeat: no-repeat;
+    background-size: 25px;
+    font-size: 14px;
 }
 
 img {