list_acl.py 1.2 KB

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