from .tool.func import * def delete_2(conn, name): curs = conn.cursor() ip = ip_check() if acl_check(name) == 1: return re_error('/ban') if flask.request.method == 'POST': if captcha_post(flask.request.form.get('g-recaptcha-response', '')) == 1: return re_error('/error/13') else: captcha_post('', 0) curs.execute("select data from data where title = ?", [name]) data = curs.fetchall() if data: today = get_time() leng = '-' + str(len(data[0][0])) history_plus( name, '', today, ip, flask.request.form.get('send', None) + ' (delete)', leng ) curs.execute("select title, link from back where title = ? and not type = 'cat' and not type = 'no'", [name]) for data in curs.fetchall(): curs.execute("insert into back (title, link, type) values (?, ?, 'no')", [data[0], data[1]]) curs.execute("delete from back where link = ?", [name]) curs.execute("delete from data where title = ?", [name]) conn.commit() return redirect('/w/' + url_pas(name)) else: curs.execute("select title from data where title = ?", [name]) if not curs.fetchall(): return redirect('/w/' + url_pas(name)) return easy_minify(flask.render_template(skin_check(), imp = [name, wiki_set(), custom(), other2([' (' + load_lang('delete') + ')', 0])], data = '''
''', menu = [['w/' + url_pas(name), load_lang('return')]] ))