|
|
@@ -1926,8 +1926,6 @@ def manager(num = 1):
|
|
|
' * [[wiki:indexing|인덱싱]]\r\n' + \
|
|
|
' * [[wiki:manager/8|관리 그룹 생성]]\r\n' + \
|
|
|
' * [[wiki:edit_set|설정 편집]]\r\n' + \
|
|
|
- ' * [[wiki:manager/9|JSON 출력]]\r\n' + \
|
|
|
- ' * [[wiki:json_in|JSON 입력]]\r\n' + \
|
|
|
'== 기타 ==\r\n' + \
|
|
|
' * 이 메뉴에 없는 기능은 해당 문서의 역사나 토론에서 바로 사용 가능함', 0, 0, 0),
|
|
|
menu = [['other', '기타']]
|
|
|
@@ -2042,24 +2040,6 @@ def manager(num = 1):
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
- elif(num == 9):
|
|
|
- if(request.method == 'POST'):
|
|
|
- return(redirect('/json_out/' + url_pas(request.forms.name)))
|
|
|
- else:
|
|
|
- return(
|
|
|
- html_minify(
|
|
|
- template('index',
|
|
|
- imp = ['문서 출력 이동', wiki_set(conn, 1), custom(conn), other2([0, 0])],
|
|
|
- data = '<form method="post"> \
|
|
|
- <input placeholder="문서명" name="name" type="text"> \
|
|
|
- <br> \
|
|
|
- <br> \
|
|
|
- <button class="btn btn-primary" type="submit">이동</button> \
|
|
|
- </form>',
|
|
|
- menu = [['manager', '관리자']]
|
|
|
- )
|
|
|
- )
|
|
|
- )
|
|
|
elif(num == 10):
|
|
|
if(request.method == 'POST'):
|
|
|
return(redirect('/check/' + url_pas(request.forms.name) + '/' + url_pas(request.forms.name2)))
|
|
|
@@ -2083,80 +2063,6 @@ def manager(num = 1):
|
|
|
)
|
|
|
else:
|
|
|
return(redirect('/'))
|
|
|
-
|
|
|
-@route('/json_out/<name:path>')
|
|
|
-def json_out(name = None):
|
|
|
- if(admin_check(conn, None, 'json_out') != 1):
|
|
|
- return(re_error(conn, '/error/3'))
|
|
|
-
|
|
|
- curs.execute('select data from data where title = ?', [name])
|
|
|
- get_d = curs.fetchall()
|
|
|
- if(get_d):
|
|
|
- da = get_d[0][0]
|
|
|
- else:
|
|
|
- da = ''
|
|
|
-
|
|
|
- curs.execute('select ip from history where title = ? order by ip asc', [name])
|
|
|
- get_h = curs.fetchall()
|
|
|
-
|
|
|
- var_n = ''
|
|
|
- hi_d = ''
|
|
|
- for hi in get_h:
|
|
|
- if(hi[0] != var_n):
|
|
|
- var_n = hi[0]
|
|
|
- hi_d += json.dumps(hi[0]) + ', '
|
|
|
- else:
|
|
|
- hi_d = re.sub(', $', '', hi_d)
|
|
|
-
|
|
|
- if(hi_d == ''):
|
|
|
- return(redirect('/w/' + url_pas(name)))
|
|
|
-
|
|
|
- json_f = '{ "title" : ' + json.dumps(name) + ', "data" : ' + json.dumps(da) + ', "history" : [' + hi_d + '] }'
|
|
|
-
|
|
|
- return(json_f)
|
|
|
-
|
|
|
-@route('/json_in', method=['POST', 'GET'])
|
|
|
-def json_in():
|
|
|
- if(admin_check(conn, None, 'json_in') != 1):
|
|
|
- return(re_error(conn, '/error/3'))
|
|
|
-
|
|
|
- if(request.method == 'POST'):
|
|
|
- data = json.loads(request.forms.data)
|
|
|
- title = data["title"]
|
|
|
-
|
|
|
- curs.execute('select title from history where title = ?', [title])
|
|
|
- get_d = curs.fetchall()
|
|
|
- if(get_d):
|
|
|
- return(redirect('/w/' + url_pas(title)))
|
|
|
-
|
|
|
- curs.execute('insert into data (title, data, acl) values (?, ?, "")', [title, data["data"]])
|
|
|
-
|
|
|
- i = 0
|
|
|
- date = get_time()
|
|
|
- for hi in data["history"]:
|
|
|
- i += 1
|
|
|
- if(i == 1):
|
|
|
- curs.execute('insert into history (id, title, data, date, ip, send, leng) values (?, ?, ?, ?, ?, "", ?)', [i, title, data["data"], date, hi, '+' + len(data["data"])])
|
|
|
- else:
|
|
|
- curs.execute('insert into history (id, title, data, date, ip, send, leng) values (?, ?, "", ?, ?, "", "0")', [i, title, date, hi])
|
|
|
-
|
|
|
- conn.commit()
|
|
|
- return(redirect('/w/' + url_pas(title)))
|
|
|
- else:
|
|
|
- return(
|
|
|
- html_minify(
|
|
|
- template('index',
|
|
|
- imp = ['문서 JSON 입력', wiki_set(conn, 1), custom(conn), other2([0, 0])],
|
|
|
- data = '<form method="post"> \
|
|
|
- <textarea rows="25" name="data"></textarea> \
|
|
|
- <br> \
|
|
|
- <br> \
|
|
|
- <button class="btn btn-primary" type="submit">입력</button> \
|
|
|
- </form>',
|
|
|
- menu = [['manager', '관리자']]
|
|
|
- )
|
|
|
- )
|
|
|
- )
|
|
|
|
|
|
@route('/title_index')
|
|
|
@route('/title_index/<num:int>/<page:int>')
|