zmiany w css

This commit is contained in:
Mateusz Gruszczyński
2025-07-07 23:53:22 +02:00
parent 8152019632
commit f9b655defd
6 changed files with 48 additions and 15 deletions

8
app.py
View File

@@ -345,13 +345,17 @@ def main_page():
@app.route('/system-auth', methods=['GET', 'POST'])
def system_auth():
#ip = request.remote_addr
if current_user.is_authenticated or request.cookies.get('authorized') == AUTHORIZED_COOKIE_VALUE:
flash('Jesteś już zalogowany lub autoryzowany.', 'info')
return redirect(url_for('main_page'))
ip = request.access_route[0]
next_page = request.args.get('next') or url_for('main_page')
if is_ip_blocked(ip):
flash('Przekroczono limit prób logowania. Dostęp zablokowany na 1 godzinę.', 'danger')
return render_template('system_auth.html'), 403
if request.method == 'POST':
if request.form['password'] == SYSTEM_PASSWORD:
reset_failed_attempts(ip)
@@ -364,7 +368,7 @@ def system_auth():
flash('Przekroczono limit prób logowania. Dostęp zablokowany na 1 godzinę.', 'danger')
return render_template('system_auth.html'), 403
remaining = attempts_remaining(ip)
flash(f'Nieprawidłowe hasło do systemu. Pozostało prób: {remaining}', 'warning')
flash(f'Nieprawidłowe hasło. Pozostało {remaining} prób.', 'warning')
return render_template('system_auth.html')
@app.route('/toggle_archive_list/<int:list_id>')