mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-24 01:04:20 +01:00
2.3.0 (#1248)
2.3.0 / 2020-02-17
==================
**General**
* During setup, admins can register their email address with the CTFd LLC newsletter for news and updates
* Fix editting hints from the admin panel
* Allow admins to insert HTML code directly into the header and footer (end of body tag) of pages. This replaces and supercedes the custom CSS feature.
* The `views.custom_css` route has been removed.
* Admins can now customize the content of outgoing emails and inject certain variables into email content.
* The `manage.py` script can now manipulate the CTFd Configs table via the `get_config` and `set_config` commands. (e.g. `python manage.py get_config ctf_theme` and `python manage.py set_config ctf_theme core`)
**Themes**
* Themes should now reference the `theme_header` and `theme_footer` configs instead of the `views.custom_css` endpoint to allow for user customizations. See the `base.html` file of the core theme.
**Plugins**
* Make `ezq` functions available to `CTFd.js` under `CTFd.ui.ezq`
**Miscellaneous**
* Python imports sorted with `isort` and import order enforced
* Black formatter running on a majority of Python code
This commit is contained in:
48
CTFd/auth.py
48
CTFd/auth.py
@@ -1,33 +1,25 @@
|
||||
from flask import (
|
||||
current_app as app,
|
||||
render_template,
|
||||
request,
|
||||
redirect,
|
||||
url_for,
|
||||
session,
|
||||
Blueprint,
|
||||
)
|
||||
from itsdangerous.exc import BadTimeSignature, SignatureExpired, BadSignature
|
||||
import base64
|
||||
|
||||
from CTFd.models import db, Users, Teams
|
||||
import requests
|
||||
from flask import Blueprint
|
||||
from flask import current_app as app
|
||||
from flask import redirect, render_template, request, session, url_for
|
||||
from itsdangerous.exc import BadSignature, BadTimeSignature, SignatureExpired
|
||||
|
||||
from CTFd.utils import get_config, get_app_config
|
||||
from CTFd.utils.decorators import ratelimit
|
||||
from CTFd.models import Teams, Users, db
|
||||
from CTFd.utils import config, email, get_app_config, get_config
|
||||
from CTFd.utils import user as current_user
|
||||
from CTFd.utils import config, validators
|
||||
from CTFd.utils import email
|
||||
from CTFd.utils.security.auth import login_user, logout_user
|
||||
from CTFd.utils.crypto import verify_password
|
||||
from CTFd.utils.logging import log
|
||||
from CTFd.utils.decorators.visibility import check_registration_visibility
|
||||
from CTFd.utils import validators
|
||||
from CTFd.utils.config import is_teams_mode
|
||||
from CTFd.utils.config.visibility import registration_visible
|
||||
from CTFd.utils.modes import TEAMS_MODE
|
||||
from CTFd.utils.security.signing import unserialize
|
||||
from CTFd.utils.crypto import verify_password
|
||||
from CTFd.utils.decorators import ratelimit
|
||||
from CTFd.utils.decorators.visibility import check_registration_visibility
|
||||
from CTFd.utils.helpers import error_for, get_errors
|
||||
|
||||
import base64
|
||||
import requests
|
||||
from CTFd.utils.logging import log
|
||||
from CTFd.utils.modes import TEAMS_MODE
|
||||
from CTFd.utils.security.auth import login_user, logout_user
|
||||
from CTFd.utils.security.signing import unserialize
|
||||
|
||||
auth = Blueprint("auth", __name__)
|
||||
|
||||
@@ -61,6 +53,7 @@ def confirm(data=None):
|
||||
name=user.name,
|
||||
)
|
||||
db.session.commit()
|
||||
email.successful_registration_notification(user.email)
|
||||
db.session.close()
|
||||
if current_user.authed():
|
||||
return redirect(url_for("challenges.listing"))
|
||||
@@ -251,12 +244,7 @@ def register():
|
||||
if (
|
||||
config.can_send_mail()
|
||||
): # We want to notify the user that they have registered.
|
||||
email.sendmail(
|
||||
request.form["email"],
|
||||
"You've successfully registered for {}".format(
|
||||
get_config("ctf_name")
|
||||
),
|
||||
)
|
||||
email.successful_registration_notification(user.email)
|
||||
|
||||
log("registrations", "[{date}] {ip} - {name} registered with {email}")
|
||||
db.session.close()
|
||||
|
||||
Reference in New Issue
Block a user