Add function set_mail_hostname

This commit is contained in:
2025-12-22 12:11:13 +01:00
parent 481e179833
commit e3100e77b2
3 changed files with 17 additions and 10 deletions

View File

@@ -8,14 +8,13 @@ from tools.utils import email_disp, valid_token_register, valid_passwd, valid_us
from socket import gethostname
import subprocess
from tools.filesutils import check_and_create
from tools.utils import set_mail_domain
app = Flask( 'pywallter' )
app.config.from_pyfile('config.py')
bcrypt = Bcrypt(app)
#### Variables ##################################################################################
DATAS_USER = app.config['DOSSIER_APP']
DOSSIER_PERSO = app.config['DOSSIER_APP']
extensionimg = app.config['EXT_IMG']
@@ -24,7 +23,7 @@ MAIL_SERVER = app.config['MAIL_SERVER']
XMPP_SERVER = app.config['XMPP_SERVER']
SETUID = app.config['SETUID']
BASE_URL = app.config['BASE_URL']
MAIL_DOMAIN = app.config['MAIL_DOMAIN']
#################################################################################################
@@ -33,7 +32,9 @@ inscription = Blueprint('inscription', __name__, template_folder='templates')
@inscription.route( '/inscription/<token>', methods=['GET','POST'] )
def signin(token) :
hostname = MAIL_DOMAIN
mail_domain = set_mail_domain()
url_inscription = BASE_URL +'/inscription/'+token
resp = None
if valid_token_register(token, "Invitation"):
@@ -44,7 +45,7 @@ def signin(token) :
# Réponse si la requete est de type GET ou si la requete POST echoue
resp = render_template('inscription.html',
signin_enable=app.config['SIGNIN_ENABLE'],
token=token, hostname=hostname,
token=token, hostname=mail_domain,
url_inscription=url_inscription,
MAIL_SERVER=MAIL_SERVER, XMPP_SERVER=XMPP_SERVER)