list_acl.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. from .tool.func import *
  2. def list_acl_2(conn):
  3. curs = conn.cursor()
  4. num = int(number_check(flask.request.args.get('num', '1')))
  5. sql_num = (num * 50 - 50) if num * 50 > 0 else 0
  6. div = '<ul class="inside_ul">'
  7. curs.execute(db_change("select distinct title from acl where data != '' order by title desc limit ?, 50"), [sql_num])
  8. list_data = curs.fetchall()
  9. for data in list_data:
  10. if not re.search(r'^user:', data[0]) and not re.search(r'^file:', data[0]):
  11. curs.execute(db_change("select time from re_admin where what like ? order by time desc limit 1"), ['acl (' + data[0] + ')%'])
  12. time_data = curs.fetchall()
  13. time_data = (time_data[0][0] + ' | ') if time_data else ''
  14. curs.execute(db_change("select data from acl where title = ? and type = 'why'"), [data[0]])
  15. why_data = curs.fetchall()
  16. why_data = (' | ' + why_data[0][0]) if why_data and why_data[0][0] != '' else ''
  17. div += '' + \
  18. '<li>' + \
  19. time_data + \
  20. '<a href="/acl/' + url_pas(data[0]) + '">' + data[0] + '</a>' + \
  21. why_data + \
  22. '</li>' + \
  23. ''
  24. div += '</ul>'
  25. div += next_fix('/acl_list?num=', num, list_data)
  26. return easy_minify(flask.render_template(skin_check(),
  27. imp = [load_lang('acl_document_list'), wiki_set(), custom(), other2([0, 0])],
  28. data = div,
  29. menu = [['other', load_lang('return')]]
  30. ))