from .tool.func import *
def give_user_check_2(conn, name):
curs = conn.cursor()
curs.execute(db_change("select acl from user where id = ? or id = ?"), [name, flask.request.args.get('plus', '-')])
user = curs.fetchall()
if user and user[0][0] != 'user':
if admin_check() != 1:
return re_error('/error/4')
if admin_check(4, 'check (' + name + ')') != 1:
return re_error('/error/3')
num = int(number_check(flask.request.args.get('num', '1')))
if num * 50 > 0:
sql_num = num * 50 - 50
else:
sql_num = 0
div = ''
plus_id = flask.request.args.get('plus', None)
if ip_or_user(name) == 0:
curs.execute(db_change("select data from user_set where name = \"approval_question\" and id = ?"), [name])
approval_question = curs.fetchall()
if approval_question and approval_question[0][0]:
curs.execute(db_change("select data from user_set where name = \"approval_question_answer\" and id = ?"), [name])
approval_question_answer = curs.fetchall()
if approval_question_answer and approval_question_answer[0]:
div = '''
| ''' + load_lang('name') + ''' |
''' + load_lang('ip') + ''' |
''' + load_lang('time') + ''' |
'''
set_n = 0
for data in record:
if data[2]:
if len(data[2]) > 300:
ua = '' + \
'(300+)' + \
'' + html.escape(data[2]) + '
' + \
''
set_n += 1
else:
ua = html.escape(data[2])
else:
ua = '
'
div += '''
| ''' + ip_pas(data[0]) + ''' |
''' + ip_pas(data[1]) + ''' |
''' + data[3] + ''' |
| ''' + ua + ''' |
'''
div += '''
'''
else:
return re_error('/error/2')
div += next_fix(
'/check/' + url_pas(name) + ('?plus=' + plus_id if plus_id else '') + '&num=',
num,
record
)
return easy_minify(flask.render_template(skin_check(),
imp = [load_lang('check'), wiki_set(), custom(), other2([0, 0])],
data = div,
menu = [['manager', load_lang('return')]]
))