|
@@ -4,9 +4,8 @@ def applications_2(conn):
|
|
|
curs = conn.cursor()
|
|
curs = conn.cursor()
|
|
|
|
|
|
|
|
div = ''
|
|
div = ''
|
|
|
- admin = admin_check()
|
|
|
|
|
|
|
|
|
|
- if admin != 1:
|
|
|
|
|
|
|
+ if admin_check() != 1:
|
|
|
return re_error('/ban')
|
|
return re_error('/ban')
|
|
|
|
|
|
|
|
curs.execute(db_change('select data from other where name = "requires_approval"'))
|
|
curs.execute(db_change('select data from other where name = "requires_approval"'))
|
|
@@ -26,10 +25,13 @@ def applications_2(conn):
|
|
|
email = application[5]
|
|
email = application[5]
|
|
|
if not question:
|
|
if not question:
|
|
|
question = ''
|
|
question = ''
|
|
|
|
|
+
|
|
|
if not answer:
|
|
if not answer:
|
|
|
answer = ''
|
|
answer = ''
|
|
|
|
|
+
|
|
|
if not email:
|
|
if not email:
|
|
|
email = ''
|
|
email = ''
|
|
|
|
|
+
|
|
|
div += '''
|
|
div += '''
|
|
|
<form method=\"post\">
|
|
<form method=\"post\">
|
|
|
<table>
|
|
<table>
|
|
@@ -41,7 +43,7 @@ def applications_2(conn):
|
|
|
<td>''' + load_lang('application_time') + '''</td><td>''' + application[1] + '''</td>
|
|
<td>''' + load_lang('application_time') + '''</td><td>''' + application[1] + '''</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td>''' + load_lang('approval_question') + '''</td><td>''' + question + '''</td>
|
|
|
|
|
|
|
+ <td>''' + load_lang('approval_question') + '''</td><td>''' + html.escape(question) + '''</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
<td>''' + load_lang('answer') + '''</td><td>''' + html.escape(answer) + '''</td>
|
|
<td>''' + load_lang('answer') + '''</td><td>''' + html.escape(answer) + '''</td>
|
|
@@ -62,9 +64,17 @@ def applications_2(conn):
|
|
|
'''
|
|
'''
|
|
|
else:
|
|
else:
|
|
|
div += load_lang('no_applications_now')
|
|
div += load_lang('no_applications_now')
|
|
|
|
|
+
|
|
|
|
|
+ return easy_minify(flask.render_template(skin_check(),
|
|
|
|
|
+ imp = [load_lang('application_list'), wiki_set(), custom(), other2([0, 0])],
|
|
|
|
|
+ data = div,
|
|
|
|
|
+ menu = [['other', load_lang('return')]]
|
|
|
|
|
+ ))
|
|
|
else:
|
|
else:
|
|
|
if flask.request.form.get('approve', '') != '':
|
|
if flask.request.form.get('approve', '') != '':
|
|
|
- curs.execute(db_change('select id, pw, date, encode, question, answer, ip, ua, email from user_application where token = ?'), [flask.request.form.get('approve', '')])
|
|
|
|
|
|
|
+ curs.execute(db_change('select id, pw, date, encode, question, answer, ip, ua, email from user_application where token = ?'), [
|
|
|
|
|
+ flask.request.form.get('approve', '')
|
|
|
|
|
+ ])
|
|
|
application = curs.fetchall()
|
|
application = curs.fetchall()
|
|
|
if not application:
|
|
if not application:
|
|
|
return re_error('/error/26')
|
|
return re_error('/error/26')
|
|
@@ -83,26 +93,14 @@ def applications_2(conn):
|
|
|
])
|
|
])
|
|
|
curs.execute(db_change("insert into user_set (name, id, data) values ('approval_question', ?, ?)"), [application[0], application[4]])
|
|
curs.execute(db_change("insert into user_set (name, id, data) values ('approval_question', ?, ?)"), [application[0], application[4]])
|
|
|
curs.execute(db_change("insert into user_set (name, id, data) values ('approval_question_answer', ?, ?)"), [application[0], application[5]])
|
|
curs.execute(db_change("insert into user_set (name, id, data) values ('approval_question_answer', ?, ?)"), [application[0], application[5]])
|
|
|
- curs.execute(db_change("insert into ua_d (name, ip, ua, today, sub) values (?, ?, ?, ?, '')"), [
|
|
|
|
|
- application[0],
|
|
|
|
|
- application[6],
|
|
|
|
|
- application[7],
|
|
|
|
|
- application[2]
|
|
|
|
|
- ])
|
|
|
|
|
|
|
+ ua_plus(application[0], application[6], application[7], application[2])
|
|
|
if application[8] and application[8] != '':
|
|
if application[8] and application[8] != '':
|
|
|
curs.execute(db_change("insert into user_set (name, id, data) values ('email', ?, ?)"), [application[0], application[8]])
|
|
curs.execute(db_change("insert into user_set (name, id, data) values ('email', ?, ?)"), [application[0], application[8]])
|
|
|
|
|
+
|
|
|
curs.execute(db_change('delete from user_application where token = ?'), [flask.request.form.get('approve', '')])
|
|
curs.execute(db_change('delete from user_application where token = ?'), [flask.request.form.get('approve', '')])
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
elif flask.request.form.get('decline', '') != '':
|
|
elif flask.request.form.get('decline', '') != '':
|
|
|
curs.execute(db_change('delete from user_application where token = ?'), [flask.request.form.get('decline', '')])
|
|
curs.execute(db_change('delete from user_application where token = ?'), [flask.request.form.get('decline', '')])
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
|
|
|
|
|
- return redirect('/applications')
|
|
|
|
|
-
|
|
|
|
|
- return easy_minify(flask.render_template(skin_check(),
|
|
|
|
|
- imp = [load_lang('application_list'), wiki_set(), custom(), other2([0, 0])],
|
|
|
|
|
- data = div,
|
|
|
|
|
- menu = [['other', load_lang('return')]]
|
|
|
|
|
- ))
|
|
|
|
|
|
|
+ return redirect('/applications')
|